生产退料,暂存仓配送优化
This commit is contained in:
@@ -38,18 +38,21 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IWmsCarryBindService _wmsCarryBindService;
|
||||
public WmsPrdReturnService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager)
|
||||
IUserManager userManager,
|
||||
IWmsCarryBindService wmsCarryBindService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_userManager = userManager;
|
||||
_wareHouseService = wareHouseService;
|
||||
_wmsCarryBindService = wmsCarryBindService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -101,6 +104,13 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
try
|
||||
{
|
||||
List<WmsCarryD> wmsCarryDs = _db.Queryable<WmsCarryD>().Where(r => r.carry_id == wmsCarryH.id).ToList();
|
||||
if (wmsCarryDs.Count > 0)
|
||||
{
|
||||
Logger.LogWarning($"【PrdReturn】料架{wmsCarryH.carry_code}下有料箱未解绑!");
|
||||
throw new AppFriendlyException($"【PrdReturn】料架{wmsCarryH.carry_code}下有料箱未解绑!", 500);
|
||||
}
|
||||
|
||||
BasLocation startlocation = _db.Queryable<BasLocation>().Where(r => r.id == input.startlocation_id).First();
|
||||
if (startlocation == null)
|
||||
{
|
||||
@@ -172,6 +182,26 @@ namespace Tnb.WarehouseMgr
|
||||
// 标记为退料
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(r => r.need_return == 1).Where(r => r.id == wmsCarryH.id).ExecuteCommandAsync();
|
||||
|
||||
Logger.LogWarning($"【RackEmptyInstock】绑定料箱到料架");
|
||||
|
||||
List<WmsCarryH> membercarrys = _db.Queryable<WmsCarryH>().Where(r => input.details.Select(r => r.carry_code).Contains(r.carry_code)).ToList();
|
||||
foreach (WmsCarryH membercarry in membercarrys)
|
||||
{
|
||||
// 绑定料箱到料架
|
||||
CarryBindInput _carryBindInput = new();
|
||||
_carryBindInput.carry_id = wmsCarryH.id;
|
||||
_carryBindInput.carry_code = wmsCarryH.carry_code;
|
||||
_carryBindInput.membercarry_id = membercarry.id;
|
||||
_carryBindInput.membercarry_code = membercarry.carry_code;
|
||||
_carryBindInput.carrystd_id = wmsCarryH.carrystd_id;
|
||||
var resCarrybind = await _wmsCarryBindService.CarryBind(_carryBindInput);
|
||||
if (resCarrybind.code != JNPF.Common.Enums.HttpStatusCode.OK)
|
||||
{
|
||||
throw new AppFriendlyException($"绑定料箱到料架失败 载具 {input.carry_code}", 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Logger.LogWarning($"【PrdReturn】开始生成预任务");
|
||||
CommonCreatePretaskInput commonCreatePretaskInput = new();
|
||||
commonCreatePretaskInput.startlocation_id = startlocation.id;
|
||||
|
||||
Reference in New Issue
Block a user