Эх сурвалжийг харах

fix
1.漏打点导出优化,增加区域条件
2.事件导出增加图片功能

459242451@qq.com 2 жил өмнө
parent
commit
c74e04be77

+ 8 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlCommonController.java

@@ -17,7 +17,13 @@ import com.ruoyi.qdtl.domain.TlArea;
 import com.ruoyi.qdtl.domain.TlInspectionLocation;
 import com.ruoyi.qdtl.domain.TlInspectionLocationLog;
 import com.ruoyi.qdtl.domain.UserCheckPoint;
-import com.ruoyi.qdtl.service.*;
+import com.ruoyi.qdtl.service.IQdCommonService;
+import com.ruoyi.qdtl.service.ITlAreaService;
+import com.ruoyi.qdtl.service.ITlInspectionLocationLogService;
+import com.ruoyi.qdtl.service.ITlInspectionLocationService;
+import com.ruoyi.qdtl.service.ITlMonitorService;
+import com.ruoyi.qdtl.service.ITlPlanRecordService;
+import com.ruoyi.qdtl.service.ITlSinglePawnService;
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.service.ISysConfigService;
 import lombok.RequiredArgsConstructor;
@@ -114,7 +120,7 @@ public class TlCommonController extends BaseController {
         map.put("area", areas);
         // 静态资源
         // 巡检点
-        List<TlInspectionLocation> staticLocation = tlInspectionLocationService.selectLocationList();
+        List<TlInspectionLocation> staticLocation = tlInspectionLocationService.selectLocationList(null);
         map.put("staticLocation", staticLocation);
 
         // 动态资源
@@ -214,7 +220,6 @@ public class TlCommonController extends BaseController {
     }
 
 
-
     //获取单兵播放列表
     @GetMapping("/singlepawnplays")
     public AjaxResult singlepawnplays() {

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlIncidentController.java

@@ -95,6 +95,11 @@ public class TlIncidentController extends BaseController {
             tlIncident.setAcceptUser(getUsername());
         }
         List<TlIncident> list = tlIncidentService.selectTlIncidentList(tlIncident);
+        for (TlIncident incident : list) {
+            if (StrUtil.isNotBlank(incident.getPics())) {
+                incident.setPics(StrUtil.subBefore(incident.getPics(), ",", false));
+            }
+        }
         ExcelUtil<TlIncident> util = new ExcelUtil<TlIncident>(TlIncident.class);
         util.exportExcel(response, list, "巡检事件管理数据");
     }

+ 11 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionLocationLogController.java

@@ -116,17 +116,25 @@ public class TlInspectionLocationLogController extends BaseController {
     @Log(title = "漏打巡检点导出", businessType = BusinessType.EXPORT)
     @PostMapping("/missExport")
     public void missExport(HttpServletResponse response, TlInspectionLocationLog tlInspectionLocationLog) {
+        // 查询近一个月内所有打卡记录
+        TlInspectionLocationLog bean = new TlInspectionLocationLog();
+        TlInspectionLocation location = new TlInspectionLocation();
+        if (StrUtil.isNotBlank(tlInspectionLocationLog.getAreaId())) {
+            Set<String> split = new HashSet<>(StrUtil.split(tlInspectionLocationLog.getAreaId(), ','));
+            bean.setAreaIds(split);
+            location.setAreaIds(split);
+        }
         // 查询每个镇所有的点位
-        List<TlInspectionLocation> locations = locationService.selectLocationList();
+        List<TlInspectionLocation> locations = locationService.selectLocationList(location);
         Set<String> locationsSet = locations.stream().map(TlInspectionLocation::getLocationCode).collect(Collectors.toSet());
         Map<String, TlInspectionLocation> locationName = locations.stream().collect(Collectors.toMap(TlInspectionLocation::getLocationCode, a -> a));
 //        Map<Long, List<TlInspectionLocation>> locationCollect = locations.stream().collect(Collectors.groupingBy(TlInspectionLocation::getAreaId));
-        // 查询近一个月内所有打卡记录
-        TlInspectionLocationLog bean = new TlInspectionLocationLog();
+
         DateTime endDate = DateUtil.date();
         DateTime startDate = DateUtil.offsetDay(endDate, -30);
         bean.setBeginTime(DateUtil.formatDateTime(startDate));
         bean.setEndTime(DateUtil.formatDateTime(endDate));
+
         List<TlInspectionLocationLog> locationLogList = tlInspectionLocationLogService.selectTlInspectionLocationLogList(bean);
         // 解析根据日期分组
         Map<String, List<TlInspectionLocationLog>> dateCollect = locationLogList.stream().collect(Collectors.groupingBy(a -> DateUtil.formatDate(a.getCreateTime())));

+ 8 - 10
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlIncident.java

@@ -25,38 +25,38 @@ public class TlIncident extends BaseEntity {
     /**
      * 事件名称
      */
-    @Excel(name = "事件名称")
+    @Excel(name = "事件名称", width = 20)
     private String name;
 
     /**
      * 事件描述
      */
-    @Excel(name = "事件描述")
+    @Excel(name = "事件描述", width = 35)
     private String detail;
 
     /**
      * 事件等级
      */
-    @Excel(name = "事件等级")
+    @Excel(name = "事件等级", dictType = "incident_level")
     private String incLevel;
 
     /**
      * 发生日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "发生日期", width = 25, dateFormat = "yyyy-MM-dd")
     private Date happenTime;
 
     /**
      * 图片
      */
-    @Excel(name = "图片")
+    @Excel(name = "图片", cellType = Excel.ColumnType.IMAGE, height = 60, width = 25)
     private String pics;
 
     /**
      * 区域
      */
-    @Excel(name = "区域")
+    @Excel(name = "区域", dictType = "tl_xun_area")
     private String area;
 
     /**
@@ -68,7 +68,6 @@ public class TlIncident extends BaseEntity {
     /**
      * 接收人
      */
-    @Excel(name = "接收人")
     private String acceptUser;
 
     /**
@@ -86,13 +85,12 @@ public class TlIncident extends BaseEntity {
     /**
      * 当前状态
      */
-    @Excel(name = "当前状态")
+    @Excel(name = "当前状态", dictType = "incident_status")
     private String status;
 
     /**
      * 处理人
      */
-    @Excel(name = "处理人")
     private String dealUser;
 
     /**
@@ -125,7 +123,7 @@ public class TlIncident extends BaseEntity {
      * 处理时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "处理时间", width = 25, dateFormat = "yyyy-MM-dd")
     private Date dealTime;
 
     public void setId(Long id) {

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLocationMapper.java

@@ -68,7 +68,7 @@ public interface TlInspectionLocationMapper {
 
     List<TlInspectionLocation> queryLocationByLineIds(List<Long> idCollect);
 
-    List<TlInspectionLocation> selectLocationList();
+    List<TlInspectionLocation> selectLocationList(TlInspectionLocation tlInspectionLocation);
 
     TlInspectionLocation queryByThirdId(String thirdId);
 

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLocationService.java

@@ -65,7 +65,7 @@ public interface ITlInspectionLocationService {
 
     List<TlInspectionLocation> queryLocationByLineIds(List<Long> idCollect);
 
-    List<TlInspectionLocation> selectLocationList();
+    List<TlInspectionLocation> selectLocationList(TlInspectionLocation tlInspectionLocation);
 
     TlInspectionLocation queryByThirdId(String thirdId);
 

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLocationServiceImpl.java

@@ -131,8 +131,8 @@ public class TlInspectionLocationServiceImpl implements ITlInspectionLocationSer
     }
 
     @Override
-    public List<TlInspectionLocation> selectLocationList() {
-        return tlInspectionLocationMapper.selectLocationList();
+    public List<TlInspectionLocation> selectLocationList(TlInspectionLocation tlInspectionLocation) {
+        return tlInspectionLocationMapper.selectLocationList(tlInspectionLocation);
     }
 
     @Override

+ 7 - 1
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLocationMapper.xml

@@ -101,9 +101,15 @@
         order by t1.sort_no
     </select>
 
-    <select id="selectLocationList" resultMap="TlInspectionLocationResult">
+    <select id="selectLocationList" resultMap="TlInspectionLocationResult" parameterType="TlInspectionLocation">
         <include refid="selectTlInspectionLocationVo"/>
         where lnglat != '' and del_flag = 0
+        <if test="areaIds != null">
+            and area_id in
+            <foreach collection="areaIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <select id="queryByThirdId" resultMap="TlInspectionLocationResult">