diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index b404e70..27780a9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -266,8 +266,19 @@ public class ScheduledTask extends BaseService { //该炉子在工作中 if (resultBoolean){ Long kilnId = kilnInfo.getId(); - String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); - Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); + Long currTaskId =0L; + //多用炉因为存在多个识别号且炉子给的DischargeIdentNumber为下油槽后的识别号,所以使用表里记录的任务id根据状态和进炉时间查出正在炉里且先进去的那个 + if (kilnInfo.getType()==1){ + List currTaskList = currTaskServiceBiz.list(new QueryWrapper().eq(CurrTask.STATUS, 1) + .eq(CurrTask.KILN_ID, kilnId).eq(CurrTask.IS_IN, 1)); + if (currTaskList.size()!=0){ + currTaskId=currTaskList.get(0).getId(); + } + }else { + String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); + currTaskId=Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); + } + if (currTaskId==0){ continue; } @@ -369,8 +380,21 @@ public class ScheduledTask extends BaseService { Boolean resultBoolean = Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); if (resultBoolean){ Long kilnId = kilnInfo.getId(); + Long currTaskId =0L; + //多用炉因为存在多个识别号且炉子给的DischargeIdentNumber为下油槽后的识别号,所以使用表里记录的任务id根据状态和进炉时间查出正在炉里且先进去的那个 + if (kilnInfo.getType()==1){ + List currTaskList = currTaskServiceBiz.list(new QueryWrapper().eq(CurrTask.STATUS, 1) + .eq(CurrTask.KILN_ID, kilnId).eq(CurrTask.IS_IN, 1)); + if (currTaskList.size()!=0){ + currTaskId=currTaskList.get(0).getId(); + } + }else { + String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); + currTaskId=Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); + } +/* Long kilnId = kilnInfo.getId(); String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); - Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); + Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString());*/ //任务id为0说明不是自动任务,不记录 if (currTaskId==0){ continue; @@ -657,7 +681,7 @@ public class ScheduledTask extends BaseService { } //监听车辆是否在线,定时恢复车辆状态会导致避让时等待时间过久,再次发起任务,造成重复发起 - //@Scheduled(fixedDelay = 1000*60) + @Scheduled(fixedDelay = 1000*60) public void listenVehicleOnline() throws IOException { List vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper().eq(VehicleInfo.STATUS,1)); for (VehicleInfo vehicleInfo:vehicleInfoList diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java index 722e972..12202f3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java @@ -97,4 +97,9 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty("车辆名称") private Integer isAuto; + /** + * 是否缓存 + */ + @ApiModelProperty("是否缓存") + private Integer isCache; }