Просмотр исходного кода

Merge branch 'dev' into sky_v2

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

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java

@@ -32,4 +32,6 @@ public interface KwsProjectMapper extends BaseMapper<KwsProject> {
     List<ProjectDeviceVO> selectDeviceNotBindList(@Param("deviceQuery") DeviceQuery deviceQuery);
 
     List<ProjectDeviceVO> selectNotBindDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery);
+
+    List<KwsProject> selectListData(@Param("ids") List<String> ids, @Param("delFlag") Integer delFlag);
 }

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

@@ -802,7 +802,7 @@ public class KwsAlarmService {
         }
         KwsAlarm kwsAlarm = alarmMapper.selectById(detailList.get(0).getAlarmId());
         Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.MODEL_PART);
-        Map<String, SystemDict> alarmType = commonService.getDictByDictCode(DictEnum.ALARM_TYPE);
+        Map<String, SystemDict> alarmType = commonService.getDictByDictCode(DictEnum.THRESHOLD_LEVEL);
         if ("1".equals(kwsAlarm.getType())) {
 
         } else {
@@ -814,8 +814,8 @@ public class KwsAlarmService {
                 }
                 ThresholdRecordDetailExportVO vo = new ThresholdRecordDetailExportVO();
                 vo.setId(detail.getId());
-                vo.setAlarmLevel(kwsAlarm.getType() == null ? null :
-                        (alarmType == null ? String.valueOf(kwsAlarm.getType()) : alarmType.get(String.valueOf(kwsAlarm.getType())).getLabel()));
+                vo.setAlarmLevel(kwsAlarm.getLevel() == null ? null :
+                        (alarmType == null ? String.valueOf(kwsAlarm.getLevel()) : alarmType.get(String.valueOf(kwsAlarm.getLevel())).getLabel()));
                 vo.setType(kwsThreshold == null ? null : (kwsThreshold.getItemName() == null ? null :
                         (dictByDictCode == null ? kwsThreshold.getItemName() :
                                 (dictByDictCode.get(kwsThreshold.getItemName()) == null ? kwsThreshold.getItemName() : dictByDictCode.get(kwsThreshold.getItemName()).getLabel()))));

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

@@ -60,16 +60,15 @@ public class ReportService {
         if (CollectionUtils.isEmpty(list)) {
             return PageRes.build(info, list);
         }
-        List<String> collect = list.stream().map(ReportStatementVO::getProjectId).collect(Collectors.toList());
-        List<KwsProject> kwsProjects = projectMapper.selectList(new LambdaQueryWrapper<KwsProject>()
-                .in(KwsProject::getId, collect)
-                .eq(KwsProject::getDelFlag, 0));
+        List<String> collect = list.stream().map(ReportStatementVO::getProjectId).distinct().collect(Collectors.toList());
+        List<KwsProject> kwsProjects = projectMapper.selectListData(collect,null);
         Map<Long, String> map = new HashMap<>();
         if (!CollectionUtils.isEmpty(kwsProjects)) {
             map = kwsProjects.stream().collect(Collectors.toMap(KwsProject::getId, KwsProject::getName));
         }
         for (ReportStatementVO reportStatementVO : list) {
             reportStatementVO.setReportType(ReportTypeEnum.getDescription(reportStatementVO.getReportType()));
+            reportStatementVO.setProjectName(map.get(Long.parseLong(reportStatementVO.getProjectId())));
         }
         return PageRes.build(info, list);
     }

+ 16 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml

@@ -214,4 +214,20 @@
               , '%')
         </if>
     </select>
+
+    <select id="selectListData" resultMap="BaseResultMap">
+        select *
+        from kws_project
+        <where>
+            <if test="ids != null and ids.size() > 0">
+                and id in
+                <foreach collection="ids" close=")" open="(" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="delFlag != null">
+                and del_flag = #{delFlag}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 3 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportDataMapper.xml

@@ -316,5 +316,8 @@
       <if test="query.endTime != null and query.endTime != ''">
           and a.create_time &lt;= #{query.endTime}
       </if>
+      <if test="mountainId != null and mountainId != ''">
+          and a.mountain_id = #{mountainId}
+      </if>
   </select>
 </mapper>