生产退料开发等

This commit is contained in:
2024-06-27 11:15:07 +08:00
parent 1765ebedc4
commit 8177d05cd2
17 changed files with 788 additions and 159 deletions

View File

@@ -19,6 +19,7 @@ using Newtonsoft.Json;
using Org.BouncyCastle.Crypto.Agreement;
using Senparc.CO2NET.Cache;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.Common.Extension;
using Tnb.EquipMgr.Entities;
using Tnb.WarehouseMgr.Entities;
@@ -399,11 +400,9 @@ namespace Tnb.WarehouseMgr
{
Logger.Information("开始处理WCS上传的取消任务");
int row = await _db.Updateable<WmsDistaskH>().SetColumns(r => new WmsDistaskH
{
agreement = "WCS上传取消(CANCELLED)信号 取消时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
agreement = "WCS上传取消(CANCELLED)信号",
status = WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID
}).Where(P => P.bill_code.Contains(input.taskChainCode)).ExecuteCommandAsync();
if (row > 0)
@@ -420,11 +419,24 @@ namespace Tnb.WarehouseMgr
await WmsElevatorUnlock(wmsElevatorUnlockInput);
Logger.Information($"WCS取消任务{wmsDistaskH.bill_code},自动解占用电梯{wmsDistaskH.device_id}");
}
else
{
// 排除电梯任务 其他任务取消时自动解锁终点库位
int unlockRow = await _db.Updateable<BasLocation>().SetColumns(r => r.is_lock == 0).Where(r => r.location_code == wmsDistaskH.endlocation_code).ExecuteCommandAsync();
if (unlockRow > 0)
{
Logger.Information($"成功解锁库位{wmsDistaskH.endlocation_code}");
}
else
{
Logger.Information($"未成功解锁库位{wmsDistaskH.endlocation_code}");
}
}
}
await _db.Updateable<WmsPretaskH>().SetColumns(r => new WmsPretaskH
{
note = "WCS上传取消(CANCELLED)信号 取消时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
note = "WCS上传取消(CANCELLED)信号",
status = WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID
}).Where(P => wmsDistaskHCodes.Contains(P.bill_code)).ExecuteCommandAsync();
Logger.Information("成功处理WCS上传的取消任务");
@@ -441,7 +453,7 @@ namespace Tnb.WarehouseMgr
Logger.Information("开始处理WCS上传的失败任务");
int row = await _db.Updateable<WmsDistaskH>().SetColumns(r => new WmsDistaskH
{
agreement = "WCS上传失败(FAILURE)信号 失败时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
agreement = "WCS上传失败(FAILURE)信号",
status = WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID
}).Where(P => P.bill_code.Contains(input.taskChainCode)).ExecuteCommandAsync();
if (row > 0)
@@ -450,7 +462,7 @@ namespace Tnb.WarehouseMgr
await _db.Updateable<WmsPretaskH>().SetColumns(r => new WmsPretaskH
{
note = "WCS上传失败(FAILURE)信号 取消时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
note = "WCS上传失败(FAILURE)信号",
status = WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID
}).Where(P => wmsDistaskHCodes.Contains(P.bill_code)).ExecuteCommandAsync();
Logger.Information("成功处理WCS上传的失败任务");