From 77069d2c1cc1aa57555ccb236de39a6277e6e595 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期三, 05 七月 2023 02:45:02 +0800
Subject: [PATCH] 增加海康SDK,整理自动抬干业务逻辑

---
 igds-inout/src/main/java/com/ld/igds/inout/manager/InoutEventControlManager.java |  172 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 91 insertions(+), 81 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 3002c16..3c7ba24 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
@@ -69,20 +69,16 @@
 
         //濡傛灉浣跨敤鐨勬槸鍦扮鎻掍欢鑾峰彇锛屽垯闇�瑕佽皟鏁磋澶囦负鍦扮鎻掍欢淇℃伅
         if (ProtocolEnum.TCP_FZZY_WEIGHT.getCode().equals(param.getProtocol())) {
-
             InoutConf conf = this.getInoutConf(param.getCompanyId(), param.getDeptId(), param.getSort(), InoutConstant.CONF_TYPE_70);
             if (null == conf) {
                 param.setErrorMsg("娌℃湁鑾峰彇鍒板綋鍓嶅崗璁彃浠堕厤缃厤缃俊鎭紝鑾峰彇澶辫触");
                 return param;
             }
-
-
             param.setIp(conf.getIp());
             param.setPort(conf.getPort());
             param.setProtocol(conf.getProtocol());
 
             return apiInoutManager.getApiService(param.getProtocol()).getPlateNum(param);
-
         }
 
         return apiInoutManager.getApiService(param.getProtocol()).getPlateNum(param);
@@ -96,6 +92,20 @@
      * @return
      */
     public ApiInoutData getIcCardNum(ApiInoutData param) {
+
+        //濡傛灉浣跨敤鐨勬槸鍦扮鎻掍欢鑾峰彇锛屽垯闇�瑕佽皟鏁磋澶囦负鍦扮鎻掍欢淇℃伅
+        if (ProtocolEnum.TCP_FZZY_WEIGHT.getCode().equals(param.getProtocol())) {
+            InoutConf conf = this.getInoutConf(param.getCompanyId(), param.getDeptId(), param.getSort(), InoutConstant.CONF_TYPE_70);
+            if (null == conf) {
+                param.setErrorMsg("娌℃湁鑾峰彇鍒板綋鍓嶅崗璁彃浠堕厤缃厤缃俊鎭紝鑾峰彇澶辫触");
+                return param;
+            }
+            param.setIp(conf.getIp());
+            param.setPort(conf.getPort());
+            param.setProtocol(conf.getProtocol());
+
+            return apiInoutManager.getApiService(param.getProtocol()).getIcCardNum(param);
+        }
 
         return apiInoutManager.getApiService(param.getProtocol()).getIcCardNum(param);
     }
@@ -121,23 +131,23 @@
      * @param param
      * @return
      */
-    public String noticeWeightDone(ApiInoutData param) {
-        //鑾峰彇绉伴噸涓绘帶鍣ㄩ厤缃�
-        InoutConf conf = getWeightGateway(param.getCompanyId(), param.getDeptId(), param.getSort());
-
-        if (null == conf) {
-            return "绉伴噸涓绘帶鏈厤缃紝鏀寔澶辫触";
-        }
-
-        ApiInoutData apiData = new ApiInoutData(conf);
-        apiData.setPlateNum(param.getPlateNum());
-        apiData.setTime(new Date());
-
-        ApiInoutService inoutApiService = apiInoutManager.getApiService(conf.getProtocol());
-
-        // return inoutApiService.noticeWeightDone(apiData); TODO
-        return null;
-    }
+//    public String noticeWeightDone(ApiInoutData param) {
+//        //鑾峰彇绉伴噸涓绘帶鍣ㄩ厤缃�
+//        InoutConf conf = getWeightGateway(param.getCompanyId(), param.getDeptId(), param.getSort());
+//
+//        if (null == conf) {
+//            return "绉伴噸涓绘帶鏈厤缃紝鏀寔澶辫触";
+//        }
+//
+//        ApiInoutData apiData = new ApiInoutData(conf);
+//        apiData.setPlateNum(param.getPlateNum());
+//        apiData.setTime(new Date());
+//
+//        ApiInoutService inoutApiService = apiInoutManager.getApiService(conf.getProtocol());
+//
+//        // return inoutApiService.noticeWeightDone(apiData); TODO
+//        return null;
+//    }
 
     /**
      * 鍑哄叆搴撴姄鎷�
@@ -175,73 +185,73 @@
      *
      * @param snapImgDto
      */
