From 4a7b0fda2e0659982239020c005615758a3acbee Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 12 十二月 2025 10:20:23 +0800
Subject: [PATCH] 采购员编码转ID
---
MES.Service/service/BasicData/MesItemsManager.cs | 45 +++++++++++++++++++++++++++------------------
1 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/MES.Service/service/BasicData/MesItemsManager.cs b/MES.Service/service/BasicData/MesItemsManager.cs
index c34f099..390ed88 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,
@@ -314,18 +314,36 @@
entity.SubconUnit = "0";
}
- // ERP: Y=鏈鐢�, N=绂佺敤
- // MES: A=鏈鐢�, B=绂佺敤
- if (string.IsNullOrEmpty(item.FForbidStatus))
+ //閲囪喘鍛樼紪鐮佽浆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.Fforbidstatus = "A";
+ entity.Fpurchaserid = entityFpurchaserid;
+ }
+ else if (!string.IsNullOrWhiteSpace(item.FPurchaserId))
+ {
+ entity.Fpurchaserid = item.FPurchaserId;
}
else
{
- //鎴戞湡鏈涚殑鍊兼槸A=鍚敤,B=绂佺敤
- //瀹為檯缁欐垜鐨勫�兼槸Y鎴朜锛屾垜甯屾湜涓烘垜杞崲浠嶢鍜孊鐨勬柟寮�
- entity.Fforbidstatus = item.FForbidStatus == "N" ? "B" : "A";
+ entity.SubconUnit = "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;
}
@@ -348,17 +366,8 @@
return newId;
}
- /// <summary>
- /// 鍚敤涓庣鐢�"Y"銆�"N" 杞崲涓� "A"銆�"B"
- /// </summary>
- /// <param name="db"></param>
- /// <param name="itemList"></param>
- /// <param name="inputStatus"></param>
- /// <returns></returns>
- /// <exception cref="NotImplementedException"></exception>
- private bool UpdateItemStatusBatch(SqlSugarScope db,List<MesItems> itemList, string inputStatus)
+ private bool UpdateItemStatusBatch(SqlSugarScope db,List<MesItems> itemList, string status)
{
- var status = (inputStatus == "Y") ? "A" : (inputStatus == "N") ? "B" : inputStatus;
var ids = itemList.Select(it => it.Id).ToArray();
var result = db.Updateable<MesItems>()
.SetColumns(s => s.Fforbidstatus == status)
--
Gitblit v1.9.3