From eb41baf336689cce9344e95c1bf1b0c702fc77d5 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期三, 09 十一月 2022 17:21:42 +0800
Subject: [PATCH] 违规检索和对导出进行封装

---
 ycl-platform/src/main/java/com/ycl/vo/message/MessageColumnVO.java                                     |   99 +++++++++
 ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java                           |    4 
 ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml                                  |   81 ++++++++
 ycl-platform/src/main/java/com/ycl/controller/cockpit/teamConstruction/TeamConstructionController.java |   34 +--
 ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java                      |   18 +
 ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java                |   35 +--
 ycl-platform/src/main/java/com/ycl/vo/casePool/QueryForViolationVO.java                                |  100 ++++++++++
 ycl-common/src/main/java/com/ycl/utils/EasyExcelUtils.java                                             |   28 ++
 ycl-platform/src/main/java/com/ycl/dto/caseHandler/QueryForViolationParam.java                         |  101 ++++++++++
 ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java                                  |    7 
 ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java                   |   15 +
 ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java                              |    4 
 ycl-platform/src/main/java/com/ycl/controller/message/MessageController.java                           |    8 
 ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java                            |   14 -
 14 files changed, 488 insertions(+), 60 deletions(-)

diff --git a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java
index 973780c..5eb9cd7 100644
--- a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java
+++ b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java
@@ -1,8 +1,6 @@
 package com.ycl.controller.user;
 
-import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ycl.annotation.LogSave;
 import com.ycl.api.CommonResult;
 import com.ycl.dto.log.LogQueryParams;
@@ -10,6 +8,7 @@
 import com.ycl.entity.user.vo.UmsAdminLogVO;
 import com.ycl.service.user.IAdminLoginLogService;
 import com.ycl.service.user.UmsAdminService;
+import com.ycl.utils.EasyExcelUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.SneakyThrows;
@@ -17,8 +16,6 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 import java.util.List;
 
 @RestController
@@ -62,12 +59,7 @@
     @SneakyThrows
     @LogSave(operationType = "鏃ュ織绠$悊", contain = "瀵煎嚭鏃ュ織")
     public void export(HttpServletResponse response, LogQueryParams logQueryParams) {
-        response.setContentType("application/vnd.ms-excel");
-        response.setCharacterEncoding("utf-8");
-        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx");
-        EasyExcel
-                .write(response.getOutputStream(), UmsAdminLogVO.class)
-                .sheet("鏁版嵁")
-                .doWrite(iAdminLoginLogService.pageList(logQueryParams).getRecords());
+        String sheet = "鏁版嵁";
+        EasyExcelUtils.export(response, sheet, UmsAdminLogVO.class, iAdminLoginLogService.pageList(logQueryParams).getRecords());
     }
 }
diff --git a/ycl-common/src/main/java/com/ycl/utils/EasyExcelUtils.java b/ycl-common/src/main/java/com/ycl/utils/EasyExcelUtils.java
new file mode 100644
index 0000000..05e51c3
--- /dev/null
+++ b/ycl-common/src/main/java/com/ycl/utils/EasyExcelUtils.java
@@ -0,0 +1,28 @@
+package com.ycl.utils;
+
+import com.alibaba.excel.EasyExcel;
+import lombok.SneakyThrows;
+
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Collection;
+
+public class EasyExcelUtils {
+
+
+    /**
+     * @Description 瀵煎嚭
+     * @Param [response , sheetName sheet鍚嶅瓧, className 绫诲悕, collection data]
+     * @return void
+     **/
+    @SneakyThrows
+    public static void export(HttpServletResponse response, String sheetName, Class className, Collection<?> collection) {
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding("utf-8");
+        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx");
+        EasyExcel.write(response.getOutputStream(), className)
+                .sheet(sheetName)
+                .doWrite(collection);
+    }
+}
diff --git a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
index 4d16ee5..228bb35 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -1,5 +1,6 @@
 package com.ycl.controller.caseHandler;
 
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -9,6 +10,7 @@
 import com.ycl.common.constant.BaseCaseStatus;
 import com.ycl.common.util.UtilNumber;
 import com.ycl.controller.BaseController;
+import com.ycl.dto.caseHandler.QueryForViolationParam;
 import com.ycl.dto.casePool.IllegalBuildingParam;
 import com.ycl.dto.casePool.ViolationParam;
 import com.ycl.entity.caseHandler.BaseCase;
@@ -18,6 +20,8 @@
 import com.ycl.service.caseHandler.IDisposeRecordService;
 import com.ycl.service.caseHandler.IIllegalBuildingService;
 import com.ycl.service.caseHandler.IViolationsService;
+import com.ycl.utils.EasyExcelUtils;
+import com.ycl.vo.casePool.QueryForViolationVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -27,6 +31,7 @@
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
@@ -282,4 +287,17 @@
                                   @RequestParam(required = false) String site) {
         return CommonResult.success(baseCaseService.selectPage(new Page<BaseCase>().setCurrent(current).setSize(pageSize), number, communityId, categories, startTime, endTime, site));
     }
+
+    @GetMapping("/query_for_violation")
+    @ApiOperation("杩濊妫�绱�")
+    public CommonResult queryForViolation(QueryForViolationParam queryForViolationParam) {
+        return CommonResult.success(baseCaseService.selectViolation(queryForViolationParam));
+    }
+
+    @PostMapping("/query_for_violation/export")
+    @ApiOperation("杩濊妫�绱�-瀵煎嚭")
+    public void queryForViolationExport(HttpServletResponse response, QueryForViolationParam queryForViolationParam) {
+        String sheetName = "杩濊鏁版嵁";
+        EasyExcelUtils.export(response, sheetName, QueryForViolationVO.class, baseCaseService.selectViolation(queryForViolationParam).getRecords());
+    }
 }
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/teamConstruction/TeamConstructionController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/teamConstruction/TeamConstructionController.java
index 2806951..855ea64 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/teamConstruction/TeamConstructionController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/teamConstruction/TeamConstructionController.java
@@ -12,6 +12,7 @@
 import com.ycl.controller.BaseController;
 import com.ycl.entity.cockpitManage.TeamConstruction;
 import com.ycl.service.cockpitManage.ITeamConstructionService;
