This commit is contained in:
alex
2023-07-18 14:13:00 +08:00
3 changed files with 15 additions and 10 deletions

View File

@@ -187,8 +187,6 @@ namespace Tnb.WarehouseMgr
{
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carry_code);
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code);
var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500);
var emptyInstock = await _db.Queryable<WmsEmptyInstock>().FirstAsync(it => it.carry_code == input.carry_code && it.status == WmsWareHouseConst.BILLSTATUS_ADD_ID);
if (emptyInstock != null)
{

View File

@@ -270,10 +270,19 @@ namespace Tnb.WarehouseMgr
//入库申请条码明细表
List<WmsInstockCode> instockcodes = input.instockcodes.Adapt<List<WmsInstockCode>>();
var loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType..ToString());
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock?.warehouse_id!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == instock.location_id);
WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code);
var loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.id == endLocations[0].id);
var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500);
loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType..ToString());
//如果数据不全或有误,
if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1)
{
@@ -329,13 +338,7 @@ namespace Tnb.WarehouseMgr
await _db.Insertable(instockCOdes).CallEntityMethod(it => it.Create(orgId)).ExecuteCommandAsync();
//生成预任务申请
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock?.warehouse_id!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == instock.location_id);
WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
if (sPoint != null && ePoint != null)
{
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);

View File

@@ -92,6 +92,10 @@ namespace Tnb.WarehouseMgr
}
if (endLocations?.Count > 0)
{
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.data[nameof(WmsCarryD.carry_id)].ToString());
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == endLocations[0].id);
var isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
if (!isMatch) throw new AppFriendlyException("库位与载具规格不匹配", 500);
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
}