فهرست منبع

增加对不能回退的工单状态判断

lixing 3 سال پیش
والد
کامیت
5553ab9621
2فایلهای تغییر یافته به همراه36 افزوده شده و 1 حذف شده
  1. 1 1
      pom.xml
  2. 35 0
      src/main/java/com/persagy/dmp/starter/alarm/service/OrderStateChangeService.java

+ 1 - 1
pom.xml

@@ -11,7 +11,7 @@
     <groupId>com.persagy.dmp.starter</groupId>
     <artifactId>dmp-alarm-starter</artifactId>
 <!--    <version>4.0.0-SNAPSHOT</version>-->
-    <version>4.1.6</version>
+    <version>4.1.7</version>
     <name>dmp-alarm-starter</name>
     <description>dmp_alarm_starter</description>
 

+ 35 - 0
src/main/java/com/persagy/dmp/starter/alarm/service/OrderStateChangeService.java

@@ -47,6 +47,11 @@ public class OrderStateChangeService extends BaseService {
         // 更新报警记录状态
         for (Object alarmRecord : alarmRecords) {
             JSONObject alarmRecordObj = (JSONObject) alarmRecord;
+            // 如果报警记录中工单状态已经为处理完成,不再更新报警
+            if (workOrderDone((Integer) alarmRecordObj.get("orderState"))) {
+                continue;
+            }
+
             alarmRecordObj.put("treatState", alarmTreatState);
             alarmRecordObj.put("orderState", orderStateMessage.getOrder_state());
             alarmRecordObj.put("userId", "system");
@@ -55,6 +60,36 @@ public class OrderStateChangeService extends BaseService {
     }
 
     /**
+     * 判断工单状态是否为已完成
+     *
+     * @param workOrderState
+     * @return boolean
+     * @exception
+     * @author lixing
+     * @version V1.0 2021/9/14 6:02 下午
+     */
+    private boolean workOrderDone(Integer workOrderState) {
+        if (workOrderState == null) {
+            return false;
+        }
+        switch (workOrderState){
+            case 7:
+            case 8:
+            case 9:
+            case 10:
+                return true;
+            default:
+                return false;
+        }
+    }
+
+//    public static void main(String[] args) {
+//        OrderStateChangeService orderStateChangeService = new OrderStateChangeService();
+//        boolean b = orderStateChangeService.workOrderDone(8);
+//        System.out.println(b);
+//    }
+
+    /**
      * @description: 根据工单id获取对应的报警记录
      * @param: orderId
      * @return: JSONArray