| | |
| | | 锘縰sing Model; |
| | | using Model.鐢熶骇绠$悊; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | |
| | | { |
| | | var model = sMainSub["model"].ToString(); |
| | | var entry = sMainSub["model"]["HENTRY"].ToString(); |
| | | |
| | | var _model = sMainSub["model"]["HPPBOMMAINENTRY"].ToString(); |
| | | var _entry = sMainSub["model"]["HPPBOMSUBENTRY"].ToString(); |
| | | model = "[" + model.ToString() + "]"; |
| | | List<ClsSc_ICMOBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_ICMOBillMain>>(model); |
| | | List<ClsSc_ICMOBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_ICMOBillSub>>(entry); |
| | | List<ClsSc_PPBomBillMain> _mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillMain>>(_model); |
| | | List<ClsSc_PPBomBillSub> _subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillSub>>(_entry); |
| | | string sql = string.Empty; |
| | | oCN.BeginTran(); |
| | | sql = $"delete Sc_ICMOBillMain where HinterID = {mainList[0].HInterID}"; |
| | |
| | | ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},4 |
| | | ,0,0,'','',0,0)"); |
| | | } |
| | | |
| | | foreach (var _item in _mainList) |
| | | { |
| | | //鐢熶骇鐢ㄦ枡娓呭崟 |
| | | sql = $"delete Sc_PPBomBillMain where HinterID = {_item.HInterID}"; |
| | | oCN.RunProc(sql); |
| | | sql = $"delete Sc_PPBomBillSub where HinterID = {_item.HInterID}"; |
| | | oCN.RunProc(sql); |
| | | //涓昏〃 |
| | | oCN.RunProc(@"Insert Into Sc_PPBomBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus,HICMOInterID |
| | | ,HICMOEntryID,HMaterID,HUnitID,HQty,HDeptID,HMaker,HMakeDate,HChecker,HCheckDate |
| | | ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HPRDORGID,HENTRUSTORGID,HPARENTOWNERID |
| | | ,HPARENTOWNERTYPEID,HERPInterID,HERPBillType,HSeOrderEntrySEQ,HICMOEntrySEQ,HREQSRC) |
| | | values(" + _item.HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3720 + "','" + |
| | | _item.HBillSubType + "','" + _item.HDate + "','" + _item.HBillNo + "','" + _item.HBillStatus + "'," + _item.HICMOInterID + |
| | | "," + _item.HICMOEntryID + ",'" + _item.HMaterID + "'," + _item.HUnitID + "," + _item.HQty + "," + _item.HDeptID + |
| | | ",'" + _item.HMaker + "','" + _item.HMakeDate + "','" + _item.HChecker + "','" + _item.HCheckDate + "','" + _item.HSeOrderBillNo + "'," + _item.HSeOrderInterID + "," + _item.HSeOrderEntryID + "," + _item.HPRDORGID + "," + _item.HENTRUSTORGID + "," + _item.HPARENTOWNERID + ",'" + |
| | | _item.HPARENTOWNERTYPEID + "'," + _item.HERPInterID + ",'" + _item.HERPBillType + "'," + _item.HSeOrderEntrySEQ + "," + _item.HICMOEntrySEQ + ",'" + _item.HREQSRC + "')"); |
| | | } |
| | | foreach (var oSub in _subList) |
| | | { |
| | | oCN.RunProc($@"Insert into Sc_PPBomBillSub |
| | | (HInterID,HEntryID,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HSPID,HQty,HQtyMust,HWHID,HRemark |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID,HICMOBillNo |
| | | ,HCHILDSUPPLYORGID,HSUPPLYORGID,HENTRUSTPICKORGID,HSRCTRANSORGID,HGROUPBYOWNERID,HOWNERID,HOWNERTYPEID |
| | | ,HRelationQty,HMoveStockQty,HAuxPropID,HBatchNO,HMTONo,HQtyScrap,HERPInterID,HERPEntryID |
| | | ,HBackRelationQty,HNumerator,HDenominator,HBASEUNITID,HProcessID,HICMOENTRYSEQ,HPROJECTNO |
| | | ,HOPERID,HSEQ,HSTOCKSTATUSID,HLOT,HOPTQUEUE,HRESERVETYPE,HSelPickedQty,HSELPRCDRETURNQTY,HProcName) |
| | | values('{oSub.HInterID}','{oSub.HEntryID}','{oSub.HMaterID}','{oSub.HMaterNumber}','{oSub.HUnitID}','{oSub.HUnitNumber}','{oSub.HSPID}','{oSub.HQty}' |
| | | ,'{oSub.HQtyMust}','{oSub.HWHID}','{oSub.HRemark}','{oSub.HSourceInterID}','{oSub.HSourceEntryID}','{oSub.HSourceBillNo}','{oSub.HSourceBillType}','{oSub.HICMOInterID}','{oSub.HICMOEntryID}','{oSub.HICMOBillNo}','{oSub.HCHILDSUPPLYORGID}','{oSub.HSUPPLYORGID}','{oSub.HENTRUSTPICKORGID}','{oSub.HSRCTRANSORGID}','{oSub.HGROUPBYOWNERID}','{oSub.HOWNERID}','{oSub.HOWNERTYPEID}','{oSub.HRelationQty}','{oSub.HMoveStockQty}','{oSub.HAuxPropID}','{oSub.HBatchNO}','{oSub.HMTONo}','{oSub.HQtyScrap}','{oSub.HERPInterID}','{oSub.HERPEntryID}','{oSub.HBackRelationQty}','{oSub.HNumerator}','{oSub.HDenominator}','{oSub.HBASEUNITID}','{oSub.HProcessID}','{oSub.HICMOENTRYSEQ}','{oSub.HPROJECTNO}','{oSub.HOPERID}','{oSub.HSEQ}','{oSub.HSTOCKSTATUSID}','{oSub.HLOT}','{oSub.HOPTQUEUE}','{oSub.HRESERVETYPE}','{oSub.HSelPickedQty}','{oSub.HSELPRCDRETURNQTY}','{oSub.HProcName}')"); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |