分拣、工位bom、现场问题处理
This commit is contained in:
@@ -504,7 +504,7 @@ namespace Tnb.WarehouseMgr
|
||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||
.Where(whereExpr)
|
||||
//.OrderByIF((a,b,c)=>SqlFunc.IsNullOrEmpty())
|
||||
.OrderBy("a.location_code,layers,loc_line,loc_column")
|
||||
.OrderBy("b.codeqty desc")
|
||||
.Select((a, b, c) => new
|
||||
{
|
||||
WmsCarryH = a,
|
||||
@@ -656,6 +656,11 @@ namespace Tnb.WarehouseMgr
|
||||
/// <exception cref="AppFriendlyException"></exception>
|
||||
public async Task<List<Tuple<WmsCarryH, decimal, BasLocation>>> OutStockStrategyZCC2Floor2([FromQuery] OutStockStrategyZCC2Floor2Query input)
|
||||
{
|
||||
var cyDb = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
cyDb = _db.CopyNew();
|
||||
}
|
||||
Expressionable<WmsCarryH, WmsCarryCode, BasLocation> whereExprable = Expressionable.Create<WmsCarryH, WmsCarryCode, BasLocation>()
|
||||
.And((a, b, c) => a.is_lock == 0 && c.is_lock == 0)
|
||||
.And((a, b, c) => !string.IsNullOrEmpty(a.location_id))
|
||||
@@ -673,7 +678,6 @@ namespace Tnb.WarehouseMgr
|
||||
_ = whereExprable.And(carryStatusFilterExp);
|
||||
Expression<Func<WmsCarryH, WmsCarryCode, BasLocation, bool>> whereExpr = whereExprable.ToExpression();
|
||||
|
||||
SqlSugarClient cyDb = _db.CopyNew();
|
||||
WmsInstockPolicies policy = await cyDb.Queryable<WmsInstockPolicies>().Where(it => it.status == 1).FirstAsync();
|
||||
if (policy == null)
|
||||
{
|
||||
@@ -730,7 +734,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 每6个重新获取一次终点
|
||||
if (i % move_num == 0)
|
||||
{
|
||||
endlocation_ssx = await _db.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
|
||||
endlocation_ssx = await cyDb.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
|
||||
}
|
||||
|
||||
// 查找是否有一个料箱可以正好满足剩余需求数量(目前只做这个额外判断,其它情形不考虑)
|
||||
@@ -743,7 +747,7 @@ namespace Tnb.WarehouseMgr
|
||||
needOut -= _wmsCarryCode.codeqty;
|
||||
WmsCarryH _wmsCarryH = itemsDESC[j].wmsCarryH;
|
||||
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
|
||||
carrysDESC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(_wmsCarryH, _wmsCarryCode.codeqty, endlocation_ssx));
|
||||
|
||||
@@ -758,7 +762,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 目前只支持一个料箱只有一个物料
|
||||
needOut -= wmsCarryCode.codeqty;
|
||||
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
|
||||
carrysDESC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(wmsCarryH, wmsCarryCode.codeqty, endlocation_ssx));
|
||||
}
|
||||
@@ -787,7 +791,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 每6个重新获取一次终点
|
||||
if (i % move_num == 0)
|
||||
{
|
||||
endlocation_ssx = await _db.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
|
||||
endlocation_ssx = await cyDb.Queryable<BasLocation>().Where(r => input.endlocations.Contains(r.id)).OrderBy("is_lock, task_nums, location_code").FirstAsync();
|
||||
}
|
||||
|
||||
// 查找是否有一个料箱可以正好满足剩余需求数量(目前只做这个额外判断,其它情形不考虑)
|
||||
@@ -800,7 +804,7 @@ namespace Tnb.WarehouseMgr
|
||||
needOut -= _wmsCarryCode.codeqty;
|
||||
WmsCarryH _wmsCarryH = itemsASC[j].wmsCarryH;
|
||||
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
|
||||
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(_wmsCarryH, _wmsCarryCode.codeqty, endlocation_ssx));
|
||||
|
||||
@@ -815,7 +819,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 目前只支持一个料箱只有一个物料
|
||||
needOut -= wmsCarryCode.codeqty;
|
||||
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
await cyDb.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(it => endlocation_ssx.id == it.id).ExecuteCommandAsync();
|
||||
|
||||
carrysASC.Add(new Tuple<WmsCarryH, decimal, BasLocation>(wmsCarryH, wmsCarryCode.codeqty, endlocation_ssx));
|
||||
}
|
||||
@@ -957,11 +961,11 @@ namespace Tnb.WarehouseMgr
|
||||
//putdic.Add("ZS-A06-1", new string[] { "hxjA", "A8允许入空箱", });
|
||||
//getdic.Add("ZS-A06-2", new string[] { "hxjA", "A8允许取满箱" });
|
||||
|
||||
//putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9允许入空箱", });
|
||||
//getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9允许取满箱" });
|
||||
putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9允许入空箱", });
|
||||
getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9允许取满箱" });
|
||||
|
||||
//putdic.Add("ZS-A08-1", new string[] { "hxjA", "A10允许入空箱", });
|
||||
//getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10允许取满箱" });
|
||||
putdic.Add("ZS-A08-1", new string[] { "hxjA", "A10允许入空箱", });
|
||||
getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10允许取满箱" });
|
||||
|
||||
putdic.Add("ZS-D01-1", new string[] { "hxjA", "A1允许入空箱", });
|
||||
getdic.Add("ZS-D01-2", new string[] { "hxjA", "A1允许取满箱" });
|
||||
@@ -1090,8 +1094,8 @@ namespace Tnb.WarehouseMgr
|
||||
//getdic.Add("ZS-D06-2", new string[] { "hxjA", "A6AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A05-2", new string[] { "hxjA", "A7AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A06-2", new string[] { "hxjA", "A8AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A09-2", new string[] { "hxjA", "A11AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A10-2", new string[] { "hxjA", "A12AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A11-2", new string[] { "hxjA", "A13AGV允许入满箱", "true" });
|
||||
@@ -1234,8 +1238,8 @@ namespace Tnb.WarehouseMgr
|
||||
//getdic.Add("ZS-D06-2", new string[] { "hxjA", "A6AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A05-2", new string[] { "hxjA", "A7AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A06-2", new string[] { "hxjA", "A8AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
//getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A09-2", new string[] { "hxjA", "A11AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A10-2", new string[] { "hxjA", "A12AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A11-2", new string[] { "hxjA", "A13AGV允许入满箱", "true" });
|
||||
@@ -1282,8 +1286,8 @@ namespace Tnb.WarehouseMgr
|
||||
//putdic.Add("ZS-D06-1", new string[] { "hxjA", "A6AGV允许出空箱", "false" });
|
||||
//putdic.Add("ZS-A05-1", new string[] { "hxjA", "A7AGV允许出空箱", "true" });
|
||||
//putdic.Add("ZS-A06-1", new string[] { "hxjA", "A8AGV允许出空箱", "true" });
|
||||
//putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9AGV允许出空箱", "true" });
|
||||
//putdic.Add("ZS-A08-1", new string[] { "hxjA", "A10AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A08-1", new string[] { "hxjA", "A10AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A09-1", new string[] { "hxjA", "A11AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A10-1", new string[] { "hxjA", "A12AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A11-1", new string[] { "hxjA", "A13AGV允许出空箱", "false" });
|
||||
@@ -2639,8 +2643,8 @@ namespace Tnb.WarehouseMgr
|
||||
#region 电梯第三次改动
|
||||
|
||||
var _floor3FirstSelectElevator = await db_agvElevatorTaskExceptionHandles.Queryable<BasFactoryConfig>().Where(p => p.key == "floor3FirstSelectElevator").FirstAsync();
|
||||
// 一托下且当前电梯还没有后续任务且首选电梯为当前电梯的情况下,切换首选电梯为另一部
|
||||
int task_nums = db.Queryable<WmsElevatorH>().Where(r => r.elevator_code == devName).Sum(r => r.task_nums);
|
||||
// 一托下且当前电梯组还没有后续任务且首选电梯为当前电梯的情况下,切换首选电梯为另一部
|
||||
int task_nums = db.Queryable<WmsElevatorH>().Where(r => r.elevator_group == "2").Sum(r => r.task_nums);
|
||||
if (disTaskIds.Count == 1 && task_nums == 1 && devName == _floor3FirstSelectElevator.value)
|
||||
{
|
||||
await ChangeSelectedElevator(db);
|
||||
|
||||
Reference in New Issue
Block a user