现场问题处理

This commit is contained in:
2024-10-11 11:05:28 +08:00
parent 77dd50faed
commit 45b26f1f5c
10 changed files with 64 additions and 28 deletions

View File

@@ -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<WmsSterilizationInstockH> wmsSterilizationInstockHs = db_Floor4DMC2CPK.Queryable<WmsSterilizationInstockH>()
.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();
}

View File

@@ -281,6 +281,12 @@ namespace Tnb.WarehouseMgr.Entities.Consts
/// </summary>
public const string WMS_PRETASK_TRANSFER_TYPE_ID = "26126753796389";
/// <summary>
/// 预任务生成业务类型-暂存仓库内转移
/// </summary>
public const string BIZTYPE_ZCCKNZY_ID = "37490619400981";
/// <summary>
/// 预任务生成业务类型-空载具出库
/// </summary>

View File

@@ -100,6 +100,16 @@ public partial class WmsCarryStockReport
/// </summary>
public string? code_batch { get; set; }
/// <summary>
///
/// </summary>
public string? material_specification { get; set; }
/// <summary>
///
/// </summary>
public string? container_no { get; set; }
/// <summary>
/// 数量
/// </summary>
@@ -223,6 +233,16 @@ public partial class WmsCarryStockReportCode
/// </summary>
public string? material_name { get; set; }
/// <summary>
///
/// </summary>
public string? material_specification { get; set; }
/// <summary>
///
/// </summary>
public string? container_no { get; set; }
/// <summary>
/// 条码编号
/// </summary>

View File

@@ -574,7 +574,7 @@ namespace Tnb.WarehouseMgr
WmsPretaskH curWmsPretaskH = await _db.Queryable<WmsPretaskH>().Where(r => r.bill_code == wmsDistaskH.pretask_code).FirstAsync();
List<WmsPretaskH> nextWmsPretaskHs = _db.Queryable<WmsPretaskH>().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<WmsPretaskH>().Where(r => r.bill_code == wmsDistaskH.pretask_code).FirstAsync();
List<WmsPretaskH> nextWmsPretaskHs = _db.Queryable<WmsPretaskH>().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)
{

View File

@@ -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

View File

@@ -327,6 +327,7 @@ namespace Tnb.WarehouseMgr
.AndIF(!string.IsNullOrEmpty(input.passage), it => it.passage == input.passage)
.ToExpression();
items = await db.Queryable<BasLocation>().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<WmsElevatorH>().Where(it => it.elevator_group == "2" && it.enabled == 1).OrderBy(r => r.task_nums).FirstAsync();
string elevatorSno = wmsElevatorH.elevator_code.Replace("Elevator", "");

View File

@@ -381,7 +381,7 @@ namespace Tnb.WarehouseMgr
/// <exception cref="AppFriendlyException"></exception>
[HttpPost, NonUnify, AllowAnonymous]
public async Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> MaterialByCarry(MaterialByCarryInput input)
public async Task<dynamic> 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);
}
}
}

View File

@@ -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<WmsCarryCode>((a, b, c, d, e, f) => f.carry_id == e.membercarry_id)
.InnerJoin<BasMaterial>((a, b, c, d, e, f, g) => g.id == f.material_id)
.InnerJoin<WmsCarryH>((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;

View File

@@ -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
/// <returns></returns>
/// <exception cref="AppFriendlyException"></exception>
[HttpPost]
public async Task<Entities.Dto.Outputs.Result> Distribute(MaterialTransferDistributeInput input)
public async Task<dynamic> 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 "成功";
}
/// <summary>
@@ -481,7 +482,8 @@ namespace Tnb.WarehouseMgr
/// <param name="wmsMaterialTransferD"></param>
/// <param name="wmsMaterialTransfer"></param>
/// <returns></returns>
public async Task<Entities.Dto.Outputs.Result> DistributeF4JXC(DistributeF4JXCInput input)
[HttpPost]
public async Task<Entities.Dto.Outputs.Result> 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))

View File

@@ -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<BasLocation> 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<WmsDistaskH>().Where(r => r.carry_code == input.carry_code && r.endlocation_id == location.id