From 5a0a406dd7d49e175a71eda9d6488badfa97375a Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 19 十二月 2025 14:33:30 +0800
Subject: [PATCH] 客户信息:销售员编码转ID、物料信息:转编码逻辑修正
---
MES.Service/service/BasicData/MesItemsManager.cs | 85 +++++++++++++++++++++++++-----------------
1 files changed, 51 insertions(+), 34 deletions(-)
diff --git a/MES.Service/service/BasicData/MesItemsManager.cs b/MES.Service/service/BasicData/MesItemsManager.cs
index 7697f7e..ce51cce 100644
--- a/MES.Service/service/BasicData/MesItemsManager.cs
+++ b/MES.Service/service/BasicData/MesItemsManager.cs
@@ -164,7 +164,7 @@
Fpurchaseunitid = item.FPurchaseUnitId,
Storeunit = item.FStoreUnitID,
Saleunit = item.FSaleUnitId,
- //Fforbidstatus = item.FForbidStatus,
+ Fforbidstatus = item.FForbidStatus,//鍚敤涓庣鐢�
MaterialProperti = item.FErpClsID,
ProductionWorkshop = item.FWorkShopId,
ProduceUnit = item.FPRODUCEUNITID,
@@ -197,10 +197,6 @@
{
entity.ItemUnit = entityItemUnit;
}
- else if (!string.IsNullOrWhiteSpace(item.FBaseUnitId))
- {
- entity.ItemUnit = item.FBaseUnitId;
- }
else
{
entity.ItemUnit = "0";
@@ -214,10 +210,6 @@
if (!string.IsNullOrWhiteSpace(entitySaleunit))
{
entity.Saleunit = entitySaleunit;
- }
- else if (!string.IsNullOrWhiteSpace(item.FSaleUnitId))
- {
- entity.Saleunit = item.FSaleUnitId;
}
else
{
@@ -233,10 +225,6 @@
{
entity.Storeunit = entityStoreunit;
}
- else if (!string.IsNullOrWhiteSpace(item.FStoreUnitID))
- {
- entity.Storeunit = item.FStoreUnitID;
- }
else
{
entity.Storeunit = "0";
@@ -250,10 +238,6 @@
if (!string.IsNullOrWhiteSpace(entityFpurchaseunitid))
{
entity.Fpurchaseunitid = entityFpurchaseunitid;
- }
- else if (!string.IsNullOrWhiteSpace(item.FPurchaseUnitId))
- {
- entity.Fpurchaseunitid = item.FPurchaseUnitId;
}
else
{
@@ -269,10 +253,6 @@
{
entity.ProduceUnit = entityProduceUnit;
}
- else if (!string.IsNullOrWhiteSpace(item.FPRODUCEUNITID))
- {
- entity.ProduceUnit = item.FPRODUCEUNITID;
- }
else
{
entity.ProduceUnit = "0";
@@ -287,27 +267,65 @@
{
entity.SubconUnit = entitySubconUnit;
}
- else if (!string.IsNullOrWhiteSpace(item.FSUBCONUNITID))
- {
- entity.SubconUnit = item.FSUBCONUNITID;
- }
else
{
entity.SubconUnit = "0";
}
- // ERP: 0=鏈鐢�, 1=绂佺敤
- // MES: A=鏈鐢�, B=绂佺敤
- if (string.IsNullOrEmpty(item.FForbidStatus))
+ //榛樿浠撳簱缂栫爜杞琁D,DepotCode = item.FStockId,
+ var entityDepotCode = Db.Queryable<MesDepots>()
+ .Where(x => x.DepotCode == item.FStockId)
+ .Select(x => x.DepotId.ToString())
+ .First();
+ if (!string.IsNullOrWhiteSpace(entityDepotCode))
{
- entity.Fforbidstatus = "A";
+ entity.DepotCode = entityDepotCode;
}
else
{
- //鎴戞湡鏈涚殑鍊兼槸A=鍚�,B=鏄�
- //瀹為檯缁欐垜鐨勫�兼槸0鎴�1锛屾垜甯屾湜涓烘垜杞崲浠嶢鍜孊鐨勬柟寮�
- entity.Fforbidstatus = item.FForbidStatus == "1" ? "B" : "A";
+ entity.DepotCode = "0";
}
+
+ //閲囪喘鍛樼紪鐮佽浆ID,Fpurchaserid = item.FPurchaserId,
+ var entityFpurchaserid = Db.Queryable<MesStaff>()
+ .Where(x => x.StaffNo == item.FPurchaserId)
+ .Select(x => x.Id.ToString())
+ .First();
+ if (!string.IsNullOrWhiteSpace(entityFpurchaserid))
+ {
+ entity.Fpurchaserid = entityFpurchaserid;
+ }
+ else
+ {
+ 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.ProductionWorkshop = "0";
+ }
+
+ //// ERP: Y=鏈鐢�, N=绂佺敤
+ //// MES: A=鏈鐢�, B=绂佺敤
+ //if (string.IsNullOrEmpty(item.FForbidStatus))
+ //{
+ // entity.Fforbidstatus = "A";
+ //}
+ //else
+ //{
+ // //鎴戞湡鏈涚殑鍊兼槸A=鍚敤,B=绂佺敤
+ // //瀹為檯缁欐垜鐨勫�兼槸Y鎴朜锛屾垜甯屾湜涓烘垜杞崲浠嶢鍜孊鐨勬柟寮�
+ // entity.Fforbidstatus = item.FForbidStatus == "N" ? "B" : "A";
+ //}
return entity;
}
@@ -330,8 +348,7 @@
return newId;
}
- private bool UpdateItemStatusBatch(SqlSugarScope db,
- List<MesItems> itemList, string status)
+ private bool UpdateItemStatusBatch(SqlSugarScope db,List<MesItems> itemList, string status)
{
var ids = itemList.Select(it => it.Id).ToArray();
var result = db.Updateable<MesItems>()
--
Gitblit v1.9.3