+import com.ycl.utils.EasyExcelUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -24,7 +25,6 @@
 
 import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 
 /**
  * <p>
@@ -58,27 +58,27 @@
         return CommonResult.success(iTeamConstructionService
                 .page(new Page<TeamConstruction>().setSize(size).setCurrent(current), new LambdaQueryWrapper<TeamConstruction>()
                         .like(StringUtils.isNotBlank(departName), TeamConstruction::getName, departName)
-                        .eq( status != null, TeamConstruction::getStatus, status)
+                        .eq(status != null, TeamConstruction::getStatus, status)
                         .eq(TeamConstruction::getIsDelete, isDelete)));
     }
 
     @PostMapping("/addition")
     @ApiOperation("娣诲姞")
-    @LogSave(operationType = "闃熶紞寤鸿绠$悊",contain = "娣诲姞")
+    @LogSave(operationType = "闃熶紞寤鸿绠$悊", contain = "娣诲姞")
     public CommonResult add(@RequestBody TeamConstruction teamConstruction) {
         return CommonResult.success(iTeamConstructionService.save(teamConstruction));
     }
 
     @PutMapping("/modification")
     @ApiOperation("淇敼")
-    @LogSave(operationType = "闃熶紞寤鸿绠$悊",contain = "淇敼")
+    @LogSave(operationType = "闃熶紞寤鸿绠$悊", contain = "淇敼")
     public CommonResult modify(@RequestBody TeamConstruction teamConstruction) {
         return CommonResult.success(iTeamConstructionService.updateById(teamConstruction));
     }
 
     @DeleteMapping("/deletion")
     @ApiOperation("鍒犻櫎")
-    @LogSave(operationType = "闃熶紞寤鸿绠$悊",contain = "鍒犻櫎")
+    @LogSave(operationType = "闃熶紞寤鸿绠$悊", contain = "鍒犻櫎")
     public CommonResult delete(@RequestParam Long id) {
         Integer isDelete = 1;
         TeamConstruction teamConstruction = new TeamConstruction();
@@ -89,7 +89,7 @@
 
     @PostMapping("/export")
     @ApiOperation("瀵煎嚭")
-    @LogSave(operationType = "闃熶紞寤鸿绠$悊",contain = "瀵煎嚭")
+    @LogSave(operationType = "闃熶紞寤鸿绠$悊", contain = "瀵煎嚭")
     @ApiImplicitParams(
             {
                     @ApiImplicitParam(name = "size", required = true, value = "椤甸潰鏁伴噺"),
@@ -104,26 +104,20 @@
                        @RequestParam(name = "status", required = false) Integer status,
                        HttpServletResponse response) {
         Integer isDelete = 0;
-        response.setContentType("application/vnd.ms-excel");
-        response.setCharacterEncoding("utf-8");
-        response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx");
-        EasyExcel
-                .write(response.getOutputStream(), TeamConstruction.class)
-                .sheet("鏁版嵁")
-                .doWrite(iTeamConstructionService
-                        .page(new Page<TeamConstruction>().setSize(size).setCurrent(current), new LambdaQueryWrapper<TeamConstruction>()
-                                .like(StringUtils.isNotBlank(departName), TeamConstruction::getName, departName)
-                                .eq(status != null, TeamConstruction::getStatus, status)
-                                .eq(TeamConstruction::getIsDelete, isDelete))
-                        .getRecords());
-
+        String sheetName = "鏁版嵁";
+        EasyExcelUtils.export(response, sheetName, TeamConstruction.class, iTeamConstructionService
+                .page(new Page<TeamConstruction>().setSize(size).setCurrent(current), new LambdaQueryWrapper<TeamConstruction>()
+                        .like(StringUtils.isNotBlank(departName), TeamConstruction::getName, departName)
+                        .eq(status != null, TeamConstruction::getStatus, status)
+                        .eq(TeamConstruction::getIsDelete, isDelete))
+                .getRecords());
     }
 
 
     @PostMapping("/import")
     @ApiOperation("瀵煎叆")
     @SneakyThrows
-    @LogSave(operationType = "闃熶紞寤鸿绠$悊",contain = "瀵煎叆")
+    @LogSave(operationType = "闃熶紞寤鸿绠$悊", contain = "瀵煎叆")
     public CommonResult export(MultipartFile multipartFile) {
         EasyExcel.read(multipartFile.getInputStream(), TeamConstruction.class, new ReadListener() {
             @Override
diff --git a/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java b/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java
index c8b1904..5cd81d7 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java
@@ -11,6 +11,7 @@
 import com.ycl.entity.equipment.EquipmentBayonet;
 import com.ycl.service.dict.IDataDictionaryService;
 import com.ycl.service.equipment.IEquipmentBayonetService;
+import com.ycl.utils.EasyExcelUtils;
 import com.ycl.vo.equipment.EquipmentBayonetVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -83,7 +84,7 @@
     @GetMapping("/export")
     @ApiOperation("瀵煎嚭")
     @SneakyThrows
-    @LogSave(operationType = "鍗″彛绠$悊", contain = "鍒犻櫎鍗″彛")
+    @LogSave(operationType = "鍗″彛绠$悊", contain = "瀵煎嚭鍗″彛")
     public void export(HttpServletResponse response,
                        @RequestParam(required = false) Integer size,
                        @RequestParam(required = false) Integer current,
@@ -91,23 +92,17 @@
         Page<EquipmentBayonet> equipmentBayonetPage = new Page<>();
         equipmentBayonetPage.setCurrent(current);
         equipmentBayonetPage.setSize(size);
-        response.setContentType("application/vnd.ms-excel");
-        response.setCharacterEncoding("utf-8");
-        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx");
-        EasyExcel.write(response.getOutputStream(), EquipmentBayonetVO.class)
-                .sheet("鏁版嵁")
-                .doWrite(iEquipmentBayonetService
-                        .page(equipmentBayonetPage, new LambdaQueryWrapper<EquipmentBayonet>()
-                                .like(StringUtils.isNotBlank(bayonetName), EquipmentBayonet::getBayonetName, bayonetName))
-                        .getRecords()
-                        .stream()
-                        .map(item -> {
-                            EquipmentBayonetVO equipmentBayonetVO = new EquipmentBayonetVO();
-                            BeanUtils.copyProperties(item, equipmentBayonetVO);
-                            equipmentBayonetVO.setFrontEndType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getFrontEndType())).getName());
-                            equipmentBayonetVO.setInOutCityType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getInOutCityType())).getName());
-                            return equipmentBayonetVO;
-                        }).collect(Collectors.toList()));
+        EasyExcelUtils.export(response,"鏁版嵁",EquipmentBayonetVO.class,iEquipmentBayonetService
+                .page(equipmentBayonetPage, new LambdaQueryWrapper<EquipmentBayonet>()
+                        .like(StringUtils.isNotBlank(bayonetName), EquipmentBayonet::getBayonetName, bayonetName))
+                .getRecords()
+                .stream()
+                .map(item -> {
+                    EquipmentBayonetVO equipmentBayonetVO = new EquipmentBayonetVO();
+                    BeanUtils.copyProperties(item, equipmentBayonetVO);
+                    equipmentBayonetVO.setFrontEndType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getFrontEndType())).getName());
+                    equipmentBayonetVO.setInOutCityType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getInOutCityType())).getName());
+                    return equipmentBayonetVO;
+                }).collect(Collectors.toList()));
     }
-
-}
+}
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/controller/message/MessageController.java b/ycl-platform/src/main/java/com/ycl/controller/message/MessageController.java
index 7eab9c8..f637925 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/message/MessageController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/message/MessageController.java
@@ -44,9 +44,9 @@
         return CommonResult.success(iMessageService.sendMessage(messageParam));
     }
     @ApiOperation(value = "鑾峰彇娑堟伅鍒嗛〉鏌ヨ")
-    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
     @ResponseBody
-    public CommonResult<IPage<Message>> list(@Validated @RequestBody MessageParam messageParam) {
+    public CommonResult<IPage<Message>> list(MessageParam messageParam) {
         return CommonResult.success(iMessageService.list(messageParam));
     }
 
@@ -87,6 +87,4 @@
         }
         return CommonResult.failed();
     }
-
-
-}
+}
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/dto/caseHandler/QueryForViolationParam.java b/ycl-platform/src/main/java/com/ycl/dto/caseHandler/QueryForViolationParam.java
new file mode 100644
index 0000000..972d796
--- /dev/null
+++ b/ycl-platform/src/main/java/com/ycl/dto/caseHandler/QueryForViolationParam.java
@@ -0,0 +1,101 @@
+package com.ycl.dto.caseHandler;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.ycl.api.BasePageDTO;
+import com.ycl.api.BasePageVO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(value = "娣诲姞杩濊妗堜欢")
+public class QueryForViolationParam  extends BasePageVO {
+
+    /**
+     * 浜嬩欢鏉ユ簮(1-瑙嗛 2-鎵嬪姩鐧昏)
+     */
+    @TableField("event_source")
+    @ApiModelProperty(value = "浜嬩欢鏉ユ簮(1-瑙嗛 2-鎵嬪姩鐧昏)")
+    private Integer eventSource;
+
+    /**
+     * 澶х被
+     */
+    @ApiModelProperty(value = "澶х被")
+    @NotNull(message = "涓嶅厑璁稿ぇ绫讳负绌�")
+    private Integer categoryId;
+
+    /**
+     * 鎶ヨ鏃堕棿
+     */
+    private String startTime;
+
+
+    /**
+     * 鎶ヨ鏃堕棿
+     */
+    private String endTime;
+
+    /**
+     * 灏忕被
+     */
+    @ApiModelProperty(value = "灏忕被")
+    @NotNull(message = "涓嶅厑璁稿皬绫讳负绌�")
+    private Integer typeId;
+
+    /**
+     * 妗堜欢绛夌骇
+     */
+    @ApiModelProperty(value = "妗堜欢绛夌骇")
+    @NotNull(message = "涓嶅厑璁告浠剁瓑绾т负绌�")
+    private Integer gradeId;
+
+    /**
+     * 鎵�灞炶閬�
+     */
+    @ApiModelProperty(value = "鎵�灞炶閬�")
+    @NotNull(message = "涓嶅厑璁告墍灞炶閬撲负绌�")
+    private Integer streetId;
+
+    /**
+     * 鎵�灞炵ぞ鍖�
+     */
+    @ApiModelProperty(value = "鎵�灞炵ぞ鍖�")
+    @NotNull(message = "涓嶅厑璁告墍灞炵ぞ鍖轰负绌�")
+    private Integer communityId;
+
+    /**
+     * 鎵�灞炵ぞ鍖�
+     */
+    @ApiModelProperty(value = "鐩戞帶鐐逛綅id")
+    private Integer videoPointId;
+
+    /**
+     * 鎵�灞炵ぞ鍖�
+     */
+    @ApiModelProperty(value = "鐘舵�� 7 鏈鏍� 8 宸茬粡瀹℃牳 9 缁撴")
+    private Byte state;
+
+    /**
+     * 鎶ヨ鐐逛綅 浜嬪彂鍦扮偣
+     */
+    @ApiModelProperty(value = "浜嬪彂鍦扮偣")
+    @NotBlank(message = "涓嶅厑璁镐簨鍙戝湴鐐逛负绌�")
+    private String site;
+
+    /**
+     * 杞︾墝鍙�
+     */
+    @ApiModelProperty(value = "杞︾墝鍙�")
+    private String carNumber;
+
+
+    @ApiModelProperty(value = "澶勭悊鎰忚")
+    private String handlingOpinion;
+
+    @ApiModelProperty(value = "妗堜欢缂栫爜")
+    private String code;
+}
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java b/ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java
index 988ddc5..f4c0846 100644
--- a/ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java
+++ b/ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java
@@ -118,6 +118,13 @@
     private Integer videoAlarmReportId;
 
     /**
+     * 瑙嗛鎶ヨid
+     */
+    @TableField("video_point_id")
+    @ApiModelProperty(value = "瑙嗛鐐逛綅")
+    private Integer videoPointId;
+
+    /**
      * 澶х被鏂囨湰
      */
     @TableField(value = "category_text",exist = false)
