From a6cad2fe831204993e4615c58d17d1a8fb689725 Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期一, 15 九月 2025 17:07:51 +0800
Subject: [PATCH] 委外工单修改

---
 MES.Service/service/BasicData/ProductionOrderManager.cs |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs
index 28b494d..93dc1ce 100644
--- a/MES.Service/service/BasicData/ProductionOrderManager.cs
+++ b/MES.Service/service/BasicData/ProductionOrderManager.cs
@@ -107,7 +107,15 @@
         // 鏃堕棿鏍煎紡杞崲鍑芥暟锛孍RP鏃堕棿鏍煎紡涓� "yyyy-MM-dd HH:mm:ss.fff"
         DateTime? ParseDateTime(string dateStr)
         {
-            if (DateTime.TryParseExact(dateStr, "yyyy-MM-dd HH:mm:ss.fff",
+
+            string[] formats = new string[]
+            {
+                  "yyyy-MM-dd HH:mm:ss.fff",
+                  "yyyy-MM-dd HH:mm:ss",
+                  "yyyy-MM-dd"
+            };
+
+            if (DateTime.TryParseExact(dateStr, formats,
                     CultureInfo.InvariantCulture,
                     DateTimeStyles.None,
                     out parsedDate))
@@ -183,7 +191,7 @@
             var productionOrderSub = new ProductionOrderSub
             {
                 SequenceNo = Convert.ToInt32(erpDto.FSEQ),
-                MaterialCode = erpDto.FMaterialID2,
+                MaterialCode = erpDto.FMaterialID,
                 RequiredQty = Convert.ToDecimal(erpDto.FMustQty),
                 IssuedQty = Convert.ToDecimal(erpDto.FPickedQty),
                 LocationNo = erpDto.FPositionNO,
@@ -192,8 +200,8 @@
                 BatchNo = erpDto.FLot,
                 Warehouse = erpDto.FStockID,
                 IssuingMethod = erpDto.FIssueType,
-                Unit = erpDto.FUnitID2,
-                Unit2 = erpDto.FUnitID3,
+                Unit = erpDto.FUnitID,
+                Unit2 = erpDto.FUnitID,
                 SupplyingType = erpDto.FSupplyType,
                 Numerator = Convert.ToDecimal(erpDto.FNumerator),
                 Denominator = Convert.ToDecimal(erpDto.FDenominator),
@@ -204,7 +212,7 @@
                 SubItemType = erpDto.FMaterialType,
                 ItemNo = erpDto.FReplaceGroup,
                 OwnerType = erpDto.FOwnerTypeId,
-                Owner = erpDto.FOwnerID2,
+                Owner = erpDto.FOwnerID,
                 Fisgetscrap = erpDto.FISGETSCRAP,
                 Fiskeycomponent = erpDto.FISKEYCOMPONENT,
                 Fsrctransorgid = erpDto.FSRCTRANSORGID,

--
Gitblit v1.9.3