1.修正移库时,重复清库的BUG

2.给送小料箱的任务生成加入限制
master
zhangxy 5 months ago
parent d16a6a2102
commit 4d8cc561ae

@ -347,7 +347,7 @@ namespace Application
try try
{ {
List<WmsBaseLocationVo> Locationlist = sqlSugarClient.SqlQueryable<WmsBaseLocationVo> List<WmsBaseLocationVo> Locationlist = sqlSugarClient.SqlQueryable<WmsBaseLocationVo>
("SELECT agv_position_code,location_status,ifnull(amount,0) as amount FROM wms_base_location wbl LEFT JOIN wms_pallet_info wpi ON wbl.container_code=wpi.pallet_info_code") ("SELECT location_code as agv_position_code,location_status,ifnull(amount,0) as amount FROM wms_base_location wbl LEFT JOIN wms_pallet_info wpi ON wbl.container_code=wpi.pallet_info_code")
.ToList(); .ToList();
//List<WmsBaseLocation> Locationlist = sqlSugarClient.Queryable<WmsBaseLocation>().LeftJoin<WmsPalletInfo>((wbi, wpi) => wbi.ContainerCode == wpi.PalletInfoCode).ToList(); //List<WmsBaseLocation> Locationlist = sqlSugarClient.Queryable<WmsBaseLocation>().LeftJoin<WmsPalletInfo>((wbi, wpi) => wbi.ContainerCode == wpi.PalletInfoCode).ToList();
//List <AllLocationInfo> locationInfos = new List<AllLocationInfo>(); //List <AllLocationInfo> locationInfos = new List<AllLocationInfo>();

@ -252,9 +252,30 @@ namespace SlnMesnac.WCS.WCS
//---------------------------------- //----------------------------------
if (string.IsNullOrEmpty(readEpc) || readEpc != task.PalletInfoCode) if (string.IsNullOrEmpty(readEpc) || readEpc != task.PalletInfoCode)
{ {
if (string.IsNullOrEmpty(readEpc)){ int RFIDretrytime;
for (RFIDretrytime = 0; RFIDretrytime < 3; RFIDretrytime++)
{
readEpc = ReadEpcStrByRfidKey(endLocation.EquipKey);
if (string.IsNullOrEmpty(readEpc)){
_logger.Error("入库校验RFID失败,当前库位RFID为空未读取到,正在重试读取任务RFID:" + task.PalletInfoCode);
Thread.Sleep(500);
}
else
{
_logger.Error("入库校验RFID失败,当前库位RFID:" + readEpc + ",任务RFID:" + task.PalletInfoCode);
return;
}
}
RFIDretrytime = 0;
if (string.IsNullOrEmpty(readEpc))
{
workShop3Plc.writeBoolByAddress("DB100.DBX120.1", true); workShop3Plc.writeBoolByAddress("DB100.DBX120.1", true);
_logger.Error("入库校验RFID失败,当前库位RFID为空未读取到,任务RFID:" + task.PalletInfoCode); _logger.Error("入库校验RFID失败,当前库位RFID为空未读取到,重试多次读取到已锁库任务RFID:" + task.PalletInfoCode);
endLocation.LocationStatus = 1;
sqlSugarClient.Updateable(endLocation).ExecuteCommand();
Thread.Sleep(500);
} }
else else
{ {
@ -393,11 +414,6 @@ namespace SlnMesnac.WCS.WCS
} }
else if (task.TaskStatus == 4) else if (task.TaskStatus == 4)
{ {
//解锁起始库位
WmsBaseLocation? startLocation = sqlSugarClient.Queryable<WmsBaseLocation>().First(t => t.AgvPositionCode == task.CurrPointNo);
startLocation.ContainerCode = "";
startLocation.LocationStatus = 0;
//解锁终点库位 //解锁终点库位
WmsBaseLocation? endLocation = sqlSugarClient.Queryable<WmsBaseLocation>().First(t => t.AgvPositionCode == task.EndPointNo); WmsBaseLocation? endLocation = sqlSugarClient.Queryable<WmsBaseLocation>().First(t => t.AgvPositionCode == task.EndPointNo);
if (endLocation != null) if (endLocation != null)
@ -407,7 +423,6 @@ namespace SlnMesnac.WCS.WCS
sqlSugarClient.AsTenant().BeginTran(); sqlSugarClient.AsTenant().BeginTran();
try try
{ {
sqlSugarClient.Updateable(startLocation).ExecuteCommand();
sqlSugarClient.Updateable(endLocation).ExecuteCommand(); sqlSugarClient.Updateable(endLocation).ExecuteCommand();
sqlSugarClient.Deleteable(task).ExecuteCommand(); sqlSugarClient.Deleteable(task).ExecuteCommand();
sqlSugarClient.AsTenant().CommitTran(); sqlSugarClient.AsTenant().CommitTran();

@ -538,9 +538,12 @@ namespace SlnMesnac.WCS.WCS
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(task); WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(task);
wcsTaskLog.Id = id; wcsTaskLog.Id = id;
targetLocation.LocationStatus = 1; targetLocation.LocationStatus = 1;
sqlSugarClient.Updateable(targetLocation).ExecuteCommand(); int LockFlag = sqlSugarClient.Updateable(targetLocation).ExecuteCommand();
sqlSugarClient.Insertable(wcsTaskLog).ExecuteCommand(); sqlSugarClient.Insertable(wcsTaskLog).ExecuteCommand();
while (LockFlag<=0)
{
LockFlag = sqlSugarClient.Updateable(targetLocation).ExecuteCommand();
}
#region 修改托盘信息 #region 修改托盘信息
if (wmsPalletInfo != null) if (wmsPalletInfo != null)
@ -582,12 +585,22 @@ namespace SlnMesnac.WCS.WCS
{ {
//判断agv是否有来这里的任务 //判断agv是否有来这里的任务
bool hasTask = sqlSugarClient.Queryable<WcsTask>().Any(it => it.TaskType == StaticTaskType.TransferMaterialMetrologyRoomBoxTask && it.PalletInfoCode == rfid); bool hasTask = sqlSugarClient.Queryable<WcsTask>().Any(it => it.TaskType == StaticTaskType.TransferMaterialMetrologyRoomBoxTask && it.PalletInfoCode == rfid);
if (hasTask) if (hasTask)
{ {
_logger.Info($"该托盘{rfid}已有3#接驳位到2#计量室接驳位的送料任务"); _logger.Info($"该托盘{rfid}已有3#接驳位到2#计量室接驳位的送料任务");
return; return;
} }
//限制送料任务生成数量
int transTaskAmount = sqlSugarClient.Queryable<WcsTask>().Where(it => it.TaskType == StaticTaskType.TransferMaterialMetrologyRoomBoxTask).ToList().Count();
if (transTaskAmount > 2)
{
_logger.Info($"小托盘任务生成任务已大于上限上限为2请稍等所有小车同时运输小托盘将会导致卡死");
return;
}
//起点库位 3#车间小料箱取送货接驳点 //起点库位 3#车间小料箱取送货接驳点
WcsBaseEquip startEquip = sqlSugarClient.Queryable<WcsBaseEquip>().First(it => it.EquipNo == "3DeliverSmallGoodsPoint"); WcsBaseEquip startEquip = sqlSugarClient.Queryable<WcsBaseEquip>().First(it => it.EquipNo == "3DeliverSmallGoodsPoint");
//终点库位 2#车间计量室接驳点 //终点库位 2#车间计量室接驳点

Loading…
Cancel
Save