459242451@qq.com 3 năm trước cách đây
mục cha
commit
09dd90b85a
20 tập tin đã thay đổi với 1433 bổ sung557 xóa
  1. 40 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlCommonController.java
  2. 197 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlDocumentController.java
  3. 6 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/XunTask.java
  4. BIN
      ruoyi-admin/src/main/resources/excel/document_template.docx
  5. 197 188
      ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
  6. 196 369
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
  7. 1 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  8. 28 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/AreaCheckInfoStatic.java
  9. 15 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/DocumentExample.java
  10. 307 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlDocument.java
  11. 10 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLocation.java
  12. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlDocumentMapper.java
  13. 2 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlPlanRecordMapper.java
  14. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlDocumentService.java
  15. 3 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlPlanRecordService.java
  16. 95 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlDocumentServiceImpl.java
  17. 58 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlPlanRecordServiceImpl.java
  18. 145 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlDocumentMapper.xml
  19. 5 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLocationMapper.xml
  20. 6 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlPlanRecordMapper.xml

+ 40 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlCommonController.java

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.qdtl.domain.MonitorStatic;
 import com.ruoyi.qdtl.domain.TlArea;
 import com.ruoyi.qdtl.domain.TlInspectionDeviceTrail;
@@ -27,13 +28,17 @@ import com.ruoyi.system.service.ISysConfigService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import sun.misc.BASE64Decoder;
 
+import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -165,4 +170,39 @@ public class TlCommonController extends BaseController {
 
         return AjaxResult.success(map);
     }
+
+    @Value(value = "${hls.path}")
+    private String path;
+    @Value(value = "${hls.url}")
+    private String url;
+    @Value(value = "${hls.ffmpegpath}")
+    private String ffmpegpath;
+    private Map<String, StringUtils.PrintStream> rtmptohlsmap = new HashMap<>();
+
+    @GetMapping("/rtmp/{from}")
+    public AjaxResult getHlsCode(@PathVariable("from") String from) {
+        Object data = "";
+        try {
+            from = new String(new BASE64Decoder().decodeBuffer(from), "UTF-8");
+            String p[] = from.split("/");
+            if (rtmptohlsmap.get(from) != null && rtmptohlsmap.get(from).isAlive()) {
+
+            } else {
+                File pc = new File(path + p[p.length - 1] + "");
+                if (!pc.exists()) {
+                    pc.mkdir();
+                    pc.setWritable(true, false);
+                    File pc1 = new File(path + p[p.length - 1] + "/playlist.m3u8");
+                    pc1.createNewFile();
+                    pc1.setWritable(true, false);
+
+                }
+                rtmptohlsmap.put(from, StringUtils.push(ffmpegpath, from, path + p[p.length - 1] + "/playlist.m3u8"));
+            }
+            data = url + p[p.length - 1] + "/playlist.m3u8";
+        } catch (Exception e) {
+            
+        }
+        return AjaxResult.success(data);
+    }
 }

+ 197 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlDocumentController.java

@@ -0,0 +1,197 @@
+package com.ruoyi.web.controller.qdtl;
+
+import cn.afterturn.easypoi.word.WordExportUtil;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.qdtl.domain.AreaCheckInfoStatic;
+import com.ruoyi.qdtl.domain.DocumentExample;
+import com.ruoyi.qdtl.domain.TlDocument;
+import com.ruoyi.qdtl.service.ITlDocumentService;
+import com.ruoyi.qdtl.service.ITlPlanRecordService;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 公文管理Controller
+ *
+ * @author ruoyi
+ * @date 2022-05-06
+ */
+@RestController
+@RequestMapping("/qdtl/document")
+public class TlDocumentController extends BaseController {
+    @Autowired
+    private ITlDocumentService tlDocumentService;
+    @Autowired
+    private ITlPlanRecordService planRecordService;
+
+    /**
+     * 查询公文管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:document:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlDocument tlDocument) {
+        startPage();
+        List<TlDocument> list = tlDocumentService.selectTlDocumentList(tlDocument);
+        return getDataTable(list);
+    }
+
+    /**
+     * 根据日期区间查询巡检打卡情况统计
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/queryCheck")
+    public AjaxResult queryCheck(@RequestParam String startDate, @RequestParam String endDate) {
+        return AjaxResult.success(planRecordService.queryCheckInfo(startDate, endDate));
+    }
+
+    /**
+     * 导出公文管理列表
+     */
+    @Log(title = "公文管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public void export(@RequestParam Long id, HttpServletResponse response) {
+        // 查询公文明细
+        TlDocument tlDocument = tlDocumentService.selectTlDocumentById(id);
+        // 处理发文日期
+        tlDocument.setPublishDate(DateUtil.format(DateUtil.parseDate(tlDocument.getPublishDate()), DatePattern.CHINESE_DATE_PATTERN));
+        // 处理典型案例
+        Object basicExample = tlDocument.getBasicExample();
+        if (ObjectUtil.isNotEmpty(basicExample)) {
+            List<DocumentExample> documentExamples = JSONUtil.toList(basicExample.toString(), DocumentExample.class);
+            tlDocument.setBasicExample(documentExamples.stream().map(DocumentExample::getContent).collect(Collectors.joining("\r\t")));
+        }
+        // 处理存在问题
+        Object question = tlDocument.getQuestion();
+        if (ObjectUtil.isNotEmpty(question)) {
+            List<DocumentExample> documentQuestion = JSONUtil.toList(question.toString(), DocumentExample.class);
+            tlDocument.setQuestion(documentQuestion.stream().map(DocumentExample::getContent).collect(Collectors.joining("\r\t")));
+        }
+        // 处理工作建议
+        Object advice = tlDocument.getAdvice();
+        if (ObjectUtil.isNotEmpty(advice)) {
+            List<DocumentExample> documentAdvice = JSONUtil.toList(advice.toString(), DocumentExample.class);
+            tlDocument.setAdvice(documentAdvice.stream().map(DocumentExample::getContent).collect(Collectors.joining("\r\t")));
+        }
+
+        Map<String, Object> map = BeanUtil.beanToMap(tlDocument);
+        // 查询巡检的统计数据
+        String infoTitle = StrUtil.concat(true, DateUtil.format(DateUtil.parseDate(tlDocument.getStartStatistic()), DatePattern.CHINESE_DATE_PATTERN),
+                "--",
+                DateUtil.format(DateUtil.parseDate(tlDocument.getEndStatistic()), DatePattern.CHINESE_DATE_PATTERN),
+                "铁路沿线巡防员打卡情况汇总");
+        map.put("infoTitle", infoTitle);
+        List<AreaCheckInfoStatic> list = planRecordService.queryCheckInfo(tlDocument.getStartStatistic(), tlDocument.getEndStatistic());
+        int i = 1;
+        for (AreaCheckInfoStatic areaCheckInfoStatic : list) {
+            areaCheckInfoStatic.setIndex(i);
+            i++;
+        }
+        map.put("checkList", list);
+
+        String fileName = "document_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".docx";
+        try {
+            XWPFDocument doc = WordExportUtil.exportWord07(
+                    "excel/document_template.docx", map);
+            FileOutputStream fos = new FileOutputStream(ExcelUtil.getAbsoluteFile(fileName));
+            doc.write(fos);
+            // 设置强制下载不打开
+            response.setContentType("application/force-download");
+            // 设置文件名
+            response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);
+            OutputStream out = response.getOutputStream();
+            doc.write(out);
+            out.close();
+            /*for (String s : tlDocument.getFileUrl().split(",")) {
+                BufferedInputStream br = FileUtil.getInputStream(s);
+                byte[] buf = new byte[1024];
+                int len = 0;
+                OutputStream out2 = response.getOutputStream();
+                while ((len = br.read(buf)) > 0)
+                    out2.write(buf, 0, len);
+                br.close();
+                out2.close();
+            }*/
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            delFileWord(ExcelUtil.getAbsoluteFile(fileName));
+        }
+    }
+
+    /**
+     * 获取公文管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:document:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tlDocumentService.selectTlDocumentById(id));
+    }
+
+    /**
+     * 新增公文管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:document:add')")
+    @Log(title = "公文管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlDocument tlDocument) {
+        tlDocument.setBasicExample(JSONUtil.toJsonStr(tlDocument.getBasicExample()));
+        tlDocument.setQuestion(JSONUtil.toJsonStr(tlDocument.getQuestion()));
+        tlDocument.setAdvice(JSONUtil.toJsonStr(tlDocument.getAdvice()));
+        return toAjax(tlDocumentService.insertTlDocument(tlDocument));
+    }
+
+    /**
+     * 修改公文管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:document:edit')")
+    @Log(title = "公文管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlDocument tlDocument) {
+        return toAjax(tlDocumentService.updateTlDocument(tlDocument));
+    }
+
+    /**
+     * 删除公文管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:document:remove')")
+    @Log(title = "公文管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tlDocumentService.deleteTlDocumentByIds(ids));
+    }
+
+    /**
+     * 删除零时生成的文件
+     */
+    public static void delFileWord(String filePath) {
+        File file = new File(filePath);
+        file.delete();
+    }
+
+
+}

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/XunTask.java

