|
|
@@ -225,8 +225,11 @@ public class ScheduledTask extends BaseService { |
|
|
|
if (resultBoolean){ |
|
|
|
//调用RunTaskUtils.runTaskForOutKiln |
|
|
|
logger.info(kilnInfo.getCode()+kilnInfo.getKilnAlias()+"识别到允许出炉信号,进入出库程序!"); |
|
|
|
asynRunTaskService.asynEndRecordConsume(currTask.getId(),kilnId); |
|
|
|
logger.info(kilnInfo.getCode()+"炉子中的任务:"+currTask.getId()+"已加工结束,记录加工结束能源消耗值"); |
|
|
|
//加工结束而没有立马出炉,加工结束记录能源消耗值只记录一次 |
|
|
|
if (currTask.getEndTime()!=null){ |
|
|
|
asynRunTaskService.asynEndRecordConsume(currTask.getId(),kilnId); |
|
|
|
logger.info(kilnInfo.getCode()+"炉子中的任务:"+currTask.getId()+"已加工结束,记录加工结束能源消耗值"); |
|
|
|
} |
|
|
|
//更新加工单工艺结束时间,只更新一次,因为可能因为不满住出炉条件而进入到下一次定时任务 |
|
|
|
if (String.valueOf(currTask.getEndTime()).equals("null")){ |
|
|
|
currTask.setEndTime(LocalDateTime.now()); |
|
|
@@ -348,9 +351,16 @@ public class ScheduledTask extends BaseService { |
|
|
|
Long kilnId = kilnInfo.getId(); |
|
|
|
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); |
|
|
|
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); |
|
|
|
|
|
|
|
if (currTaskId==0){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
CurrTask currTask = currTaskServiceBiz.getById(currTaskId); |
|
|
|
if (currTask!=null){ |
|
|
|
if (currTask.getEndTime()!=null){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
//加工炉 |
|
|
|
if (kilnInfo.getType()==1){ |
|
|
|
//实际温度 |
|
|
@@ -539,10 +549,10 @@ public class ScheduledTask extends BaseService { |
|
|
|
//判断炉子是否在工作状态 |
|
|
|
String working = readPlcToString(kilnNameSpace.getName(), "Working"); |
|
|
|
JSONObject jsonObject = JSON.parseObject(working); |
|
|
|
Boolean aBoolean = Boolean.valueOf(String.valueOf(jsonObject.get("msg"))); |
|
|
|
Boolean aBoolean = Boolean.valueOf(String.valueOf(jsonObject.get("result"))); |
|
|
|
if (aBoolean){ |
|
|
|
//命名空间前缀 |
|
|
|
String nameSpace = kilnNameSpace.getNote(); |
|
|
|
String nameSpace = kilnNameSpace.getName(); |
|
|
|
//炉子的报警变量 |
|
|
|
List<PlcNameSpace> alarmNameList = plcNameSpaceServiceBiz.list(new QueryWrapper<PlcNameSpace>() |
|
|
|
.eq(PlcNameSpace.EQ_TYPE, 1) |
|
|
|