diff --git a/NX.ERP.Model/Response/Store/MaterialApp.cs b/NX.ERP.Model/Response/Store/MaterialApp.cs index 65593d6..5e4e916 100644 --- a/NX.ERP.Model/Response/Store/MaterialApp.cs +++ b/NX.ERP.Model/Response/Store/MaterialApp.cs @@ -111,8 +111,15 @@ namespace NX.ERP.Model.Response.Store public string PesoSeq { get; set; } + [JsonIgnore] + public string DeptName { get; set; } + [JsonIgnore] + public string ProductNo { get; set; } - + [JsonIgnore] + public decimal MoQuantity { get; set; } + [JsonIgnore] + public string DeptCode { get; set; } } diff --git a/NX.ERP.U8/Store/MaterialAppDAL.cs b/NX.ERP.U8/Store/MaterialAppDAL.cs index 7193378..5e3cb1d 100644 --- a/NX.ERP.U8/Store/MaterialAppDAL.cs +++ b/NX.ERP.U8/Store/MaterialAppDAL.cs @@ -51,7 +51,7 @@ namespace NX.ERP.U8.Store , b.iMPoIds AS MPoIds, b.comcode AS OmCode, b.iOMoDID AS OMoDId, b.cciqbookcode AS ciqBookCode, b.cmworkcentercode AS mWorkCenterCode , b.cservicecode AS servicecode, b.isotype AS SoType, b.csocode AS SoCode, b.isodid AS SodId, b.isoseq AS SoSeq , b.iordertype AS ordertype, b.iordercode AS OrderCode, b.iorderdid AS OrderdId, b.iorderseq AS OrderSeq, b.ipesotype AS PesoType - , b.cpesocode AS PesoCode, b.ipesodid AS PesodId, b.ipesoseq AS PesoSeq + , b.cpesocode AS PesoCode, b.ipesodid AS PesodId, b.ipesoseq AS PesoSeq,b.cdepCode as DeptCode,cdepName as DeptName,b.cinvcode as ProductNo,b.imquantity as MoQuantity FROM MaterialAppVouch a LEFT JOIN KCMATERIALAPPLIST b ON a.id = b.id"; if (!string.IsNullOrEmpty(strWhere)) diff --git a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs index 178c6e1..994faca 100644 --- a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs +++ b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs @@ -39,7 +39,12 @@ namespace NX.ERP.U8.Store } headXml.setAttribute("cbustype", "领料"); headXml.setAttribute("cbuscode", metailApp.Code); - string lastProductNo = null; + + string lastProductNo = null; + decimal moqty = 0; + string DeptName = ""; + string moCode = ""; + string DeptCode = ""; IXMLDOMElement bodyXml; for (var n = 0; n < storeOut.Details.Count(); n++) { @@ -49,6 +54,25 @@ namespace NX.ERP.U8.Store { throw new Exception("未知明细"); } + + if (lastProductNo == null) + { + lastProductNo = materialAppDetail.ProductNo; + moqty = materialAppDetail.MoQuantity; + DeptName = materialAppDetail.DeptName; + DeptCode = materialAppDetail.DeptCode; + moCode = materialAppDetail.MoCode; + + } + else if (lastProductNo != "" && lastProductNo != materialAppDetail.ProductNo) + { + lastProductNo = ""; + moqty = 0; + } + + + + bodyXml = domBody.createElement("z:row"); var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost); bodyXml.setAttribute("iunitcost", _cost); @@ -94,9 +118,10 @@ namespace NX.ERP.U8.Store } headXml.setAttribute("cpspcode", lastProductNo); - - - + headXml.setAttribute("imquantity", moqty); + headXml.setAttribute("cdepname", DeptName); + headXml.setAttribute("cdepcode", DeptCode); + headXml.setAttribute("cmpocode", moCode); }