上报apms炉号
This commit is contained in:
李广豪 2022-11-18 10:12:54 +08:00
parent 592d27b858
commit 5eed777f0a

View File

@ -88,6 +88,7 @@ public class ScheduledTask extends BaseService {
public void test() throws IOException {
}
//@Scheduled(fixedDelay = 1000*60)
public void testWebsocket() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
@ -134,7 +135,7 @@ public class ScheduledTask extends BaseService {
/**
* 正在加工的加工任务详情
*/
@Scheduled(fixedDelay = 1000*60)
//@Scheduled(fixedDelay = 1000*60)
public void screen() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>()
@ -196,6 +197,7 @@ public class ScheduledTask extends BaseService {
}
webSocketServer.sendtoUser(JSON.toJSONString(nowCurrTaskDetVoList), "2");
}
/**
* 查询加工完成的工业炉
*/
@ -437,10 +439,19 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
//ABC向电流
Double phaseACurrent = readPlc(nameSpaceNote, "PhaseACurrent");
Double phaseBCurrent = readPlc(nameSpaceNote, "PhaseBCurrent");
Double phaseDCurrent = readPlc(nameSpaceNote, "PhaseDCurrent");
ParEleValue parEleValue = new ParEleValue();
parEleValue.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue.setAVoltagevValue(phaseBVoltage.floatValue());
parEleValue.setAVoltagevValue(phaseCVoltage.floatValue());
parEleValue.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue.setACurrentValue(phaseACurrent.floatValue());
parEleValue.setBCurrentValue(phaseBCurrent.floatValue());
parEleValue.setCCurrentValue(phaseDCurrent.floatValue());
parEleValue.setTotalBat(electricalValue.floatValue());
parEleValue.setKilnId(kilnId);
parEleValue.setTaskId(currTaskId);
@ -466,10 +477,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
//ABC三相电流
Double aCurrent = readPlc(nameSpaceNote, "ACurrent");
Double bCurrent = readPlc(nameSpaceNote, "BCurrent");
Double cCurrent = readPlc(nameSpaceNote, "CCurrent");
ParEleValue parEleValue2 = new ParEleValue();
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue());
parEleValue2.setAVoltagevValue(phaseCVoltage.floatValue());
parEleValue2.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue2.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue2.setACurrentValue(aCurrent.floatValue());
parEleValue2.setBCurrentValue(bCurrent.floatValue());
parEleValue2.setCCurrentValue(cCurrent.floatValue());
parEleValue2.setTotalBat(electricalValue.floatValue());
parEleValue2.setKilnId(kilnId);
parEleValue2.setTaskId(currTaskId);
@ -504,10 +522,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
//ABC三向电流
Double phaseACurrent = readPlc(nameSpaceNote, "PhaseACurrent");
Double phaseBCurrent = readPlc(nameSpaceNote, "PhaseBCurrent");
Double phaseCCurrent = readPlc(nameSpaceNote, "PhaseCCurrent");
ParEleValue parEleValue3 = new ParEleValue();
parEleValue3.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue3.setAVoltagevValue(phaseBVoltage.floatValue());
parEleValue3.setAVoltagevValue(phaseCVoltage.floatValue());
parEleValue3.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue3.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue3.setACurrentValue(phaseACurrent.floatValue());
parEleValue3.setBCurrentValue(phaseBCurrent.floatValue());
parEleValue3.setCCurrentValue(phaseCVoltage.floatValue());
parEleValue3.setTotalBat(electricalValue.floatValue());
parEleValue3.setKilnId(kilnId);
parEleValue3.setTaskId(currTaskId);
@ -522,10 +547,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
//ABC三向电流
Double aCurrent = readPlc(nameSpaceNote, "ACurrent");
Double bCurrent = readPlc(nameSpaceNote, "BCurrent");
Double cCurrent = readPlc(nameSpaceNote, "CCurrent");
ParEleValue parEleValue4 = new ParEleValue();
parEleValue4.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue4.setAVoltagevValue(phaseBVoltage.floatValue());
parEleValue4.setAVoltagevValue(phaseCVoltage.floatValue());
parEleValue4.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue4.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue4.setACurrentValue(aCurrent.floatValue());
parEleValue4.setBCurrentValue(bCurrent.floatValue());
parEleValue4.setCCurrentValue(cCurrent.floatValue());
parEleValue4.setTotalBat(electricalValue.floatValue());
parEleValue4.setKilnId(kilnId);
parEleValue4.setTaskId(currTaskId);
@ -538,7 +570,7 @@ public class ScheduledTask extends BaseService {
//遍历工业炉空工业炉查询缓存区是否有等待加工的任务
//待加工任务存在且没有状态为正在进炉的情况下按照先进先出的规则选择待加工任务呼叫车辆进炉
@Scheduled(fixedDelay = 1000*60)
//@Scheduled(fixedDelay = 1000*60)
public void runTaskForEmptyKiln() throws IOException {
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>()
.eq(KilnInfo.VALID, 1).eq(KilnInfo.STATUS, 0).orderByAsc(KilnInfo.TYPE));
@ -612,7 +644,7 @@ public class ScheduledTask extends BaseService {
}
//遍历正在工作炉子的报警变量记录报警
@Scheduled(fixedDelay = 1000*60)
//@Scheduled(fixedDelay = 1000*60)
public void listenKilnAlarm() {
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
for (KilnInfo kilnInfo : kilnInfoList
@ -631,7 +663,8 @@ public class ScheduledTask extends BaseService {
List<PlcNameSpace> alarmNameList = plcNameSpaceServiceBiz.list(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 1)
.eq(PlcNameSpace.TYPE, 1)
.eq(PlcNameSpace.EQ_ID,kilnInfo.getId()));;
.eq(PlcNameSpace.EQ_ID, kilnInfo.getId()));
;
for (PlcNameSpace plcNameSpace : alarmNameList
) {
String name = plcNameSpace.getName();
@ -663,8 +696,7 @@ public class ScheduledTask extends BaseService {
alarmInfo.setCreateTime(LocalDateTime.now());
alarmInfoServiceBiz.save(alarmInfo);
}
}
else {
} else {
AlarmInfo alarmInfo = new AlarmInfo();
alarmInfo.setEquipmentId(kilnInfo.getId());
alarmInfo.setEquipmentName(kilnInfo.getKilnName());
@ -701,8 +733,10 @@ public class ScheduledTask extends BaseService {
}
}
}
/**
* 获取变量值
*
* @param nameSpace nameSpace前缀
* @param variableName 变量名称
* @return result字符串
@ -723,8 +757,10 @@ public class ScheduledTask extends BaseService {
return result;
}
/**
* 获取变量值
*
* @param nameSpace nameSpace前缀
* @param variableName 变量名称
* @return 变量值
@ -754,6 +790,7 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "AllowIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
}
private Boolean kilnReadyIn(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0)
@ -763,6 +800,7 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "ReadyIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
}
private Boolean kilnWorking(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0)
@ -775,6 +813,7 @@ public class ScheduledTask extends BaseService {
/**
* 车辆是否在线
*
* @param vehicleId 车辆id
* @return true/false
* @throws IOException plc访问失败
@ -804,6 +843,7 @@ public class ScheduledTask extends BaseService {
/**
* 车辆是否空闲
*
* @param vehicleId 车辆id
* @return true/false
* @throws IOException plc访问失败