瀏覽代碼

添加铣面、轧制工艺读码成功后上传MES系统

zhifei 1 年之前
父節點
當前提交
c654510891

+ 5 - 0
warewms-system/src/main/java/com/warewms/hailiang/connect/CodeReader5Connect.java

@@ -2,6 +2,7 @@ package com.warewms.hailiang.connect;
 
 import cn.hutool.extra.spring.SpringUtil;
 import com.github.rholder.retry.*;
+import com.warewms.hailiang.MES.MesService;
 import com.warewms.hailiang.config.CodeReadProperties;
 import com.warewms.hailiang.connect.base.TCPConnectBase;
 import com.warewms.hailiang.domain.Device;
@@ -55,12 +56,14 @@ public class CodeReader5Connect implements TCPConnectBase {
 
     private ChannelPipeline pipeline;
 
+    private MesService mesService;
 
     private RetroactiveNowService retroactiveNowService;
 
     private PlcConnectServiceRunner plcConnectServiceRunner;
 
     {
+        mesService = SpringUtil.getBean(MesService.class);
         retroactiveNowService = SpringUtil.getBean(RetroactiveNowService.class);
         plcConnectServiceRunner = SpringUtil.getBean(PlcConnectServiceRunner.class);
     }
@@ -175,6 +178,8 @@ public class CodeReader5Connect implements TCPConnectBase {
                 retroactiveNow.setDeviceId("Z1_XiMian_DMQ-1-27.5");
                 retroactiveNowService.updateData(retroactiveNow);
                 plcConnectServiceRunner.getPlcServer(DeviceNameEnum.XIMIANPLC.getDeviceName()).writeBoolean(XiMianPlcEnum.ISREAD.getMetadata(), false);
+                //上传ME系统
+                mesService.processFeedback(message,"1");
                 //添加设备日志
                 SpringUtil.getApplicationContext().publishEvent(new DeviceLog("Z1_XiMian_DMQ-1-27.5", deviceName, "识别到码:" + message, "1"));
             }

+ 6 - 0
warewms-system/src/main/java/com/warewms/hailiang/connect/CodeReader6Connect.java

@@ -2,6 +2,7 @@ package com.warewms.hailiang.connect;
 
 import cn.hutool.extra.spring.SpringUtil;
 import com.github.rholder.retry.*;
+import com.warewms.hailiang.MES.MesService;
 import com.warewms.hailiang.config.CodeReadProperties;
 import com.warewms.hailiang.connect.base.TCPConnectBase;
 import com.warewms.hailiang.domain.Device;
@@ -52,9 +53,12 @@ public class CodeReader6Connect implements TCPConnectBase {
 
     private ChannelPipeline pipeline;
 
+    private MesService mesService;
+
     private RetroactiveNowService retroactiveNowService;
 
     {
+        mesService = SpringUtil.getBean(MesService.class);
         retroactiveNowService = SpringUtil.getBean(RetroactiveNowService.class);
     }
     @Override
@@ -163,6 +167,8 @@ public class CodeReader6Connect implements TCPConnectBase {
                 retroactiveNow.setStatus("4");
                 retroactiveNow.setDeviceId("Z1_ZhaZhi_DMQ-1-27.6");
                 retroactiveNowService.updateData(retroactiveNow);
+                //上传ME系统
+                mesService.processFeedback(message,"2");
                 //添加设备日志
                 SpringUtil.getApplicationContext().publishEvent(new DeviceLog("Z1_ZhaZhi_DMQ-1-27.6", deviceName, "识别到码:" + message, "1"));
             }