更改location的is_use字段为string
This commit is contained in:
@@ -44,7 +44,7 @@ public partial class BasLocation : BaseEntity<string>
|
||||
/// 是否使用
|
||||
/// </summary>
|
||||
//[SugarColumn(ColumnDataType = "varchar(32)", SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||
public int is_use { get; set; }
|
||||
public string is_use { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否最小
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
|
||||
//var stauts = (int)EnumCarryStatus.空闲;
|
||||
items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_type == "0" && it.is_use == (int)EnumCarryStatus.空闲).OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_type == "0" && it.is_use == ((int)EnumCarryStatus.空闲).ToString()).OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -434,7 +434,7 @@ namespace Tnb.WarehouseMgr
|
||||
//更新起始库位,状态改为空闲、锁定状态,未锁定
|
||||
if (startLocationIds?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲, is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = ((int)EnumCarryStatus.空闲).ToString(), is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
@@ -494,7 +494,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryStatus = ((int)EnumCarryStatus.占用).ToString();
|
||||
}
|
||||
var cStatus = carryStatus.ParseToInt();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = cStatus, is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = cStatus.ToString(), is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
}
|
||||
//更新业务主表的单据状态
|
||||
if (disTasks?.Count > 0)
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Insertable(carryCodes).ExecuteCommandAsync();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = input.data[nameof(WmsCarryH.carry_code)].ToString()!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1, is_use = (int)EnumCarryStatus.占用 });
|
||||
it => new BasLocation { is_lock = 1, is_use = ((int)EnumCarryStatus.占用).ToString() });
|
||||
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();
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
if (location != null && location.is_use == (int)EnumCarryStatus.空闲 && location.is_lock == 0)
|
||||
if (location != null && location.is_use == ((int)EnumCarryStatus.空闲).ToString() && location.is_lock == 0)
|
||||
{
|
||||
//出库
|
||||
var sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Tnb.WarehouseMgr
|
||||
GenPreTaskUpInput genPreTaskAfterUpInput = new();
|
||||
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
|
||||
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1, carry_status = ((int)EnumCarryStatus.齐套分拣).ToString() }, it => new BasLocation { is_use = (int)EnumCarryStatus.齐套分拣, is_lock = 1 });
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1, carry_status = ((int)EnumCarryStatus.齐套分拣).ToString() }, it => new BasLocation { is_use = ((int)EnumCarryStatus.齐套分拣).ToString(), is_lock = 1 });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -288,7 +288,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
if (carry!.location_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲 }).Where(it => it.id == carry.location_id).ExecuteCommandAsync();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = ((int)EnumCarryStatus.空闲).ToString() }).Where(it => it.id == carry.location_id).ExecuteCommandAsync();
|
||||
}
|
||||
carry.out_status = ((int)EnumOutStatus.正常).ToString();
|
||||
carry.carry_status = ((int)EnumCarryStatus.齐套).ToString();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (carry!.location_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = (int)EnumCarryStatus.空闲;
|
||||
loc.is_use = ((int)EnumCarryStatus.空闲).ToString();
|
||||
await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
|
||||
}
|
||||
carry.location_id = null;
|
||||
|
||||
@@ -137,7 +137,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 == (int)EnumCarryStatus.空闲 && it.is_lock == 0).ToListAsync();
|
||||
var locs = await _db.Queryable<BasLocation>().Where(it => it.id == koGrp.Key && it.is_use == ((int)EnumCarryStatus.空闲).ToString() && it.is_lock == 0).ToListAsync();
|
||||
if (locs?.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user