Explorar o código

完善倒角plc的对接

zhifei hai 1 ano
pai
achega
51ebbc94fe

+ 3 - 2
warewms-system/src/main/java/com/warewms/hailiang/connect/CodeReader3Connect.java

@@ -168,6 +168,7 @@ public class CodeReader3Connect implements TCPConnectBase {
         try {
             log.info("倒角机读码器读码结果,{}", message);
             if (CodeReadProperties.failureReturnInstruction.equals(message)) {
+                plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeInt32(DaoJiaoPlcEnum.RETURNOUTCOME.getMetadata(), 19);
                 //读码失败
                 SpringUtil.getApplicationContext().publishEvent(new DeviceLog("Z1_DaoJia_DMQ-1-27.3", deviceName, "未识别到码", "2"));
                 return;
@@ -181,8 +182,8 @@ public class CodeReader3Connect implements TCPConnectBase {
             //上传MES系统
             mesService.getBatchNoResult(message, true);
             //回写PLC读码完成
-            plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeBoolean(DaoJiaoPlcEnum.RETURNOUTCOME.getMetadata(), false);
-
+            plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeInt32(DaoJiaoPlcEnum.RETURNOUTCOME.getMetadata(), 18);
+            plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeInt32(DaoJiaoPlcEnum.READCODE.getMetadata(), 0);
             //添加日志
             SpringUtil.getApplicationContext().publishEvent(new DeviceLog("Z1_DaoJia_DMQ-1-27.3", deviceName, "识别到码:" + message, "1"));
         } catch (Exception e) {

+ 7 - 4
warewms-system/src/main/java/com/warewms/hailiang/enums/DaoJiaoPlcEnum.java

@@ -8,14 +8,17 @@ public enum DaoJiaoPlcEnum {
     /**
      * 验证喷码机喷码内容
      */
-    CHECKFINISH("Q1.6"),
+    CHECKFINISH("VB470"),
 
     /**
-     *
+     * 读码消息
      */
-    READCODE("Q1.7"),
+    READCODE("VB472"),
 
-    RETURNOUTCOME("");
+    /**
+     * 读码反馈
+     */
+    RETURNOUTCOME("VB472");
 
     private String metadata;
 

+ 33 - 33
warewms-system/src/main/java/com/warewms/hailiang/job/TraceJob.java

@@ -6,7 +6,6 @@ import com.warewms.hailiang.init.PlcConnectServiceRunner;
 import com.warewms.hailiang.init.TcpServiceRunner;
 import com.warewms.hailiang.service.ProcessRealizationService;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -55,11 +54,12 @@ public class TraceJob {
      * 获取喷码信号
      */
     public void getTheChamferCompletionSignal() {
-//        boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
-//        log.info("喷码信号:{}", b);
-//        if (b) {
+        Integer i = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readInt32(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
+        log.info("喷码信号:{}", i);
+        if (i.equals(6)) {
             processRealizationService.DaoJiaoCodingCodeProcess();
-//        }
+            plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeInt32(DaoJiaoPlcEnum.CHECKFINISH.getMetadata(),0);
+        }
     }
 
     /**
@@ -67,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) {
+        Integer i = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readInt32(DaoJiaoPlcEnum.READCODE.getMetadata());
+        log.info("倒角机读码信号,{}",i);
+        if (i.equals(16)) {
             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");
-//        }
+        }
     }
 
     /**
@@ -125,32 +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) {
+        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) {
+        boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TuiHuoDownPcl.getDeviceName()).readBoolean(TuiHuoDownPlcEnum.ISREAD.getMetadata());
+        log.info("大散盘4号行车读码信号:{}", b);
+        if (b) {
             processRealizationService.CodeReadingProcess("CodeReader14");
-//        }
+        }
     }
 }

+ 1 - 0
warewms-system/src/main/java/com/warewms/hailiang/service/impl/RetroactiveHistoryServiceImpl.java

@@ -29,6 +29,7 @@ public class RetroactiveHistoryServiceImpl extends ServiceImpl<RetroactiveHistor
     @Override
     public TableDataInfo<RetroactiveHistory> getListByPage(RetroactiveHistory retroactiveHistory, PageDomain pageDomain) {
         return TableDataInfo.build(retroactiveHistoryMapper.selectPage(pageDomain.build(),new LambdaQueryWrapper<RetroactiveHistory>()
+                .like(StringUtils.isNotEmpty(retroactiveHistory.getRetroactiveId()),RetroactiveHistory::getRetroactiveId,retroactiveHistory.getRetroactiveId())
                 .like(StringUtils.isNotEmpty(retroactiveHistory.getProductionLine()),RetroactiveHistory::getProductionLine,retroactiveHistory.getProductionLine())
                 .like(StringUtils.isNotEmpty(retroactiveHistory.getBatchNo()),RetroactiveHistory::getBatchNo,retroactiveHistory.getBatchNo())
                 .like(StringUtils.isNotEmpty(retroactiveHistory.getLotNo()),RetroactiveHistory::getLotNo,retroactiveHistory.getLotNo())