From 0317085383fabf0c5415983e247ad73f518d94cb Mon Sep 17 00:00:00 2001 From: gongxh Date: Mon, 13 Dec 2021 13:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.BLL/Model/StoreResult.cs | 2 +- NX.ERP.BLL/Store/SotreIn.cs | 2 +- NX.ERP.BLL/Store/SotreOut.cs | 2 +- NX.ERP.Model/Response/Base/Materiel.cs | 5 ++ NX.ERP.Model/Response/MOM/MoAllocate.cs | 10 ++++ NX.ERP.U8/Base/MaterielDAL.cs | 6 +-- NX.ERP.U8/Mom/MomOrderDAL.cs | 2 +- NX.ERP.U8/Store/MaterielStoreOutDAL.cs | 68 +++++++++++++++++++++---- NX.ERP.WebAPi/Web.config | 4 +- 9 files changed, 82 insertions(+), 19 deletions(-) diff --git a/NX.ERP.BLL/Model/StoreResult.cs b/NX.ERP.BLL/Model/StoreResult.cs index 222a0ac..5c0ea0b 100644 --- a/NX.ERP.BLL/Model/StoreResult.cs +++ b/NX.ERP.BLL/Model/StoreResult.cs @@ -7,6 +7,6 @@ namespace NX.ERP.BLL.Model { public class StoreResult { - public int ID { get; set; } + public string ID { get; set; } } } diff --git a/NX.ERP.BLL/Store/SotreIn.cs b/NX.ERP.BLL/Store/SotreIn.cs index d02ba74..4daafa6 100644 --- a/NX.ERP.BLL/Store/SotreIn.cs +++ b/NX.ERP.BLL/Store/SotreIn.cs @@ -95,7 +95,7 @@ namespace NX.ERP.BLL.Store }); } - return new StoreResult() { ID = int.Parse(ID) }; + return new StoreResult() { ID =ID}; } } diff --git a/NX.ERP.BLL/Store/SotreOut.cs b/NX.ERP.BLL/Store/SotreOut.cs index 38a6c70..3ea3e2c 100644 --- a/NX.ERP.BLL/Store/SotreOut.cs +++ b/NX.ERP.BLL/Store/SotreOut.cs @@ -96,7 +96,7 @@ namespace NX.ERP.BLL.Store }); } - return new StoreResult() { ID = int.Parse(ID) }; + return new StoreResult() { ID = ID }; } } diff --git a/NX.ERP.Model/Response/Base/Materiel.cs b/NX.ERP.Model/Response/Base/Materiel.cs index 15f0692..1723a14 100644 --- a/NX.ERP.Model/Response/Base/Materiel.cs +++ b/NX.ERP.Model/Response/Base/Materiel.cs @@ -147,5 +147,10 @@ namespace NX.ERP.Model /// public float GrossW { get; set; } + /// + /// + /// + public string Srpolicy { get; set; } + } } diff --git a/NX.ERP.Model/Response/MOM/MoAllocate.cs b/NX.ERP.Model/Response/MOM/MoAllocate.cs index 58c5045..50a3c51 100644 --- a/NX.ERP.Model/Response/MOM/MoAllocate.cs +++ b/NX.ERP.Model/Response/MOM/MoAllocate.cs @@ -31,5 +31,15 @@ namespace NX.ERP.Model.MOM [Newtonsoft.Json.JsonIgnore] public MomDetail momDetail { get; set; } + [Newtonsoft.Json.JsonIgnore] + public decimal? iinvexchrate { get; set; } + + [Newtonsoft.Json.JsonIgnore] + public string AuxUnitCode { get; set; } + + [Newtonsoft.Json.JsonIgnore] + public string Srpolicy { get; set; } + + } } diff --git a/NX.ERP.U8/Base/MaterielDAL.cs b/NX.ERP.U8/Base/MaterielDAL.cs index b8a8348..e4e4283 100644 --- a/NX.ERP.U8/Base/MaterielDAL.cs +++ b/NX.ERP.U8/Base/MaterielDAL.cs @@ -191,7 +191,7 @@ namespace NX.ERP.U8 // bMPS AS MPS件, // bROP AS ROP件, // bRePlan AS 是否重复计划, - // cSRPolicy AS 供需政策, + // cSRPolicy AS 供需政策, // bBillUnite AS 是否令单合并, // iSupplyDay AS 供应期间, // fSupplyMulti AS 供应倍数, @@ -299,9 +299,9 @@ namespace NX.ERP.U8 cInvCCode AS MaterialTypeCode, bSale AS IsSale, - bPurchase AS IsPurchase, + bPurchase AS IsPurchase,D bSelf AS IsSelf, - + cSRPolicy AS SRPolicy, bProducing AS IsProducing, iTaxRate AS TaxRate, diff --git a/NX.ERP.U8/Mom/MomOrderDAL.cs b/NX.ERP.U8/Mom/MomOrderDAL.cs index 82ee209..637c0af 100644 --- a/NX.ERP.U8/Mom/MomOrderDAL.cs +++ b/NX.ERP.U8/Mom/MomOrderDAL.cs @@ -23,7 +23,7 @@ namespace NX.ERP.U8.Mom string strSQL = @" select a.MoId as ProductOrderId,a.moCode as ProductOrderNo,ISNULL( ModifyDate,createDate) as ModifyDate,CONVERT(BIGINT,a.Ufts) AS pubufts,a.CreateDate as ProductDate,a.CreateUser as PreparedBy, b.MoId as id ,b.MoDId as ProductOrderDtlId,b.MoId as ProductOrderId,b.MoTypeId,d.DueDate,b.Remark as Remark,ISNULL( b.MDeptCode,'53') as MDeptCode,a.MoCode as ProductOrderNo, a.CreateDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,b.QualifiedInQty,b.SortSeq,b.SoCode,b.Status,InvDetail.cInvName as ProductName ,InvDetail.cInvStd ProductSpecsModel, - c.AllocateId as id ,c.AllocateId as AllocateId,c.MoDId as ProductOrderDtlId,c.InvCode as MaterialCode,InvLocate.cInvName as MaterialName,InvLocate.cInvStd as MaterialSpecsModel,b.MoId as ProductOrderId, c.IssQty as IssQty,c.Qty, + c.AllocateId as id ,c.AllocateId as AllocateId,c.MoDId as ProductOrderDtlId,c.ChangeRate as iinvexchrate,c.AuxUnitCode,c.InvCode as MaterialCode,InvLocate.cInvName as MaterialName,InvLocate.cSrpolicy as Srpolicy,InvLocate.cInvStd as MaterialSpecsModel,b.MoId as ProductOrderId, c.IssQty as IssQty,c.Qty, e.cInvSN as ID from mom_order as a left join mom_orderdetail as b on a.MoId=b.MoId diff --git a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs index d9b3e27..cfa8f3c 100644 --- a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs +++ b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs @@ -185,7 +185,59 @@ namespace NX.ERP.U8.Store bodyXml.setAttribute("cvmivencode", ""); bodyXml.setAttribute("cposition", detail.Position); bodyXml.setAttribute("editprop", "A"); - bodyXml.setAttribute("innum", 10); + + //iXMLDOMElement.setAttribute("inquantity", Convert.ToDouble(recordset.Fields["Qty"].Value.ToString()) - Convert.ToDouble(string.IsNullOrEmpty(recordset.Fields["IssQty"].Value.ToString()) ? "0" : recordset.Fields["IssQty"].Value.ToString())); + //if (!string.IsNullOrEmpty(recordset.Fields["iinvexchrate"].Value.ToString())) + //{ + // iXMLDOMElement.setAttribute("innum", (Convert.ToDouble(recordset.Fields["Qty"].Value.ToString()) - Convert.ToDouble(string.IsNullOrEmpty(recordset.Fields["IssQty"].Value.ToString()) ? "0" : recordset.Fields["IssQty"].Value.ToString())) / Convert.ToDouble(recordset.Fields["iinvexchrate"].Value.ToString())); + //} + + bodyXml.setAttribute("inquantity", alllocate.Qty - alllocate.Issqty); + if (alllocate.iinvexchrate != null && alllocate.iinvexchrate.HasValue && alllocate.iinvexchrate.Value != 0) + { + var _innum = (alllocate.Qty - alllocate.Issqty) / (double)alllocate.iinvexchrate.Value; + bodyXml.setAttribute("innum", _innum); + + } + + + + if (alllocate.iinvexchrate.HasValue) + { + bodyXml.setAttribute("inum", detail.Quantity / (double)alllocate.iinvexchrate); + bodyXml.setAttribute("iinvexchrate", alllocate.iinvexchrate); + bodyXml.setAttribute("cassunit", alllocate.AuxUnitCode); + } + + //if (csrPolicy.ToUpper() == "PE") + //{ + // iXMLDOMElement.setAttribute("ipesotype", "7"); + // iXMLDOMElement.setAttribute("cpesocode", recordset.Fields["mocode"].Value.ToString()); + // iXMLDOMElement.setAttribute("ipesodid", rdRecords.AutoID.ToString()); + // iXMLDOMElement.setAttribute("ipesoseq", recordset.Fields["moseq"].Value.ToString()); + //} + //iXMLDOMElement.setAttribute("isotype", recordset.Fields["sotype"].Value.ToString()); + //iXMLDOMElement.setAttribute("csocode", recordset.Fields["SoCode"].Value.ToString()); + //iXMLDOMElement.setAttribute("isodid", recordset.Fields["SoDId"].Value.ToString()); + //iXMLDOMElement.setAttribute("isoseq", recordset.Fields["SoSeq"].Value.ToString()); + + if (alllocate.Srpolicy=="PE") + { + + bodyXml.setAttribute("ipesotype", "7"); + bodyXml.setAttribute("cpesocode", storeOut.SourceCode); + bodyXml.setAttribute("ipesodid", detail.SorceDetailId); + bodyXml.setAttribute("ipesoseq", moomDetail.SortSeq); + + } + + //销售信息 + bodyXml.setAttribute("isotype", ""); + bodyXml.setAttribute("csocode", ""); + bodyXml.setAttribute("isodid", ""); + bodyXml.setAttribute("isoseq", ""); + // + bodyXml.setAttribute("autoid", storeOut.Id); bodyXml.setAttribute("id", storeOut.Id); bodyXml.setAttribute("impoids", detail.SorceDetailId); @@ -193,14 +245,10 @@ namespace NX.ERP.U8.Store bodyXml.setAttribute("invcode", moomDetail.ProductCode);//产品编码 bodyXml.setAttribute("cwhcode", storeOut.Whcode); bodyXml.setAttribute("imoseq", moomDetail.SortSeq); - bodyXml.setAttribute("ipesotype", "7"); - bodyXml.setAttribute("cpesocode", ""); - bodyXml.setAttribute("ipesodid", ""); - bodyXml.setAttribute("ipesoseq", ""); - bodyXml.setAttribute("isotype", ""); - bodyXml.setAttribute("csocode", ""); - bodyXml.setAttribute("isodid", ""); - bodyXml.setAttribute("isoseq", ""); + + + + domBody.selectSingleNode("//rs:data").appendChild(bodyXml); #endregion } @@ -263,7 +311,7 @@ namespace NX.ERP.U8.Store if (!string.IsNullOrEmpty(voucherId)) { var model = this.GetModel(int.Parse(voucherId)); - if (model!=null) + if (model != null) { voucherId = model.Code; } diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 6d1c5e5..2bd4a91 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -6,8 +6,8 @@ - - + +