修改业务回更方法

This commit is contained in:
2023-06-16 16:28:37 +08:00
parent 82856d3bd3
commit 32c3de6dac
11 changed files with 107 additions and 64 deletions

View File

@@ -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 });
}
}

View File

@@ -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();
}
}
}

View File

@@ -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 });
}
}

View File

@@ -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
@@ -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();
}
}
}

View File

@@ -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 });
}
}

View File

@@ -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 });
}
}

View File

@@ -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();
}
}
}

View File

@@ -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 });
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}