15928045575 пре 2 година
родитељ
комит
3ebb63c0ce

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

@@ -102,6 +102,12 @@ public class KwsDeviceReference implements Serializable {
     @TableField(exist = false)
     private String  unitNe;
 
+    /**
+     * itemName
+     */
+    @TableField(exist = false)
+    private String  itemName;
+
     private static final long serialVersionUID = 1L;
 
 }

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

@@ -106,6 +106,7 @@ public class BackTrackService {
                 if (re.getItem().equals(value.getValue())) {
                     re.setUnit(value.getUrl());
                     re.setUnitNe(value.getRemark());
+                    re.setItemName(value.getLabel());
                 }
             }
         }
@@ -421,6 +422,7 @@ public class BackTrackService {
                 if (re.getItem().equals(value.getValue())) {
                     re.setUnit(value.getUrl());
                     re.setUnitNe(value.getRemark());
+                    re.setItemName(value.getLabel());
                 }
             }
         }

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -177,6 +177,8 @@ public class CommonService {
                     .eq(KwsDeviceReference::getType, NumberConstant.ONE)
                     .eq(KwsDeviceReference::getDelFlag, NumberConstant.ZERO)
                     .eq(KwsDeviceReference::getItem, DictItemEnum.LATITUDE_Y.getValue())
+                    .last("limit 1")
+                    .orderByDesc(KwsDeviceReference::getCreateTime)
             );
             if (deviceReference != null) {
                 angleInRadians = deviceReference.getCurrentValue().doubleValue();

+ 16 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -756,12 +756,26 @@ public class DeviceService {
             put("type", "1");
         }});
 
+        Map<String, SystemDict> unit = commonService.getDictList(null, new HashMap<>() {{
+            put("code", DictEnum.INTEGRATION_UNIT.getCodeType());
+            put("type", "1");
+        }});
+
+        //获取集成要素信息
+        List<DeviceIntegrationVo> intergData = new ArrayList<>();
+        intergData = deviceIntegrationMapper.selectListParamsAndInterNameByDeviceId(deviceId);
         for (Object object : array) {
             JSONObject obj = (JSONObject) object;
             if(modelPart.containsKey(obj.get("item"))){
-                logDesc += modelPart.get(obj.get("item")).getLabel()+ ":" +obj.get("value")+",";
+                logDesc += modelPart.get(obj.get("item")).getLabel()+ ":" +obj.get("value")+modelPart.get(obj.get("item")).getUrl()+",";
             }else{
-                logDesc += obj.get("item")+ ":" +obj.get("value")+",";
+                for(DeviceIntegrationVo vo : intergData){
+                    if(obj.get("item").equals(vo.getIntegrationName())){
+
+                        logDesc += obj.get("item")+ ":" +obj.get("value")+unit.get(vo.getUnit()).getDescription()+",";
+                    }
+                }
+
             }