跨层回写工位,其他出选择列表接口
This commit is contained in:
@@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.HSSF.Record;
|
||||
using NPOI.SS.Formula;
|
||||
using SqlSugar;
|
||||
@@ -500,11 +501,24 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
throw new AppFriendlyException($"转移托盘{new_wmsCarryH.carry_code}不存在!", 500);
|
||||
}
|
||||
await _db.Updateable<BasLocation>().SetColumns(r => new BasLocation
|
||||
{
|
||||
is_lock = 0,
|
||||
is_use = "0"
|
||||
}).Where(r => r.id == new_wmsCarryH.location_id).ExecuteCommandAsync();
|
||||
Logger.Information($"托盘{input.new_carrycode} 原先的库位{new_wmsCarryH.location_code} 状态设置为未锁定 、空闲");
|
||||
|
||||
if (new_wmsCarryH.carry_status != "0")
|
||||
{
|
||||
throw new AppFriendlyException($"转移托盘{new_wmsCarryH.carry_code}上的状态不为空闲,不能转移!", 500);
|
||||
}
|
||||
new_wmsCarryH.is_lock = 0;
|
||||
new_wmsCarryH.carry_status = "1";
|
||||
new_wmsCarryH.location_id = wmsCarryH.location_id;
|
||||
new_wmsCarryH.location_code = wmsCarryH.location_code;
|
||||
|
||||
wmsCarryH.is_lock = 0;
|
||||
wmsCarryH.carry_status = "0";
|
||||
wmsCarryH.location_id = "";
|
||||
wmsCarryH.location_code = "";
|
||||
List<WmsCarryCode> new_wmsCarryCodes = await _db.Queryable<WmsCarryCode>().Where(r => r.carry_id == new_wmsCarryH.id).ToListAsync();
|
||||
@@ -516,10 +530,14 @@ namespace Tnb.WarehouseMgr
|
||||
WmsCarryCode new_wmsCarryCode = wmsCarryCode.Adapt<WmsCarryCode>();
|
||||
if (new_wmsCarryCodes.Count > 0)
|
||||
{
|
||||
if (new_wmsCarryCodes[0].material_id != wmsCarryCode.material_id || new_wmsCarryCodes[0].code_batch != wmsCarryCode.code_batch)
|
||||
if (new_wmsCarryCodes.Count > 0)
|
||||
{
|
||||
throw new AppFriendlyException($"转移托盘{new_wmsCarryH.carry_code}上的物料批次数据与分拣托盘上的物料批次数据不一致,不能转移!", 500);
|
||||
throw new AppFriendlyException($"转移托盘{new_wmsCarryH.carry_code}已存在条码,不能转移!", 500);
|
||||
}
|
||||
//if (new_wmsCarryCodes[0].material_id != wmsCarryCode.material_id || new_wmsCarryCodes[0].code_batch != wmsCarryCode.code_batch)
|
||||
//{
|
||||
// throw new AppFriendlyException($"转移托盘{new_wmsCarryH.carry_code}上的物料批次数据与分拣托盘上的物料批次数据不一致,不能转移!", 500);
|
||||
//}
|
||||
new_wmsCarryCode = new_wmsCarryCodes[0];
|
||||
new_wmsCarryCode.codeqty = wmsCarryCode.codeqty - wmsSortingtask.qty + new_wmsCarryCodes[0].codeqty;
|
||||
await _db.Updateable(new_wmsCarryCode).UpdateColumns(r => new { r.codeqty }).ExecuteCommandAsync();
|
||||
@@ -530,12 +548,24 @@ namespace Tnb.WarehouseMgr
|
||||
new_wmsCarryCode.carry_id = new_wmsCarryH.id;
|
||||
new_wmsCarryCode.barcode = new_wmsCarryH.carry_code;
|
||||
new_wmsCarryCode.codeqty = wmsCarryCode.codeqty - wmsSortingtask.qty;
|
||||
await _db.Insertable(new_wmsCarryCode).ExecuteCommandAsync();
|
||||
if (new_wmsCarryCode.codeqty > 0)
|
||||
{
|
||||
Logger.Information($"托盘{new_wmsCarryH.carry_code} 新增条码数据{JsonConvert.SerializeObject(new_wmsCarryCode)}");
|
||||
await _db.Insertable(new_wmsCarryCode).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Information($"托盘{new_wmsCarryH.carry_code} 分拣数量{wmsSortingtask.qty}与条码数量{wmsCarryCode.codeqty}相同 无需新增新托盘的条码数据");
|
||||
}
|
||||
}
|
||||
|
||||
await _db.Updateable<WmsCarryCode>().SetColumns(r => r.codeqty == wmsSortingtask.qty).Where(r => r.carry_id == wmsSortingtask.carry_id).ExecuteCommandAsync();
|
||||
//await _db.Updateable<WmsCarryCode>().SetColumns(r => r.codeqty == wmsSortingtask.qty).Where(r => r.carry_id == wmsSortingtask.carry_id).ExecuteCommandAsync();
|
||||
await _db.Updateable(new_wmsCarryH).UpdateColumns(r => new { r.is_lock, r.carry_status, r.location_id, r.location_code }).ExecuteCommandAsync();
|
||||
await _db.Updateable(wmsCarryH).UpdateColumns(r => new { r.location_id, r.location_code }).ExecuteCommandAsync();
|
||||
await _db.Updateable(wmsCarryH).UpdateColumns(r => new { r.is_lock, r.carry_status, r.location_id, r.location_code }).ExecuteCommandAsync();
|
||||
await _db.Deleteable<WmsCarryCode>().Where(r => r.carry_id == wmsSortingtask.carry_id).ExecuteCommandAsync();
|
||||
Logger.Information($"新托盘{new_wmsCarryH.carry_code} 更新数据: 锁定状态{new_wmsCarryH.is_lock} 占用状态{new_wmsCarryH.carry_status} 库位id{new_wmsCarryH.location_id} 库位编码{new_wmsCarryH.location_code}");
|
||||
Logger.Information($"老托盘{wmsCarryH.carry_code} 更新数据为 锁定状态{wmsCarryH.is_lock} 占用状态{wmsCarryH.carry_status} 库位id{wmsCarryH.location_id} 库位编码{wmsCarryH.location_code} ");
|
||||
Logger.Information($"老托盘{wmsSortingtask.carry_code} 在转移新托盘时清除条码数据");
|
||||
}
|
||||
|
||||
await _db.Updateable<WmsSortingtask>().SetColumns(r => new WmsSortingtask
|
||||
|
||||
Reference in New Issue
Block a user