//多用炉因为存在多个识别号且炉子给的DischargeIdentNumber为下油槽后的识别号,所以使用表里记录的任务id根据状态和进炉时间查出正在炉里且先进去的那个
This commit is contained in:
李广豪 2022-08-15 10:44:08 +08:00
parent 1616215534
commit 4af20b8551
2 changed files with 33 additions and 4 deletions

View File

@ -266,8 +266,19 @@ public class ScheduledTask extends BaseService {
//该炉子在工作中 //该炉子在工作中
if (resultBoolean){ if (resultBoolean){
Long kilnId = kilnInfo.getId(); Long kilnId = kilnInfo.getId();
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); Long currTaskId =0L;
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); //多用炉因为存在多个识别号且炉子给的DischargeIdentNumber为下油槽后的识别号,所以使用表里记录的任务id根据状态和进炉时间查出正在炉里且先进去的那个
if (kilnInfo.getType()==1){
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().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){ if (currTaskId==0){
continue; continue;
} }
@ -369,8 +380,21 @@ public class ScheduledTask extends BaseService {
Boolean resultBoolean = Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); Boolean resultBoolean = Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
if (resultBoolean){ if (resultBoolean){
Long kilnId = kilnInfo.getId(); Long kilnId = kilnInfo.getId();
Long currTaskId =0L;
//多用炉因为存在多个识别号且炉子给的DischargeIdentNumber为下油槽后的识别号,所以使用表里记录的任务id根据状态和进炉时间查出正在炉里且先进去的那个
if (kilnInfo.getType()==1){
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().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"); 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说明不是自动任务不记录 //任务id为0说明不是自动任务不记录
if (currTaskId==0){ if (currTaskId==0){
continue; continue;
@ -657,7 +681,7 @@ public class ScheduledTask extends BaseService {
} }
//监听车辆是否在线,定时恢复车辆状态会导致避让时等待时间过久,再次发起任务,造成重复发起 //监听车辆是否在线,定时恢复车辆状态会导致避让时等待时间过久,再次发起任务,造成重复发起
//@Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60)
public void listenVehicleOnline() throws IOException { public void listenVehicleOnline() throws IOException {
List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>().eq(VehicleInfo.STATUS,1)); List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>().eq(VehicleInfo.STATUS,1));
for (VehicleInfo vehicleInfo:vehicleInfoList for (VehicleInfo vehicleInfo:vehicleInfoList

View File

@ -97,4 +97,9 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo {
*/ */
@ApiModelProperty("车辆名称") @ApiModelProperty("车辆名称")
private Integer isAuto; private Integer isAuto;
/**
* 是否缓存
*/
@ApiModelProperty("是否缓存")
private Integer isCache;
} }