From 8e6bec9d0a8ae0eea1be319ad3ee972a0ba97c58 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期二, 23 十二月 2025 16:53:29 +0800
Subject: [PATCH] 物料信息:添加物料分类编号

---
 MES.Service/service/BasicData/MesItemsManager.cs |   47 +++++++++++++++--------------------------------
 1 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/MES.Service/service/BasicData/MesItemsManager.cs b/MES.Service/service/BasicData/MesItemsManager.cs
index 390ed88..f1a1d17 100644
--- a/MES.Service/service/BasicData/MesItemsManager.cs
+++ b/MES.Service/service/BasicData/MesItemsManager.cs
@@ -133,6 +133,7 @@
             ItemNo = item.FNumber,
             ItemName = item.FName,
             ItemModel = item.FSpecification,
+            Ppbom00019124= item.PPBOM00019124,
             ItemUnit = item.FBaseUnitId,//鐗╂枡鍩烘湰鍗曚綅缂栫爜杞琁D
             Lowlimit = Convert.ToDouble(item.FSafeStock),
             Highlimit = Convert.ToDouble(item.FMaxStock),
@@ -197,10 +198,6 @@
         {
             entity.ItemUnit = entityItemUnit;
         }
-        else if (!string.IsNullOrWhiteSpace(item.FBaseUnitId))
-        {
-            entity.ItemUnit = item.FBaseUnitId;
-        }
         else
         {
             entity.ItemUnit = "0";
@@ -214,10 +211,6 @@
         if (!string.IsNullOrWhiteSpace(entitySaleunit))
         {
             entity.Saleunit = entitySaleunit;
-        }
-        else if (!string.IsNullOrWhiteSpace(item.FSaleUnitId))
-        {
-            entity.Saleunit = item.FSaleUnitId;
         }
         else
         {
@@ -233,10 +226,6 @@
         {
             entity.Storeunit = entityStoreunit;
         }
-        else if (!string.IsNullOrWhiteSpace(item.FStoreUnitID))
-        {
-            entity.Storeunit = item.FStoreUnitID;
-        }
         else
         {
             entity.Storeunit = "0";
@@ -250,10 +239,6 @@
         if (!string.IsNullOrWhiteSpace(entityFpurchaseunitid))
         {
             entity.Fpurchaseunitid = entityFpurchaseunitid;
-        }
-        else if (!string.IsNullOrWhiteSpace(item.FPurchaseUnitId))
-        {
-            entity.Fpurchaseunitid = item.FPurchaseUnitId;
         }
         else
         {
@@ -269,10 +254,6 @@
         {
             entity.ProduceUnit = entityProduceUnit;
         }
-        else if (!string.IsNullOrWhiteSpace(item.FPRODUCEUNITID))
-        {
-            entity.ProduceUnit = item.FPRODUCEUNITID;
-        }
         else
         {
             entity.ProduceUnit = "0";
@@ -286,10 +267,6 @@
         if (!string.IsNullOrWhiteSpace(entitySubconUnit))
         {
             entity.SubconUnit = entitySubconUnit;
-        }
-        else if (!string.IsNullOrWhiteSpace(item.FSUBCONUNITID))
-        {
-            entity.SubconUnit = item.FSUBCONUNITID;
         }
         else
         {
@@ -305,13 +282,9 @@
         {
             entity.DepotCode = entityDepotCode;
         }
-        else if (!string.IsNullOrWhiteSpace(item.FStockId))
-        {
-            entity.DepotCode = item.FStockId;
-        }
         else
         {
-            entity.SubconUnit = "0";
+            entity.DepotCode = "0";
         }
 
         //閲囪喘鍛樼紪鐮佽浆ID,Fpurchaserid = item.FPurchaserId,
@@ -323,13 +296,23 @@
         {
             entity.Fpurchaserid = entityFpurchaserid;
         }
-        else if (!string.IsNullOrWhiteSpace(item.FPurchaserId))
+        else
         {
-            entity.Fpurchaserid = item.FPurchaserId;
+            entity.Fpurchaserid = "0";
+        }
+
+        //宸ヤ綔涓績缂栫爜杞琁D,ProductionWorkshop = item.FWorkShopId,
+        var entityProductionWorkshop = Db.Queryable<SysDepartment>()
+        .Where(x => x.WorkshopCenterCode == item.FWorkShopId)
+        .Select(x => x.Id.ToString())
+        .First();
+        if (!string.IsNullOrWhiteSpace(entityProductionWorkshop))
+        {
+            entity.ProductionWorkshop = entityProductionWorkshop;
         }
         else
         {
-            entity.SubconUnit = "0";
+            entity.ProductionWorkshop = "0";
         }
 
         //// ERP: Y=鏈鐢�, N=绂佺敤

--
Gitblit v1.9.3