将BaseLocation,is_use属性类型改为int
This commit is contained in:
@@ -210,7 +210,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpGet]
|
||||
public async Task<List<BasLocation>> InStockStrategy([FromQuery] InStockStrategyQuery input)
|
||||
{
|
||||
var items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_use == "0" && it.is_type == "0").OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
var items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_use == (int)EnumCarryStatus.空闲 && it.is_type == "0").OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
return items.Take(input.Size).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -399,7 +399,7 @@ namespace Tnb.WarehouseMgr
|
||||
//更新起始库位,状态改为空闲、锁定状态,未锁定
|
||||
if (startLocationIds?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = "0", is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲, is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
@@ -450,7 +450,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
carryStatus = (int)EnumCarryStatus.空闲;
|
||||
}
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = carryStatus.ToString(), is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = carryStatus, is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
}
|
||||
//更新业务主表的单据状态
|
||||
if (disTasks?.Count > 0)
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, carry_status = (int)EnumCarryStatus.占用, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1, is_use = "1" });
|
||||
it => new BasLocation { is_lock = 1, is_use = (int)EnumCarryStatus.占用 });
|
||||
if (instockCOdes?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.FriendlyException;
|
||||
@@ -14,6 +15,7 @@ using NPOI.SS.Formula;
|
||||
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.Entities.Enums;
|
||||
@@ -24,12 +26,14 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// 齐套分拣服务类
|
||||
/// </summary>
|
||||
[ServiceModule(BizTypeId)]
|
||||
public class WmsSetSortingService : BaseWareHouseService
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
private const string BizTypeId = "26172520979237";
|
||||
|
||||
public WmsSetSortingService(ISqlSugarRepository<WmsSetsortingH> repository, IWareHouseService wareHouseService, IUserManager userManager, IBillRullService billRullService)
|
||||
{
|
||||
@@ -186,10 +190,25 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
|
||||
|
||||
public override Task ModifyAsync(WareHouseUpInput input)
|
||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
//根据载具更新明细表状态
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_status = (int)EnumCarryStatus.齐套 }).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲 }).ExecuteCommandAsync();
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -81,7 +82,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = "0";
|
||||
loc.is_use = (int)EnumCarryStatus.空闲;
|
||||
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
|
||||
WareHouseUpInput upInput = new() { bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId } };
|
||||
await DoUpdate(upInput); //回更业务
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Tnb.WarehouseMgr
|
||||
var grpList = kittingOuts.GroupBy(g => g.location_id).ToList();
|
||||
foreach (var koGrp in grpList)
|
||||
{
|
||||
var locs = await _db.Queryable<BasLocation>().Where(it => it.id == koGrp.Key && it.is_use == "0" && it.is_lock == 0).ToListAsync();
|
||||
var locs = await _db.Queryable<BasLocation>().Where(it => it.id == koGrp.Key && it.is_use == (int)EnumCarryStatus.空闲 && it.is_lock == 0).ToListAsync();
|
||||
if (locs?.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user