将BaseLocation,is_use属性类型改为int
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities;
|
namespace Tnb.BasicData.Entities;
|
||||||
|
|
||||||
@@ -42,7 +43,8 @@ public partial class BasLocation : BaseEntity<string>
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否使用
|
/// 是否使用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string is_use { get; set; } = string.Empty;
|
[SugarColumn(ColumnDataType = "varchar(1)", SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||||
|
public int is_use { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否最小
|
/// 是否最小
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<BasLocation>> InStockStrategy([FromQuery] InStockStrategyQuery input)
|
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();
|
return items.Take(input.Size).ToList();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -399,7 +399,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//更新起始库位,状态改为空闲、锁定状态,未锁定
|
//更新起始库位,状态改为空闲、锁定状态,未锁定
|
||||||
if (startLocationIds?.Count > 0)
|
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();
|
await _db.Ado.CommitTranAsync();
|
||||||
@@ -450,7 +450,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
carryStatus = (int)EnumCarryStatus.空闲;
|
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)
|
if (disTasks?.Count > 0)
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
|
||||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
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 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)
|
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();
|
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.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
@@ -14,6 +15,7 @@ using NPOI.SS.Formula;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||||
using Tnb.WarehouseMgr.Entities.Consts;
|
using Tnb.WarehouseMgr.Entities.Consts;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto;
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
using Tnb.WarehouseMgr.Entities.Enums;
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
@@ -24,12 +26,14 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 齐套分拣服务类
|
/// 齐套分拣服务类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[ServiceModule(BizTypeId)]
|
||||||
public class WmsSetSortingService : BaseWareHouseService
|
public class WmsSetSortingService : BaseWareHouseService
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarClient _db;
|
private readonly ISqlSugarClient _db;
|
||||||
private readonly IWareHouseService _wareHouseService;
|
private readonly IWareHouseService _wareHouseService;
|
||||||
private readonly IBillRullService _billRullService;
|
private readonly IBillRullService _billRullService;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
|
private const string BizTypeId = "26172520979237";
|
||||||
|
|
||||||
public WmsSetSortingService(ISqlSugarRepository<WmsSetsortingH> repository, IWareHouseService wareHouseService, IUserManager userManager, IBillRullService billRullService)
|
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.Consts;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto;
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Enums;
|
||||||
using Tnb.WarehouseMgr.Interfaces;
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr
|
namespace Tnb.WarehouseMgr
|
||||||
@@ -81,7 +82,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
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();
|
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 } };
|
WareHouseUpInput upInput = new() { bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId } };
|
||||||
await DoUpdate(upInput); //回更业务
|
await DoUpdate(upInput); //回更业务
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
var grpList = kittingOuts.GroupBy(g => g.location_id).ToList();
|
var grpList = kittingOuts.GroupBy(g => g.location_id).ToList();
|
||||||
foreach (var koGrp in grpList)
|
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)
|
if (locs?.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user