From 6105a2d7b44ad0bf0d73d19df34158e9acff75af Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期四, 06 七月 2023 09:00:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java
index 3c7ba24..780d073 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java
@@ -6,6 +6,7 @@
 import com.ld.igds.camera.data.ApiCameraResp;
 import com.ld.igds.camera.data.ApiSnapReq;
 import com.ld.igds.constant.BizType;
+import com.ld.igds.constant.DeviceType;
 import com.ld.igds.data.SnapImgDto;
 import com.ld.igds.file.CoreFileService;
 import com.ld.igds.inout.ApiInoutManager;
@@ -420,30 +421,41 @@
     public void onReceivePlateNum(ApiInoutData data) {
 
         InoutConf conf = this.getInoutConfBySn(data.getCompanyId(), data.getDeptId(), data.getSn());
-
-        if (null == conf) return;
-
+        if (null == conf) {
+            log.error("娌℃湁鑾峰彇鍒板嚭鍏ュ簱閰嶇疆CONF锛�"+data.toString());
+            return;
+        }
+        log.info(conf.toString());
         if (0 == conf.getInOrder()) return;
 
         data = new ApiInoutData(conf);
-
-        ApiInoutService inoutApiService = apiInoutManager.getApiService(conf.getProtocol());
-
+        log.info(data.toString());
+        ApiInoutService inoutApiService = null;
+        InoutConf gateconf = null;
         //鑾峰彇杞︾墝淇℃伅锛屽紑闂告満
         if (InoutApiConstant.DEVICE_CODE_1002 == data.getDeviceCode()) {
+            gateconf = this.getWeightGateway(data.getCompanyId(), data.getDeptId(), null);
+            if (null == gateconf) {
+                log.info("----------娌℃湁鑾峰彇鍒扮О閲嶆帶鍒跺櫒--------------");
+            }
+            data = new ApiInoutData(gateconf);
             //寮�鍏ュ彛澶勯亾闂�
+            inoutApiService = apiInoutManager.getApiService(gateconf.getProtocol());
             data.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002);
             data.setActionCode(InoutApiConstant.ACTION_CODE_1);
-
             inoutApiService.gateControl(data);
         }
 
-
         if (InoutApiConstant.DEVICE_CODE_1003 == data.getDeviceCode()) {
+            gateconf = this.getWeightGateway(data.getCompanyId(), data.getDeptId(), null);
+            if (null == gateconf) {
+                log.info("----------娌℃湁鑾峰彇鍒扮О閲嶆帶鍒跺櫒--------------");
+            }
             //寮�鍏ュ彛澶勯亾闂�
+            data = new ApiInoutData(gateconf);
+            inoutApiService = apiInoutManager.getApiService(gateconf.getProtocol());
             data.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003);
             data.setActionCode(InoutApiConstant.ACTION_CODE_1);
-
             inoutApiService.gateControl(data);
         }
 
@@ -464,7 +476,7 @@
         ApiInoutData apiInoutData;
         ApiInoutService inoutApiService;
         for (InoutConf conf : listInoutConf) {
-            if (InoutConstant.CONF_TYPE_10.equals(conf.getType()) && sort.equals(conf.getSort())) {
+            if (InoutConstant.PROGRESS_WEIGHT_TAG.equals(conf.getInoutProgress())&&InoutConstant.CONF_TYPE_10.equals(conf.getType()) && sort.equals(conf.getSort())) {
                 apiInoutData = new ApiInoutData(conf);
                 inoutApiService = apiInoutManager.getApiService(conf.getProtocol());
                 inoutApiService.initLpr(apiInoutData);
@@ -515,9 +527,9 @@
         if (InoutConstant.TYPE_IN.equals(data.getType())) {
             //缁撶畻閲嶉噺澶т簬0琛ㄧず浜屾绉伴噸
             if (data.getNetWeight() > 0) {
-                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1002);
+                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002);
             } else {
-                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1003);
+                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003);
             }
             apiData.setActionCode(InoutApiConstant.ACTION_CODE_1);
 
@@ -525,9 +537,9 @@
         } else {
             //缁撶畻閲嶉噺澶т簬0琛ㄧず浜屾绉伴噸
             if (data.getNetWeight() > 0) {
-                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1003);
+                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002);
             } else {
-                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1002);
+                apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003);
             }
             apiData.setActionCode(InoutApiConstant.ACTION_CODE_1);
             inoutApiService.gateControl(apiData);

--
Gitblit v1.9.3