Преглед изворни кода

阈值数据数据补充展示翻译

lengfaqiang пре 2 година
родитељ
комит
06b8b329fb

+ 1 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/DictEnum.java

@@ -15,6 +15,7 @@ public enum DictEnum {
     ALARM_TYPE("alarm_type", "告警类型"),
     ALARM_DETAIL_TYPE("alarm_detail_type", "告警明细类型"),
     REPORT_TEMPLATE_TYPE("report_template_type", "报表模板"),
+    COMPANY("company", "厂商"),
     ;
     private final String codeType;
     private final String name;

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectAndDeviceVo.java

@@ -22,6 +22,11 @@ public class ProjectAndDeviceVo implements Serializable {
      */
     private String logicLat;
 
+    /**
+     * 逻辑纬度(测点布设的值)
+     */
+    private String fence;
+
     /**
      * 逻辑海拔(测点布设的值)
      */

+ 16 - 5
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -257,7 +257,8 @@ public class ProjectService {
         if (CollectionUtils.isEmpty(list)) {
             return PageRes.build(info, list);
         }
-//        后期要数据翻译产品类型
+        Map<String, SystemDict> deviceType = commonService.getDictByDictCode(DictEnum.DEVICE_TYPE);
+        Map<String, SystemDict> company = commonService.getDictByDictCode(DictEnum.COMPANY);
         for (ProjectDeviceVO projectDeviceDTO : list) {
             Long id = projectDeviceDTO.getDeviceRelationId();
             KwsDeviceRelation deviceRelation = deviceRelationMapper.selectOne(new LambdaQueryWrapper<KwsDeviceRelation>()
@@ -265,6 +266,13 @@ public class ProjectService {
                     .eq(KwsDeviceRelation::getMountainId, headerData.getMountainId())
                     .eq(KwsDeviceRelation::getDelFlag, 0)
             );
+            projectDeviceDTO.setDeviceModelName(projectDeviceDTO.getDeviceModelName() == null ? null :
+                    (deviceType == null ? projectDeviceDTO.getDeviceModelName() : (
+                            deviceType.get(projectDeviceDTO.getDeviceType()) == null ? projectDeviceDTO.getDeviceModelName() : deviceType.get(projectDeviceDTO.getDeviceType()).getLabel()
+                    )));
+            projectDeviceDTO.setManufacturer(projectDeviceDTO.getManufacturer() == null ? null :
+                    (company == null ? projectDeviceDTO.getManufacturer() :
+                            (company.get(projectDeviceDTO.getManufacturer()) == null ? projectDeviceDTO.getManufacturer() : company.get(projectDeviceDTO.getManufacturer()).getLabel())));
             if (deviceRelation != null) {
                 projectDeviceDTO.setParentId(deviceRelation.getDeviceId().toString());
                 KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(deviceRelation.getDeviceId());
@@ -382,10 +390,13 @@ public class ProjectService {
         if (CollectionUtils.isEmpty(list)) {
             return PageRes.build(info, list);
         }
-//        后期要数据翻译产品类型
-//        for (ProjectDeviceDTO projectDeviceDTO : list) {
-//
-//        }
+        Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.DEVICE_TYPE);
+        for (ProjectDeviceVO projectDeviceVO : list) {
+            projectDeviceVO.setDeviceType(projectDeviceVO.getDeviceType() == null ? null :
+                    (dictByDictCode == null ? projectDeviceVO.getDeviceType() :
+                            (dictByDictCode.get(projectDeviceVO.getDeviceType()) == null ? projectDeviceVO.getDeviceType() :
+                                    dictByDictCode.get(projectDeviceVO.getDeviceType()).getLabel())));
+        }
         return PageRes.build(info, list);
     }
 

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

@@ -653,10 +653,11 @@ public class ThresholdService {
         String deviceId = param.getDeviceId();
         String projectId = param.getProjectId();
         KwsProject project = projectMapper.selectById(Long.parseLong(projectId));
-//        KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>()
-//                .eq(KwsProjectArea::getProjectId, Long.parseLong(projectId))
-//                .eq(KwsProjectArea::getDelFlag, 0));
+        KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>()
+                .eq(KwsProjectArea::getProjectId, Long.parseLong(projectId))
+                .eq(KwsProjectArea::getDelFlag, 0));
         ProjectAndDeviceVo vo = new ProjectAndDeviceVo();
+        vo.setFence(area == null ? null : area.getFence());
         KwsDevice kwsDevice = deviceMapper.selectById(Long.parseLong(deviceId));
         if (kwsDevice != null) {
             vo.setLogicLng(kwsDevice.getLogicLng());