Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -13,11 +13,6 @@ namespace Tnb.WarehouseMgr.Entities.Consts
|
||||
/// </summary>
|
||||
public const string WMS_CARRY_REPLACE_ENCODE = "WmsCarryReplace";
|
||||
|
||||
/// <summary>
|
||||
/// 物料签收编码
|
||||
/// </summary>
|
||||
public const string MATERIAL_RECEIPT_CODE = "MaterialReceipt";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,23 +35,17 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
public WmsCarryBindService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService)
|
||||
IUserManager userManager)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = CarryBind;
|
||||
}
|
||||
|
||||
@@ -90,21 +84,33 @@ namespace Tnb.WarehouseMgr
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
|
||||
}
|
||||
/* //更新主载具明细表,增加新的数据
|
||||
var row = await _db.Insertable<WmsCarryD>(new WmsCarryD {
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
org_id = carry.org_id,
|
||||
carry_id = carry.id,
|
||||
membercarry_id = subCarry.id,
|
||||
membercarry_code = subCarry.carry_code,
|
||||
loc = input.data[nameof(WmsCarrybindH.loc)].ToString(),
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
})
|
||||
.ExecuteCommandAsync();
|
||||
if (row <= 0) throw Oops.Oh(ErrorCode.COM1000);
|
||||
_db.Updateable<WmsCarryH>().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/
|
||||
await _db.Ado.CommitTranAsync();
|
||||
else
|
||||
{
|
||||
if (carry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的主载具", 500);
|
||||
}
|
||||
if (subCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的子载具", 500);
|
||||
}
|
||||
|
||||
}
|
||||
/* //更新主载具明细表,增加新的数据
|
||||
var row = await _db.Insertable<WmsCarryD>(new WmsCarryD {
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
org_id = carry.org_id,
|
||||
carry_id = carry.id,
|
||||
membercarry_id = subCarry.id,
|
||||
membercarry_code = subCarry.carry_code,
|
||||
loc = input.data[nameof(WmsCarrybindH.loc)].ToString(),
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
})
|
||||
.ExecuteCommandAsync();
|
||||
if (row <= 0) throw Oops.Oh(ErrorCode.COM1000);
|
||||
_db.Updateable<WmsCarryH>().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -124,7 +124,12 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null);
|
||||
//根据载具移出Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveOutstock>().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,23 +35,18 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
public WmsCarryUnbindService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService)
|
||||
|
||||
IUserManager userManager)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = CarryUnbind;
|
||||
}
|
||||
|
||||
@@ -80,7 +75,17 @@ namespace Tnb.WarehouseMgr
|
||||
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
|
||||
isOk = (row > 0);
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (carry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的主载具", 500);
|
||||
}
|
||||
if (subCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的子载具", 500);
|
||||
}
|
||||
}
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Tnb.WarehouseMgr
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_basLocationService = basLocationService;
|
||||
//OverideFuncs.CreateAsync = Create;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据载具编号获取起始库位点
|
||||
@@ -152,16 +152,20 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||
if (isOk)
|
||||
{
|
||||
//不需要插入操作表
|
||||
/* var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/
|
||||
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
|
||||
{
|
||||
//查询库位表
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsDelivery.startlocation_id)].ToString());
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1, location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(), location_code = location.location_code}).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
var ids = new[] { input.data[nameof(WmsDelivery.startlocation_id)].ToString(), input.data[nameof(WmsDelivery.endlocation_id)].ToString() };
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,9 @@ namespace Tnb.WarehouseMgr
|
||||
//根据空载具入库Id,回更单据状态
|
||||
await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -77,7 +78,7 @@ namespace Tnb.WarehouseMgr
|
||||
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
||||
|
||||
//出库取起点,获取所有符合输入的载具规格的载具
|
||||
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)]);
|
||||
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
||||
var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
||||
.Select((a,b) => new
|
||||
{
|
||||
@@ -141,15 +142,13 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null);
|
||||
//所有载具加锁
|
||||
var ids = carrys.Select(x => x.carry_id).ToList();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
//所有库位加锁
|
||||
var loc = carrys.Select(x => x.location_id).ToList();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => loc.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,12 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null);
|
||||
//根据载具移入Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveInstock>().SetColumns(it => new WmsMoveInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,9 +122,15 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null);
|
||||
//根据载具移出Id,回更单据状态
|
||||
await _db.Updateable<WmsMoveOutstock>().SetColumns(it => new WmsMoveOutstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_basLocationService = basLocationService;
|
||||
//OverideFuncs.CreateAsync = Create;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据载具编号获取起始库位点
|
||||
@@ -151,16 +151,25 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||
if (isOk)
|
||||
{
|
||||
//不需要插入操作表
|
||||
/* var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/
|
||||
f(input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
|
||||
{
|
||||
//查询库位表
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsDelivery.startlocation_id)].ToString());
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
{
|
||||
carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1,
|
||||
location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(),
|
||||
location_code = location.location_code
|
||||
}).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
var ids = new[] { input.data[nameof(WmsDelivery.startlocation_id)].ToString(), input.data[nameof(WmsDelivery.endlocation_id)].ToString() };
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,8 +140,9 @@ namespace Tnb.WarehouseMgr
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
//根据空载具入库Id,回更单据状态
|
||||
await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,null,null);
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -141,15 +141,13 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, null, null);
|
||||
//所有载具加锁
|
||||
var ids = carrys.Select(x => x.carry_id).ToList();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
//所有库位加锁
|
||||
var loc = carrys.Select(x => x.location_id).ToList();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => loc.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = ExceptionCancel;
|
||||
OverideFuncs.CreateAsync = ExceptionComplete;
|
||||
}
|
||||
|
||||
private async Task<dynamic> ExceptionCancel(VisualDevModelDataCrInput input)
|
||||
private async Task<dynamic> ExceptionComplete(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
try
|
||||
|
||||
@@ -52,10 +52,10 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = ExceptionCancel;
|
||||
OverideFuncs.CreateAsync = ExceptionReexcute;
|
||||
}
|
||||
|
||||
private async Task<dynamic> ExceptionCancel(VisualDevModelDataCrInput input)
|
||||
private async Task<dynamic> ExceptionReexcute(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
try
|
||||
|
||||
@@ -22,6 +22,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -115,16 +116,22 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
||||
if (isOk)
|
||||
{
|
||||
//不需要插入操作表
|
||||
/* var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/
|
||||
//查询库位表
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
{
|
||||
carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1,
|
||||
location_id = input.data[nameof(WmsTransfer.startlocation_id)].ToString(),
|
||||
location_code = location.location_code
|
||||
}).Where(it => it.id == input.data[nameof(WmsTransfer.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
var ids = new[] { input.data[nameof(WmsTransfer.startlocation_id)].ToString(), input.data[nameof(WmsTransfer.endlocation_id)].ToString() };
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -115,16 +116,22 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
|
||||
if (isOk)
|
||||
{
|
||||
//不需要插入操作表
|
||||
/* var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.PreTaskId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
await _wareHouseService.GenTaskHandleAfter(preTaskUpInput);*/
|
||||
//查询库位表
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
{
|
||||
carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1,
|
||||
location_id = input.data[nameof(WmsTransfer.startlocation_id)].ToString(),
|
||||
location_code = location.location_code
|
||||
}).Where(it => it.id == input.data[nameof(WmsTransfer.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
var ids = new[] { input.data[nameof(WmsTransfer.startlocation_id)].ToString(), input.data[nameof(WmsTransfer.endlocation_id)].ToString() };
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user