15928045575 2 лет назад
Родитель
Сommit
94ccf73c27

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceReference.java

@@ -27,6 +27,8 @@ public class KwsDeviceReference implements Serializable {
     */
     private String item;
 
+
+
     private String mountainId;
 
     /**

+ 3 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/tdengine/SlopeData.java

@@ -17,14 +17,15 @@ import java.util.Date;
 public class SlopeData implements Serializable {
     //ts|raw_id|tslver_id|guid|line|val|create_time|msg_id|name|
 //    SELECT ts, raw_id, tslver_id, guid, line, val, create_time, msg_idmsg_id, name
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date ts;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date rawId;
     private int tslverId;
     private String guid;
     private String line;
     private String val;
+
     private String msgId;
     private String jsonText;
     private String name;

+ 2 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ThresholdBean.java

@@ -18,6 +18,6 @@ public class ThresholdBean implements Serializable {
      */
 
     private int level;
-    private long max;
-    private long min;
+    private String max;
+    private String min;
 }

+ 13 - 5
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/BackTrackService.java

@@ -20,6 +20,7 @@ import com.sckw.slope.detection.model.dos.tdengine.InsTables;
 import com.sckw.slope.detection.model.dos.tdengine.SlopeData;
 import com.sckw.slope.detection.model.dto.DeviceDataDTO;
 import com.sckw.slope.detection.model.dto.HeaderData;
+import com.sckw.slope.detection.model.dto.SystemDict;
 import com.sckw.slope.detection.model.param.IntegrationQuery;
 import com.sckw.slope.detection.model.vo.IntegrationVo;
 import jakarta.servlet.http.HttpServletRequest;
@@ -88,6 +89,13 @@ public class BackTrackService {
                 .eq(KwsDeviceReference::getDelFlag, NumberConstant.ZERO)
                 .groupBy(KwsDeviceReference::getItem)
         );
+        Map<String, SystemDict> dictList = commonService.getDictList(null, new HashMap<>() {{
+            put("code", DictEnum.MODEL_PART.getCodeType());
+            put("type", "1");
+        }});
+        for (KwsDeviceReference re : references){
+
+        }
         return HttpResult.ok(references);
     }
 
@@ -133,11 +141,11 @@ public class BackTrackService {
             List<SlopeData> selectedData = slopeDataMapper.selectLineListByArray(snCode, arr, dateStart, dateEnd);
             Map<String,List<Object>>  map = new HashMap<>();
 
-            if (CollectionUtils.isEmpty(selectedData)) {
+            if (Objects.isNull(selectedData)) {
                 map = commonService.getDateByNull(dateStart,dateEnd,arr);
                 return HttpResult.ok(map);
             }
-
+            Collections.reverse(selectedData);
             for(SlopeData slop : selectedData){
                 if(slop.getLine().equals(DictItemEnum.getData(slop.getLine()).getValue())){
                     List<Object> list = new ArrayList<>();
@@ -202,8 +210,8 @@ public class BackTrackService {
                 for (SlopeData message : selected) {
                     String line = message.getLine();
                     String val1 = message.getVal();
-                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH");
-                    String key = format.format(message.getTs());
+                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    String key = format.format(message.getRawId());
                     BigDecimal subtract = new BigDecimal(val1).subtract(currentValue);
                     if (DictItemEnum.LONGITUDE_X.getValue().equals(element.getItem())) {//如果是X轴
                         double cosValue = Math.cos(angleInRadians);
@@ -221,7 +229,7 @@ public class BackTrackService {
                     temp.put("offset",offsetValue);
                     datemap.add(temp);
                 }
-
+                Collections.reverse(datemap);
             }
             mapList.put(element.getItem(), datemap);
         }

+ 15 - 13
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -223,19 +223,21 @@ public class DeviceService {
         //新增到数据表kws_device_Integration
         KwsDeviceIntegration deIntergration = new KwsDeviceIntegration();
         String[] temp;//接收分割后的数组
-        temp = deviceAdd.getIntegrationId().split(Global.COMMA);
-        for (int i = 0; i < temp.length; i++) {
-            long interId = new IdWorker(NumberConstant.ONE).nextId();
-            deIntergration.setId(interId);
-            deIntergration.setDeviceId(id);
-            deIntergration.setMountainId(headerData.getMountainId());
-            deIntergration.setIntegrationId(Long.parseLong(temp[i]));
-            deIntergration.setCreateBy(Long.parseLong(headerData.getCreateBy()));
-            deIntergration.setCreateTime(now);
-            deIntergration.setStatus(NumberConstant.ZERO);
-            deIntergration.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
-            deIntergration.setUpdateTime(now);
-            deviceIntegrationMapper.insert(deIntergration);
+        if(Objects.nonNull(deviceAdd.getIntegrationId())){
+            temp = deviceAdd.getIntegrationId().split(Global.COMMA);
+            for (int i = 0; i < temp.length; i++) {
+                long interId = new IdWorker(NumberConstant.ONE).nextId();
+                deIntergration.setId(interId);
+                deIntergration.setDeviceId(id);
+                deIntergration.setMountainId(headerData.getMountainId());
+                deIntergration.setIntegrationId(Long.parseLong(temp[i]));
+                deIntergration.setCreateBy(Long.parseLong(headerData.getCreateBy()));
+                deIntergration.setCreateTime(now);
+                deIntergration.setStatus(NumberConstant.ZERO);
+                deIntergration.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
+                deIntergration.setUpdateTime(now);
+                deviceIntegrationMapper.insert(deIntergration);
+            }
         }
         //新增log
         //获取新增设备的型号

+ 46 - 46
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java

@@ -314,8 +314,8 @@ public class ThresholdService {
             for (KwsThreshold threshold : kwsThreshold) {
                 ThresholdBean bean = new ThresholdBean();
                 bean.setLevel(threshold.getLevel());
-                bean.setMax(Integer.valueOf(threshold.getMax()));
-                bean.setMin(Integer.valueOf(threshold.getMin()));
+                bean.setMax(threshold.getMax());
+                bean.setMin(threshold.getMin());
                 beanList.add(bean);
             }
             vo.setThreshold(beanList);
@@ -342,7 +342,7 @@ public class ThresholdService {
         }
         //页面阈值等级校验
         //当前使用阈值123级硬编码校验
-        checkThresholdLevel(configurationDTO, headerData);
+        //checkThresholdLevel(configurationDTO, headerData);
         //后期阈值等级扩容可调用此方法
         //checkLevelMax(threshold, configurationDTO, headerData);
         for (ThresholdBean thresholdBean : threshold) {
@@ -420,24 +420,24 @@ public class ThresholdService {
                 String min = twoKwsThreshold.getMin();
                 if (min.contains("-")) {
 //                    min = StringUtils.deleteCharString(min, "-");
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("一级最小值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("一级最小值阈值设置数据填写错误");
                     }
                 }
                 String max = twoKwsThreshold.getMax();
                 if (max.contains("-")) {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("一级最大值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("一级最大值阈值设置数据填写错误");
                     }
@@ -446,24 +446,24 @@ public class ThresholdService {
             if (threeKwsThreshold != null) {
                 String min = threeKwsThreshold.getMin();
                 if (min.contains("-")) {
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("一级最小值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("一级最小值阈值设置数据填写错误");
                     }
                 }
                 String max = threeKwsThreshold.getMax();
                 if (max.contains("-")) {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("一级最大值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("一级最大值阈值设置数据填写错误");
                     }
@@ -476,12 +476,12 @@ public class ThresholdService {
                 String min = oneKwsThreshold.getMin();
                 if (min.contains("-")) {
 //                    min = StringUtils.deleteCharString(min, "-");
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("二级最小值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("阈值设置数据填写错误");
                     }
@@ -489,12 +489,12 @@ public class ThresholdService {
                 String max = oneKwsThreshold.getMax();
                 if (max.contains("-")) {
 //                    min = StringUtils.deleteCharString(min, "-");
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) < thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("阈值设置数据填写错误");
                     }
@@ -503,24 +503,24 @@ public class ThresholdService {
             if (threeKwsThreshold != null) {
                 String min = threeKwsThreshold.getMin();
                 if (min.contains("-")) {
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("二级最小级阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("二级最小级阈值设置数据填写错误");
                     }
                 }
                 String max = threeKwsThreshold.getMax();
                 if (max.contains("-")) {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("二级最大值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) > thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("二级最大值阈值设置数据填写错误");
                     }
@@ -532,24 +532,24 @@ public class ThresholdService {
             if (oneKwsThreshold != null) {
                 String min = oneKwsThreshold.getMin();
                 if (min.contains("-")) {
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("三级最小值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) < thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("三级最小值阈值设置数据填写错误");
                     }
                 }
                 String max = oneKwsThreshold.getMax();
                 if (max.contains("-")) {
-                    if (Long.parseLong(max) < thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("三级最大值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) < thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("三级最大值阈值设置数据填写错误");
                     }
@@ -558,24 +558,24 @@ public class ThresholdService {
             if (twoKwsThreshold != null) {
                 String min = twoKwsThreshold.getMin();
                 if (min.contains("-")) {
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("三级最小值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(min) > thresholdBean.getMin()) {
+                    if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
                         throw new BusinessException("三级最小值阈值设置数据填写错误");
                     }
                 }
                 String max = twoKwsThreshold.getMax();
                 if (max.contains("-")) {
-                    if (thresholdBean.getMax() > Long.parseLong(max)) {
+                    if (Double.parseDouble(thresholdBean.getMax()) > Double.parseDouble(max)) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("三级最大值阈值设置数据填写错误");
                     }
                 } else {
-                    if (Long.parseLong(max) < thresholdBean.getMax()) {
+                    if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
                         log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
                         throw new BusinessException("三级最大值阈值设置数据填写错误");
                     }
@@ -605,21 +605,21 @@ public class ThresholdService {
             String min = String.valueOf(thresholdBeanTwo.getMin());//10
             String max = String.valueOf(thresholdBeanTwo.getMax());//90
             if (thresholdBeanThree != null) {
-                long minThree = thresholdBeanThree.getMin();//8
+                double minThree = Double.parseDouble(thresholdBeanThree.getMin());//8
 //                if (minThree.contains("-")) {
 //                    minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
 //                }
-                long maxThree = thresholdBeanThree.getMax();//80
-                if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(maxThree)) < 0) {
+                double maxThree = Double.parseDouble(thresholdBeanThree.getMax());//80
+                if (max.compareTo(String.valueOf(maxThree)) < 0) {
                     throw new BusinessException("阈值填写错误");
                 }
                 if (min.contains("-")) {
 //                min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");//-10
-                    if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(minThree)) > 0) {
+                    if (min.compareTo(String.valueOf(maxThree)) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 } else {
-                    if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(minThree)) > 0) {
+                    if (min.compareTo(String.valueOf(maxThree)) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 }
@@ -628,16 +628,16 @@ public class ThresholdService {
             if (thresholdBeanOne != null) {
                 String minOne = String.valueOf(thresholdBeanOne.getMin()); //15
                 String maxThree = String.valueOf(thresholdBeanOne.getMax());//100
-                if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) > 0) {
+                if (max.compareTo(maxThree) > 0) {
                     throw new BusinessException("阈值填写错误");
                 }
                 if (minOne.contains("-")) {
 //                    minOne = com.sckw.core.utils.StringUtils.deleteCharString(minOne, "-");//-15
-                    if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(minOne))) < 0) {
+                    if (min.compareTo(minOne) < 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 } else {
-                    if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(minOne))) < 0) {
+                    if (min.compareTo(minOne) < 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 }
@@ -647,18 +647,18 @@ public class ThresholdService {
             String minThree = String.valueOf(thresholdBeanThree.getMin());//8
             String maxThree = String.valueOf(thresholdBeanThree.getMax());//80
             if (thresholdBeanTwo != null) {
-                long twoMax = thresholdBeanTwo.getMax();//90
-                long twoMin = thresholdBeanTwo.getMin();//-10
-                if (BigDecimal.valueOf(twoMax).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) < 0) {
+                double twoMax = Double.parseDouble(thresholdBeanTwo.getMax());//90
+                double twoMin = Double.parseDouble(thresholdBeanTwo.getMin());//-10
+                if (String.valueOf(twoMax).compareTo(maxThree) < 0) {
                     throw new BusinessException("阈值填写错误");
                 }
                 if (minThree.contains("-")) {
 //                    minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
-                    if (BigDecimal.valueOf(twoMin).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
+                    if (String.valueOf(twoMin).compareTo(minThree) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 } else {
-                    if (BigDecimal.valueOf(twoMin).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
+                    if (String.valueOf(twoMin).compareTo(minThree) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 }
@@ -670,16 +670,16 @@ public class ThresholdService {
             if (thresholdBeanOne != null) {
                 String oneMax = String.valueOf(thresholdBeanOne.getMax());//100
                 String oneMin = String.valueOf(thresholdBeanOne.getMin());//-15
-                if (BigDecimal.valueOf(Long.parseLong(oneMax)).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) < 0) {
+                if (oneMax.compareTo(maxThree) < 0) {
                     throw new BusinessException("阈值填写错误");
                 }
                 if (oneMin.contains("-")) {
 //                    oneMin = com.sckw.core.utils.StringUtils.deleteCharString(oneMin, "-");//-8
-                    if (BigDecimal.valueOf(Long.parseLong(oneMin)).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
+                    if (oneMax.compareTo(maxThree) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 } else {
-                    if (BigDecimal.valueOf(Long.parseLong(oneMin)).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
+                    if (oneMin.compareTo(minThree) > 0) {
                         throw new BusinessException("阈值填写错误");
                     }
                 }
@@ -706,7 +706,7 @@ public class ThresholdService {
                         if (min.contains("-")) {
                             min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");
                         }
-                        if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(thresholdBean.getMax())) > 0) {
+                        if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(Double.parseDouble(thresholdBean.getMax()))) > 0) {
                             throw new BusinessException("阈值填写错误");
                         }
                         if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(thresholdBeanMin))) < 0) {
@@ -721,8 +721,8 @@ public class ThresholdService {
                     int levelMax = level + 1;
                     int levelMin = level - 1;
                     if (maps.get(levelMax) != null) {
-                        long min = value.getMin();
-                        long max = value.getMax();
+                        double min = Double.parseDouble(value.getMin());
+                        double max = Double.parseDouble(value.getMax());
                     }
                     if (maps.get(levelMin) != null) {
 

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml

@@ -50,7 +50,8 @@
              d.update_time,
              p.`name` as project_name,
              d.status,
-            m.`name` as mName
+            m.`name` as mName,
+            d.sn_code
       from kws_device as d
       left join kws_device_model as m on d.model_id = m.id
                left join kws_project_device as pd on d.id = pd.device_id

+ 3 - 3
slope-modules/slope-detection/src/main/resources/mapper/tdengine/SlopeDataMapper.xml

@@ -80,7 +80,7 @@
         <include refid="Base_List">
         </include>
         FROM devicesv2.device_${snCode}
-        where line = #{item} and ts &gt;= #{dateStart} and ts &lt;= #{dateEnd} order by ts desc
+        where line = #{item} and raw_ts &gt;= #{dateStart} and raw_ts &lt;= #{dateEnd} order by ts desc
     </select>
 
     <select id="selectLineListByArray" resultType="com.sckw.slope.detection.model.dos.tdengine.SlopeData">
@@ -88,7 +88,7 @@
         <include refid="Base_List">
         </include>
         FROM devicesv2.device_#{snCode}
-        where  ts &gt;= #{dateStart} and ts &lt;= #{dateEnd}
+        where  raw_ts &gt;= #{dateStart} and raw_ts &lt;= #{dateEnd}
 
         <if test="parts != null">
             and line in
@@ -107,7 +107,7 @@
         msg_id      as msgId,
         ts
         FROM devicesv2.device_#{snCode}
-        where  ts &gt;= #{dateStart} and ts &lt;= #{dateEnd}
+        where  raw_ts &gt;= #{dateStart} and raw_ts &lt;= #{dateEnd}
 
         <if test="parts != null">
             and line in