From 69e9f4f7ea3467e4030b60200705a750598827b6 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期一, 23 十二月 2024 13:21:18 +0800
Subject: [PATCH] 11

---
 MES.Service/Dto/webApi/ErpProductionOrderDto.cs         |    4 ++--
 MES.Service/service/BasicData/ProductionOrderManager.cs |   16 +++++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/MES.Service/Dto/webApi/ErpProductionOrderDto.cs b/MES.Service/Dto/webApi/ErpProductionOrderDto.cs
index c61d444..d281ff8 100644
--- a/MES.Service/Dto/webApi/ErpProductionOrderDto.cs
+++ b/MES.Service/Dto/webApi/ErpProductionOrderDto.cs
@@ -15,6 +15,7 @@
     public string? FPlannerID { get; set; } // 璁″垝鍛�
     public string? FPlanStartDate { get; set; } // 棰勮寮�宸ユ椂闂�
     public string? FPlanFinishDate { get; set; } // 棰勮瀹屽伐鏃堕棿
+    public string? PlanConfirmation{ get; set; } 
     public string? FStockInLimitH { get; set; } // 鍏ュ簱涓婇檺
     public string? FStockInLimitL { get; set; } // 鍏ュ簱涓嬮檺
     public string? FMTONO { get; set; } // 璁″垝璺熻釜鍙�
@@ -33,7 +34,7 @@
     public string? FFORCECLOSERID { get; set; } // 缁撴浜�
     public string? FCloseType { get; set; } // 缁撴绫诲瀷
     public string? FDescription { get; set; } // 澶囨敞
-    public string? FPPOMID { get; set; } // ERPID
+    public string? FID { get; set; } // ERPID
     public string? FSUBENTRYID { get; set; } // ERP鐢熶骇璁㈠崟鍒嗗綍鍐呯爜
     public string? FPurOrderNo { get; set; } // 閲囪喘璁㈠崟
     public string? FPurOrderEntrySeq { get; set; } // 閲囪喘璁㈠崟琛屽彿
@@ -41,7 +42,6 @@
     public string? FBaseNoStockInQty { get; set; } // 鏈叆搴撴暟閲�
 
     public string? FInStockOwnerId { get; set; } // 鍏ュ簱璐т富
-    public string? PlanConfirmation { get; set; }
     public string? FReqSrc { get; set; }
     public string? SrcSplitSeq { get; set; }
     public string? TypeA { get; set; }
diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs
index 5659a47..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,7 +148,7 @@
             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),
@@ -158,7 +164,7 @@
             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;

--
Gitblit v1.9.3