From 10cced0eeb7d17aab1d1a58c9be163ba0aeb2640 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期一, 24 二月 2025 11:17:15 +0800 Subject: [PATCH] 1.销售订单(ERP->MES)已完成 --- MES.Service/service/BasicData/ProductionOrderManager.cs | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs index ccd6353..9c3cd46 100644 --- a/MES.Service/service/BasicData/ProductionOrderManager.cs +++ b/MES.Service/service/BasicData/ProductionOrderManager.cs @@ -75,10 +75,16 @@ if (mesRohInDatas.Count > 0) db.Deleteable<ProductionOrderSub>() - .Where(s => s.ErpHeaderId == mesRohIn.ErpId).ExecuteCommand(); + .Where(s => s.ErpProductionEntryCode == mesRohIn.ErpProductionEntryCode).ExecuteCommand(); - var orUpdate = base.Insert(mesRohIn); - var baOrUpdate = _productionOrderSubManager.InsertRange(mesRohInDatas); + var orUpdate = db.Insertable(mesRohIn) + .IgnoreColumns(true).ExecuteCommand() > 0; + + + var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1) + .IgnoreColumnsNull() + .ExecuteCommand() > 0; + if (orUpdate && baOrUpdate) return true; throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�"); @@ -142,16 +148,23 @@ ClosingPerson = erpDto.FFORCECLOSERID, ClosingType = erpDto.FCloseType, Remarks = erpDto.FDescription, - ErpId = erpDto.FPPOMID, + ErpId = erpDto.FID, ErpProductionEntryCode = erpDto.FSUBENTRYID, Purchaseorderno = erpDto.FPurOrderNo, Purchaseorderentryseq = Convert.ToInt32(erpDto.FPurOrderEntrySeq), Stockinqty = Convert.ToDecimal(erpDto.FBaseStockInQty), Nostockinqty = Convert.ToDecimal(erpDto.FBaseNoStockInQty), - Stockowner = erpDto.FInStockOwnerId + Stockowner = erpDto.FInStockOwnerId, + PlanConfirmation = erpDto.PlanConfirmation != null + ? DateTime.ParseExact(erpDto.PlanConfirmation, + "yyyy-MM-dd HH:mm:ss", null) + : null, + ReqSrc = erpDto.FReqSrc, + SrcSplitSeq = erpDto.SrcSplitSeq, + Typea = erpDto.TypeA, }; - var single = base.GetSingle(it => it.ErpId == erpDto.FPPOMID); + var single = base.GetSingle(it => it.ErpId == erpDto.FID); if (single != null) productionOrder.Guid = single.Guid; return productionOrder; @@ -190,6 +203,18 @@ ItemNo = erpDto.FReplaceGroup, OwnerType = erpDto.FOwnerTypeId, Owner = erpDto.FOwnerID2, + Fisgetscrap = erpDto.FISGETSCRAP, + Fiskeycomponent = erpDto.FISKEYCOMPONENT, + Fsrctransorgid = erpDto.FSRCTRANSORGID, + Fsrctransstockid = erpDto.FSRCTRANSSTOCKID, + Fstockstatusid = erpDto.FSTOCKSTATUSID, + Fneeddate = erpDto.FNEEDDATE != null + ? DateTime.ParseExact(erpDto.FNEEDDATE, + "yyyy-MM-dd HH:mm:ss", null) + : null, + Freservetype = erpDto.FRESERVETYPE, + Fmemo = erpDto.FMEMO, + Typeb = erpDto.TypeB, ErpProductionEntryCode = erpDto.FSUBENTRYID }; -- Gitblit v1.9.3