Forráskód Böngészése

救生衣逻辑修改:穿救生衣等级高于未穿救生衣等级

John 1 hónapja
szülő
commit
5069eddff0

+ 11 - 11
download-center-server/src/main/java/com/shanghaichengdi/downloadcenterserver/faced/AnalyseFaced.java

@@ -218,14 +218,14 @@ public class AnalyseFaced {
       JSONObject jsonObject = JSONObject.parseObject(responseBody);
       List<Object> strings = JSONArray.parseArray(jsonObject.get("result").toString());
       JSONObject jsonObject1 = JSONObject.parseObject(strings.get(0).toString());
-      if(String.valueOf(1).equals(jsonObject1.get("is_wear").toString())) {
-        // 如果whetherWearLifejacket为1
-        resultMap.put("1",responseBody);
-//        result = responseBody;
-        break;
+      if(String.valueOf(0).equals(jsonObject1.get("is_wear").toString())) {
         // 如果whetherWearLifejacket为0
-      } else if (String.valueOf(0).equals(jsonObject1.get("is_wear").toString())) {
         resultMap.put("0",responseBody);
+//        result = responseBody;
+        break;
+        // 如果whetherWearLifejacket为1
+      } else if (String.valueOf(1).equals(jsonObject1.get("is_wear").toString())) {
+        resultMap.put("1",responseBody);
 //        result = responseBody;
       } else {
         // 如果whetherWearLifejacket为空值(2)
@@ -234,16 +234,16 @@ public class AnalyseFaced {
 //        result = responseBody;
       }
     };
-    //等级排序:1>0>2
+    //等级排序:0>1>2
     if (resultMap.get("2") != null){
       result = resultMap.get("2");
     }
-    if (resultMap.get("0") != null){
-      result = resultMap.get("0");
-    }
-    if (resultMap.get("1") != null) {
+    if (resultMap.get("1") != null){
       result = resultMap.get("1");
     }
+    if (resultMap.get("0") != null) {
+      result = resultMap.get("0");
+    }
 //    log.info("救生衣分析最终结果:{}", result);
     // 调用云上覆盖物/国旗/救生衣接收接口
     Map<String, Object> yunParam = new LinkedHashMap<>();