@@ -21,6 +21,7 @@ import com.ruoyi.qdtl.service.ITlInspectionLocationLogService;
 import com.ruoyi.qdtl.service.ITlInspectionLocationService;
 import com.ruoyi.qdtl.service.ITlPatrolmanService;
 import com.ruoyi.qdtl.service.ITlPlanRecordService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -33,6 +34,7 @@ import java.util.Date;
  * @Version V1.0
  */
 @Component("xunTask")
+@Slf4j
 public class XunTask {
 
     @Autowired
@@ -149,6 +151,10 @@ public class XunTask {
                 BeanUtil.copyProperties(convert, deviceTrail, "id", "fence");
                 // 查询该点位的经纬度
                 TlInspectionLocation tlInspectionLocation = tlInspectionLocationService.queryByThirdId(deviceTrail.getCheckpointId());
+                if (tlInspectionLocation == null) {
+                    log.error("没有通过CheckpointId找到相应的巡检点信息{}", deviceTrail.getCheckpointId());
+                    continue;
+                }
                 if (StrUtil.isNotBlank(tlInspectionLocation.getLnglat())) {
                     deviceTrail.setFence(tlInspectionLocation.getLnglat());
                     tlInspectionDeviceTrailService.insertTlInspectionDeviceTrail(deviceTrail);

BIN
ruoyi-admin/src/main/resources/excel/document_template.docx


+ 197 - 188
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java

@@ -1,193 +1,179 @@
 package com.ruoyi.common.utils;
 
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.text.StrFormatter;
+import org.springframework.util.AntPathMatcher;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import org.springframework.util.AntPathMatcher;
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.core.text.StrFormatter;
 
 /**
  * 字符串工具类
- * 
+ *
  * @author ruoyi
  */
-public class StringUtils extends org.apache.commons.lang3.StringUtils
-{
-    /** 空字符串 */
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+    /**
+     * 空字符串
+     */
     private static final String NULLSTR = "";
 
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final char SEPARATOR = '_';
 
     /**
      * 获取参数不为空值
-     * 
+     *
      * @param value defaultValue 要判断的value
      * @return value 返回值
      */
-    public static <T> T nvl(T value, T defaultValue)
-    {
+    public static <T> T nvl(T value, T defaultValue) {
         return value != null ? value : defaultValue;
     }
 
     /**
      * * 判断一个Collection是否为空, 包含List,Set,Queue
-     * 
+     *
      * @param coll 要判断的Collection
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Collection<?> coll)
-    {
+    public static boolean isEmpty(Collection<?> coll) {
         return isNull(coll) || coll.isEmpty();
     }
 
     /**
      * * 判断一个Collection是否非空,包含List,Set,Queue
-     * 
+     *
      * @param coll 要判断的Collection
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
 
     /**
      * * 判断一个对象数组是否为空
-     * 
+     *
      * @param objects 要判断的对象数组
-     ** @return true:为空 false:非空
+     *                * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Object[] objects)
-    {
+    public static boolean isEmpty(Object[] objects) {
         return isNull(objects) || (objects.length == 0);
     }
 
     /**
      * * 判断一个对象数组是否非空
-     * 
+     *
      * @param objects 要判断的对象数组
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Object[] objects)
-    {
+    public static boolean isNotEmpty(Object[] objects) {
         return !isEmpty(objects);
     }
 
     /**
      * * 判断一个Map是否为空
-     * 
+     *
      * @param map 要判断的Map
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Map<?, ?> map)
-    {
+    public static boolean isEmpty(Map<?, ?> map) {
         return isNull(map) || map.isEmpty();
     }
 
     /**
      * * 判断一个Map是否为空
-     * 
+     *
      * @param map 要判断的Map
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Map<?, ?> map)
-    {
+    public static boolean isNotEmpty(Map<?, ?> map) {
         return !isEmpty(map);
     }
 
     /**
      * * 判断一个字符串是否为空串
-     * 
+     *
      * @param str String
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(String str)
-    {
+    public static boolean isEmpty(String str) {
         return isNull(str) || NULLSTR.equals(str.trim());
     }
 
     /**
      * * 判断一个字符串是否为非空串
-     * 
+     *
      * @param str String
      * @return true:非空串 false:空串
      */
-    public static boolean isNotEmpty(String str)
-    {
+    public static boolean isNotEmpty(String str) {
         return !isEmpty(str);
     }
 
     /**
      * * 判断一个对象是否为空
-     * 
+     *
      * @param object Object
      * @return true:为空 false:非空
      */
-    public static boolean isNull(Object object)
-    {
+    public static boolean isNull(Object object) {
         return object == null;
     }
 
     /**
      * * 判断一个对象是否非空
-     * 
+     *
      * @param object Object
      * @return true:非空 false:空
      */
-    public static boolean isNotNull(Object object)
-    {
+    public static boolean isNotNull(Object object) {
         return !isNull(object);
     }
 
     /**
      * * 判断一个对象是否是数组类型(Java基本型别的数组)
-     * 
+     *
      * @param object 对象
      * @return true:是数组 false:不是数组
      */
-    public static boolean isArray(Object object)
-    {
+    public static boolean isArray(Object object) {
         return isNotNull(object) && object.getClass().isArray();
     }
 
     /**
      * 去空格
      */
-    public static String trim(String str)
-    {
+    public static String trim(String str) {
         return (str == null ? "" : str.trim());
     }
 
     /**
      * 截取字符串
-     * 
-     * @param str 字符串
+     *
+     * @param str   字符串
      * @param start 开始
      * @return 结果
      */
-    public static String substring(final String str, int start)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (start > str.length())
-        {
+        if (start > str.length()) {
             return NULLSTR;
         }
 
@@ -196,44 +182,36 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
 
     /**
      * 截取字符串
-     * 
-     * @param str 字符串
+     *
+     * @param str   字符串
      * @param start 开始
-     * @param end 结束
+     * @param end   结束
      * @return 结果
      */
-    public static String substring(final String str, int start, int end)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start, int end) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (end < 0)
-        {
+        if (end < 0) {
             end = str.length() + end;
         }
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (end > str.length())
-        {
+        if (end > str.length()) {
             end = str.length();
         }
 
-        if (start > end)
-        {
+        if (start > end) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (end < 0)
-        {
+        if (end < 0) {
             end = 0;
         }
 
@@ -248,15 +226,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
      * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
      * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
-     * 
+     *
      * @param template 文本模板,被替换的部分用 {} 表示
-     * @param params 参数值
+     * @param params   参数值
      * @return 格式化后的文本
      */
-    public static String format(String template, Object... params)
-    {
-        if (isEmpty(params) || isEmpty(template))
-        {
+    public static String format(String template, Object... params) {
+        if (isEmpty(params) || isEmpty(template)) {
             return template;
         }
         return StrFormatter.format(template, params);
@@ -264,58 +240,50 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
 
     /**
      * 是否为http(s)://开头
-     * 
+     *
      * @param link 链接
      * @return 结果
      */
-    public static boolean ishttp(String link)
-    {
+    public static boolean ishttp(String link) {
         return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
     }
 
     /**
      * 字符串转set
-     * 
+     *
      * @param str 字符串
      * @param sep 分隔符
      * @return set集合
      */
-    public static final Set<String> str2Set(String str, String sep)
-    {
+    public static final Set<String> str2Set(String str, String sep) {
         return new HashSet<String>(str2List(str, sep, true, false));
     }
 
     /**
      * 字符串转list
-     * 
-     * @param str 字符串
-     * @param sep 分隔符
+     *
+     * @param str         字符串
+     * @param sep         分隔符
      * @param filterBlank 过滤纯空白
-     * @param trim 去掉首尾空白
+     * @param trim        去掉首尾空白
      * @return list集合
      */
-    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
-    {
+    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
         List<String> list = new ArrayList<String>();
-        if (StringUtils.isEmpty(str))
-        {
+        if (StringUtils.isEmpty(str)) {
             return list;
         }
 
         // 过滤空白字符串
-        if (filterBlank && StringUtils.isBlank(str))
-        {
+        if (filterBlank && StringUtils.isBlank(str)) {
             return list;
         }
         String[] split = str.split(sep);
-        for (String string : split)
-        {
-            if (filterBlank && StringUtils.isBlank(string))
-            {
+        for (String string : split) {
+            if (filterBlank && StringUtils.isBlank(string)) {
                 continue;
             }
-            if (trim)
-            {
+            if (trim) {
                 string = string.trim();
             }
             list.add(string);
@@ -327,20 +295,16 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
      *
-     * @param cs 指定字符串
+     * @param cs                  指定字符串
      * @param searchCharSequences 需要检查的字符串数组
      * @return 是否包含任意一个字符串
      */
-    public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences)
-    {
-        if (isEmpty(cs) || isEmpty(searchCharSequences))
-        {
+    public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
+        if (isEmpty(cs) || isEmpty(searchCharSequences)) {
             return false;
         }
-        for (CharSequence testStr : searchCharSequences)
-        {
-            if (containsIgnoreCase(cs, testStr))
-            {
+        for (CharSequence testStr : searchCharSequences) {
+            if (containsIgnoreCase(cs, testStr)) {
                 return true;
             }
         }
@@ -350,10 +314,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 驼峰转下划线命名
      */
-    public static String toUnderScoreCase(String str)
-    {
-        if (str == null)
-        {
+    public static String toUnderScoreCase(String str) {
+        if (str == null) {
             return null;
         }
         StringBuilder sb = new StringBuilder();
@@ -363,31 +325,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
         boolean curreCharIsUpperCase = true;
         // 下一字符是否大写
         boolean nexteCharIsUpperCase = true;
-        for (int i = 0; i < str.length(); i++)
-        {
+        for (int i = 0; i < str.length(); i++) {
             char c = str.charAt(i);
-            if (i > 0)
-            {
+            if (i > 0) {
                 preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
-            }
-            else
-            {
+            } else {
                 preCharIsUpperCase = false;
             }
 
             curreCharIsUpperCase = Character.isUpperCase(c);
 
-            if (i < (str.length() - 1))
-            {
+            if (i < (str.length() - 1)) {
                 nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
             }
 
-            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
-            {
+            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
                 sb.append(SEPARATOR);
-            }
-            else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
-            {
+            } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
                 sb.append(SEPARATOR);
             }
             sb.append(Character.toLowerCase(c));
@@ -398,19 +352,15 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
 
     /**
      * 是否包含字符串
-     * 
-     * @param str 验证字符串
+     *
+     * @param str  验证字符串
      * @param strs 字符串组
      * @return 包含返回true
      */
-    public static boolean inStringIgnoreCase(String str, String... strs)
-    {
-        if (str != null && strs != null)
-        {
-            for (String s : strs)
-            {
-                if (str.equalsIgnoreCase(trim(s)))
-                {
+    public static boolean inStringIgnoreCase(String str, String... strs) {
+        if (str != null && strs != null) {
+            for (String s : strs) {
+                if (str.equalsIgnoreCase(trim(s))) {
                     return true;
                 }
             }
@@ -420,31 +370,25 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
 
     /**
      * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
-     * 
+     *
      * @param name 转换前的下划线大写方式命名的字符串
      * @return 转换后的驼峰式命名的字符串
      */
-    public static String convertToCamelCase(String name)
-    {
+    public static String convertToCamelCase(String name) {
         StringBuilder result = new StringBuilder();
         // 快速检查
-        if (name == null || name.isEmpty())
-        {
+        if (name == null || name.isEmpty()) {
             // 没必要转换
             return "";
-        }
-        else if (!name.contains("_"))
-        {
+        } else if (!name.contains("_")) {
             // 不含下划线,仅将首字母大写
             return name.substring(0, 1).toUpperCase() + name.substring(1);
         }
         // 用下划线将原始字符串分割
         String[] camels = name.split("_");
-        for (String camel : camels)
-        {
+        for (String camel : camels) {
             // 跳过原始字符串中开头、结尾的下换线或双重下划线
-            if (camel.isEmpty())
-            {
+            if (camel.isEmpty()) {
                 continue;
             }
             // 首字母大写
@@ -457,30 +401,22 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 驼峰式命名法 例如:user_name->userName
      */
-    public static String toCamelCase(String s)
-    {
-        if (s == null)
-        {
+    public static String toCamelCase(String s) {
+        if (s == null) {
             return null;
         }
         s = s.toLowerCase();
         StringBuilder sb = new StringBuilder(s.length());
         boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++)
-        {
+        for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
 
-            if (c == SEPARATOR)
-            {
+            if (c == SEPARATOR) {
                 upperCase = true;
-            }
-            else if (upperCase)
-            {
+            } else if (upperCase) {
                 sb.append(Character.toUpperCase(c));
                 upperCase = false;
-            }
-            else
-            {
+            } else {
                 sb.append(c);
             }
         }
@@ -489,21 +425,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
 
     /**
      * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
-     * 
-     * @param str 指定字符串
+     *
+     * @param str  指定字符串
      * @param strs 需要检查的字符串数组
      * @return 是否匹配
      */
-    public static boolean matches(String str, List<String> strs)
-    {
-        if (isEmpty(str) || isEmpty(strs))
-        {
+    public static boolean matches(String str, List<String> strs) {
+        if (isEmpty(str) || isEmpty(strs)) {
             return false;
         }
-        for (String pattern : strs)
-        {
-            if (isMatch(pattern, str))
-            {
+        for (String pattern : strs) {
+            if (isMatch(pattern, str)) {
                 return true;
             }
         }
@@ -511,24 +443,101 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     }
 
     /**
-     * 判断url是否与规则配置: 
-     * ? 表示单个字符; 
-     * * 表示一层路径内的任意字符串,不可跨层级; 
+     * 判断url是否与规则配置:
+     * ? 表示单个字符;
+     * * 表示一层路径内的任意字符串,不可跨层级;
      * ** 表示任意层路径;
-     * 
+     *
      * @param pattern 匹配规则
-     * @param url 需要匹配的url
+     * @param url     需要匹配的url
      * @return
      */
-    public static boolean isMatch(String pattern, String url)
-    {
+    public static boolean isMatch(String pattern, String url) {
         AntPathMatcher matcher = new AntPathMatcher();
         return matcher.match(pattern, url);
     }
 
     @SuppressWarnings("unchecked")
-    public static <T> T cast(Object obj)
-    {
+    public static <T> T cast(Object obj) {
         return (T) obj;
     }
+
+    /**
+     * @param input  可以是一个InputStream的流、动态图片(apng,gif等等),视频文件(mp4,flv,avi等等),流媒体地址(http-flv,rtmp,rtsp等等)
+     * @param output hls切片存放地址
+     * @throws org.bytedeco.javacv.FrameGrabber.Exception
+     * @throws org.bytedeco.javacv.FrameRecorder.Exception
+     * @Title: push
+     * @Description: hls切片
+     * @return: void
+     **/
+    public static PrintStream push(String ffmpegpath, String input, String output) {
+//                 public boolean exchangeToMp4(String ffmpegPath, String upFilePath, String codcFilePath) throws Exception {
+        // 创建List集合来保存转换视频文件为flv格式的命令
+        List<String> convert = new ArrayList<String>();
+        convert.add(ffmpegpath); // 添加转换工具路径
+        convert.add("-y"); // 该参数指定将覆盖已存在的文件
+        convert.add("-i");
+        convert.add(input);
+        convert.add("-vcodec");
+        convert.add("copy");
+        convert.add("-acodec");
+        convert.add("copy");
+        convert.add("-c:a");
+        convert.add("aac");
+        convert.add("-vbsf");
+        convert.add("h264_mp4toannexb");
+        convert.add("-f");
+        convert.add("hls");
+        convert.add("-hls_list_size");
+        convert.add("5");
+        convert.add("-hls_time");
+        convert.add("10");
+        convert.add("-hls_wrap");
+        convert.add("6");
+
+        // convert.add("-vf"); // 添加水印
+        // convert.add("movie=watermark.gif[wm];[in][wm]overlay=20:20[out]");
+        convert.add(output);
+
+        boolean mark = true;
+
+        try {
+            Process videoProcess = new ProcessBuilder(convert).redirectErrorStream(true).start();
+
+            PrintStream p = new PrintStream(videoProcess.getInputStream());
+            p.start();
+            return p;
+//                     videoProcess.waitFor(); // 加上这句,系统会等待转换完成。不加,就会在服务器后台自行转换。
+
+        } catch (Exception e) {
+            mark = false;
+            System.out.println(e);
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static class PrintStream extends Thread {
+        java.io.InputStream __is = null;
+
+        public PrintStream(java.io.InputStream is) {
+            __is = is;
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (this != null) {
+                    int _ch = __is.read();
+                    if (_ch != -1)
+                        System.out.print((char) _ch);
+                    else
+                        break;
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 196 - 369
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java


+ 1 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -107,6 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                         "/qdtl/plan/exportSchedule",
                         "/profile/**"
                 ).permitAll()
+                .antMatchers("/common/upload", "/common/download/resource").permitAll()
                 .antMatchers("/swagger-ui.html").anonymous()
                 .antMatchers("/swagger-resources/**").anonymous()
                 .antMatchers("/webjars/**").anonymous()

+ 28 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/AreaCheckInfoStatic.java

@@ -0,0 +1,28 @@
+package com.ruoyi.qdtl.domain;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Description: TODO
+ * @Author: huangcheng
+ * @Date: 2022/3/31
+ * @Version V1.0
+ */
+@Data
+public class AreaCheckInfoStatic {
+    private int index;
+    private Long areaId;
+    private String areaName;
+    // 巡更点数
+    private int locationPoint = 0;
+    // 打卡次数
+    private int checkPoint = 0;
+    // 平均每日打卡次数
+    private BigDecimal dailyPoint = new BigDecimal(0);
+    // 达标率
+    private double standardPercent = 0;
+    // 漏检率
+    private double unStandardPercent = 0;
+}

+ 15 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/DocumentExample.java

@@ -0,0 +1,15 @@
+package com.ruoyi.qdtl.domain;
+
+import lombok.Data;
+
+/**
+ * @Description: TODO
+ * @Author: huangcheng
+ * @Date: 2022/5/9
+ * @Version V1.0
+ */
+@Data
+public class DocumentExample {
+    private String areaName;
+    private String content;
+}

+ 307 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlDocument.java

@@ -0,0 +1,307 @@
+package com.ruoyi.qdtl.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 公文管理对象 tl_document
+ *
+ * @author ruoyi
+ * @date 2022-05-06
+ */
+public class TlDocument extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 文头
+     */
+    @Excel(name = "文头")
+    private String wenTou;
+
+    /**
+     * 标题
+     */
+    @Excel(name = "标题")
+    private String title;
+
+    /**
+     * 期数
+     */
+    @Excel(name = "期数")
+    private String periods;
+
+    /**
+     * 副标题
+     */
+    @Excel(name = "副标题")
+    private String secondTitle;
+
+    /**
+     * 发文日期
+     */
+    @Excel(name = "发文日期")
+    private String publishDate;
+
+    /**
+     * 指挥中心动态
+     */
+    @Excel(name = "指挥中心动态")
+    private String centerNews;
+
+    /**
+     * 区镇动态
+     */
+    @Excel(name = "区镇动态")
+    private String areaNews;
+
+    /**
+     * 典型案例
+     */
+    @Excel(name = "典型案例")
+    private Object basicExample;
+
+    /**
+     * 巡防统计周期起止
+     */
+    @Excel(name = "巡防统计周期起止")
+    private String startStatistic;
+
+    /**
+     * 巡防统计周期终止
+     */
+    @Excel(name = "巡防统计周期终止")
+    private String endStatistic;
+
+    /**
+     * 存在问题
+     */
+    @Excel(name = "存在问题")
+    private Object question;
+
+    /**
+     * 工作建议
+     */
+    @Excel(name = "工作建议")
+    private Object advice;
+
+    /**
+     * 附件地址
+     */
+    @Excel(name = "附件地址")
+    private String fileUrl;
+
+    /**
+     * 报送机关
+     */
+    @Excel(name = "报送机关")
+    private String baoSong;
+
+    /**
+     * 抄送机关
+     */
+    @Excel(name = "抄送机关")
+    private String chaoSong;
+
+    /**
+     * 统稿人
+     */
+    @Excel(name = "统稿人")
+    private String tongGao;
+
+    /**
+     * 审核人
+     */
+    @Excel(name = "审核人")
+    private String shenHe;
+
+    /**
+     * 签发人
+     */
+    @Excel(name = "签发人")
+    private String qianFa;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setWenTou(String wenTou) {
+        this.wenTou = wenTou;
+    }
+
+    public String getWenTou() {
+        return wenTou;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setPeriods(String periods) {
+        this.periods = periods;
+    }
+
+    public String getPeriods() {
+        return periods;
+    }
+
+    public void setSecondTitle(String secondTitle) {
+        this.secondTitle = secondTitle;
+    }
+
+    public String getSecondTitle() {
+        return secondTitle;
+    }
+
+    public void setPublishDate(String publishDate) {
+        this.publishDate = publishDate;
+    }
+
+    public String getPublishDate() {
+        return publishDate;
+    }
+
+    public void setCenterNews(String centerNews) {
+        this.centerNews = centerNews;
+    }
+
+    public String getCenterNews() {
+        return centerNews;
+    }
+
+    public void setAreaNews(String areaNews) {
+        this.areaNews = areaNews;
+    }
+
+    public String getAreaNews() {
+        return areaNews;
+    }
+
+    public void setBasicExample(Object basicExample) {
+        this.basicExample = basicExample;
+    }
+
+    public Object getBasicExample() {
+        return basicExample;
+    }
+
+    public void setStartStatistic(String startStatistic) {
+        this.startStatistic = startStatistic;
+    }
+
+    public String getStartStatistic() {
+        return startStatistic;
+    }
+
+    public void setEndStatistic(String endStatistic) {
+        this.endStatistic = endStatistic;
+    }
+
+    public String getEndStatistic() {
+        return endStatistic;
+    }
+
+    public void setQuestion(Object question) {
+        this.question = question;
+    }
+
+    public Object getQuestion() {
+        return question;
+    }
+
+    public void setAdvice(Object advice) {
+        this.advice = advice;
+    }
+
+    public Object getAdvice() {
+        return advice;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setBaoSong(String baoSong) {
+        this.baoSong = baoSong;
+    }
+
+    public String getBaoSong() {
+        return baoSong;
+    }
+
+    public void setChaoSong(String chaoSong) {
+        this.chaoSong = chaoSong;
+    }
+
+    public String getChaoSong() {
+        return chaoSong;
+    }
+
+    public void setTongGao(String tongGao) {
+        this.tongGao = tongGao;
+    }
+
+    public String getTongGao() {
+        return tongGao;
+    }
+
+    public void setShenHe(String shenHe) {
+        this.shenHe = shenHe;
+    }
+
+    public String getShenHe() {
+        return shenHe;
+    }
+
+    public void setQianFa(String qianFa) {
+        this.qianFa = qianFa;
+    }
+
+    public String getQianFa() {
+        return qianFa;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("wenTou", getWenTou())
+                .append("title", getTitle())
+                .append("periods", getPeriods())
+                .append("secondTitle", getSecondTitle())
+                .append("publishDate", getPublishDate())
+                .append("centerNews", getCenterNews())
+                .append("areaNews", getAreaNews())
+                .append("basicExample", getBasicExample())
+                .append("startStatistic", getStartStatistic())
+                .append("endStatistic", getEndStatistic())
+                .append("question", getQuestion())
+                .append("advice", getAdvice())
+                .append("fileUrl", getFileUrl())
+                .append("baoSong", getBaoSong())
+                .append("chaoSong", getChaoSong())
+                .append("tongGao", getTongGao())
+                .append("shenHe", getShenHe())
+                .append("qianFa", getQianFa())
+                .append("createTime", getCreateTime())
+                .toString();
+    }
+}

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLocation.java

@@ -77,6 +77,8 @@ public class TlInspectionLocation extends BaseEntity {
 
     private String thirdId;
 
+    private String pic;
+
     public void setId(Long id) {
         this.id = id;
     }
@@ -223,4 +225,12 @@ public class TlInspectionLocation extends BaseEntity {
     public void setDeviceNamesText(String deviceNamesText) {
         this.deviceNamesText = deviceNamesText;
     }
+
+    public String getPic() {
+        return pic;
+    }
+
+    public void setPic(String pic) {
+        this.pic = pic;
+    }
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlDocumentMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlDocument;
+
+/**
+ * 公文管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-05-06
+ */
+public interface TlDocumentMapper 
+{
+    /**
+     * 查询公文管理
+     * 
+     * @param id 公文管理主键
+     * @return 公文管理
+     */
+    public TlDocument selectTlDocumentById(Long id);
+
+    /**
+     * 查询公文管理列表
+     * 
+     * @param tlDocument 公文管理
+     * @return 公文管理集合
+     */
+    public List<TlDocument> selectTlDocumentList(TlDocument tlDocument);
+
+    /**
+     * 新增公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    public int insertTlDocument(TlDocument tlDocument);
+
+    /**
+     * 修改公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    public int updateTlDocument(TlDocument tlDocument);
+
+    /**
+     * 删除公文管理
+     * 
+     * @param id 公文管理主键
+     * @return 结果
+     */
+    public int deleteTlDocumentById(Long id);
+
+    /**
+     * 批量删除公文管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlDocumentByIds(Long[] ids);
+}

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlPlanRecordMapper.java

@@ -65,4 +65,6 @@ public interface TlPlanRecordMapper {
     void updateRecordByDateAndCard(TlPlanRecord tlPlanRecord);
 
     List<TlPlanRecord> selectTlPlanRecordListByDate(@Param("date") String date);
+
+    List<TlPlanRecord> selectTlPlanRecordListByDatePeriod(@Param("startDate") String startDate, @Param("endDate") String endDate);
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlDocumentService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlDocument;
+
+/**
+ * 公文管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-05-06
+ */
+public interface ITlDocumentService 
+{
+    /**
+     * 查询公文管理
+     * 
+     * @param id 公文管理主键
+     * @return 公文管理
+     */
+    public TlDocument selectTlDocumentById(Long id);
+
+    /**
+     * 查询公文管理列表
+     * 
+     * @param tlDocument 公文管理
+     * @return 公文管理集合
+     */
+    public List<TlDocument> selectTlDocumentList(TlDocument tlDocument);
+
+    /**
+     * 新增公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    public int insertTlDocument(TlDocument tlDocument);
+
+    /**
+     * 修改公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    public int updateTlDocument(TlDocument tlDocument);
+
+    /**
+     * 批量删除公文管理
+     * 
+     * @param ids 需要删除的公文管理主键集合
+     * @return 结果
+     */
+    public int deleteTlDocumentByIds(Long[] ids);
+
+    /**
+     * 删除公文管理信息
+     * 
+     * @param id 公文管理主键
+     * @return 结果
+     */
+    public int deleteTlDocumentById(Long id);
+}

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlPlanRecordService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.qdtl.service;
 
+import com.ruoyi.qdtl.domain.AreaCheckInfoStatic;
 import com.ruoyi.qdtl.domain.TlPlanRecord;
 
 import java.util.List;
@@ -65,4 +66,6 @@ public interface ITlPlanRecordService {
     void updateRecordByDateAndCard(TlPlanRecord tlPlanRecord);
 
     Map<String, Object> queryCheckPercent(String date);
+
+    List<AreaCheckInfoStatic> queryCheckInfo(String startDate, String endDate);
 }

+ 95 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlDocumentServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlDocumentMapper;
+import com.ruoyi.qdtl.domain.TlDocument;
+import com.ruoyi.qdtl.service.ITlDocumentService;
+
+/**
+ * 公文管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-05-06
+ */
+@Service
+public class TlDocumentServiceImpl implements ITlDocumentService 
+{
+    @Autowired
+    private TlDocumentMapper tlDocumentMapper;
+
+    /**
+     * 查询公文管理
+     * 
+     * @param id 公文管理主键
+     * @return 公文管理
+     */
+    @Override
+    public TlDocument selectTlDocumentById(Long id)
+    {
+        return tlDocumentMapper.selectTlDocumentById(id);
+    }
+
+    /**
+     * 查询公文管理列表
+     * 
+     * @param tlDocument 公文管理
+     * @return 公文管理
+     */
+    @Override
+    public List<TlDocument> selectTlDocumentList(TlDocument tlDocument)
+    {
+        return tlDocumentMapper.selectTlDocumentList(tlDocument);
+    }
+
+    /**
+     * 新增公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    @Override
+    public int insertTlDocument(TlDocument tlDocument)
+    {
+        tlDocument.setCreateTime(DateUtils.getNowDate());
+        return tlDocumentMapper.insertTlDocument(tlDocument);
+    }
+
+    /**
+     * 修改公文管理
+     * 
+     * @param tlDocument 公文管理
+     * @return 结果
+     */
+    @Override
+    public int updateTlDocument(TlDocument tlDocument)
+    {
+        return tlDocumentMapper.updateTlDocument(tlDocument);
+    }
+
+    /**
+     * 批量删除公文管理
+     * 
+     * @param ids 需要删除的公文管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlDocumentByIds(Long[] ids)
+    {
+        return tlDocumentMapper.deleteTlDocumentByIds(ids);
+    }
+
+    /**
+     * 删除公文管理信息
+     * 
+     * @param id 公文管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlDocumentById(Long id)
+    {
+        return tlDocumentMapper.deleteTlDocumentById(id);
+    }
+}

+ 58 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlPlanRecordServiceImpl.java

@@ -2,10 +2,12 @@ package com.ruoyi.qdtl.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.qdtl.domain.AreaCheckInfoStatic;
 import com.ruoyi.qdtl.domain.AreaCheckPercent;
 import com.ruoyi.qdtl.domain.TlArea;
 import com.ruoyi.qdtl.domain.TlPlanRecord;
@@ -210,4 +212,60 @@ public class TlPlanRecordServiceImpl implements ITlPlanRecordService {
         mapResult.put("totalStatic", totalCount == 0 ? 0.00 : NumberUtil.mul(NumberUtil.div(finishCount, totalCount, 4), 100));
         return mapResult;
     }
+
+    /**
+     * 根据时间区间查询巡检打卡统计情况
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    @Override
+    public List<AreaCheckInfoStatic> queryCheckInfo(String startDate, String endDate) {
+        List<TlPlanRecord> planRecords = tlPlanRecordMapper.selectTlPlanRecordListByDatePeriod(startDate, endDate);
+        // 以各个镇分组
+        Map<Long, List<TlPlanRecord>> areaCollect = planRecords.stream().filter(a -> ObjectUtil.isNotNull(a.getAreaId())).collect(Collectors.groupingBy(TlPlanRecord::getAreaId));
+        List<AreaCheckInfoStatic> list = new ArrayList<>();
+        for (Map.Entry<Long, List<TlPlanRecord>> longListEntry : areaCollect.entrySet()) {
+            AreaCheckInfoStatic areaCheckInfoStatic = new AreaCheckInfoStatic();
+            Long key = longListEntry.getKey();
+            List<TlPlanRecord> value = longListEntry.getValue();
+            // 对每一个镇的完成数据筛选出来
+            List<TlPlanRecord> finish = value.stream().filter(a -> StrUtil.isNotBlank(a.getDeviceCode())).collect(Collectors.toList());
+            // 计算时间区间一共几天
+            long betweenDay = DateUtil.betweenDay(DateUtil.parseDate(startDate), DateUtil.offsetDay(DateUtil.parseDate(endDate), 1), false);
+
+            areaCheckInfoStatic.setAreaId(key);
+            areaCheckInfoStatic.setLocationPoint(value.size());
+            areaCheckInfoStatic.setCheckPoint(finish.size());
+            areaCheckInfoStatic.setDailyPoint(NumberUtil.div(Convert.toStr(finish.size()), Convert.toStr(betweenDay), 1));
+            areaCheckInfoStatic.setStandardPercent(value.size() == 0 ? 0 : NumberUtil.mul(NumberUtil.div(finish.size(), value.size(), 4), 100));
+            areaCheckInfoStatic.setUnStandardPercent(value.size() == 0 ? 0 : NumberUtil.sub(100, areaCheckInfoStatic.getStandardPercent()));
+            list.add(areaCheckInfoStatic);
+        }
+        // 对result中补齐缺失的镇以及对镇名称赋值
+        TlArea tlArea = new TlArea();
+        tlArea.setAreaType("1");
+        List<TlArea> areas = tlAreaService.selectTlAreaList(tlArea);
+        Map<Long, List<AreaCheckInfoStatic>> collect = list.stream().collect(Collectors.groupingBy(AreaCheckInfoStatic::getAreaId));
+        List<AreaCheckInfoStatic> areaStatics = new ArrayList<>();
+        for (TlArea area : areas) {
+            AreaCheckInfoStatic areaCheckInfoStatic = new AreaCheckInfoStatic();
+            areaCheckInfoStatic.setAreaId(area.getId());
+            areaCheckInfoStatic.setAreaName(area.getAreaName());
+            List<AreaCheckInfoStatic> areaCheckPercents = collect.get(area.getId());
+            if (areaCheckPercents != null && areaCheckPercents.size() > 0) {
+                areaCheckInfoStatic.setLocationPoint(areaCheckPercents.get(0).getLocationPoint());
+                areaCheckInfoStatic.setCheckPoint(areaCheckPercents.get(0).getCheckPoint());
+                areaCheckInfoStatic.setDailyPoint(areaCheckPercents.get(0).getDailyPoint());
+                areaCheckInfoStatic.setStandardPercent(areaCheckPercents.get(0).getStandardPercent());
+                areaCheckInfoStatic.setUnStandardPercent(areaCheckPercents.get(0).getUnStandardPercent());
+            }
+            areaStatics.add(areaCheckInfoStatic);
+        }
+
+        return areaStatics;
+    }
+
+
 }

+ 145 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlDocumentMapper.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.qdtl.mapper.TlDocumentMapper">
+    
+    <resultMap type="TlDocument" id="TlDocumentResult">
+        <result property="id"    column="id"    />
+        <result property="wenTou"    column="wen_tou"    />
+        <result property="title"    column="title"    />
+        <result property="periods"    column="periods"    />
+        <result property="secondTitle"    column="second_title"    />
+        <result property="publishDate"    column="publish_date"    />
+        <result property="centerNews"    column="center_news"    />
+        <result property="areaNews"    column="area_news"    />
+        <result property="basicExample"    column="basic_example"    />
+        <result property="startStatistic"    column="start_statistic"    />
+        <result property="endStatistic"    column="end_statistic"    />
+        <result property="question"    column="question"    />
+        <result property="advice"    column="advice"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="baoSong"    column="bao_song"    />
+        <result property="chaoSong"    column="chao_song"    />
+        <result property="tongGao"    column="tong_gao"    />
+        <result property="shenHe"    column="shen_he"    />
+        <result property="qianFa"    column="qian_fa"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectTlDocumentVo">
+        select id, wen_tou, title, periods, second_title, publish_date, center_news, area_news, basic_example, start_statistic, end_statistic, question, advice, file_url, bao_song, chao_song, tong_gao, shen_he, qian_fa, create_time from tl_document
+    </sql>
+
+    <select id="selectTlDocumentList" parameterType="TlDocument" resultMap="TlDocumentResult">
+        <include refid="selectTlDocumentVo"/>
+        <where>  
+            <if test="wenTou != null  and wenTou != ''"> and wen_tou = #{wenTou}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="periods != null  and periods != ''"> and periods = #{periods}</if>
+            <if test="secondTitle != null  and secondTitle != ''"> and second_title = #{secondTitle}</if>
+            <if test="publishDate != null  and publishDate != ''"> and publish_date = #{publishDate}</if>
+            <if test="centerNews != null  and centerNews != ''"> and center_news = #{centerNews}</if>
+            <if test="areaNews != null  and areaNews != ''"> and area_news = #{areaNews}</if>
+            <if test="basicExample != null  and basicExample != ''"> and basic_example = #{basicExample}</if>
+            <if test="startStatistic != null  and startStatistic != ''"> and start_statistic = #{startStatistic}</if>
+            <if test="endStatistic != null  and endStatistic != ''"> and end_statistic = #{endStatistic}</if>
+            <if test="question != null  and question != ''"> and question = #{question}</if>
+            <if test="advice != null  and advice != ''"> and advice = #{advice}</if>
+            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
+            <if test="baoSong != null  and baoSong != ''"> and bao_song = #{baoSong}</if>
+            <if test="chaoSong != null  and chaoSong != ''"> and chao_song = #{chaoSong}</if>
+            <if test="tongGao != null  and tongGao != ''"> and tong_gao = #{tongGao}</if>
+            <if test="shenHe != null  and shenHe != ''"> and shen_he = #{shenHe}</if>
+            <if test="qianFa != null  and qianFa != ''"> and qian_fa = #{qianFa}</if>
+        </where>
+    </select>
+    
+    <select id="selectTlDocumentById" parameterType="Long" resultMap="TlDocumentResult">
+        <include refid="selectTlDocumentVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTlDocument" parameterType="TlDocument" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_document
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="wenTou != null">wen_tou,</if>
+            <if test="title != null">title,</if>
+            <if test="periods != null">periods,</if>
+            <if test="secondTitle != null">second_title,</if>
+            <if test="publishDate != null">publish_date,</if>
+            <if test="centerNews != null">center_news,</if>
+            <if test="areaNews != null">area_news,</if>
+            <if test="basicExample != null">basic_example,</if>
+            <if test="startStatistic != null">start_statistic,</if>
+            <if test="endStatistic != null">end_statistic,</if>
+            <if test="question != null">question,</if>
+            <if test="advice != null">advice,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="baoSong != null">bao_song,</if>
+            <if test="chaoSong != null">chao_song,</if>
+            <if test="tongGao != null">tong_gao,</if>
+            <if test="shenHe != null">shen_he,</if>
+            <if test="qianFa != null">qian_fa,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="wenTou != null">#{wenTou},</if>
+            <if test="title != null">#{title},</if>
+            <if test="periods != null">#{periods},</if>
+            <if test="secondTitle != null">#{secondTitle},</if>
+            <if test="publishDate != null">#{publishDate},</if>
+            <if test="centerNews != null">#{centerNews},</if>
+            <if test="areaNews != null">#{areaNews},</if>
+            <if test="basicExample != null">#{basicExample},</if>
+            <if test="startStatistic != null">#{startStatistic},</if>
+            <if test="endStatistic != null">#{endStatistic},</if>
+            <if test="question != null">#{question},</if>
+            <if test="advice != null">#{advice},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="baoSong != null">#{baoSong},</if>
+            <if test="chaoSong != null">#{chaoSong},</if>
+            <if test="tongGao != null">#{tongGao},</if>
+            <if test="shenHe != null">#{shenHe},</if>
+            <if test="qianFa != null">#{qianFa},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTlDocument" parameterType="TlDocument">
+        update tl_document
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="wenTou != null">wen_tou = #{wenTou},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="periods != null">periods = #{periods},</if>
+            <if test="secondTitle != null">second_title = #{secondTitle},</if>
+            <if test="publishDate != null">publish_date = #{publishDate},</if>
+            <if test="centerNews != null">center_news = #{centerNews},</if>
+            <if test="areaNews != null">area_news = #{areaNews},</if>
+            <if test="basicExample != null">basic_example = #{basicExample},</if>
+            <if test="startStatistic != null">start_statistic = #{startStatistic},</if>
+            <if test="endStatistic != null">end_statistic = #{endStatistic},</if>
+            <if test="question != null">question = #{question},</if>
+            <if test="advice != null">advice = #{advice},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="baoSong != null">bao_song = #{baoSong},</if>
+            <if test="chaoSong != null">chao_song = #{chaoSong},</if>
+            <if test="tongGao != null">tong_gao = #{tongGao},</if>
+            <if test="shenHe != null">shen_he = #{shenHe},</if>
+            <if test="qianFa != null">qian_fa = #{qianFa},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlDocumentById" parameterType="Long">
+        delete from tl_document where id = #{id}
+    </delete>
+
+    <delete id="deleteTlDocumentByIds" parameterType="String">
+        delete from tl_document where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLocationMapper.xml

@@ -9,6 +9,7 @@
         <result property="locationCode" column="location_code"/>
         <result property="locationName" column="location_name"/>
         <result property="detail" column="detail"/>
+        <result property="pic" column="pic"/>
         <result property="deviceIds" column="device_ids"/>
         <result property="areaId" column="area_id"/>
         <result property="lnglat" column="lnglat"/>
@@ -30,6 +31,7 @@
                device_ids,
                area_id,
                lnglat,
+               pic,
                remark,
                del_flag,
                version,
@@ -142,6 +144,7 @@
             <if test="updateTime != null">update_time,</if>
             <if test="thirdId != null">third_id,</if>
             <if test="version != null">version,</if>
+            <if test="pic != null">pic,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="locationCode != null">#{locationCode},</if>
@@ -158,6 +161,7 @@
             <if test="updateTime != null">#{updateTime},</if>
             <if test="thirdId != null">#{thirdId},</if>
             <if test="version != null">#{version},</if>
+            <if test="pic != null">#{pic},</if>
         </trim>
     </insert>
 
@@ -178,6 +182,7 @@
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="thirdId != null">third_id = #{thirdId},</if>
             <if test="version != null">version = #{version},</if>
+            <if test="pic != null">pic = #{pic},</if>
         </trim>
         where id = #{id}
     </update>

+ 6 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlPlanRecordMapper.xml

@@ -72,6 +72,12 @@
         order by create_time
     </select>
 
+    <select id="selectTlPlanRecordListByDatePeriod" resultMap="TlPlanRecordResult">
+        <include refid="selectTlPlanRecordVo"/>
+        where plan_date &lt;= #{endDate} and plan_date &gt;= #{startDate}
+        order by create_time
+    </select>
+
     <insert id="insertTlPlanRecord" parameterType="TlPlanRecord" useGeneratedKeys="true" keyProperty="id">
         insert into tl_plan_record
         <trim prefix="(" suffix=")" suffixOverrides=",">

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác