From 72ef2381eaa9672fe87f72415b5c827fa88155f8 Mon Sep 17 00:00:00 2001
From: zhangchao <zc857179121@qq.com>
Date: 星期二, 12 十一月 2024 10:57:43 +0800
Subject: [PATCH] 1

---
 src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
index adfe4fc..88a8d08 100644
--- a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
@@ -59,6 +59,8 @@
 
     @Value("${agvBasDev.maxWorkNum}")
     private int maxWrokNum;
+    @Value("${mes.report}")
+    private Boolean flag;
     @Value("${mes.url}")
     private String url;
     @Value("${mes.getTokenUrl}")
@@ -353,11 +355,7 @@
         }
         //TODO
         //鏆傛椂鍔犱笂trycatch
-        try {
-            reportMes(agvWrkMast, agvWrkDetlListOld);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        reportMes(agvWrkMast, agvWrkDetlListOld);
         return SUCCESS;
     }
 
@@ -517,7 +515,7 @@
             log.error("" + e.getMessage());
         }
         //TODO 寮犺秴
-        //reportMes(agvWrkMast, agvWrkDetlListOld);
+        reportMes(agvWrkMast, agvWrkDetlListOld);
         return SUCCESS;
     }
 
@@ -542,7 +540,7 @@
             return SUCCESS;
         } catch (Exception e) {
             //TODO
-            //log.error("淇敼AGV鍏ュ簱閫氱煡妗g姸鎬佸叆鍑虹姸鎬佷负Y" + e.getMessage());
+            log.error("淇敼AGV鍏ュ簱閫氱煡妗g姸鎬佸叆鍑虹姸鎬佷负Y" + e.getMessage());
         }
         return FAIL;
     }
@@ -692,6 +690,9 @@
     }
 
     private void reportMes(AgvWrkMast agvWrkMast, List<AgvWrkDetl> agvWrkDetls) {
+        if (!flag){
+            return;
+        }
         if (Cools.isEmpty(agvWrkDetls)) {
             return;
         }
@@ -870,7 +871,7 @@
             if (Cools.isEmpty(jsonObject.get("code")) || Integer.parseInt(jsonObject.get("code").toString()) != 200) {
                 log.info("mes鎺ュ彛璋冪敤澶辫触锛岃繑鍥炰俊鎭細" + jsonObject);
                 //TODO 寮犺秴
-                //throw new CoolException("mes鎺ュ彛璋冪敤澶辫触锛岃繑鍥炰俊鎭�:" + jsonObject);
+                throw new CoolException("mes鎺ュ彛璋冪敤澶辫触锛岃繑鍥炰俊鎭�:" + jsonObject);
             }
             success = true;
             return jsonObject;

--
Gitblit v1.9.1