From d2d86e818fe8e7ee28928e580335dfffb579f16e Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Wed, 6 Nov 2024 16:54:25 +0800 Subject: [PATCH] =?UTF-8?q?bip=E8=B0=83=E6=8B=A8=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsTransferInstockService.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferInstockService.cs index c4a92a6b..663bdd1d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferInstockService.cs @@ -116,12 +116,12 @@ namespace Tnb.WarehouseMgr List allInstockDetails = await _db.Queryable().Where(it => it.bill_id == TransferInstockHId).ToListAsync(); List materialIds = allInstockDetails.Select(x => x.material_id).Distinct().ToList(); - List unitCodes = allInstockDetails.Select(x => x.unit_id).Distinct().ToList(); - List unitDatas = await _db.Queryable() - .LeftJoin((x, y) => x.Id == y.DictionaryTypeId) - .Where((x, y) => x.EnCode == DictConst.MeasurementUnit && unitCodes.Contains(y.EnCode)) - .Select((x, y) => y) - .ToListAsync(); + List unitIds = allInstockDetails.Select(x => x.unit_id).Distinct().ToList(); + //List unitDatas = await _db.Queryable() + // .LeftJoin((x, y) => x.Id == y.DictionaryTypeId) + // .Where((x, y) => x.EnCode == DictConst.MeasurementUnit && unitIds.Contains(y.Id)) + // .Select((x, y) => y) + // .ToListAsync(); List erpWarehouserelaHs = await _db.Queryable().Where(x=>x.id!=null).ToListAsync(); BasWarehouse basWarehouse = await _db.Queryable().Where(r => r.id == WmsWareHouseConst.WAREHOUSE_CP_ID).FirstAsync(); string userAccount = wmsTransferInstockH?.biller ?? ""; @@ -136,7 +136,7 @@ namespace Tnb.WarehouseMgr tableIds.Add(basWarehouse.id); tableIds.AddRange(materialIds); tableIds.Add(supplierId); - tableIds.AddRange(unitDatas.Select(x => x.Id).ToList()); + tableIds.AddRange(unitIds); List erpExtendFields = await _db.Queryable().Where(x => tableIds.Contains(x.table_id)).ToListAsync(); //string erpCreateId = erpExtendFields.Find(x => x.table_id == userId)?.user_id ?? WmsWareHouseConst.ERPUSERID; @@ -190,7 +190,7 @@ namespace Tnb.WarehouseMgr ["crowno"] = item.lineno, ["csourcebillhid"] = wmsTransferInstockH?.erp_pk ?? "", ["csourcebillbid"] = wmsTransferInstockD?.erp_line_pk ?? "", - ["cunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit_id)?.Id ?? ""))?.cunitid ?? "", + ["cunitid"] = erpExtendFields.Find(x => x.table_id == item.unit_id)?.cunitid ?? "", ["cvendorid"] = erpExtendFields.Find(x => x.table_id == supplierId)?.supplier_id ?? "", ["cvendorvid"] = erpExtendFields.Find(x => x.table_id == supplierId)?.supplier_vid ?? "", ["dbizdate"] = date,