diff --git a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
index 84f3cac..c80d993 100644
--- a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
+++ b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
@@ -4,9 +4,11 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ycl.bo.casePool.CasePoolIllegalBuildingDO;
 import com.ycl.bo.casePool.CasePoolViolationDO;
+import com.ycl.dto.caseHandler.QueryForViolationParam;
 import com.ycl.entity.caseHandler.BaseCase;
 import com.ycl.vo.casePool.CasePoolIllegalBuildingVO;
 import com.ycl.vo.casePool.CasePoolViolationVO;
+import com.ycl.vo.casePool.QueryForViolationVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -28,4 +30,6 @@
     BaseCase selectCondMap(Map map);
 
     List<BaseCase> selectBaseCasePage(Page<BaseCase> page, @Param("code") String number,@Param("communityId") Integer communityId, @Param("categories") Integer categories, @Param("startTime") String startTime,@Param("endTime") String endTime,@Param("site") String site);
+
+    Page<QueryForViolationVO> selectViolationPage(Page<QueryForViolationVO> setCurrent, QueryForViolationParam queryForViolationParam);
 }
diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
index 2eb9937..8f3055e 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
@@ -2,10 +2,12 @@
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ycl.dto.caseHandler.QueryForViolationParam;
 import com.ycl.dto.casePool.IllegalBuildingParam;
 import com.ycl.dto.casePool.ViolationParam;
 import com.ycl.entity.caseHandler.BaseCase;
 import com.ycl.entity.caseHandler.BaseCaseDetail;
