From 24da1906e96788a30cf875012399afa22018ad0a Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Fri, 11 Oct 2024 13:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=8A=A5=E5=91=8A=E9=83=A8?= =?UTF-8?q?=E9=97=A8vid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 922d8fca..1a0392a5 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -2598,14 +2598,18 @@ namespace Tnb.ProductionMgr string erpCreateId = WmsWareHouseConst.ERPUSERID; ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (WmsWareHouseConst.AdministratorOrgId)); string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); - + ErpExtendField deptExtendField = null; + if (!string.IsNullOrEmpty(prdMo.dept_id)) + { + deptExtendField = await _db.Queryable().Where(x => x.cdptid==prdMo.dept_id).FirstAsync(); + } List> requestData = new List>(); Dictionary erpRequestData = new Dictionary(); erpRequestData.Add("auditer", erpCreateId); erpRequestData.Add("billmaker", erpCreateId); erpRequestData.Add("cdeptid", prdMo.dept_id); //部门先写死1001A1100000001JFOPQ - erpRequestData.Add("cdeptvid", erpExtendFields.Find(x=>x.cdptid==prdMo.dept_id)?.cdptvid ?? ""); //部门先写死 + erpRequestData.Add("cdeptvid", deptExtendField?.cdptvid); //部门先写死 erpRequestData.Add("taudittime", nowStr); erpRequestData.Add("creationtime", nowStr); erpRequestData.Add("creator", erpCreateId); @@ -2624,7 +2628,7 @@ namespace Tnb.ProductionMgr erpRequestDataDetails.Add(new Dictionary() { ["cbdeptid"] = prdMo.dept_id, - ["cbdeptvid"] = erpExtendFields.Find(x=>x.cdptid==prdMo.dept_id)?.cdptvid ?? "", //部门先写死 + ["cbdeptvid"] = deptExtendField?.cdptvid, ["cbmainmaterialid"] = erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialoid ?? "", ["cbmainmaterialvid"] = erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialvid ?? "", ["cbmaterialid"] = erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialvid ?? "",