-    private void noticeGatewayWeightInfo(SnapImgDto snapImgDto) {
-
-        log.debug("-------------鐢ㄦ埛纭绉伴噸----閫氱煡绉伴噸缃戝叧----{}", snapImgDto.getWeight());
-        InoutConf conf = this.getWeightGateway(snapImgDto.getCompanyId(), snapImgDto.getDeptId(), snapImgDto.getSort());
-
-        if (null == conf) {
-            log.info("-------------鐢ㄦ埛纭绉伴噸----閫氱煡绉伴噸缃戝叧---鏈厤缃綉鍏�----");
-            return;
-        }
-
-        ApiInoutData apiData = new ApiInoutData(conf);
-        apiData.setTime(new Date());
-        apiData.setRepeat(2);
-        apiData.setWeight(snapImgDto.getWeight());
-        apiData.setPlateNum(snapImgDto.getPlateNum());
-        //绉伴噸淇℃伅鏆傛椂鍙栨秷鎾斁
-//        apiData.setMsg("褰撳墠绉伴噸锛�" + apiData.getWeight() + "鍗冨厠");
-        apiData.setMsg("绉伴噸宸插畬鎴�");
-
-//        apiInoutManager.getApiService(apiData.getProtocol()).noticeWeightDone(apiData);
-        //  apiInoutManager.getApiService(apiData.getProtocol()).noticeRadio(apiData);
-    }
+//    private void noticeGatewayWeightInfo(SnapImgDto snapImgDto) {
+//
+//        log.debug("-------------鐢ㄦ埛纭绉伴噸----閫氱煡绉伴噸缃戝叧----{}", snapImgDto.getWeight());
+//        InoutConf conf = this.getWeightGateway(snapImgDto.getCompanyId(), snapImgDto.getDeptId(), snapImgDto.getSort());
+//
+//        if (null == conf) {
+//            log.info("-------------鐢ㄦ埛纭绉伴噸----閫氱煡绉伴噸缃戝叧---鏈厤缃綉鍏�----");
+//            return;
+//        }
+//
+//        ApiInoutData apiData = new ApiInoutData(conf);
+//        apiData.setTime(new Date());
+//        apiData.setRepeat(2);
+//        apiData.setWeight(snapImgDto.getWeight());
+//        apiData.setPlateNum(snapImgDto.getPlateNum());
+//        //绉伴噸淇℃伅鏆傛椂鍙栨秷鎾斁
+////        apiData.setMsg("褰撳墠绉伴噸锛�" + apiData.getWeight() + "鍗冨厠");
+//        apiData.setMsg("绉伴噸宸插畬鎴�");
+//
+////        apiInoutManager.getApiService(apiData.getProtocol()).noticeWeightDone(apiData);
+//        //  apiInoutManager.getApiService(apiData.getProtocol()).noticeRadio(apiData);
+//    }
 
     /**
      * 鏂板鐧藉悕鍗曠粰浣忔帶鍒跺櫒锛岄渶瑕佹敞鎰忕殑鏄紝鐧昏鏃跺�欎笉纭浣跨敤鍝釜鍦扮绯荤粺锛屽鏋滅郴缁熼厤缃涓富鎺у櫒锛岄渶瑕佸悓姝ュ叏閮ㄦ帹閫�
      *
      * @param imgDto
      */