+import com.ycl.vo.casePool.QueryForViolationVO;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -53,4 +55,6 @@
     void endCase(Long caseId, String result,String opinion);
 
     List<BaseCase> selectPage(Page<BaseCase> setSize, String number, Integer communityId, Integer categories, String startTime, String endTime, String site);
+
+    Page<QueryForViolationVO> selectViolation(QueryForViolationParam queryForViolationParam);
 }
diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
index 7d3c506..9b439d2 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -11,6 +11,7 @@
 import com.ycl.common.constant.BaseCaseStatus;
 import com.ycl.common.constant.StepName;
 import com.ycl.common.util.DateUtil;
+import com.ycl.dto.caseHandler.QueryForViolationParam;
 import com.ycl.dto.casePool.IllegalBuildingParam;
 import com.ycl.dto.casePool.ViolationParam;
 import com.ycl.entity.caseHandler.*;
@@ -26,10 +27,7 @@
 import com.ycl.service.caseHandler.IBaseCaseService;
 import com.ycl.service.caseHandler.IViolationsService;
 import com.ycl.service.video.IVideoAlarmReportService;
-import com.ycl.vo.casePool.CasePoolViolationVO;
-import com.ycl.vo.casePool.CurrentSitVo;
-import com.ycl.vo.casePool.FilesPictureVo;
-import com.ycl.vo.casePool.HandlePassVo;
+import com.ycl.vo.casePool.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -353,6 +351,7 @@
         baseCase.setState(BaseCaseStatus.CLOSING_REGISTER);
         baseCase.setId(caseId);
         baseCase.setFinalOpinion(opinion);
