diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index 4a46c631..26eec796 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -720,6 +720,9 @@ namespace Tnb.ProductionMgr { records = await _db.Queryable().Where(x => thirdNameArr.Contains(x.third_name) && x.status == "0" && x.is_send == 1).ToListAsync(); } + + if (records.IsEmpty()) return ""; + DateTime now = DateTime.Now; Stopwatch stopwatch = null; string response = ""; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index bf2ac622..40f4c2b8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -3163,7 +3163,7 @@ namespace Tnb.WarehouseMgr ids.AddRange(unitDatas.Select(x => x.Id).ToList()); List erpExtendFields = await db.Queryable().Where(x => ids.Contains(x.table_id)).ToListAsync(); - string erpCreateId = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.create_id)?.user_id ?? ""; + string erpCreateId = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.create_id)?.user_id ?? WmsWareHouseConst.AdministratorUserId; ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId)); string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); List erpWarehouserelaHs = await _db.Queryable().Where(x => x.id != null).ToListAsync(); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs index 962add84..cd44eef8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs @@ -1036,7 +1036,7 @@ namespace Tnb.WarehouseMgr List erpExtendFields = await _db.Queryable().Where(x => ids.Contains(x.table_id)).ToListAsync(); ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId)); - string erpCreateId = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.create_id)?.user_id ?? ""; + string erpCreateId = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.create_id)?.user_id ?? WmsWareHouseConst.AdministratorUserId; List erpWarehouserelaHs = await _db.Queryable().Where(x=>x.id!=null).ToListAsync(); BasWarehouse outWarehouse = await _db.Queryable().SingleAsync(x=>x.id==wmsMaterialTransfer.warehouse_outstock); BasWarehouse inWarehouse = await _db.Queryable().SingleAsync(x=>x.id==wmsMaterialTransfer.warehouse_instock);