销售出库两托下电梯逻辑调整 原材料仓转移控制
This commit is contained in:
@@ -422,8 +422,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
["TagName"] = strs[3],
|
||||
["Value"] = strs[4],
|
||||
};
|
||||
//LoggerBGWCarrySupplement.LogInformation($"【ScanInStock】 八工位 {key} 发送PutDoneEmptyBox指令 {_eleCtlCfg.WriteTagUrl} {JsonConvert.SerializeObject(dicCommand)}");
|
||||
//HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait();
|
||||
LoggerBGWCarrySupplement.LogInformation($"【ScanInStock】 八工位 {key} 发送PutDoneEmptyBox指令 {_eleCtlCfg.WriteTagUrl} {JsonConvert.SerializeObject(dicCommand)}");
|
||||
HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait();
|
||||
|
||||
|
||||
string coderesult = await GetStringTag(strs[0], strs[2]);
|
||||
@@ -640,6 +640,14 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
if (_wareHouseService.s_taskExecuteSemaphore_YCLOutstock.CurrentCount == 0)
|
||||
return;
|
||||
|
||||
|
||||
var YCLInnerTransfer = await db_YCLInternalTransfer.Queryable<BasFactoryConfig>().Where(p => p.key == "YCLInnerTransfer").FirstAsync();
|
||||
// 0则不进行移转
|
||||
if (YCLInnerTransfer != null && YCLInnerTransfer.value == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await _wareHouseService.s_taskExecuteSemaphore_YCLInstock.WaitAsync();
|
||||
await _wareHouseService.s_taskExecuteSemaphore_YCLOutstock.WaitAsync();
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
@@ -662,7 +670,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
|
||||
if (items.Count < 1)
|
||||
{
|
||||
LoggerF2KTPsupplement.LogWarning($"【YCLInternalTransfer】 没有可以出库的载具");
|
||||
LoggerYCLInternalTransfer.LogWarning($"【YCLInternalTransfer】 没有可以出库的载具");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2109,6 +2117,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
OutStockStrategyQuery outStockStrategyInput = new()
|
||||
{
|
||||
warehouse_id = WmsWareHouseConst.WAREHOUSE_DMJC_ID,
|
||||
filter_carry_status = false,
|
||||
Size = 1
|
||||
};
|
||||
List<WmsCarryH> items = await _wareHouseService.OutStockStrategy(outStockStrategyInput);
|
||||
|
||||
@@ -76,7 +76,11 @@
|
||||
/// 外协存储区
|
||||
/// </summary>
|
||||
public const string REGION_YCLWX_ID = "26125771318821";
|
||||
|
||||
/// <summary>
|
||||
/// 成品库出库暂存区
|
||||
/// </summary>
|
||||
public const string REGION_CPOutstockCache_ID = "35948525263893";
|
||||
|
||||
/// <summary>
|
||||
/// 长管出库
|
||||
/// </summary>
|
||||
@@ -578,5 +582,16 @@
|
||||
/// 原材料仓先进先出
|
||||
/// </summary>
|
||||
public const string POLICY_YCLOUTSTOCK = "WOSP202407260001";
|
||||
|
||||
/// <summary>
|
||||
/// 成品仓四号梯点位
|
||||
/// </summary>
|
||||
public const string POINT_Elevator4 = "29728469086741";
|
||||
|
||||
/// <summary>
|
||||
/// 成品仓三号梯点位
|
||||
/// </summary>
|
||||
public const string POINT_Elevator3 = "29307999693333";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
else if (floor == 1)
|
||||
{
|
||||
realFloor = 1;
|
||||
realFloor = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -941,6 +941,11 @@ namespace Tnb.WarehouseMgr
|
||||
getdic.Add("SSX-021-005", new string[] { "YTCS", "FullOut_CS05Done", "true" });
|
||||
getdic.Add("SSX-111-011", new string[] { "东面提升机输送线", "下升降机11出箱完毕", "true" });
|
||||
getdic.Add("SSX-111-012", new string[] { "东面提升机输送线", "下升降机12出箱完毕", "true" });
|
||||
|
||||
getdic.Add("ZZ-01-02", new string[] { "外包装箱码垛线", "WBZX_x1_take_mtp", "true" });
|
||||
getdic.Add("ZZ-02-02", new string[] { "外包装箱码垛线", "WBZX_x2_take_mtp", "true" });
|
||||
|
||||
|
||||
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线上层允许出箱3", "true" });
|
||||
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线上层允许出箱1", "true" });
|
||||
getdic.Add("SSX-011-008", new string[] { "东面提升机输送线", "入库输送线8出箱完毕", "true" });
|
||||
@@ -2179,7 +2184,7 @@ namespace Tnb.WarehouseMgr
|
||||
eleStatusMulti = await _elevatorControlService.GetElevatorStatus(devName, tags, CancellationToken.None);
|
||||
Logger.Information($"{devName.Match(@"\d+")}#, 当前Agv状态:{eleStatusMulti.agvStatus.ToEnum<EnumAgvStatus>()}");
|
||||
await Task.Delay(1000);
|
||||
} while (eleStatusMulti.agvStatus != (int)EnumAgvStatus.AGV运行状态 );
|
||||
} while (eleStatusMulti.agvStatus != (int)EnumAgvStatus.AGV运行状态);
|
||||
Logger.Information($"{devName.Match(@"\d+")}#, 当前Agv状态:{eleStatusMulti.agvStatus.ToEnum<EnumAgvStatus>()}");
|
||||
_elevatorAgvCtlStatusMap[disTask.id] = eleStatusMulti.agvStatus;
|
||||
}
|
||||
@@ -2190,6 +2195,7 @@ namespace Tnb.WarehouseMgr
|
||||
do
|
||||
{
|
||||
doorStatus = await _elevatorControlService.GetTagAsync(devName, ElevatorConsts.DoorStatus);
|
||||
Logger.Information($"当前门状态:{doorStatus}");
|
||||
await Task.Delay(1000);
|
||||
} while (doorStatus != 4);
|
||||
Logger.Information($"当前门状态:{doorStatus}");
|
||||
@@ -2204,7 +2210,7 @@ namespace Tnb.WarehouseMgr
|
||||
Logger.Information($"开始呼梯 {devName}到{floor}");
|
||||
//发送到目标楼的指令
|
||||
dynamic result = await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.FloorExecute, floor);
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
tuple = await _elevatorControlService.GetElevatorStatus(devName, tags, CancellationToken.None);
|
||||
@@ -2216,7 +2222,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (tuple.sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && tuple.runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯)
|
||||
{
|
||||
Logger.Information($"disTask.require_id={disTask.require_id}");
|
||||
List<string> disTaskIds = new() { disTasks[0].id, disTasks[1].id };
|
||||
List<string> disTaskIds = new() { disTasks[0].id };
|
||||
if (disTasks.Count == 2)
|
||||
{
|
||||
disTaskIds.Add(disTasks[1].id);
|
||||
}
|
||||
TaskExecuteAfterUpInput teaUpInput = new()
|
||||
{
|
||||
disTaskIds = disTaskIds,
|
||||
@@ -2263,6 +2273,10 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
"29815764588053","29815767573013"
|
||||
};
|
||||
string[] doubleCarryRunElevatorsF1Code =
|
||||
{
|
||||
"DT-1-3","DT-1-4"
|
||||
};
|
||||
|
||||
//调用AGV创建任务链接口
|
||||
try
|
||||
@@ -2306,8 +2320,8 @@ namespace Tnb.WarehouseMgr
|
||||
reqBody.type = (int)EnumTaskChainType.KIVA;
|
||||
}
|
||||
|
||||
// 三四号电梯出货
|
||||
if (doubleCarryRunElevators.Contains(dis.device_id) && dis.end_floor == 1)
|
||||
// 三四号电梯出货 暂存仓到三楼电梯以及一楼电梯出库任务发type5
|
||||
if ((doubleCarryRunElevators.Contains(dis.device_id) && dis.endlocation_code.Contains("DT")) || doubleCarryRunElevatorsF1Code.Contains(dis.startlocation_code))
|
||||
{
|
||||
reqBody.type = (int)EnumTaskChainType.电梯载两托货;
|
||||
}
|
||||
@@ -2512,7 +2526,7 @@ namespace Tnb.WarehouseMgr
|
||||
_ = await _db.Updateable(carryIts).UpdateColumns(it => new { it.is_lock, it.location_id, it.location_code, it.instock_time }).ExecuteCommandAsync();
|
||||
Logger.Information($"【TaskComplate】 更新载具 {JsonConvert.SerializeObject(carryIts)}");
|
||||
//更新条码的库位和仓库信息
|
||||
_ = await _db.Updateable(carryCodeIts).UpdateColumns(it => new { it.warehouse_id, it.location_id, it.location_code }).Where(it => multiList.Select(x => x.carry_id).Contains(it.carry_id)).ExecuteCommandAsync();
|
||||
_ = await _db.Updateable(carryCodeIts).UpdateColumns(it => new { it.warehouse_id, it.location_id, it.location_code }).ExecuteCommandAsync();
|
||||
//更新库位信息,使用状态为 使用,锁定状态为未锁定
|
||||
_ = await _db.Updateable(locIts).UpdateColumns(it => new { it.is_use, it.is_lock }).ExecuteCommandAsync();
|
||||
Logger.Information($"【TaskComplate】 更新库位 {JsonConvert.SerializeObject(locIts)}");
|
||||
@@ -2864,9 +2878,34 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
WmsElevatorH wmsElevatorH = await _db.Queryable<WmsElevatorH>().Where(it => it.elevator_group == "2" && it.enabled == 1).OrderBy(r => r.task_nums).FirstAsync();
|
||||
string elevatorSno = wmsElevatorH.elevator_code.Replace("Elevator", "");
|
||||
List<BasLocation> locations = await _db.Queryable<BasLocation>()
|
||||
.InnerJoin<WmsPointH>((a, b) => a.id == b.location_id)
|
||||
.InnerJoin<WmsPointD>((a, b, c) => b.id == c.point_id)
|
||||
.InnerJoin<WmsPointH>((a, b, c, d) => d.id == c.endpoint_id)
|
||||
.Where((a, b, c, d) => a.wh_id == WmsWareHouseConst.WAREHOUSE_CP_ID && a.region_id == WmsWareHouseConst.REGION_CPOutstockCache_ID && d.point_code == $"DT-3-{elevatorSno}")
|
||||
.Select((a, b, c, d) => new BasLocation
|
||||
{
|
||||
location_code = a.location_code,
|
||||
extras = d.point_code
|
||||
}).OrderBy("a.is_lock, a.is_use, a.location_code, d.point_code").ToListAsync();
|
||||
|
||||
if (locations.Count == 0)
|
||||
{
|
||||
throw new AppFriendlyException($"三楼发货时,没有可用的暂存库位可以使用", 500);
|
||||
}
|
||||
BasLocation cache_location = locations.First();
|
||||
// 到暂存区
|
||||
points.Add(wmsPointHs.Where(r => r.id == pStartId).First());
|
||||
points.Add(wmsPointHs.Where(r => r.point_code == $"DT-C-03-0{elevatorSno}").First());
|
||||
points.Add(wmsPointHs.Where(r => r.location_code == cache_location.location_code).First());
|
||||
// 到电梯
|
||||
WmsPointH cacheOut_point = wmsPointHs.Where(r => r.location_code == cache_location.location_code).First().Copy();
|
||||
WmsPointH DT_C_point = wmsPointHs.Where(r => r.point_code == $"DT-C-03-0{elevatorSno}").First().Copy();
|
||||
cacheOut_point.area_code = "FC";
|
||||
DT_C_point.area_code = "FC";
|
||||
|
||||
points.Add(cacheOut_point);
|
||||
points.Add(DT_C_point);
|
||||
// 到一楼
|
||||
points.Add(wmsPointHs.Where(r => r.point_code == $"DT-3-{elevatorSno}").First());
|
||||
points.Add(wmsPointHs.Where(r => r.point_code == $"DT-1-{elevatorSno}").First());
|
||||
points.Add(wmsPointHs.Where(r => r.point_code == $"DT-R-01-0{elevatorSno}").First());
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
|
||||
//所有库位加锁
|
||||
string?[] ids = new[] { startLocation.id, endLocationId };
|
||||
string?[] ids = new[] { startLocation.id, preTasks[0].endlocation_id, endLocationId };
|
||||
_ = 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