-    private void noticeGatewayAddWhitePlate(SnapImgDto imgDto) {
+//    private void noticeGatewayAddWhitePlate(SnapImgDto imgDto) {
+//
+//        List<InoutConf> list = this.getWeightGateway(imgDto.getCompanyId(), imgDto.getDeptId());
+//
+//        if (null == list || list.isEmpty()) {
+//            log.info("-------------绉伴噸缃戝叧澧炲姞鐧藉悕鍗�----娌℃湁鑾峰彇鍒扮綉鍏抽厤缃�-----鍙栨秷鎵ц---");
+//            return;
+//        }
+//
+//        log.debug("-------------鐧昏瀹屾垚锛屽鍔犺溅鐗岀櫧鍚嶅崟-----------{}", imgDto.getPlateNum());
+//
+//        ApiInoutService inoutApiService = apiInoutManager.getApiService(list.get(0).getProtocol());
+//
+//        ApiInoutData apiData;
+//        for (InoutConf conf : list) {
+//            apiData = new ApiInoutData(conf);
+//            apiData.setPlateNum(imgDto.getPlateNum());
+//            // inoutApiService.addWhitePlate(apiData);
+//        }
+//    }
 
-        List<InoutConf> list = this.getWeightGateway(imgDto.getCompanyId(), imgDto.getDeptId());
-
-        if (null == list || list.isEmpty()) {
-            log.info("-------------绉伴噸缃戝叧澧炲姞鐧藉悕鍗�----娌℃湁鑾峰彇鍒扮綉鍏抽厤缃�-----鍙栨秷鎵ц---");
-            return;
-        }
-
-        log.debug("-------------鐧昏瀹屾垚锛屽鍔犺溅鐗岀櫧鍚嶅崟-----------{}", imgDto.getPlateNum());
-
-        ApiInoutService inoutApiService = apiInoutManager.getApiService(list.get(0).getProtocol());
-
-        ApiInoutData apiData;
-        for (InoutConf conf : list) {
-            apiData = new ApiInoutData(conf);
-            apiData.setPlateNum(imgDto.getPlateNum());
-            // inoutApiService.addWhitePlate(apiData);
-        }
-    }
-
-    public void noticeProgressComplete(InoutData data) {
-        log.debug("-----------------閫氱煡绉伴噸涓绘帶--------娴佺▼缁撴潫鍒犻櫎鐧藉悕鍗�");
-        List<InoutConf> list = this.getWeightGateway(data.getCompanyId(), data.getDeptId());
-
-        if (null == list || list.isEmpty()) {
-            return;
-        }
-
-        ApiInoutService inoutApiService = apiInoutManager.getApiService(list.get(0).getProtocol());
-
-        ApiInoutData apiData;
-        for (InoutConf conf : list) {
-            apiData = new ApiInoutData(conf);
-            apiData.setPlateNum(data.getPlateNum());
-
-            // inoutApiService.delWhitePlate(apiData); TODO
-        }
-    }
+//    public void noticeProgressComplete(InoutData data) {
+//        log.debug("-----------------閫氱煡绉伴噸涓绘帶--------娴佺▼缁撴潫鍒犻櫎鐧藉悕鍗�");
+//        List<InoutConf> list = this.getWeightGateway(data.getCompanyId(), data.getDeptId());
+//
+//        if (null == list || list.isEmpty()) {
+//            return;
+//        }
+//
+//        ApiInoutService inoutApiService = apiInoutManager.getApiService(list.get(0).getProtocol());
+//
+//        ApiInoutData apiData;
+//        for (InoutConf conf : list) {
+//            apiData = new ApiInoutData(conf);
+//            apiData.setPlateNum(data.getPlateNum());
+//
+//            // inoutApiService.delWhitePlate(apiData); TODO
+//        }
+//    }
 
     /**
      * 璋冪敤鎺ュ彛杩涜鎶撴媿

--
Gitblit v1.9.3