|
@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
/**
|
|
|
* 溯源系統定時任務
|
|
|
*/
|
|
@@ -16,16 +18,16 @@ import org.springframework.stereotype.Component;
|
|
|
@Slf4j
|
|
|
public class TraceJob {
|
|
|
|
|
|
- @Autowired
|
|
|
- PlcConnectServiceRunner plcConnectServiceRunner;
|
|
|
+ @Resource
|
|
|
+ private PlcConnectServiceRunner plcConnectServiceRunner;
|
|
|
|
|
|
- @Autowired
|
|
|
- TcpServiceRunner tcpServiceRunner;
|
|
|
+ @Resource
|
|
|
+ private TcpServiceRunner tcpServiceRunner;
|
|
|
|
|
|
- @Autowired
|
|
|
- ProcessRealizationService processRealizationService;
|
|
|
+ @Resource
|
|
|
+ private ProcessRealizationService processRealizationService;
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
|
|
@@ -53,11 +55,11 @@ public class TraceJob {
|
|
|
* 获取喷码信号
|
|
|
*/
|
|
|
public void getTheChamferCompletionSignal() {
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
|
|
|
- log.info("喷码信号:{}", b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
|
|
|
+// log.info("喷码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.DaoJiaoCodingCodeProcess();
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -65,44 +67,44 @@ public class TraceJob {
|
|
|
*/
|
|
|
|
|
|
public void obtainTheChamferingMachineCodeReadingSignal (){
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.READCODE.getMetadata());
|
|
|
- log.info("倒角机读码信号,{}",b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.READCODE.getMetadata());
|
|
|
+// log.info("倒角机读码信号,{}",b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader3");
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取铣面读码信号
|
|
|
*/
|
|
|
public void obtainTheMillingFaceReadingSignal() {
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.XIMIANPLC.getDeviceName()).readBoolean(XiMianPlcEnum.ISREAD.getMetadata());
|
|
|
- log.info("铣面读码信号:{}", b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.XIMIANPLC.getDeviceName()).readBoolean(XiMianPlcEnum.ISREAD.getMetadata());
|
|
|
+// log.info("铣面读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader5");
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取轧制读码信号
|
|
|
*/
|
|
|
public void getARollingReadingSignal() {
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.ZHAZHIPLC.getDeviceName()).readBoolean(ZhaZhiPlcEnum.ISREAD.getMetadata());
|
|
|
- log.info("轧制读码信号:{}", b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.ZHAZHIPLC.getDeviceName()).readBoolean(ZhaZhiPlcEnum.ISREAD.getMetadata());
|
|
|
+// log.info("轧制读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader6");
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取行车1读码信号
|
|
|
*/
|
|
|
public void getTheDriving1CodeReadingSignal() {
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_one.getMetadata());
|
|
|
- log.info("大散盘1号行车读码信号:{}", b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_one.getMetadata());
|
|
|
+// log.info("大散盘1号行车读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader7");
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -123,24 +125,32 @@ public class TraceJob {
|
|
|
* 获取行车4读码信号
|
|
|
*/
|
|
|
public void getTheDriving4CodeReadingSignal() {
|
|
|
- boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_fourth.getMetadata());
|
|
|
- log.info("大散盘4号行车读码信号:{}", b);
|
|
|
- if (b) {
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_fourth.getMetadata());
|
|
|
+// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader12");
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取上料读码信号
|
|
|
*/
|
|
|
public void obtainTheLoadingReadingSignal() {
|
|
|
-
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TUIHUOUPPLC.getDeviceName()).readBoolean(TuiHuoUPPlcEnum.ISREAD.getMetadata());
|
|
|
+// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
+ processRealizationService.CodeReadingProcess("CodeReader13");
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取下料读码信号
|
|
|
*/
|
|
|
public void obtainTheUnloadingReadingSignal() {
|
|
|
-
|
|
|
+// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TuiHuoDownPcl.getDeviceName()).readBoolean(TuiHuoDownPlcEnum.ISREAD.getMetadata());
|
|
|
+// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+// if (b) {
|
|
|
+ processRealizationService.CodeReadingProcess("CodeReader14");
|
|
|
+// }
|
|
|
}
|
|
|
}
|