1
This commit is contained in:
@@ -39,6 +39,10 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// 预任务条码记录
|
||||
/// </summary>
|
||||
public List<WmsHandleCode> PreTaskHandleCodes { get; set; }
|
||||
/// <summary>
|
||||
/// 是否检验
|
||||
/// </summary>
|
||||
public int? IsCheck { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpGet]
|
||||
public async Task<List<WmsCarryH>> OutStockStrategy([FromQuery] OutStockStrategyQuery input)
|
||||
{
|
||||
var items = await _db.Queryable<WmsCarryH>().Where(it => it.id == input.carry_id ).ToListAsync();
|
||||
var items = await _db.Queryable<WmsCarryH>().Where(it => it.id == input.carry_id).ToListAsync();
|
||||
return items.Take(input.Size).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -471,7 +471,14 @@ namespace Tnb.WarehouseMgr
|
||||
//根据生成的预任务,插入预任务操作记录
|
||||
await _db.Insertable(input.PreTaskRecords).ExecuteCommandAsync();
|
||||
//根据载具ID,更新是否锁定和赋值起始库位
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
if (!input.IsCheck.HasValue)
|
||||
{
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
|
||||
}
|
||||
//根据所有库位更新库位的锁定状态为“锁定”
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Ado.CommitTranAsync();
|
||||
|
||||
@@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
@@ -28,11 +29,12 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// 空载具入库
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleId)]
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID)]
|
||||
[ServiceModule(BizModuleId)]
|
||||
|
||||
public class WmsEmptyInstockService : BaseWareHouseService
|
||||
{
|
||||
private const string ModuleId = "26120915344165";
|
||||
private const string BizModuleId = "26121986416677";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
@@ -63,7 +65,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
@@ -138,5 +140,12 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var isOk = await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = input.bizTypeId }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user