From 5b7e724d586b6689919e3cfc6980bfdfd22a1a12 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Wed, 26 Jun 2024 14:23:34 +0800 Subject: [PATCH] bug --- .../Tnb.ProductionMgr/PrdMaterialReceiptService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index 83f0adf6..089c411a 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -21,6 +21,7 @@ using Tnb.ProductionMgr.Interfaces; using Tnb.WarehouseMgr; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; +using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; @@ -404,7 +405,13 @@ namespace Tnb.ProductionMgr OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(moTask.workstation_id, DictConst.RegionCategoryWorkshopCode); List insertHList = new List(); List insertDList = new List(); - string orgId = _userManager.GetUserInfo().Result.organizeId; + string orgId = WmsWareHouseConst.AdministratorOrgId; + string userId = WmsWareHouseConst.AdministratorUserId; + if (_userManager != null && _userManager.GetUserInfo() != null && _userManager.GetUserInfo().Result!=null) + { + orgId = _userManager.GetUserInfo().Result.organizeId; + userId = _userManager.UserId; + } foreach(string carryId in input.carryIds) { WmsCarryH carry = await db.Queryable().SingleAsync(x => x.id == carryId); @@ -421,7 +428,7 @@ namespace Tnb.ProductionMgr workline_id = moTask.workline_id, carry_code = carry.carry_code, mbom_process_id = moTask.mbom_process_id, - create_id = _userManager.UserId, + create_id = userId, create_time = DateTime.Now, org_id = orgId };