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 };