From 4a8f16f0d07d67098e538c6a03bdc979b04af9bc Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期一, 15 九月 2025 16:16:10 +0800 Subject: [PATCH] 1111 --- MES.Service/service/BasicData/MesRohInManager.cs | 31 ++++++++++++++- MES.Service/service/WomcaaManager.cs | 47 +++++++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/MES.Service/service/BasicData/MesRohInManager.cs b/MES.Service/service/BasicData/MesRohInManager.cs index fc681ae..043fab3 100644 --- a/MES.Service/service/BasicData/MesRohInManager.cs +++ b/MES.Service/service/BasicData/MesRohInManager.cs @@ -129,12 +129,37 @@ mesRohIn.Supplier = mesSupplier.Id.ToString(); } + // SETTLEMENT_PARTY -> MesSupplier.id + if (!string.IsNullOrEmpty(rohIn.FSettleId)) + { + var settlementSupplier = Db.Queryable<MesSupplier>() + .Where(s => s.SuppNo == rohIn.FSettleId) + .Select(s => s.Id) + .First(); + if (settlementSupplier != null) + { + mesRohIn.SettlementParty = settlementSupplier.ToString(); + } + } + + // PURCHASE_DEPT -> SYS_DEPARTMENT.DEPARTMENTID + if (!string.IsNullOrEmpty(rohIn.FPurchaseDeptId)) + { + var department = Db.Queryable<SysDepartment>() + .Where(d => d.Departmentcode == rohIn.FPurchaseDeptId) + .Select(d => d.Id) + .First(); + if (department != null) + { + mesRohIn.PurchaseDept = department.ToString(); + } + } + mesRohIn.CloseStatus = rohIn.FCloseStatus; - mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId; - mesRohIn.PurchaseDept = rohIn.FPurchaseDeptId; + // mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId; + mesRohIn.PurchaseOrg = "1"; mesRohIn.PurchaseGroup = rohIn.FPurchaserGroupId; mesRohIn.Purchaser = rohIn.FPurchaserId; - mesRohIn.SettlementParty = rohIn.FSettleId; mesRohIn.PaymentParty = rohIn.FChargeId; mesRohIn.Email = rohIn.FProviderEMail; mesRohIn.Remarks = rohIn.Remarks; diff --git a/MES.Service/service/WomcaaManager.cs b/MES.Service/service/WomcaaManager.cs index 9a109f5..1113a5f 100644 --- a/MES.Service/service/WomcaaManager.cs +++ b/MES.Service/service/WomcaaManager.cs @@ -173,6 +173,53 @@ var single = base.GetSingle(it => it.Erpid == entity.Erpid); if (single != null) entity.Guid = single.Guid; + // 鏌ユ壘骞惰缃搴旂殑MES绯荤粺ID + // CAA021 宸ヤ綔杞﹂棿 -> SYS_DEPARTMENT.id + if (!string.IsNullOrEmpty(entity.Caa021)) + { + var department = Db.Queryable<SysDepartment>() + .Where(d => d.Departmentcode == entity.Caa021) + .Select(d => d.Id) + .First(); + entity.Caa021 = department.ToString(); + } + + // DEPOT_CODE 浠撳簱 -> MES_DEPOTS.id + if (!string.IsNullOrEmpty(entity.DepotCode)) + { + var depot = Db.Queryable<MesDepots>() + .Where(d => d.DepotCode == entity.DepotCode) + .Select(d => d.DepotId) + .First(); + entity.DepotCode = depot.ToString(); + } + + // ERP_WTZZ 濮旀墭缁勭粐 -> 1 (鍥哄畾鍊�) + entity.ErpWtzz = 1; + + // ERP_SCZZ 鐢熶骇缁勭粐 -> 1 (鍥哄畾鍊�) + entity.ErpSczz = 1; + + // CAA006 浜у搧缂栫爜 -> MES_ITEMS.id + if (!string.IsNullOrEmpty(entity.Caa006)) + { + var item = Db.Queryable<MesItems>() + .Where(i => i.ItemNo == entity.Caa006) + .Select(i => i.Id) + .First(); + entity.Caa006 = item.ToString(); + } + + // CAA009 鍗曚綅 -> MES_UNIT.id + if (!string.IsNullOrEmpty(entity.Caa009)) + { + var unit = Db.Queryable<MesUnit>() + .Where(u => u.Fnumber == entity.Caa009) + .Select(u => u.Id) + .First(); + entity.Caa009 = unit.ToString(); + } + return entity; } -- Gitblit v1.9.3