15928045575 2 سال پیش
والد
کامیت
1d1ece95c9

+ 12 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/DictItemEnum.java

@@ -48,4 +48,16 @@ public enum DictItemEnum {
         }
         return DictItemEnum.ALTITUDE_NULL;
     }
+
+    public static int getHasBool(String value) {
+        for (DictItemEnum entry : values()) {
+            if(!Objects.isNull(entry.getValue())){
+                if (entry.getValue().equals(value)) {
+                    return 1;
+                }
+            }
+
+        }
+        return 0;
+    }
 }

+ 2 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -202,4 +202,6 @@ public class HttpStatus {
 
     public static final String INTEGRATION_EXISTS = "集成要素名称已存在,不可重复!";
 
+    public static final String INTEGRATION_SAME_PART_EXISTS = "集成要素不能与基础要素名称相同!";
+
 }

+ 6 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/BackTrackService.java

@@ -171,7 +171,9 @@ public class BackTrackService {
             if(Objects.nonNull(intergData)){
                 for (DeviceIntegrationVo listvo : intergData){
                     listm = commonService.returnIntegrationDataArray(snCode,dateStart,dateEnd,listvo,"rawId","val");
+                    Collections.reverse(listm);
                     map.put(listvo.getIntegrationName(),listm);
+
                 }
             }
             return HttpResult.ok(map);
@@ -255,6 +257,7 @@ public class BackTrackService {
         if(Objects.nonNull(intergData)){
             for (DeviceIntegrationVo listvo : intergData){
                 listm = commonService.returnIntegrationDataArray(snCode,dateStart,dateEnd,listvo,"time","offset");
+                Collections.reverse(listm);
                 mapList.put(listvo.getIntegrationName(),listm);
             }
         }
@@ -327,6 +330,9 @@ public class BackTrackService {
         if (!Objects.isNull(has)) {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.INTEGRATION_EXISTS);
         }
+        if(DictItemEnum.getHasBool(vo.getIntegrationName()) == 1){
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.INTEGRATION_SAME_PART_EXISTS);
+        }
         HeaderData headerData = commonService.getHeaderData(request);
         KwsIntegration integration = new KwsIntegration();
         BeanUtils.copyProperties(vo, integration);