diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs index ee3b4c82..35516af2 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs @@ -1464,7 +1464,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA LoggerFloor2RackDelivery.LogInformation($"【送空托到上升降区】 开始生成预任务 起点{startLocation.location_code} 终点{wmsMechanicalArmH.location_code} 料架 {targetCarry.carry_code}"); - bool result = await createPretask(startLocation.id, wmsMechanicalArmH.location_id, targetCarry.id, targetCarry.carry_code, LoggerFloor2RackDelivery, db_Floor2timer送空托到上升降区); + bool result = await createPretask(startLocation.id, wmsMechanicalArmH.location_id, targetCarry.id, targetCarry.carry_code, LoggerFloor2RackDelivery, db_Floor2timer送空托到上升降区, WmsWareHouseConst.BIZTYPE_ZCCKNZY_ID); if (!result) { LoggerFloor2RackDelivery.LogInformation($"【送空托到上升降区】 未成功生成预任务 起点{startLocation.location_code} 终点{wmsMechanicalArmH.location_code} 料架 {targetCarry.carry_code}"); @@ -1642,7 +1642,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA LoggerFloor2RackDelivery.LogInformation($"【送满托到下升降区】 开始生成预任务 起点{startLocation.location_code} 终点{wmsMechanicalArmH.location_code} 料架 {targetCarry.carry_code}"); - bool result = await createPretask(startLocation.id, wmsMechanicalArmH.location_id, targetCarry.id, targetCarry.carry_code, LoggerFloor2RackDelivery, db_Floor2timer送满托到下升降区); + bool result = await createPretask(startLocation.id, wmsMechanicalArmH.location_id, targetCarry.id, targetCarry.carry_code, LoggerFloor2RackDelivery, db_Floor2timer送满托到下升降区, WmsWareHouseConst.BIZTYPE_ZCCKNZY_ID); if (!result) { LoggerFloor2RackDelivery.LogInformation($"【送满托到下升降区】 未成功生成预任务 起点{startLocation.location_code} 终点{wmsMechanicalArmH.location_code} 料架 {targetCarry.carry_code}"); @@ -1765,7 +1765,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA { LoggerFloor2RackDelivery.LogWarning($"【移走上升降区满托的料架】找不到转库单{wmsMechanicalArmH.outbill}"); } - bool result = await createPretask(wmsMechanicalArmH.location_id, endLocation.id, wmsMechanicalArmH.rackid, wmsMechanicalArmH.rackcode, LoggerFloor2RackDelivery, db_Floor2timer移走上升降区未生成预任务且满托的料架, "erp_qtrk", wmsMaterialTransferId); + bool result = await createPretask(wmsMechanicalArmH.location_id, endLocation.id, wmsMechanicalArmH.rackid, wmsMechanicalArmH.rackcode, LoggerFloor2RackDelivery, db_Floor2timer移走上升降区未生成预任务且满托的料架, WmsWareHouseConst.BIZTYPE_ZCCKNZY_ID, wmsMaterialTransferId); if (!result) { LoggerFloor2RackDelivery.LogError($"【移走上升降区满托的料架】 未成功生成预任务 起点{wmsMechanicalArmH.location_code} 终点{endLocation.location_code} 料架 {wmsMechanicalArmH.rackcode}"); @@ -1898,7 +1898,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA LoggerFloor2RackDelivery.LogInformation($"【移走下升降区空托的料架】 开始执行预任务生成: 料架区为{wmsMechanicalArmH.name}{wmsMechanicalArmH.stackingposition} 料架为{wmsMechanicalArmH.rackcode}"); - bool result = await createPretask(wmsMechanicalArmH.location_id, endLocation.id, wmsMechanicalArmH.rackid, wmsMechanicalArmH.rackcode, LoggerFloor2RackDelivery, db_Floor2timer移走下升降区未生成预任务且空托的料架); + bool result = await createPretask(wmsMechanicalArmH.location_id, endLocation.id, wmsMechanicalArmH.rackid, wmsMechanicalArmH.rackcode, LoggerFloor2RackDelivery, db_Floor2timer移走下升降区未生成预任务且空托的料架, WmsWareHouseConst.BIZTYPE_ZCCKNZY_ID); if (!result) { LoggerFloor2RackDelivery.LogInformation($"【移走下升降区空托的料架】 未成功生成预任务 起点{wmsMechanicalArmH.location_code} 终点{endLocation.location_code} 料架 {wmsMechanicalArmH.rackcode}"); @@ -2603,7 +2603,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA DateTime now = DateTime.Now; List wmsSterilizationInstockHs = db_Floor4DMC2CPK.Queryable() - .Where(r => (DateTime.Now - r.instock_time.Value).TotalHours > hours && r.status == WmsWareHouseConst.BILLSTATUS_ADD_ID).ToList(); + .Where(r => (DateTime.Now - r.instock_time.Value).TotalHours > hours && r.status == WmsWareHouseConst.BILLSTATUS_ADD_ID && r.origin == "生产入库").ToList(); foreach (WmsSterilizationInstockH wmsSterilizationInstockH in wmsSterilizationInstockHs) { @@ -2667,7 +2667,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA wmsSterilizationInstockH.cp_location_id = endlocation.id; wmsSterilizationInstockH.cp_location_code = endlocation.location_code; - await db_Floor4DMC2CPK.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status }).ExecuteCommandAsync(); + await db_Floor4DMC2CPK.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status, r.cp_location_id, r.cp_location_code }).ExecuteCommandAsync(); await db_Floor4DMC2CPK.Ado.CommitTranAsync(); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index a8ad461b..aeb2e922 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -281,6 +281,12 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// public const string WMS_PRETASK_TRANSFER_TYPE_ID = "26126753796389"; + + /// + /// 预任务生成业务类型-暂存仓库内转移 + /// + public const string BIZTYPE_ZCCKNZY_ID = "37490619400981"; + /// /// 预任务生成业务类型-空载具出库 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryStockReportH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryStockReportH.cs index 002f9c53..b9f7fcf5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryStockReportH.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryStockReportH.cs @@ -100,6 +100,16 @@ public partial class WmsCarryStockReport /// public string? code_batch { get; set; } + /// + /// + /// + public string? material_specification { get; set; } + + /// + /// + /// + public string? container_no { get; set; } + /// /// 数量 /// @@ -223,6 +233,16 @@ public partial class WmsCarryStockReportCode /// public string? material_name { get; set; } + /// + /// + /// + public string? material_specification { get; set; } + + /// + /// + /// + public string? container_no { get; set; } + /// /// 条码编号 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index 7e4fdba0..13eb97e7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -574,7 +574,7 @@ namespace Tnb.WarehouseMgr WmsPretaskH curWmsPretaskH = await _db.Queryable().Where(r => r.bill_code == wmsDistaskH.pretask_code).FirstAsync(); List nextWmsPretaskHs = _db.Queryable().Where(r => r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && r.carry_code == wmsDistaskH.carry_code && long.Parse(r.id) > long.Parse(curWmsPretaskH.id) - && new string[3] { "A", "F", "FC" }.Contains(r.area_code)).ToList(); + && new string[4] { "A", "F", "J", "FC" }.Contains(r.area_code)).ToList(); Logger.Information($"即将取消{wmsDistaskH.bill_code}的后续预任务{nextWmsPretaskHs.Count}条"); foreach (WmsPretaskH wmsPretaskH in nextWmsPretaskHs) { @@ -706,7 +706,7 @@ namespace Tnb.WarehouseMgr WmsPretaskH curWmsPretaskH = await _db.Queryable().Where(r => r.bill_code == wmsDistaskH.pretask_code).FirstAsync(); List nextWmsPretaskHs = _db.Queryable().Where(r => r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && r.carry_code == wmsDistaskH.carry_code && long.Parse(r.id) > long.Parse(curWmsPretaskH.id) - && new string[3] { "A", "F", "FC" }.Contains(r.area_code)).ToList(); + && new string[4] { "A", "F", "J", "FC" }.Contains(r.area_code)).ToList(); Logger.Information($"即将取消{wmsDistaskH.bill_code}的后续预任务{nextWmsPretaskHs.Count}条"); foreach (WmsPretaskH wmsPretaskH in nextWmsPretaskHs) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs index 4635fadb..7030f106 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs @@ -763,7 +763,7 @@ namespace Tnb.WarehouseMgr else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_ZC_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_YCL_ID) transfer_type = WmsWareHouseConst.MATERIALTRANSFER_WXDBOUTWAREHOUSE_CODE; // 灭菌入库 - else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_JXK_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_CP_ID) + else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_MJC_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_CP_ID) transfer_type = WmsWareHouseConst.MATERIALTRANSFER_SterilizationInstock_CODE; #endregion @@ -1030,7 +1030,7 @@ namespace Tnb.WarehouseMgr else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_ZC_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_YCL_ID) transfer_type = WmsWareHouseConst.MATERIALTRANSFER_WXDBOUTWAREHOUSE_CODE; // 灭菌入库 - else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_JXK_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_CP_ID) + else if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_MJC_ID && warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_CP_ID) transfer_type = WmsWareHouseConst.MATERIALTRANSFER_SterilizationInstock_CODE; #endregion diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index d91a219a..e6a08bdf 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -327,6 +327,7 @@ namespace Tnb.WarehouseMgr .AndIF(!string.IsNullOrEmpty(input.passage), it => it.passage == input.passage) .ToExpression(); items = await db.Queryable().Where(whereExp).OrderBy(policy.policy).ToListAsync(); + } catch (Exception) { @@ -3182,7 +3183,7 @@ namespace Tnb.WarehouseMgr } else if (dt.biz_type == "erp_qtrk") { - await QTRK2BIP(dt, db); + //await QTRK2BIP(dt, db); } #endregion @@ -3598,7 +3599,7 @@ namespace Tnb.WarehouseMgr //} #endregion //1-4 - if (startlocation.wh_id == WmsWareHouseConst.WAREHOUSE_CPCRK_ID && endlocation.wh_id == WmsWareHouseConst.WAREHOUSE_JXK_ID) + if (startlocation.wh_id == WmsWareHouseConst.WAREHOUSE_CPCRK_ID && endlocation.wh_id == WmsWareHouseConst.WAREHOUSE_MJC_ID) { WmsElevatorH wmsElevatorH = await _db.Queryable().Where(it => it.elevator_group == "2" && it.enabled == 1).OrderBy(r => r.task_nums).FirstAsync(); string elevatorSno = wmsElevatorH.elevator_code.Replace("Elevator", ""); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs index 2364337c..90cbcea4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs @@ -381,7 +381,7 @@ namespace Tnb.WarehouseMgr /// [HttpPost, NonUnify, AllowAnonymous] - public async Task MaterialByCarry(MaterialByCarryInput input) + public async Task MaterialByCarry(MaterialByCarryInput input) { try { @@ -499,13 +499,13 @@ namespace Tnb.WarehouseMgr } } - - return await ToApiResult(HttpStatusCode.OK, "成功", wmsCarryCodes); + + return "成功"; } catch (Exception ex) { await _db.Ado.RollbackTranAsync(); - return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); + throw new AppFriendlyException(ex.Message, 500); } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryStockReportService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryStockReportService.cs index 71db37df..7955f22e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryStockReportService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryStockReportService.cs @@ -84,6 +84,8 @@ namespace Tnb.WarehouseMgr material_id = e.material_id, material_code = e.material_code, material_name = f.name, + material_specification = f.material_specification, + container_no = f.material_standard, unit = e.unit_id, creator = e.create_id, bind_time = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" @@ -100,9 +102,9 @@ namespace Tnb.WarehouseMgr .InnerJoin((a, b, c, d, e, f) => f.carry_id == e.membercarry_id) .InnerJoin((a, b, c, d, e, f, g) => g.id == f.material_id) .InnerJoin((a, b, c, d, e, f, g, h) => h.id == e.membercarry_id) - .Where((a, b, c, d, e) => b.carry_status != "0" && b.carry_status != "6") + .Where((a, b, c, d, e) => b.carry_status != "0" && b.carry_status != "6") .WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id) - .WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d, e, f, g, h) => b.carry_code.Contains(carry_code)|| h.carry_code.Contains(carry_code)) + .WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d, e, f, g, h) => b.carry_code.Contains(carry_code) || h.carry_code.Contains(carry_code)) .WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f, g) => g.code.Contains(material_code)) .WhereIF(!string.IsNullOrEmpty(code_batch), (a, b, c, d, e, f, g) => f.code_batch.Contains(code_batch)) .WhereIF(!string.IsNullOrEmpty(container_no), (a, b, c, d, e, f, g) => g.container_no.Contains(container_no)) @@ -126,6 +128,8 @@ namespace Tnb.WarehouseMgr material_id = f.material_id, material_code = f.material_code, material_name = g.name, + material_specification = g.material_specification, + container_no = g.material_standard, unit = f.unit_id, creator = f.create_id, bind_time = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" @@ -164,6 +168,8 @@ namespace Tnb.WarehouseMgr wmsCarryStockReportCode.code_batch = x.code_batch; wmsCarryStockReportCode.qty = x.qty; wmsCarryStockReportCode.unit = x.unit; + wmsCarryStockReportCode.material_specification = x.material_specification; + wmsCarryStockReportCode.container_no = x.container_no; //wmsCarryStockReportCode.创建用户 = x.操作用户; wmsCarryStockReportCode.bind_time = x.bind_time; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs index c5b75933..7d0a8923 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs @@ -45,6 +45,7 @@ using Tnb.ProductionMgr.Entities.Entity; using Tnb.WarehouseMgr.Entities.Dto.Outputs; using System.Threading; using Tnb.BasicData.Interfaces; +using Top.Api; namespace Tnb.WarehouseMgr { @@ -323,7 +324,7 @@ namespace Tnb.WarehouseMgr /// /// [HttpPost] - public async Task Distribute(MaterialTransferDistributeInput input) + public async Task Distribute(MaterialTransferDistributeInput input) { try { @@ -463,7 +464,7 @@ namespace Tnb.WarehouseMgr await _db.Ado.RollbackTranAsync(); Logger.LogError("【Distribute】" + ex.Message); Logger.LogError("【Distribute】" + ex.StackTrace); - return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message); + throw new AppFriendlyException(ex.Message, 500); } finally { @@ -471,7 +472,7 @@ namespace Tnb.WarehouseMgr InvokeGenPretaskExcute(); } - return await ToApiResult(HttpStatusCode.OK, "成功"); + return "成功"; } /// @@ -481,7 +482,8 @@ namespace Tnb.WarehouseMgr /// /// /// - public async Task DistributeF4JXC(DistributeF4JXCInput input) + [HttpPost] + public async Task DistributeJZCToCPC(DistributeF4JXCInput input) { SemaphoreSlim semaphoreSlim_MJC = null; SemaphoreSlim semaphoreSlim_CPK = null; @@ -519,7 +521,7 @@ namespace Tnb.WarehouseMgr //出库取起点,获取所有符合输入的载具规格的载具 OutStockStrategyQuery outStockStrategyInput = new() { - warehouse_id = WmsWareHouseConst.WAREHOUSE_HCC_ID, + warehouse_id = WmsWareHouseConst.WAREHOUSE_MJC_ID, material_id = wmsMaterialTransferD.material_id, code_batch = wmsMaterialTransferD.code_batch, qty = needOut, @@ -571,7 +573,7 @@ namespace Tnb.WarehouseMgr wmsSterilizationInstockH.cp_location_id = endLocations[instockLocIndex].id; wmsSterilizationInstockH.cp_location_code = endLocations[instockLocIndex].location_code; - await _db.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status }).ExecuteCommandAsync(); + await _db.Updateable(wmsSterilizationInstockH).UpdateColumns(r => new { r.status, r.cp_location_id, r.cp_location_code }).ExecuteCommandAsync(); // 转库单载具子表 WmsMaterialTransferCarry wmsMaterialTransferCarry = new WmsMaterialTransferCarry(); @@ -1287,7 +1289,8 @@ namespace Tnb.WarehouseMgr // 其它入库 if (wmsMaterialTransfer.type == WmsWareHouseConst.MATERIALTRANSFER_WXDBRK_CODE || wmsMaterialTransfer.type == WmsWareHouseConst.MATERIALTRANSFER_CROSSLAYER_CODE - || wmsMaterialTransfer.type == WmsWareHouseConst.MATERIALTRANSFER_WXDBOUTWAREHOUSE_CODE) + || wmsMaterialTransfer.type == WmsWareHouseConst.MATERIALTRANSFER_WXDBOUTWAREHOUSE_CODE + || wmsMaterialTransfer.type == WmsWareHouseConst.MATERIALTRANSFER_QTCRK_CODE) { //自制的不调erp接口 if (string.IsNullOrEmpty(wmsMaterialTransfer.erp_bill_code)) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs index 3b11f5d1..eb0cd110 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs @@ -198,7 +198,7 @@ namespace Tnb.WarehouseMgr } await _db.Ado.BeginTranAsync(); //入库取终点 //出库起点 - InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_JXK_ID, Size = 1 }; + InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_MJC_ID, Size = 1 }; List endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput); if (endLocations.Count == 0) { @@ -426,9 +426,9 @@ namespace Tnb.WarehouseMgr Logger.Error($"【FinishproductOutstockSign】库位id {wmsCarryH.location_id}没有对应的库位基础资料!"); throw new AppFriendlyException($"库位id {wmsCarryH.location_id}没有对应的库位基础资料!", 500); } - if (location != null && location.is_type == "0") + if (location != null && location.region_id != WmsWareHouseConst.REGION_CPManualOutstock_ID) { - throw new Exception($"托盘{wmsCarryH.carry_code}在存储库位中,不能签收!"); + throw new Exception($"托盘{wmsCarryH.carry_code}不在人工出库库位中,不能签收!"); } WmsDistaskH wmsDistaskH = _db.Queryable().Where(r => r.carry_code == input.carry_code && r.endlocation_id == location.id