From caabe3ba39cedbe0daf18c231a22df1e693b49be Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期五, 26 九月 2025 14:35:55 +0800
Subject: [PATCH] 11

---
 MES.Service/service/WomcaaManager.cs                    |   17 +++++++++++++++--
 MES.Service/service/BasicData/ProductionOrderManager.cs |   30 ++++++++++++++++++++++++------
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs
index 28b494d..61fab5b 100644
--- a/MES.Service/service/BasicData/ProductionOrderManager.cs
+++ b/MES.Service/service/BasicData/ProductionOrderManager.cs
@@ -21,7 +21,8 @@
     public bool Save(ErpWYOrder wyOrder)
     {
         var erpProductionOrderDto = wyOrder.OrderDto;
-        var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto, wyOrder.Items[0].FBILLNO);
+        var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto,
+            wyOrder.Items[0].FBILLNO);
         var mesRohInDatas =
             ConvertErpToProductionOrderSub(wyOrder.Items);
 
@@ -77,7 +78,9 @@
 
         if (mesRohInDatas.Count > 0)
             db.Deleteable<ProductionOrderSub>()
-                .Where(s => s.ErpProductionEntryCode == mesRohIn.ErpProductionEntryCode).ExecuteCommand();
+                .Where(s =>
+                    s.ErpProductionEntryCode == mesRohIn.ErpProductionEntryCode)
+                .ExecuteCommand();
 
         var orUpdate = db.Insertable(mesRohIn)
             .IgnoreColumns(true).ExecuteCommand() > 0;
@@ -86,7 +89,7 @@
         var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1)
             .IgnoreColumnsNull()
             .ExecuteCommand() > 0;
-        
+
         if (orUpdate && baOrUpdate) return true;
 
         throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
@@ -100,7 +103,7 @@
     }
 
     private ProductionOrder ConvertErpToProductionOrder(
-        ErpProductionOrderDto erpDto,string SUBBOM)
+        ErpProductionOrderDto erpDto, string SUBBOM)
     {
         DateTime parsedDate;
 
@@ -142,7 +145,7 @@
             ErpProductionOrderId = erpDto.FSUBID,
             ErpProductionOrderLineNo = erpDto.FSUBBILLNOSEQ,
             ErpProductionOrderNo = erpDto.FSUBBILLNO,
-            SourceOrderType = erpDto.FSrcBillType,
+
             SourceOrderNo = erpDto.FSrcBillNo,
             SourceOrderEntryNo = erpDto.FSrcBillEntrySeq,
             DemandOrderNo = erpDto.FSALEORDERNO,
@@ -166,7 +169,22 @@
             Typea = erpDto.TypeA,
         };
 
-        var single = base.GetSingle(it => it.ErpProductionEntryCode == erpDto.FSUBENTRYID);
+        productionOrder.SourceOrderType = erpDto.FSrcBillType switch
+        {
+            //SourceOrderType = erpDto.FSrcBillType,
+            "0" => "鏃犳潵婧�",
+            "1" => "閿�鍞鍗曡鍙�",
+            "2" => "棰勬祴",
+            "3" => "鍑哄彛璁㈠崟琛屽彿",
+            "4" => "闇�姹傚垎绫讳唬鍙�",
+            "5" => "閿�鍞鍗曞彿",
+            "6" => "鍑哄彛璁㈠崟鍙�",
+            "7" or "8" => "鐢熶骇璁㈠崟",
+            _ => "濮斿璁㈠崟"
+        };
+
+        var single = base.GetSingle(it =>
+            it.ErpProductionEntryCode == erpDto.FSUBENTRYID);
         if (single != null) productionOrder.Guid = single.Guid;
 
         return productionOrder;
diff --git a/MES.Service/service/WomcaaManager.cs b/MES.Service/service/WomcaaManager.cs
index 62c68a4..b5621f9 100644
--- a/MES.Service/service/WomcaaManager.cs
+++ b/MES.Service/service/WomcaaManager.cs
@@ -134,7 +134,7 @@
             Caa013 = dto.FBomId, ///     BOM鐗堟
 
             CreateType = dto.FCreateType, ///     鐢熸垚鏂瑰紡
-            SrcBillType = dto.FSrcBillType, ///     婧愬崟绫诲瀷
+           
             SrcBillNo = dto.FSrcBillNo, ///     婧愬崟缂栧彿
             SrcBillentryseq = dto.FSrcBillEntrySeq, ///     婧愬崟鍒嗗綍琛屽彿
             SaleOrderNo = dto.FSaleOrderNo, ///     闇�姹傚崟鎹彿
@@ -219,7 +219,20 @@
                 .First();
             entity.Caa009 = unit.ToString();
         }
-        
+
+        entity.SrcBillType = dto.FSrcBillType switch
+        {
+            // SrcBillType = dto.FSrcBillType, ///     婧愬崟绫诲瀷
+            "0" => "鏃犳潵婧�",
+            "1" => "閿�鍞鍗曡",
+            "2" => "",
+            "3" => "鍑哄彛璁㈠崟琛�",
+            "4" => "闇�姹傚垎绫�",
+            "5" => "閿�鍞鍗�",
+            "6" => "鍑哄彛璁㈠崟",
+            _ => ""
+        };
+
         //CreateDate = dto.FDate, ///     鍗曟嵁鏃ユ湡
         if (!dto.FDate.IsNullOrEmpty())
         {

--
Gitblit v1.9.3