bug修改
This commit is contained in:
parent
ddf86e07b4
commit
93eaf9ed40
@ -116,7 +116,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
currTask.setCraftCodeId(one.getId());
|
currTask.setCraftCodeId(one.getId());
|
||||||
currTask.setPlcValue(one.getPlcValue());
|
currTask.setPlcValue(one.getPlcValue());
|
||||||
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
|
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
|
||||||
currTask.setTaskCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
|
currTask.setTaskCode(currTask.getInterCode());
|
||||||
setCommonField(currTask);
|
setCommonField(currTask);
|
||||||
currTaskServiceBiz.save(currTask);
|
currTaskServiceBiz.save(currTask);
|
||||||
return successful(IdVo.builder().id(currTask.getId()).build());
|
return successful(IdVo.builder().id(currTask.getId()).build());
|
||||||
|
@ -605,9 +605,9 @@ public class AsynRunTaskService extends BaseService {
|
|||||||
//电度值
|
//电度值
|
||||||
electricalValue = readPlc(nameSpaceNote, "TotalElectricity");
|
electricalValue = readPlc(nameSpaceNote, "TotalElectricity");
|
||||||
//A向电压
|
//A向电压
|
||||||
phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
|
phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
|
||||||
phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
|
phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
|
||||||
phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
|
phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
|
||||||
ParEleValue parEleValue2 = new ParEleValue();
|
ParEleValue parEleValue2 = new ParEleValue();
|
||||||
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
|
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
|
||||||
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue());
|
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue());
|
||||||
@ -799,9 +799,9 @@ public class AsynRunTaskService extends BaseService {
|
|||||||
//电度值
|
//电度值
|
||||||
electricalValue = readPlc(nameSpaceNote, "TotalElectricity");
|
electricalValue = readPlc(nameSpaceNote, "TotalElectricity");
|
||||||
//A向电压
|
//A向电压
|
||||||
phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
|
phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
|
||||||
phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
|
phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
|
||||||
phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
|
phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
|
||||||
ParEleValue parEleValue2 = new ParEleValue();
|
ParEleValue parEleValue2 = new ParEleValue();
|
||||||
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
|
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
|
||||||
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue());
|
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue());
|
||||||
|
@ -127,7 +127,9 @@ public class ScheduledTask extends BaseService {
|
|||||||
@Scheduled(fixedDelay = 1000*60)
|
@Scheduled(fixedDelay = 1000*60)
|
||||||
public void screen() throws IOException {
|
public void screen() throws IOException {
|
||||||
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间,剩余时间,查询标识卡详情
|
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间,剩余时间,查询标识卡详情
|
||||||
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
|
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>()
|
||||||
|
.eq(CurrTask.IS_IN, 1)
|
||||||
|
.eq(CurrTask.STATUS,1));
|
||||||
if (currTaskList.size()==0){
|
if (currTaskList.size()==0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -171,7 +173,8 @@ public class ScheduledTask extends BaseService {
|
|||||||
nowCurrTask.setCompleteness(completeness);
|
nowCurrTask.setCompleteness(completeness);
|
||||||
nowCurrTask.setKilnCode(kilnInfo.getCode());
|
nowCurrTask.setKilnCode(kilnInfo.getCode());
|
||||||
//标识卡详情
|
//标识卡详情
|
||||||
List<CurrTaskDet> currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, nowCurrTask.getId()));
|
List<CurrTaskDet> currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper<CurrTaskDet>()
|
||||||
|
.eq(CurrTaskDet.CURR_TASK_ID, nowCurrTask.getId()));
|
||||||
List<CurrTaskDetVo> currTaskDetVoList = BeanUtils.copyList(currTaskDetList, CurrTaskDetVo.class);
|
List<CurrTaskDetVo> currTaskDetVoList = BeanUtils.copyList(currTaskDetList, CurrTaskDetVo.class);
|
||||||
for (CurrTaskDetVo currTaskDetVo:currTaskDetVoList
|
for (CurrTaskDetVo currTaskDetVo:currTaskDetVoList
|
||||||
) {
|
) {
|
||||||
@ -211,6 +214,12 @@ public class ScheduledTask extends BaseService {
|
|||||||
if (resultBoolean){
|
if (resultBoolean){
|
||||||
//调用RunTaskUtils.runTaskForOutKiln
|
//调用RunTaskUtils.runTaskForOutKiln
|
||||||
logger.info(kilnInfo.getCode()+kilnInfo.getKilnAlias()+"识别到允许出炉信号,进入出库程序!");
|
logger.info(kilnInfo.getCode()+kilnInfo.getKilnAlias()+"识别到允许出炉信号,进入出库程序!");
|
||||||
|
asynRunTaskService.asynEndRecordConsume(currTask.getId(),kilnId);
|
||||||
|
logger.info(kilnInfo.getCode()+"炉子中的任务:"+currTask.getId()+"已加工结束,记录加工结束能源消耗值");
|
||||||
|
//更新加工单工艺结束时间
|
||||||
|
currTask.setEndTime(LocalDateTime.now());
|
||||||
|
currTaskServiceBiz.updateById(currTask);
|
||||||
|
//上报apms结束加工
|
||||||
runTaskUtils.runTaskForOutKiln(kilnId);
|
runTaskUtils.runTaskForOutKiln(kilnId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -221,7 +230,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
//查询出正在加工的工业炉,遍历,根据采集频率的不同,采集高频数据能源消耗。暂定30秒
|
//查询出正在加工的工业炉,遍历,根据采集频率的不同,采集高频数据能源消耗。暂定30秒
|
||||||
@Scheduled(fixedDelay = 1000*30)
|
@Scheduled(fixedDelay = 1000*30)
|
||||||
public void getFastValue(){
|
public void getFastValue(){
|
||||||
logger.info("==采集高频能耗数据开始==");
|
|
||||||
//加工炉列表
|
//加工炉列表
|
||||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>().in(KilnInfo.TYPE,1,3));
|
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>().in(KilnInfo.TYPE,1,3));
|
||||||
for (KilnInfo kilnInfo:kilnInfoList
|
for (KilnInfo kilnInfo:kilnInfoList
|
||||||
@ -239,7 +247,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
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());
|
||||||
if (currTaskId==0){
|
if (currTaskId==0){
|
||||||
logger.info("==当前加工的为手动加工任务,不记录能耗==");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//加工炉
|
//加工炉
|
||||||
@ -310,13 +317,11 @@ public class ScheduledTask extends BaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("==采集高频能耗数据结束==");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询出正在加工的工业炉,遍历,根据采集频率的不同,采集低频数据能源消耗。暂定3分钟一次
|
//查询出正在加工的工业炉,遍历,根据采集频率的不同,采集低频数据能源消耗。暂定3分钟一次
|
||||||
@Scheduled(fixedDelay = 1000*60*3)
|
@Scheduled(fixedDelay = 1000*60*3)
|
||||||
public void getSlowValue(){
|
public void getSlowValue(){
|
||||||
logger.info("==开始采集低频数据==");
|
|
||||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
||||||
for (KilnInfo kilnInfo:kilnInfoList
|
for (KilnInfo kilnInfo:kilnInfoList
|
||||||
) {
|
) {
|
||||||
@ -332,7 +337,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
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());
|
||||||
if (currTaskId==0){
|
if (currTaskId==0){
|
||||||
logger.info("==当前加工的为手动加工任务,不记录能耗==");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//加工炉
|
//加工炉
|
||||||
@ -457,7 +461,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("==结束采集低频数据==");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//遍历工业炉,空工业炉查询缓存区是否有等待加工的任务,
|
//遍历工业炉,空工业炉查询缓存区是否有等待加工的任务,
|
||||||
@ -518,7 +521,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
@Scheduled(fixedDelay = 1000*60)
|
@Scheduled(fixedDelay = 1000*60)
|
||||||
public void listenKilnAlarm(){
|
public void listenKilnAlarm(){
|
||||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
||||||
logger.info("==开始查询炉子是否有报警==");
|
|
||||||
for (KilnInfo kilnInfo:kilnInfoList
|
for (KilnInfo kilnInfo:kilnInfoList
|
||||||
) {
|
) {
|
||||||
PlcNameSpace kilnNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
PlcNameSpace kilnNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||||
@ -586,7 +588,6 @@ public class ScheduledTask extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("==结束查询炉子是否有报警==");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听车辆是否在线
|
//监听车辆是否在线
|
||||||
|
Loading…
Reference in New Issue
Block a user