Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | <Compile Include="车é´ç®¡ç\ClsSc_StationInBillSub.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsSc_StationOutBillMain.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsSc_StationOutBillSub.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsSc_StationOutBillSub_Emp.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsSc_StationOutBillSub_Item.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsSc_ABJJDMain.cs" /> |
| | | <Compile Include="车é´ç®¡ç\ClsWW_EntrustWorkOrderBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_StationOutBillSub_Emp : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public string HBillNo_bak; //åæ®å·ï¼å¤ä»½ï¼ä»¥å
å
ç ä¸¢å¤±ï¼æ¾ä¸å°å¯¹åºä¸»è¡¨ï¼ |
| | | public Int64 HItemSubID; //èªå¢å(GUID) |
| | | public Int64 HWorkEmpID; //æä½å(Gy_Employee) |
| | | public Int64 HWorkSourceID; //çäº§èµæº(Gy_Source) |
| | | public decimal HQty ; //ç产æ°é |
| | | public decimal HRate;//åå·¥ç³»æ° |
| | | public decimal HProcPrice;//工价 |
| | | public decimal HMoney; //éé¢ |
| | | public Int64 HWorkProcID; //å·¥åº(Gy_Process) |
| | | } |
| | | } |
| | |
| | | ,HMaker,HMakeDate,HChecker,HCheckDate,HOWNERTYPEID,HOWNERID |
| | | ,HERPInterID,HERPBillType,HPURCHASEORGID,HSTOCKORGID,HREQUIREORGID |
| | | ,HSTOCKGROUPID,HSENDBILLNO,HLADBILLNO,HPURDEPTID,HPURGROUPID,HSUPPLYID |
| | | ,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HSUPPLYADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID,HCurID,HExRate,HAddress,HWHID) |
| | | ,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HSUPPLYADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID,HCurID,HExRate,HAddress,HWHID,HInnerBillNo) |
| | | values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1103 + "','" + |
| | | mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "'," + mainList[0].HBillStatus + "," + mainList[0].HSupID + |
| | | "," + mainList[0].HManagerID + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + |
| | | "','" + mainList[0].HMakeDate + "','" + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HOWNERTYPEID + "'," + mainList[0].HOWNERID + "," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "'," + mainList[0].HPURCHASEORGID + "," + mainList[0].HSTOCKORGID + "," + mainList[0].HREQUIREORGID + "," + |
| | | mainList[0].HSTOCKGROUPID + ",'" + mainList[0].HSENDBILLNO + "','" + mainList[0].HLADBILLNO + "'," + mainList[0].HPURDEPTID + "," + mainList[0].HPURGROUPID + "," + mainList[0].HSUPPLYID + "," + |
| | | mainList[0].HSETTLEID + "," + mainList[0].HCHARGEID + ",'" + mainList[0].HBUSINESSTYPE + "','" + mainList[0].HSUPPLYADDRESS + "'," + mainList[0].HCORRESPONDORGID + "," + mainList[0].HPROVIDERCONTACTID + "," + mainList[0].HCurID + "," + mainList[0].HExRate + ",'" + mainList[0].HAddress + "'," + mainList[0].HWHID + ")"; |
| | | mainList[0].HSETTLEID + "," + mainList[0].HCHARGEID + ",'" + mainList[0].HBUSINESSTYPE + "','" + mainList[0].HSUPPLYADDRESS + "'," + mainList[0].HCORRESPONDORGID + "," + mainList[0].HPROVIDERCONTACTID + "," + mainList[0].HCurID + "," + mainList[0].HExRate + ",'" + mainList[0].HAddress + "'," + mainList[0].HWHID + "," + mainList[0].HInnerBillNo + ")"; |
| | | oCN.RunProc(sql); |
| | | //ä¿å主表 |
| | | foreach (var oSub in subList) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å§å¤å·¥åºååºåæµæ°´å·å车è·åæ¡ç ä¿¡æ¯2ï¼å§å¤å·¥åºæ¥æ¶ãå·¥åºè¿ç«æ¥æ¶éç¨ï¼ |
| | | #region å§å¤å·¥åºååºåæµæ°´å·å车è·åæ¡ç ä¿¡æ¯2 |
| | | [Route("Cj_StationBill/txtHBarCode_KeyDown2")] |
| | | [HttpGet] |
| | | public object txtHBarCode_KeyDown2(string HBarCode,string HInterID,string UserID) |
| | | public object txtHBarCode_KeyDown2(string HBarCode,string HInterID,string UserID,string HBillType) |
| | | { |
| | | try |
| | | { |
| | |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºåªæ¾ç¤ºå½åç»å½ç¨æ·å
³èçå·¥åºä¿¡æ¯,N为å¦ï¼Yä¸ºæ¯ |
| | | if (oSystemParameter.omodel.MES_StationInBill_ShowUSERProcess == "Y") |
| | | if(HBillType == "In") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNoByUser where HItemID = '" + BillNo + "' and HInterID = '" + HInterID + "' and ç¨æ·ç¼ç = '" + UserID + "'", "h_v_Gy_ProcessList_GetProcNoByUser"); |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºåªæ¾ç¤ºå½åç»å½ç¨æ·å
³èçå·¥åºä¿¡æ¯,N为å¦ï¼Yä¸ºæ¯ |
| | | if (oSystemParameter.omodel.MES_StationInBill_ShowUSERProcess == "Y") |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_ProcessList_GetProcNoByUser where HItemID = '" + BillNo + "' and HInterID = '" + HInterID + "' and ç¨æ·ç¼ç = '" + UserID + "'" + " order by åºå· asc", "h_v_Gy_ProcessList_GetProcNoByUser"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNo where HItemID = '" + BillNo + "' and HInterID = '" + |
| | | HInterID + "'" + " order by åºå· asc", "h_v_Gy_ProcessList_GetProcNo"); |
| | | } |
| | | } |
| | | else |
| | | else if(HBillType == "Out") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNo where HItemID = '" + BillNo + "' and HInterID = '" + |
| | | HInterID + "'", "h_v_Gy_ProcessList_GetProcNo"); |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºåªæ¾ç¤ºå½åç»å½ç¨æ·å
³èçå·¥åºä¿¡æ¯,N为å¦ï¼Yä¸ºæ¯ |
| | | if (oSystemParameter.omodel.MES_StationOutBill_ShowUSERProcess == "Y") |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_ProcessList_GetProcNoByUser where HItemID = '" + BillNo + "' and HInterID = '" + HInterID + "' and ç¨æ·ç¼ç = '" + UserID + "'" + " order by åºå· asc", "h_v_Gy_ProcessList_GetProcNoByUser"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNo where HItemID = '" + BillNo + "' and HInterID = '" + |
| | | HInterID + "'" + " order by åºå· asc", "h_v_Gy_ProcessList_GetProcNo"); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | |
| | | #region æ ¹æ®ç»å½ç¨æ·è·åå·¥åº |
| | | [Route("Sc_StationInBill/autoGetProcNo")] |
| | | [HttpGet] |
| | | public object autoGetProcNo(string HUserID, string HInterID) |
| | | public object autoGetProcNo(string HUserID, string HInterID, string BillType) |
| | | { |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºèªå¨å¹é
æµæ°´å·,N为æå¨è¾å
¥ï¼Y为èªå¨å¹é
|
| | | if (oSystemParameter.omodel.MES_StationOutBill_ShowUSERProcess == "Y") |
| | | if(BillType == "In")//å·¥åºè¿ç«æ¥æ¶å |
| | | { |
| | | try |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºèªå¨å¹é
æµæ°´å·,N为æå¨è¾å
¥ï¼Y为èªå¨å¹é
|
| | | if (oSystemParameter.omodel.MES_StationInBill_AutoFindSNO == "Y") |
| | | { |
| | | if (HUserID == null || HUserID.Equals("")) |
| | | try |
| | | { |
| | | if (HUserID == null || HUserID.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¨æ·ç¼ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å¾å°ä¿¡æ¯ |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_StationBill_autoGetProcNo where HInterID = '" + HInterID + "' and ç¨æ·ç¼ç ='" + HUserID + "'" + " and 累计è¿ç«æ°é < è®¡åæ°é and ä¸éæµè½¬å·¥åº<>'转' and å§å¤æ è®°=0 order by åºå· asc", "h_v_Sc_StationBill_autoGetProcNo"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°å·¥åºä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¨æ·ç¼ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å¾å°ä¿¡æ¯ |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_StationBill_autoGetProcNo where HInterID = '" + HInterID + "' and ç¨æ·ç¼ç ='" + HUserID + "'", "h_v_Sc_StationBill_autoGetProcNo"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°å·¥åºä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | objJsonResult.Message = "æå¨è¾å
¥æ¨¡å¼"; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else if(BillType == "Out")//å·¥åºåºç«æ±æ¥å |
| | | { |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºèªå¨å¹é
æµæ°´å·,N为æå¨è¾å
¥ï¼Y为èªå¨å¹é
|
| | | if (oSystemParameter.omodel.MES_StationOutBill_AutoFindSNO == "Y") |
| | | { |
| | | try |
| | | { |
| | | if (HUserID == null || HUserID.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¨æ·ç¼ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å¾å°ä¿¡æ¯ |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_StationBill_autoGetProcNo where HInterID = '" + HInterID + "' and ç¨æ·ç¼ç ='" + HUserID + "'" + " and 累计åºç«æ°é < è®¡åæ°é and ä¸éæµè½¬å·¥åº<>'转' and å§å¤æ è®°=0 order by åºå· asc", "h_v_Sc_StationBill_autoGetProcNo"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°å·¥åºä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æå¨è¾å
¥æ¨¡å¼"; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æå¨è¾å
¥æ¨¡å¼"; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | using Newtonsoft.Json; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region è¿åå·¥åºåºç«æ±æ¥åæç»å表 |
| | | [Route("Cj_StationOutBill_Detail/get_Display2")] |
| | | [HttpGet] |
| | | public object get_Display2(string HMaterID, string HWorkProcID, string HProcExchBillNo) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_GetStationOutBill_Detail where å·¥åºID = " + HWorkProcID + " and ç©æID = " + HMaterID + " and æµè½¬å¡å· = '" + HProcExchBillNo + "'" , "h_v_GetStationOutBill_Detail"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å·¥åºåºç«æ±æ¥åæç»ä¿¡æ¯è·å失败ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æç» ä¿å/ç¼è¾åè½ |
| | | //[Route("Cj_StationOutBill/AddBill_Detail")] |
| | | //[HttpPost] |
| | | //public object AddBill_Detail([FromBody] JObject sMain) |
| | | //{ |
| | | // try |
| | | // { |
| | | // var _value = sMain["sMainSub"].ToString(); |
| | | // string msg1 = _value.ToString(); |
| | | // oCN.BeginTran(); |
| | | // //ä¿å主表 |
| | | // objJsonResult = Add_Detail(msg1); |
| | | // if (objJsonResult.code == "0") |
| | | // { |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = objJsonResult.Message; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // oCN.Commit(); |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | |
| | | //public json Add_Detail(string msg1) |
| | | //{ |
| | | // string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | // string msg2 = sArray[0].ToString(); //è¡¨å¤´æ°æ® |
| | | // string msg3 = sArray[1].ToString(); //è¡¨ä½æ°æ® |
| | | // int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | // string user = sArray[3].ToString(); //ç¨æ·å |
| | | // try |
| | | // { |
| | | // List<ClsSc_StationOutBillSub_Emp> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_StationOutBillSub_Emp>>(msg2); |
| | | |
| | | // List<ClsSc_StationOutBillSub_Emp> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_StationOutBillSub_Emp>>(msg3); |
| | | |
| | | // long HWorkEmpID = subList[0].HWorkEmpID; |
| | | // long HWorkSourceID = subList[0].HWorkSourceID; |
| | | // decimal HQty = subList[0].HQty; |
| | | // decimal HRate = subList[0].HRate; |
| | | // decimal HProcPrice = subList[0].HProcPrice; |
| | | // decimal HMoney = subList[0].HMoney; |
| | | // long HWorkProcID = mainList[0].HWorkProcID; |
| | | |
| | | // foreach (ClsSc_StationOutBillSub_Emp oSub in subList) |
| | | // { |
| | | // //ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_ICMOBillList"); |
| | | |
| | | // if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | // { |
| | | // //主表 |
| | | // oCN.RunProc(@"Insert Into Sc_StationOutBillSub_Emp |
| | | // (HBillNo_bak ,HCloseMan ,HEntryCloseDate ,HCloseType ,HRemark ,HSourceInterID |
| | | // ,HSourceEntryID ,HSourceBillNo ,HSourceBillType ,HRelationQty ,HRelationMoney |
| | | // ,HWorkEmpID ,HWorkSourceID ,HQty ,HRate ,HProcPrice |
| | | // ,HMoney ,HWorkProcID) |
| | | // values('3710',1," + HInterID + ",'" + HBillNo + "','" + HDate + "'," + HPRDORGID + |
| | | // "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + HRemark + "','" + HMaker + "',getdate()" + |
| | | // ",'" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HEmpID + "," + HCusID + |
| | | // "," + HCenterID + ",0,0,0,0," + HBomID + ",'','') "); |
| | | // } |
| | | // } |
| | | |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = null; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | websLsmain.HBillerID = 0; |
| | | websLsmain.HExplanation = ""; |
| | | websLsmain.HInnerBillNo = ""; |
| | | websLsmain.HRedBlueFlag = true; |
| | | websLsmain.HRedBlueFlag = false; |
| | | websLsmain.HMainSourceBillType = "-1"; |
| | | websLsmain.HStockStyle = ""; |
| | | websLsmain.HBillType = "1207"; |
| | |
| | | websLsmain.HSupID = 0; |
| | | //websLsmain.HGroupID = lsmain[0].HGroupID; |
| | | string sErrMsg = ""; |
| | | //ä¸ä¼ å夿 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_MoveStockBill_AR " + websLsmain.HInterID.ToString() + ",'" + websLsmain.HBillNo + "','" + websLsmain.HBillType + "'", "h_p_WMS_BeforeUpload_MoveStockBill_AR"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "æ ¡éªä¸ä¼ å夿ï¼åçé误ï¼"; |
| | | //return false; |
| | | ////ä¸ä¼ å夿 |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_MoveStockBill_AR " + websLsmain.HInterID.ToString() + ",'" + websLsmain.HBillNo + "','" + websLsmain.HBillType + "'", "h_p_WMS_BeforeUpload_MoveStockBill_AR"); |
| | | //if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // sErrMsg = "æ ¡éªä¸ä¼ å夿ï¼åçé误ï¼"; |
| | | // //return false; |
| | | |
| | | objJsonResult.code = "99"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¸ä¼ 失败ï¼" + sErrMsg; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "åæ®å·ï¼" + websLsmain.HBillNo + "ï¼åæ®IDï¼" + websLsmain.HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | //return false; |
| | | objJsonResult.code = "99"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¸ä¼ 失败ï¼" + sErrMsg; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | // objJsonResult.code = "99"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "ä¸ä¼ 失败ï¼" + sErrMsg; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | // { |
| | | // sErrMsg = "åæ®å·ï¼" + websLsmain.HBillNo + "ï¼åæ®IDï¼" + websLsmain.HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | // //return false; |
| | | // objJsonResult.code = "99"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "ä¸ä¼ 失败ï¼" + sErrMsg; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç©æåç±» æ å½¢å¾ |
| | | public class TreeModel |
| | | { |
| | | public string id { get; set; } |
| | | public string title { get; set; } |
| | | public List<TreeModel> children = new List<TreeModel>(); |
| | | } |
| | | [Route("Gy_MaterType/Gy_MaterTypeTreeList")] |
| | | [HttpGet] |
| | | public object Gy_DutyBillTreeList() |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format("select hitemid,hnumber,hname from Gy_MaterType order by hnumber"); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "Gy_MaterType"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | | first.id = "0"; |
| | | first.title = "ç©æå类设置"; |
| | | treeModels.Add(first); |
| | | |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | var strLen = row["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == 1) |
| | | { |
| | | TreeModel tree = new TreeModel(); |
| | | tree.id = row["hnumber"].ToString(); |
| | | tree.title = row["hname"].ToString(); |
| | | treeModels[0].children.Add(tree); |
| | | } |
| | | } |
| | | digui(ds.Tables[0], treeModels[0].children, 2); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½å½æ° |
| | | /// </summary> |
| | | public void digui(DataTable dt, List<TreeModel> tree, int num) |
| | | { |
| | | for (int m = 0; m < tree.Count; m++) |
| | | { |
| | | tree[m].children = new List<TreeModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++)//ç¬¬ä¸æ¬¡å¾ªç¯ï¼å¾å°æææ ¹èç¹çåé |
| | | { |
| | | var strLen = dt.Rows[i]["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + ".")) |
| | | { |
| | | TreeModel tbjson = new TreeModel(); |
| | | tbjson.id = dt.Rows[i]["hnumber"].ToString(); |
| | | tbjson.title = dt.Rows[i]["hname"].ToString(); |
| | | tree[m].children.Add(tbjson); |
| | | } |
| | | } |
| | | var strLens = tree[m].id.Split('.'); |
| | | for (int i = 0; i < tree[m].children.Count; i++) |
| | | { |
| | | digui(dt, tree[m].children, strLens.Length + 2);//忬¡ç¨åéå»å¾ªç¯ï¼æ¿åºåéçåé |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | <Folder Include="Views\Sc_MouldScrapRequestBill\" /> |
| | | <Folder Include="Views\Sc_MouldStatusChangeBill\" /> |
| | | <Folder Include="Views\Sc_ProcessExchangeIssueBill\" /> |
| | | <Folder Include="Views\Sc_ProcExchRecordBackBill\" /> |
| | | <Folder Include="Views\Sc_ProcessSendWork\" /> |
| | | <Folder Include="Views\Sc_ProcExchRecordBackBill\" /> |
| | | <Folder Include="Views\Sc_WorkBillAutoSortBillMain\" /> |
| | | <Folder Include="Views\Sc_WorkBillSortBill\" /> |
| | | <Folder Include="Views\Sc_WorkDemandPlanBill\" /> |