From 4af20b8551602a3067a2cd99d50629722090fe26 Mon Sep 17 00:00:00 2001 From: LGH <1746689524@qq.com> Date: Mon, 15 Aug 2022 10:44:08 +0800 Subject: [PATCH] =?UTF-8?q?update:=20//=E5=A4=9A=E7=94=A8=E7=82=89?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AD=98=E5=9C=A8=E5=A4=9A=E4=B8=AA=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E5=8F=B7=E4=B8=94=E7=82=89=E5=AD=90=E7=BB=99=E7=9A=84?= =?UTF-8?q?DischargeIdentNumber=E4=B8=BA=E4=B8=8B=E6=B2=B9=E6=A7=BD?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E8=AF=86=E5=88=AB=E5=8F=B7,=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E4=BD=BF=E7=94=A8=E8=A1=A8=E9=87=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E4=BB=BB=E5=8A=A1id=E6=A0=B9=E6=8D=AE=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=92=8C=E8=BF=9B=E7=82=89=E6=97=B6=E9=97=B4=E6=9F=A5?= =?UTF-8?q?=E5=87=BA=E6=AD=A3=E5=9C=A8=E7=82=89=E9=87=8C=E4=B8=94=E5=85=88?= =?UTF-8?q?=E8=BF=9B=E5=8E=BB=E7=9A=84=E9=82=A3=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mt/wms/empty/task/ScheduledTask.java | 32 ++++++++++++++++--- .../com/mt/wms/empty/vo/CurrTaskQueryVo.java | 5 +++ 2 files changed, 33 insertions(+), 4 deletions(-) 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; }