+        baseCase.setCloseTime(LocalDateTime.now());
         baseCaseMapper.updateById(baseCase);
 
         QueryWrapper<WorkflowConfigStep> stepQurey = new QueryWrapper<>();
@@ -379,4 +378,12 @@
     public List<BaseCase> selectPage(Page<BaseCase> page, String number, Integer communityId, Integer categories, String startTime, String endTime, String site) {
         return baseCaseMapper.selectBaseCasePage(page, number, communityId, categories, startTime, endTime, site);
     }
+
+    @Override
+    public Page<QueryForViolationVO> selectViolation(QueryForViolationParam queryForViolationParam) {
+        return baseCaseMapper.selectViolationPage(
+                new Page<QueryForViolationVO>()
+                        .setSize(queryForViolationParam.getPageSize())
+                        .setCurrent(queryForViolationParam.getCurrent()), queryForViolationParam);
+    }
 }
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/vo/casePool/QueryForViolationVO.java b/ycl-platform/src/main/java/com/ycl/vo/casePool/QueryForViolationVO.java
new file mode 100644
index 0000000..52a51cc
--- /dev/null
+++ b/ycl-platform/src/main/java/com/ycl/vo/casePool/QueryForViolationVO.java
@@ -0,0 +1,100 @@
+package com.ycl.vo.casePool;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(value = "娣诲姞杩濊妗堜欢")
+public class QueryForViolationVO {
+
+    /**
+     * 浜嬩欢鏉ユ簮(1-瑙嗛 2-鎵嬪姩鐧昏)
+     */
+    @TableField("event_source")
+    @ApiModelProperty(value = "浜嬩欢鏉ユ簮(1-瑙嗛 2-鎵嬪姩鐧昏)")
+    @ExcelProperty(value = "浜嬩欢鏉ユ簮", index = 1)
+    private String eventSource;
+
+    /**
+     * 澶х被
+     */
+    @ApiModelProperty(value = "澶х被")
+    @NotNull(message = "涓嶅厑璁稿ぇ绫讳负绌�")
+    @ExcelProperty(value = "澶х被", index = 2)
+    private String categoryName;
+
+    /**
+     * 鎶ヨ鏃堕棿
+     */
+    @ExcelProperty(value = "鎶ヨ鏃堕棿", index = 8)
+    private String alarmTime;
+
+    /**
+     * 灏忕被
+     */
+    @ApiModelProperty(value = "灏忕被")
+    @ExcelProperty(value = "灏忕被", index = 3)
+    private String typeName;
+
+    /**
+     * 妗堜欢绛夌骇
+     */
+    @ApiModelProperty(value = "妗堜欢绛夌骇")
+    @NotNull(message = "涓嶅厑璁告浠剁瓑绾т负绌�")
+    @ExcelProperty(value = "浜嬩欢绛夌骇", index = 4)
+    private String gradeName;
+
+    /**
+     * 鎵�灞炶閬�
+     */
+    @ApiModelProperty(value = "琛楅亾")
+    @NotNull(message = "涓嶅厑璁告墍灞炶閬撲负绌�")
+    @ExcelProperty(value = "琛楅亾", index = 7)
+    private String streetName;
+
+    /**
+     * 鎵�灞炵ぞ鍖�
+     */
+    @ApiModelProperty(value = "鎵�灞炵ぞ鍖�")
+    @ExcelProperty(value = "绀惧尯", index = 6)
+    private String communityName;
+
+    @ApiModelProperty("鎸佺画鏃堕棿")
+    @ExcelIgnore
+    private String continueTime;
+    /**
+     * 鎶ヨ鐐逛綅 浜嬪彂鍦扮偣
+     */
+    @ApiModelProperty(value = "浜嬪彂鍦扮偣")
+    @ExcelProperty(value = "鎶ヨ鐐逛綅", index = 5)
+    private String site;
+
+    /**
+     * 杞︾墝鍙�
+     */
+    @ApiModelProperty(value = "杞︾墝鍙�")
+    @ExcelProperty(value = "杞︾墝鍙风爜", index = 9)
+    private String carNumber;
+
+    @ApiModelProperty(value = "瀹℃牳鐘舵��")
+    @ExcelProperty(value = "瀹℃牳鐘舵��", index = 10)
+    private String state;
+
+    @ApiModelProperty(value = "澶勭悊鎰忚")
+    @ExcelProperty(value = "澶勭悊鎰忚", index = 11)
+    private String handlingOpinion;
+
+    @ApiModelProperty(value = "鍥剧墖")
+    @ExcelIgnore
+    private String url;
+
+    @ApiModelProperty(value = "妗堜欢缂栫爜")
+    @ExcelProperty(value = "妗堜欢缂栧彿", index = 0)
+    private String code;
+}
\ No newline at end of file
diff --git a/ycl-platform/src/main/java/com/ycl/vo/message/MessageColumnVO.java b/ycl-platform/src/main/java/com/ycl/vo/message/MessageColumnVO.java
new file mode 100644
index 0000000..f9f999a
--- /dev/null
+++ b/ycl-platform/src/main/java/com/ycl/vo/message/MessageColumnVO.java
@@ -0,0 +1,99 @@
+package com.ycl.vo.message;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *  娑堟伅鏍忕洰  瀹炰綋绫�
+ * </p>
+ *
+ * @author mg
+ * @since 2022-10-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("ums_message_column")
+@ApiModel(value = "娑堟伅鏍忕洰琛�")
+public class MessageColumnVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 涓婚敭
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    @ApiModelProperty(value = "涓婚敭")
+    private Long id;
+
+    /**
+     * 鏍忕洰鍚嶇О
+     */
+    @TableField("column_name")
+    @ApiModelProperty(value = "鏍忕洰鍚嶇О")
+    @NotBlank(message = "鏍忕洰鍚嶇О涓虹┖")
+    private String columnName;
+
+
+    /**
+     * 鏍忕洰缂栫爜
+     */
+    @TableField("column_number")
+    @ApiModelProperty(value = "鏍忕洰缂栫爜")
+    @NotBlank(message = "鏍忕洰缂栫爜涓虹┖")
+    private String columnNumber;
+
+    /**
+     * 鍏憡鏁�
+     */
+    @TableField("notice_amount")
+    @ApiModelProperty(value = "鍏憡鏁�")
+    private Integer noticeAmount;
+
+    /**
+     * 鏄惁鏄剧ず
+     */
+    @TableField("is_show")
+    @ApiModelProperty(value = "鏄惁鏄剧ず")
+    private Integer isShow;
+
+    /**
+     * 鎻忚堪
+     */
+    @TableField("description")
+    @ApiModelProperty(value = "鎻忚堪")
+    private String description;
+
+    /**
+     * 鍒涘缓浜�
+     */
+    @TableField("create_user")
+    @ApiModelProperty(value = "鍒涘缓浜�")
+    private Long createUser;
+    /**
+     * 鍒涘缓鏃堕棿
+     */
+    @TableField("create_time")
+    @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+    private Date createTime;
+    /**
+     * 鏇存柊浜�
+     */
+    @TableField("update_user")
+    @ApiModelProperty(value = "鍒涘缓浜�")
+    private Long updateUser;
+    /**
+     * 鏇存柊鏃堕棿
+     */
+    @TableField("update_time")
+    @ApiModelProperty(value = "鏇存柊鏃堕棿")
+    private Date updateTime;
+}
diff --git a/ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml b/ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
index 3ce4be9..b3c8dd6 100644
--- a/ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -148,4 +148,85 @@
             </if>
         </where>
     </select>
+
+    <select id="selectViolationPage" resultType="com.ycl.vo.casePool.QueryForViolationVO"
+            parameterType="com.ycl.dto.caseHandler.QueryForViolationParam">
+        SELECT
+        t1.`code`,
+        t1.alarm_time,
+        t1.handling_opinion,
+        CASE
+        t1.event_source
+        WHEN 1 THEN
+        "瑙嗛宸℃煡"
+        WHEN 2 THEN
+        "浜哄伐涓婃姤"
+        END AS event_source,
+        t1.site,
+        CASE
+        t1.state
+        WHEN 7 THEN
+        "寰呭鏍�"
+        WHEN 8 THEN
+        "宸插鏍�"
+        END AS state,
+        t3.`name` as categoryName,
+        t4.`name` AS typeName,
+        t5.`name` as gradeName,
+        t2.car_number,
+        t6.region_name as communityName,
+        t7.region_name as streetName,
+        t8.url,
+        t9.address
+        FROM
+        ums_base_case t1
+        LEFT JOIN ums_violations t2 on t1.id=t2.id
+        LEFT JOIN ums_data_dictionary t3 on t3.id=t2.category_id
+        LEFT JOIN ums_data_dictionary t4 on t4.id=t2.type_id
+        LEFT JOIN ums_data_dictionary t5 on t5.id=t2.grade_id
+        LEFT JOIN ums_sccg_region t6 on t6.id=t1.community_id
+        LEFT JOIN ums_sccg_region t7 on t7.id=t1.street_id
+        LEFT JOIN ums_image_resources t8 on t8.belong_to_id=t1.id
+        LEFT JOIN ums_video_point t9 on t9.id=t2.video_point_id
+        <where>
+            t1.state IN (7,8)
+            <if test="queryForViolationParam.eventSource != null">
+                and t1.event_source=#{queryForViolationParam.eventSource}
+            </if>
+            <if test="queryForViolationParam.categoryId != null">
+                and t2.category_id=#{queryForViolationParam.categoryId}
+            </if>
+            <if test="queryForViolationParam.startTime != null and queryForViolationParam.startTime !='' and queryForViolationParam.endTime !=null and queryForViolationParam.endTime !=''">
+                and t1.alarm_time between #{queryForViolationParam.startTime} and #{queryForViolationParam.endTime}
+            </if>
+            <if test="queryForViolationParam.code != null and queryForViolationParam.code != '' ">
+                and t1.code like concat('%',#{queryForViolationParam.code},'%')
+            </if>
+            <if test=" queryForViolationParam.typeId!= null">
+                and t2.type_id=#{v.typeId}
+            </if>
+            <if test="queryForViolationParam.gradeId != null">
+                and t2.grade_id=#{queryForViolationParam.gradeId}
+            </if>
+            <if test="queryForViolationParam.streetId != null">
+                and t1.street_id=#{queryForViolationParam.streetId}
+            </if>
+            <if test="queryForViolationParam.communityId != null">
+                and t1.community_id=#{queryForViolationParam.communityId}
+            </if>
+            <if test="queryForViolationParam.state != null">
+                and t1.state=#{queryForViolationParam.state}
+            </if>
+            <if test="queryForViolationParam.carNumber != null and  queryForViolationParam.carNumber!=''">
+                and t1.car_umber like concat('%',#{queryForViolationParam.carNumber},'%')
+            </if>
+            <if test="queryForViolationParam.videoPointId != null">
+                and t1.video_point_id=#{queryForViolationParam.videoPointId}
+            </if>
+            <if test="queryForViolationParam.handlingOpinion != null and queryForViolationParam.handlingOpinion !=''">
+                and t1.handling_opinion like concat('%',#{queryForViolationParam.handlingOpinion},'%')
+            </if>
+        </where>
+
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0