Browse Source

feat(ps):巡检

jiangbiao 3 weeks ago
parent
commit
f3a24b9679
100 changed files with 6231 additions and 3730 deletions
  1. 5 9
      master/src/main/java/com/ruoyi/common/utils/StringUtils.java
  2. 141 14
      master/src/main/java/com/ruoyi/common/utils/poi/QRCodeUtil.java
  3. 14 18
      master/src/main/java/com/ruoyi/project/common/controller/TCommonfileController.java
  4. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevAlarmController.java
  5. 117 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCabinetController.java
  6. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCallsystemController.java
  7. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCofferController.java
  8. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCurtainController.java
  9. 119 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevExtinguisherController.java
  10. 113 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevEyewashController.java
  11. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevFgsController.java
  12. 117 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevFiredoorController.java
  13. 117 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevHydrantController.java
  14. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevLiftController.java
  15. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevMonitorController.java
  16. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevPitController.java
  17. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevRainvalveController.java
  18. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevSteamController.java
  19. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevSumpController.java
  20. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevUtilitystationController.java
  21. 115 6
      master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevVentvalveController.java
  22. 100 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionAlarmController.java
  23. 577 0
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionAppController.java
  24. 102 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCabinetController.java
  25. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCallsystemController.java
  26. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCofferController.java
  27. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCurtainController.java
  28. 106 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionExtinguisherController.java
  29. 108 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionEyewashController.java
  30. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionFgsController.java
  31. 102 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionFiredoorController.java
  32. 104 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionHydrantController.java
  33. 103 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionLiftController.java
  34. 102 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionMonitorController.java
  35. 100 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionPitController.java
  36. 100 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionRainvalveController.java
  37. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionSteamController.java
  38. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionSumpController.java
  39. 102 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionUtilitystationController.java
  40. 101 6
      master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionVentvalveController.java
  41. 3 3
      master/src/main/java/com/ruoyi/project/ps/inspection/domain/TPsInspectionSump.java
  42. 184 0
      master/src/main/java/com/ruoyi/project/ps/inspection/dto/InspectionQueryRequest.java
  43. 16 6
      master/src/main/java/com/ruoyi/project/ps/patrol/domain/TPsPatrolIssues.java
  44. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevAlarmMapper.xml
  45. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevCabinetMapper.xml
  46. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevCallsystemMapper.xml
  47. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevCofferMapper.xml
  48. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevCurtainMapper.xml
  49. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevExtinguisherMapper.xml
  50. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevEyewashMapper.xml
  51. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevFgsMapper.xml
  52. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevFiredoorMapper.xml
  53. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevHydrantMapper.xml
  54. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevLiftMapper.xml
  55. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevMonitorMapper.xml
  56. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevPitMapper.xml
  57. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevRainvalveMapper.xml
  58. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevSteamMapper.xml
  59. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevSumpMapper.xml
  60. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevUtilitystationMapper.xml
  61. 1 1
      master/src/main/resources/mybatis/ps/dev/TPsDevVentvalveMapper.xml
  62. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionAlarmMapper.xml
  63. 4 3
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionCabinetMapper.xml
  64. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionCallsystemMapper.xml
  65. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionCofferMapper.xml
  66. 2 1
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionCurtainMapper.xml
  67. 4 3
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionExtinguisherMapper.xml
  68. 2 1
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionEyewashMapper.xml
  69. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionFgsMapper.xml
  70. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionFiredoorMapper.xml
  71. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionHydrantMapper.xml
  72. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionLiftMapper.xml
  73. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionMonitorMapper.xml
  74. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionPitMapper.xml
  75. 2 1
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionRainvalveMapper.xml
  76. 2 1
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionSteamMapper.xml
  77. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionSumpMapper.xml
  78. 2 1
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionUtilitystationMapper.xml
  79. 3 2
      master/src/main/resources/mybatis/ps/inspection/TPsInspectionVentvalveMapper.xml
  80. 12 7
      master/src/main/resources/mybatis/ps/patrol/TPsPatrolIssuesMapper.xml
  81. 58 76
      ui/src/views/ps/dev/alarm/index.vue
  82. 62 140
      ui/src/views/ps/dev/cabinet/index.vue
  83. 55 136
      ui/src/views/ps/dev/callsystem/index.vue
  84. 56 137
      ui/src/views/ps/dev/coffer/index.vue
  85. 58 139
      ui/src/views/ps/dev/curtain/index.vue
  86. 71 155
      ui/src/views/ps/dev/extinguisher/index.vue
  87. 52 136
      ui/src/views/ps/dev/eyewash/index.vue
  88. 61 141
      ui/src/views/ps/dev/fgs/index.vue
  89. 59 137
      ui/src/views/ps/dev/firedoor/index.vue
  90. 67 152
      ui/src/views/ps/dev/hydrant/index.vue
  91. 56 136
      ui/src/views/ps/dev/lift/index.vue
  92. 55 136
      ui/src/views/ps/dev/monitor/index.vue
  93. 56 136
      ui/src/views/ps/dev/pit/index.vue
  94. 58 139
      ui/src/views/ps/dev/rainvalve/index.vue
  95. 59 139
      ui/src/views/ps/dev/steam/index.vue
  96. 56 136
      ui/src/views/ps/dev/sump/index.vue
  97. 59 140
      ui/src/views/ps/dev/utilitystation/index.vue
  98. 59 140
      ui/src/views/ps/dev/ventvalve/index.vue
  99. 117 471
      ui/src/views/ps/inspection/alarm/index.vue
  100. 122 484
      ui/src/views/ps/inspection/cabinet/index.vue

+ 5 - 9
master/src/main/java/com/ruoyi/common/utils/StringUtils.java

@@ -1,13 +1,9 @@
 package com.ruoyi.common.utils;
 
-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 com.ruoyi.common.core.text.StrFormatter;
 
+import java.util.*;
+
 /**
  * 字符串工具类
  *
@@ -470,11 +466,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
             return false;
         }
         for (String s : val2) {
-            if (s.equals(val1)) {
-                return true;
+            if (!s.equals(val1)) {
+                return false;
             }
         }
-        return false;
+        return true;
     }
 
     /**

+ 141 - 14
master/src/main/java/com/ruoyi/common/utils/poi/QRCodeUtil.java

@@ -26,6 +26,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 public class QRCodeUtil<T> {
     private static final Logger log = LoggerFactory.getLogger(QRCodeUtil.class);
@@ -34,12 +36,13 @@ public class QRCodeUtil<T> {
      * 导出数据列表
      */
     private List<T> list;
+    private String title;
     private static XWPFDocument doc;
 
     //CODE_WIDTH:二维码宽度,单位像素
-    private static final int CODE_WIDTH = 400;
+    private static final int CODE_WIDTH = 300;
     //CODE_HEIGHT:二维码高度,单位像素
-    private static final int CODE_HEIGHT = 400;
+    private static final int CODE_HEIGHT = 300;
     //FONT_WIDTH:字体大小
     private static final int FONT_WIDTH = 16;
     //FRONT_COLOR:二维码前景色,0x000000 表示黑色
@@ -63,6 +66,7 @@ public class QRCodeUtil<T> {
             list = new ArrayList<>();
         }
         this.list = list;
+        this.title = title;
         doc = new XWPFDocument();
     }
 
@@ -115,7 +119,7 @@ public class QRCodeUtil<T> {
         }
     }
 
-    public static void createCodeToStream(String content, ByteArrayOutputStream baos,String text) {
+    public static void createCodeToStream(String content, ByteArrayOutputStream baos, String topText, String bottomText) {
         try {
             if (StringUtils.isBlank(content)) {
                 return;
@@ -124,18 +128,47 @@ public class QRCodeUtil<T> {
             //核心代码-生成二维码
             BufferedImage qrCodeImage = getBufferedImage(content);
 
+            // 计算总高度:顶部文字区域 + 二维码 + 底部文字区域
+            int topMargin = StringUtils.isNotEmpty(topText) ? 30 : 0; // 顶部文字区域高度
+            int bottomMargin = 30; // 底部文字区域高度
+            int totalHeight = CODE_HEIGHT + topMargin + bottomMargin;
 
-            // 添加底部文字
-            BufferedImage combinedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT + 30, BufferedImage.TYPE_INT_RGB);
+            // 创建包含顶部和底部文字的组合图片
+            BufferedImage combinedImage = new BufferedImage(CODE_WIDTH, totalHeight, BufferedImage.TYPE_INT_RGB);
             Graphics2D g = combinedImage.createGraphics();
-            g.setColor(Color.WHITE); // 设置背景颜色为白色
-            g.fillRect(0, 0, CODE_WIDTH, CODE_HEIGHT + 30); // 填充背景颜色
-            g.drawImage(qrCodeImage, 0, 0, null);
-            g.setColor(Color.BLACK); // 设置文字颜色为黑色
-            g.setFont(new Font("微软雅黑", Font.PLAIN, FONT_WIDTH));
-            int textWidth = g.getFontMetrics().stringWidth(text);
-            int textX = (CODE_WIDTH - textWidth) / 2;
-            g.drawString(text, textX, CODE_HEIGHT + 20);
+
+            // 设置抗锯齿
+            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+            // 设置背景颜色为白色
+            g.setColor(Color.WHITE);
+            g.fillRect(0, 0, CODE_WIDTH, totalHeight);
+
+            // 绘制顶部文字
+            if (StringUtils.isNotEmpty(topText)) {
+                g.setColor(Color.BLACK);
+                g.setFont(new Font("微软雅黑", Font.PLAIN, FONT_WIDTH));
+                FontMetrics fm = g.getFontMetrics();
+                int textWidth = fm.stringWidth(topText);
+                int textX = (CODE_WIDTH - textWidth) / 2;
+                int textY = topMargin - 10; // 文字在顶部区域垂直居中
+                g.drawString(topText, textX, textY);
+            }
+
+            // 绘制二维码(向下偏移顶部文字区域的高度)
+            g.drawImage(qrCodeImage, 0, topMargin, null);
+
+            // 绘制底部文字
+            if (StringUtils.isNotEmpty(bottomText)) {
+                g.setColor(Color.BLACK);
+                g.setFont(new Font("微软雅黑", Font.PLAIN, FONT_WIDTH));
+                FontMetrics fm = g.getFontMetrics();
+                int textWidth = fm.stringWidth(bottomText);
+                int textX = (CODE_WIDTH - textWidth) / 2;
+                int textY = topMargin + CODE_HEIGHT + 20; // 文字在底部区域垂直居中
+                g.drawString(bottomText, textX, textY);
+            }
+
             g.dispose();
             ImageIO.write(combinedImage, "png", baos);
 
@@ -185,7 +218,7 @@ public class QRCodeUtil<T> {
                 log.info("==================================================" + JSON.toJSONString(item));
                 //务必重写类的toString方法
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                createCodeToStream(JSON.toJSONString(item), baos,item.toString());
+                createCodeToStream(JSON.toJSONString(item), baos, title, item.toString());
                 InputStream is = new ByteArrayInputStream(baos.toByteArray());
                 paragraph.createRun().addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, "image.jpg", Units.toEMU(200), Units.toEMU(200));
             } catch (Exception e) {
@@ -194,4 +227,98 @@ public class QRCodeUtil<T> {
         });
     }
 
+
+    /**
+     * 生成二维码图片并打包成ZIP文件下载
+     *
+     * @param response HttpServletResponse
+     * @param list     数据列表
+     * @param title    标题(可选)
+     */
+    public void exportQRCodeAsZip(HttpServletResponse response, List<T> list, String title) {
+
+        response.setContentType("application/zip");
+        response.setCharacterEncoding("utf-8");
+        response.setHeader("Content-Disposition", "attachment;");
+
+        this.init(list, title);
+
+        try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) {
+            // 设置压缩级别
+            zos.setLevel(ZipOutputStream.STORED);
+
+            int index = 1;
+            for (T item : list) {
+                try {
+                    // 生成文件名
+                    String fileName = generateFileName(item, index) + ".png";
+                    index++;
+
+                    // 创建ZIP条目
+                    ZipEntry zipEntry = new ZipEntry(fileName);
+                    zos.putNextEntry(zipEntry);
+
+                    // 生成二维码图片并写入ZIP
+                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                    String content = JSON.toJSONString(item);
+                    String bottomText = item.toString();
+
+                    createCodeToStream(content, baos, title, bottomText);
+
+                    // 将字节数组写入ZIP
+                    zos.write(baos.toByteArray());
+                    zos.closeEntry();
+
+                    baos.close();
+
+                    log.info("成功生成二维码图片: {}", fileName);
+                } catch (Exception e) {
+                    log.error("生成二维码图片失败: {}", e.getMessage());
+                }
+            }
+
+            zos.finish();
+            log.info("ZIP文件生成成功,包含 {} 个二维码图片", list.size());
+
+        } catch (Exception e) {
+            log.error("生成ZIP文件异常: {}", e.getMessage());
+            try {
+                response.reset();
+                response.setContentType("application/json");
+                response.setCharacterEncoding("utf-8");
+                response.getWriter().println("生成ZIP文件失败: " + e.getMessage());
+            } catch (IOException ex) {
+                log.error("发送错误信息失败: {}", ex.getMessage());
+            }
+        }
+    }
+
+    /**
+     * 生成二维码图片并打包成ZIP文件下载(简化版)
+     *
+     * @param response HttpServletResponse
+     * @param list     数据列表
+     */
+    public void exportQRCodeAsZip(HttpServletResponse response, List<T> list) {
+        exportQRCodeAsZip(response, list, StringUtils.EMPTY);
+    }
+
+
+    /**
+     * 生成文件名
+     *
+     * @param item  数据项
+     * @param index 索引
+     * @return 文件名
+     */
+    private String generateFileName(T item, int index) {
+        // 如果对象有特定的标识字段,可以重写此方法
+        // 例如:如果对象有name字段,可以返回 item.getName()
+
+        // 默认使用索引+对象字符串表示
+        String baseName = StringUtils.substring(item.toString(), 0, 20); // 限制长度
+        baseName = baseName.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]", "_"); // 替换特殊字符
+        return String.format("%03d_%s", index, baseName);
+    }
+
 }

+ 14 - 18
master/src/main/java/com/ruoyi/project/common/controller/TCommonfileController.java

@@ -1,32 +1,27 @@
 package com.ruoyi.project.common.controller;
 
-import java.io.IOException;
-import java.time.LocalDate;
-import java.util.List;
-
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.thread.TaskThread;
-import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
-import com.ruoyi.common.utils.spring.SpringUtils;
-import com.ruoyi.framework.config.RuoYiConfig;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.project.monitor.domain.SysJob;
-import com.ruoyi.project.monitor.service.ISysJobService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.common.domain.TCommonfile;
-import com.ruoyi.project.common.service.ITCommonfileService;
+import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.common.domain.TCommonfile;
+import com.ruoyi.project.common.service.ITCommonfileService;
+import com.ruoyi.project.monitor.domain.SysJob;
+import com.ruoyi.project.monitor.service.ISysJobService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.IOException;
+import java.time.LocalDate;
+import java.util.List;
+
 /**
  * 通用附件Controller
  *
@@ -47,7 +42,7 @@ public class TCommonfileController extends BaseController
      */
     @Log(title = "通用附件上传", businessType = BusinessType.UPDATE)
     @PostMapping("/uploadFile")
-    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file,String pType,String pId) throws IOException
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file,String pType,String pId,@RequestParam(value = "pValue",required = false)String pValue) throws IOException
     {
         if (!file.isEmpty())
         {
@@ -66,6 +61,7 @@ public class TCommonfileController extends BaseController
                 tCommonfile.setCreaterCode(String.valueOf(getUserId()));
                 tCommonfile.setpId(Long.parseLong(pId));
                 tCommonfile.setpType(pType);
+                tCommonfile.setpValue(pValue);
                 tCommonfile.setFileSize(String.valueOf(size));
                 tCommonfileService.insertTCommonfile(tCommonfile);
 

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevAlarmController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevAlarm;
 import com.ruoyi.project.ps.dev.service.ITPsDevAlarmService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevAlarmController extends BaseController {
     /**
      * 查询手动启动火灾报警器基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevAlarm tPsDevAlarm) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevAlarmController extends BaseController {
     /**
      * 导出手动启动火灾报警器基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevAlarm tPsDevAlarm) {
@@ -49,10 +60,22 @@ public class TPsDevAlarmController extends BaseController {
         return util.exportExcel(list, "alarm");
     }
 
+    @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevAlarm tPsDevAlarm) {
+        List<TPsDevAlarm> list = tPsDevAlarmService.selectTPsDevAlarmList(tPsDevAlarm);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevAlarm item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "手动启动火灾报警器");
+    }
+
     /**
      * 获取手动启动火灾报警器基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevAlarmService.selectTPsDevAlarmById(id));
@@ -61,7 +84,7 @@ public class TPsDevAlarmController extends BaseController {
     /**
      * 新增手动启动火灾报警器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevAlarm tPsDevAlarm) {
@@ -71,7 +94,7 @@ public class TPsDevAlarmController extends BaseController {
     /**
      * 修改手动启动火灾报警器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevAlarm tPsDevAlarm) {
@@ -81,10 +104,96 @@ public class TPsDevAlarmController extends BaseController {
     /**
      * 删除手动启动火灾报警器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:alarm:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevAlarmService.deleteTPsDevAlarmByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "手动启动火灾报警器基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevAlarm> list = new ArrayList<TPsDevAlarm>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevAlarm entity = new TPsDevAlarm();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "1" (alarm)
+                entity.setPatrolType("1");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevAlarm t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的位号
+                TPsDevAlarm existAlarm = new TPsDevAlarm();
+                existAlarm.setDevNo(t.getDevNo());
+                List<TPsDevAlarm> existList = tPsDevAlarmService.selectTPsDevAlarmList(existAlarm);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevAlarmService.updateTPsDevAlarm(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 117 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCabinetController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevCabinet;
 import com.ruoyi.project.ps.dev.service.ITPsDevCabinetService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevCabinetController extends BaseController {
     /**
      * 查询玻璃门消火栓箱和泡沫栓箱基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevCabinet tPsDevCabinet) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevCabinetController extends BaseController {
     /**
      * 导出玻璃门消火栓箱和泡沫栓箱基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevCabinet tPsDevCabinet) {
@@ -49,10 +60,22 @@ public class TPsDevCabinetController extends BaseController {
         return util.exportExcel(list, "cabinet");
     }
 
+    @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevCabinet tPsDevCabinet) {
+        List<TPsDevCabinet> list = tPsDevCabinetService.selectTPsDevCabinetList(tPsDevCabinet);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevCabinet item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getBoxNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "玻璃门消火栓箱和泡沫栓箱");
+    }
+
     /**
      * 获取玻璃门消火栓箱和泡沫栓箱基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevCabinetService.selectTPsDevCabinetById(id));
@@ -61,7 +84,7 @@ public class TPsDevCabinetController extends BaseController {
     /**
      * 新增玻璃门消火栓箱和泡沫栓箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevCabinet tPsDevCabinet) {
@@ -71,7 +94,7 @@ public class TPsDevCabinetController extends BaseController {
     /**
      * 修改玻璃门消火栓箱和泡沫栓箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevCabinet tPsDevCabinet) {
@@ -81,10 +104,98 @@ public class TPsDevCabinetController extends BaseController {
     /**
      * 删除玻璃门消火栓箱和泡沫栓箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:cabinet:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevCabinetService.deleteTPsDevCabinetByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "玻璃门消火栓箱和泡沫栓箱基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevCabinet> list = new ArrayList<TPsDevCabinet>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevCabinet entity = new TPsDevCabinet();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 1) {
+                        entity.setModelNo(cellValue);
+                    } else if (j == 2) {
+                        entity.setBoxNo(cellValue);
+                    } else if (j == 3) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "2" (cabinet)
+                entity.setPatrolType("2");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevCabinet t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的boxNo
+                TPsDevCabinet exist = new TPsDevCabinet();
+                exist.setBoxNo(t.getBoxNo());
+                List<TPsDevCabinet> existList = tPsDevCabinetService.selectTPsDevCabinetList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevCabinetService.updateTPsDevCabinet(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCallsystemController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevCallsystem;
 import com.ruoyi.project.ps.dev.service.ITPsDevCallsystemService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevCallsystemController extends BaseController {
     /**
      * 查询现场呼叫系统基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevCallsystem tPsDevCallsystem) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevCallsystemController extends BaseController {
     /**
      * 导出现场呼叫系统基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevCallsystem tPsDevCallsystem) {
@@ -49,10 +60,22 @@ public class TPsDevCallsystemController extends BaseController {
         return util.exportExcel(list, "callsystem");
     }
 
+    @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevCallsystem tPsDevCallsystem) {
+        List<TPsDevCallsystem> list = tPsDevCallsystemService.selectTPsDevCallsystemList(tPsDevCallsystem);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevCallsystem item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "现场呼叫系统");
+    }
+
     /**
      * 获取现场呼叫系统基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevCallsystemService.selectTPsDevCallsystemById(id));
@@ -61,7 +84,7 @@ public class TPsDevCallsystemController extends BaseController {
     /**
      * 新增现场呼叫系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevCallsystem tPsDevCallsystem) {
@@ -71,7 +94,7 @@ public class TPsDevCallsystemController extends BaseController {
     /**
      * 修改现场呼叫系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevCallsystem tPsDevCallsystem) {
@@ -81,10 +104,96 @@ public class TPsDevCallsystemController extends BaseController {
     /**
      * 删除现场呼叫系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:callsystem:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevCallsystemService.deleteTPsDevCallsystemByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "现场呼叫系统基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevCallsystem> list = new ArrayList<TPsDevCallsystem>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevCallsystem entity = new TPsDevCallsystem();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "3" (callsystem)
+                entity.setPatrolType("3");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevCallsystem t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的devNo
+                TPsDevCallsystem exist = new TPsDevCallsystem();
+                exist.setDevNo(t.getDevNo());
+                List<TPsDevCallsystem> existList = tPsDevCallsystemService.selectTPsDevCallsystemList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevCallsystemService.updateTPsDevCallsystem(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCofferController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevCoffer;
 import com.ruoyi.project.ps.dev.service.ITPsDevCofferService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevCofferController extends BaseController {
     /**
      * 查询围堰基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevCoffer tPsDevCoffer) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevCofferController extends BaseController {
     /**
      * 导出围堰基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "围堰基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevCoffer tPsDevCoffer) {
@@ -49,10 +60,22 @@ public class TPsDevCofferController extends BaseController {
         return util.exportExcel(list, "coffer");
     }
 
+    @Log(title = "围堰基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevCoffer tPsDevCoffer) {
+        List<TPsDevCoffer> list = tPsDevCofferService.selectTPsDevCofferList(tPsDevCoffer);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevCoffer item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getCofferNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "围堰");
+    }
+
     /**
      * 获取围堰基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevCofferService.selectTPsDevCofferById(id));
@@ -61,7 +84,7 @@ public class TPsDevCofferController extends BaseController {
     /**
      * 新增围堰基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "围堰基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevCoffer tPsDevCoffer) {
@@ -71,7 +94,7 @@ public class TPsDevCofferController extends BaseController {
     /**
      * 修改围堰基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "围堰基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevCoffer tPsDevCoffer) {
@@ -81,10 +104,96 @@ public class TPsDevCofferController extends BaseController {
     /**
      * 删除围堰基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:coffer:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "围堰基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevCofferService.deleteTPsDevCofferByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "消防水箱基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevCoffer> list = new ArrayList<TPsDevCoffer>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevCoffer entity = new TPsDevCoffer();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setCofferNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "4" (coffer)
+                entity.setPatrolType("4");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevCoffer t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的cofferNo
+                TPsDevCoffer exist = new TPsDevCoffer();
+                exist.setCofferNo(t.getCofferNo());
+                List<TPsDevCoffer> existList = tPsDevCofferService.selectTPsDevCofferList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevCofferService.updateTPsDevCoffer(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevCurtainController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevCurtain;
 import com.ruoyi.project.ps.dev.service.ITPsDevCurtainService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevCurtainController extends BaseController {
     /**
      * 查询现场消防水幕检测记录列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevCurtain tPsDevCurtain) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevCurtainController extends BaseController {
     /**
      * 导出现场消防水幕检测记录列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevCurtain tPsDevCurtain) {
@@ -49,10 +60,22 @@ public class TPsDevCurtainController extends BaseController {
         return util.exportExcel(list, "curtain");
     }
 
+    @Log(title = "现场消防水幕检测记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevCurtain tPsDevCurtain) {
+        List<TPsDevCurtain> list = tPsDevCurtainService.selectTPsDevCurtainList(tPsDevCurtain);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevCurtain item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getCurtainName(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "现场消防水幕检测记录");
+    }
+
     /**
      * 获取现场消防水幕检测记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevCurtainService.selectTPsDevCurtainById(id));
@@ -61,7 +84,7 @@ public class TPsDevCurtainController extends BaseController {
     /**
      * 新增现场消防水幕检测记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevCurtain tPsDevCurtain) {
@@ -71,7 +94,7 @@ public class TPsDevCurtainController extends BaseController {
     /**
      * 修改现场消防水幕检测记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevCurtain tPsDevCurtain) {
@@ -81,10 +104,96 @@ public class TPsDevCurtainController extends BaseController {
     /**
      * 删除现场消防水幕检测记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:curtain:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevCurtainService.deleteTPsDevCurtainByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "防火卷帘基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevCurtain> list = new ArrayList<TPsDevCurtain>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevCurtain entity = new TPsDevCurtain();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setCurtainName(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "5" (curtain)
+                entity.setPatrolType("5");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevCurtain t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的curtainName
+                TPsDevCurtain exist = new TPsDevCurtain();
+                exist.setCurtainName(t.getCurtainName());
+                List<TPsDevCurtain> existList = tPsDevCurtainService.selectTPsDevCurtainList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevCurtainService.updateTPsDevCurtain(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 119 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevExtinguisherController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevExtinguisher;
 import com.ruoyi.project.ps.dev.service.ITPsDevExtinguisherService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevExtinguisherController extends BaseController {
     /**
      * 查询现场灭火器基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevExtinguisher tPsDevExtinguisher) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevExtinguisherController extends BaseController {
     /**
      * 导出现场灭火器基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场灭火器基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevExtinguisher tPsDevExtinguisher) {
@@ -49,10 +60,22 @@ public class TPsDevExtinguisherController extends BaseController {
         return util.exportExcel(list, "extinguisher");
     }
 
+    @Log(title = "现场灭火器基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevExtinguisher tPsDevExtinguisher) {
+        List<TPsDevExtinguisher> list = tPsDevExtinguisherService.selectTPsDevExtinguisherList(tPsDevExtinguisher);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevExtinguisher item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getFireExtinguisherNo() != null ? item.getFireExtinguisherNo() : "", item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "现场灭火器");
+    }
+
     /**
      * 获取现场灭火器基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevExtinguisherService.selectTPsDevExtinguisherById(id));
@@ -61,7 +84,7 @@ public class TPsDevExtinguisherController extends BaseController {
     /**
      * 新增现场灭火器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场灭火器基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevExtinguisher tPsDevExtinguisher) {
@@ -71,7 +94,7 @@ public class TPsDevExtinguisherController extends BaseController {
     /**
      * 修改现场灭火器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场灭火器基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevExtinguisher tPsDevExtinguisher) {
@@ -81,10 +104,100 @@ public class TPsDevExtinguisherController extends BaseController {
     /**
      * 删除现场灭火器基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:extinguisher:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场灭火器基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevExtinguisherService.deleteTPsDevExtinguisherByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "现场灭火器基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevExtinguisher> list = new ArrayList<TPsDevExtinguisher>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevExtinguisher entity = new TPsDevExtinguisher();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setFireExtinguisherNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setFireExtinguisherModel(cellValue);
+                    } else if (j == 3) {
+                        entity.setDevType(cellValue);
+                    } else if (j == 4) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "6" (extinguisher)
+                entity.setPatrolType("6");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevExtinguisher t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的现场编号
+                TPsDevExtinguisher existExtinguisher = new TPsDevExtinguisher();
+                existExtinguisher.setFireExtinguisherNo(t.getFireExtinguisherNo());
+                List<TPsDevExtinguisher> existList = tPsDevExtinguisherService.selectTPsDevExtinguisherList(existExtinguisher);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevExtinguisherService.updateTPsDevExtinguisher(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 113 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevEyewashController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevEyewash;
 import com.ruoyi.project.ps.dev.service.ITPsDevEyewashService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevEyewashController extends BaseController {
     /**
      * 查询洗眼器巡检记录列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevEyewash tPsDevEyewash) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevEyewashController extends BaseController {
     /**
      * 导出洗眼器巡检记录列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevEyewash tPsDevEyewash) {
@@ -49,10 +60,22 @@ public class TPsDevEyewashController extends BaseController {
         return util.exportExcel(list, "eyewash");
     }
 
+    @Log(title = "洗眼器巡检记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevEyewash tPsDevEyewash) {
+        List<TPsDevEyewash> list = tPsDevEyewashService.selectTPsDevEyewashList(tPsDevEyewash);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevEyewash item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), ""));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "洗眼器");
+    }
+
     /**
      * 获取洗眼器巡检记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevEyewashService.selectTPsDevEyewashById(id));
@@ -61,7 +84,7 @@ public class TPsDevEyewashController extends BaseController {
     /**
      * 新增洗眼器巡检记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevEyewash tPsDevEyewash) {
@@ -71,7 +94,7 @@ public class TPsDevEyewashController extends BaseController {
     /**
      * 修改洗眼器巡检记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevEyewash tPsDevEyewash) {
@@ -81,10 +104,94 @@ public class TPsDevEyewashController extends BaseController {
     /**
      * 删除洗眼器巡检记录
      */
-    @PreAuthorize("@ss.hasPermi('dev:eyewash:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevEyewashService.deleteTPsDevEyewashByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "洗眼器基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevEyewash> list = new ArrayList<TPsDevEyewash>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevEyewash entity = new TPsDevEyewash();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "7" (eyewash)
+                entity.setPatrolType("7");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevEyewash t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的devNo
+                TPsDevEyewash exist = new TPsDevEyewash();
+                exist.setDevNo(t.getDevNo());
+                List<TPsDevEyewash> existList = tPsDevEyewashService.selectTPsDevEyewashList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevEyewashService.updateTPsDevEyewash(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevFgsController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevFgs;
 import com.ruoyi.project.ps.dev.service.ITPsDevFgsService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevFgsController extends BaseController {
     /**
      * 查询FGS Mini板基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevFgs tPsDevFgs) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevFgsController extends BaseController {
     /**
      * 导出FGS Mini板基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "FGS Mini板基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevFgs tPsDevFgs) {
@@ -49,10 +60,22 @@ public class TPsDevFgsController extends BaseController {
         return util.exportExcel(list, "fgs");
     }
 
+    @Log(title = "FGS Mini板基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevFgs tPsDevFgs) {
+        List<TPsDevFgs> list = tPsDevFgsService.selectTPsDevFgsList(tPsDevFgs);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevFgs item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getFgsNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "FGS Mini板");
+    }
+
     /**
      * 获取FGS Mini板基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevFgsService.selectTPsDevFgsById(id));
@@ -61,7 +84,7 @@ public class TPsDevFgsController extends BaseController {
     /**
      * 新增FGS Mini板基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "FGS Mini板基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevFgs tPsDevFgs) {
@@ -71,7 +94,7 @@ public class TPsDevFgsController extends BaseController {
     /**
      * 修改FGS Mini板基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "FGS Mini板基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevFgs tPsDevFgs) {
@@ -81,10 +104,96 @@ public class TPsDevFgsController extends BaseController {
     /**
      * 删除FGS Mini板基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:fgs:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "FGS Mini板基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevFgsService.deleteTPsDevFgsByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "FGS Mini板基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevFgs> list = new ArrayList<TPsDevFgs>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevFgs entity = new TPsDevFgs();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setFgsNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "8" (fgs)
+                entity.setPatrolType("8");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevFgs t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的fgsNo
+                TPsDevFgs exist = new TPsDevFgs();
+                exist.setFgsNo(t.getFgsNo());
+                List<TPsDevFgs> existList = tPsDevFgsService.selectTPsDevFgsList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevFgsService.updateTPsDevFgs(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 117 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevFiredoorController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevFiredoor;
 import com.ruoyi.project.ps.dev.service.ITPsDevFiredoorService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevFiredoorController extends BaseController {
     /**
      * 查询安全防火门防爆门基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevFiredoor tPsDevFiredoor) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevFiredoorController extends BaseController {
     /**
      * 导出安全防火门防爆门基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevFiredoor tPsDevFiredoor) {
@@ -49,10 +60,22 @@ public class TPsDevFiredoorController extends BaseController {
         return util.exportExcel(list, "firedoor");
     }
 
+    @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevFiredoor tPsDevFiredoor) {
+        List<TPsDevFiredoor> list = tPsDevFiredoorService.selectTPsDevFiredoorList(tPsDevFiredoor);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevFiredoor item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDoorNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "安全防火门防爆门");
+    }
+
     /**
      * 获取安全防火门防爆门基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevFiredoorService.selectTPsDevFiredoorById(id));
@@ -61,7 +84,7 @@ public class TPsDevFiredoorController extends BaseController {
     /**
      * 新增安全防火门防爆门基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevFiredoor tPsDevFiredoor) {
@@ -71,7 +94,7 @@ public class TPsDevFiredoorController extends BaseController {
     /**
      * 修改安全防火门防爆门基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevFiredoor tPsDevFiredoor) {
@@ -81,10 +104,98 @@ public class TPsDevFiredoorController extends BaseController {
     /**
      * 删除安全防火门防爆门基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:firedoor:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevFiredoorService.deleteTPsDevFiredoorByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "安全防火门防爆门基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevFiredoor> list = new ArrayList<TPsDevFiredoor>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevFiredoor entity = new TPsDevFiredoor();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDoorNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setDoorName(cellValue);
+                    } else if (j == 2) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 3) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "9" (firedoor)
+                entity.setPatrolType("9");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevFiredoor t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的doorNo
+                TPsDevFiredoor exist = new TPsDevFiredoor();
+                exist.setDoorNo(t.getDoorNo());
+                List<TPsDevFiredoor> existList = tPsDevFiredoorService.selectTPsDevFiredoorList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevFiredoorService.updateTPsDevFiredoor(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 117 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevHydrantController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevHydrant;
 import com.ruoyi.project.ps.dev.service.ITPsDevHydrantService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevHydrantController extends BaseController {
     /**
      * 查询地上消火栓和消防水带箱基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevHydrant tPsDevHydrant) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevHydrantController extends BaseController {
     /**
      * 导出地上消火栓和消防水带箱基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevHydrant tPsDevHydrant) {
@@ -49,10 +60,22 @@ public class TPsDevHydrantController extends BaseController {
         return util.exportExcel(list, "hydrant");
     }
 
+    @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevHydrant tPsDevHydrant) {
+        List<TPsDevHydrant> list = tPsDevHydrantService.selectTPsDevHydrantList(tPsDevHydrant);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevHydrant item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getEquipId(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "地上消火栓和消防水带箱");
+    }
+
     /**
      * 获取地上消火栓和消防水带箱基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevHydrantService.selectTPsDevHydrantById(id));
@@ -61,7 +84,7 @@ public class TPsDevHydrantController extends BaseController {
     /**
      * 新增地上消火栓和消防水带箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevHydrant tPsDevHydrant) {
@@ -71,7 +94,7 @@ public class TPsDevHydrantController extends BaseController {
     /**
      * 修改地上消火栓和消防水带箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevHydrant tPsDevHydrant) {
@@ -81,10 +104,98 @@ public class TPsDevHydrantController extends BaseController {
     /**
      * 删除地上消火栓和消防水带箱基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:hydrant:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevHydrantService.deleteTPsDevHydrantByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "地上消火栓和消防水带箱基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevHydrant> list = new ArrayList<TPsDevHydrant>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevHydrant entity = new TPsDevHydrant();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 1) {
+                        entity.setEquipId(cellValue);
+                    } else if (j == 2) {
+                        entity.setDevType(cellValue);
+                    } else if (j == 3) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "10" (hydrant)
+                entity.setPatrolType("10");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevHydrant t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的器材编号
+                TPsDevHydrant existHydrant = new TPsDevHydrant();
+                existHydrant.setEquipId(t.getEquipId());
+                List<TPsDevHydrant> existList = tPsDevHydrantService.selectTPsDevHydrantList(existHydrant);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevHydrantService.updateTPsDevHydrant(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevLiftController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevLift;
 import com.ruoyi.project.ps.dev.service.ITPsDevLiftService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevLiftController extends BaseController {
     /**
      * 查询电梯基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevLift tPsDevLift) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevLiftController extends BaseController {
     /**
      * 导出电梯基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "电梯基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevLift tPsDevLift) {
@@ -49,10 +60,22 @@ public class TPsDevLiftController extends BaseController {
         return util.exportExcel(list, "lift");
     }
 
+    @Log(title = "电梯基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevLift tPsDevLift) {
+        List<TPsDevLift> list = tPsDevLiftService.selectTPsDevLiftList(tPsDevLift);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevLift item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "电梯");
+    }
+
     /**
      * 获取电梯基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevLiftService.selectTPsDevLiftById(id));
@@ -61,7 +84,7 @@ public class TPsDevLiftController extends BaseController {
     /**
      * 新增电梯基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "电梯基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevLift tPsDevLift) {
@@ -71,7 +94,7 @@ public class TPsDevLiftController extends BaseController {
     /**
      * 修改电梯基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "电梯基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevLift tPsDevLift) {
@@ -81,10 +104,96 @@ public class TPsDevLiftController extends BaseController {
     /**
      * 删除电梯基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:lift:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "电梯基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevLiftService.deleteTPsDevLiftByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "电梯基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevLift> list = new ArrayList<TPsDevLift>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevLift entity = new TPsDevLift();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "11" (lift)
+                entity.setPatrolType("11");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevLift t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的devNo
+                TPsDevLift exist = new TPsDevLift();
+                exist.setDevNo(t.getDevNo());
+                List<TPsDevLift> existList = tPsDevLiftService.selectTPsDevLiftList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevLiftService.updateTPsDevLift(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevMonitorController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevMonitor;
 import com.ruoyi.project.ps.dev.service.ITPsDevMonitorService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevMonitorController extends BaseController {
     /**
      * 查询现场消防炮基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevMonitor tPsDevMonitor) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevMonitorController extends BaseController {
     /**
      * 导出现场消防炮基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场消防炮基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevMonitor tPsDevMonitor) {
@@ -49,10 +60,22 @@ public class TPsDevMonitorController extends BaseController {
         return util.exportExcel(list, "monitor");
     }
 
+    @Log(title = "现场消防炮基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevMonitor tPsDevMonitor) {
+        List<TPsDevMonitor> list = tPsDevMonitorService.selectTPsDevMonitorList(tPsDevMonitor);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevMonitor item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "现场消防炮");
+    }
+
     /**
      * 获取现场消防炮基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevMonitorService.selectTPsDevMonitorById(id));
@@ -61,7 +84,7 @@ public class TPsDevMonitorController extends BaseController {
     /**
      * 新增现场消防炮基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场消防炮基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevMonitor tPsDevMonitor) {
@@ -71,7 +94,7 @@ public class TPsDevMonitorController extends BaseController {
     /**
      * 修改现场消防炮基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场消防炮基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevMonitor tPsDevMonitor) {
@@ -81,10 +104,96 @@ public class TPsDevMonitorController extends BaseController {
     /**
      * 删除现场消防炮基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:monitor:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场消防炮基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevMonitorService.deleteTPsDevMonitorByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "消防水炮/水幕基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevMonitor> list = new ArrayList<TPsDevMonitor>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevMonitor entity = new TPsDevMonitor();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "12" (monitor)
+                entity.setPatrolType("12");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevMonitor t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的devNo
+                TPsDevMonitor exist = new TPsDevMonitor();
+                exist.setDevNo(t.getDevNo());
+                List<TPsDevMonitor> existList = tPsDevMonitorService.selectTPsDevMonitorList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevMonitorService.updateTPsDevMonitor(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevPitController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevPit;
 import com.ruoyi.project.ps.dev.service.ITPsDevPitService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevPitController extends BaseController {
     /**
      * 查询现场地井基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevPit tPsDevPit) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevPitController extends BaseController {
     /**
      * 导出现场地井基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场地井基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevPit tPsDevPit) {
@@ -49,10 +60,22 @@ public class TPsDevPitController extends BaseController {
         return util.exportExcel(list, "pit");
     }
 
+    @Log(title = "现场地井基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevPit tPsDevPit) {
+        List<TPsDevPit> list = tPsDevPitService.selectTPsDevPitList(tPsDevPit);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevPit item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getDevNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "现场地井");
+    }
+
     /**
      * 获取现场地井基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevPitService.selectTPsDevPitById(id));
@@ -61,7 +84,7 @@ public class TPsDevPitController extends BaseController {
     /**
      * 新增现场地井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场地井基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevPit tPsDevPit) {
@@ -71,7 +94,7 @@ public class TPsDevPitController extends BaseController {
     /**
      * 修改现场地井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场地井基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevPit tPsDevPit) {
@@ -81,10 +104,96 @@ public class TPsDevPitController extends BaseController {
     /**
      * 删除现场地井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:pit:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场地井基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevPitService.deleteTPsDevPitByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "坑基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevPit> list = new ArrayList<TPsDevPit>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevPit entity = new TPsDevPit();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setDevNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "13" (pit)
+                entity.setPatrolType("13");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevPit t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的devNo
+                TPsDevPit exist = new TPsDevPit();
+                exist.setDevNo(t.getDevNo());
+                List<TPsDevPit> existList = tPsDevPitService.selectTPsDevPitList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevPitService.updateTPsDevPit(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevRainvalveController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevRainvalve;
 import com.ruoyi.project.ps.dev.service.ITPsDevRainvalveService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevRainvalveController extends BaseController {
     /**
      * 查询污水/雨排切换阀门检查列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevRainvalve tPsDevRainvalve) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevRainvalveController extends BaseController {
     /**
      * 导出污水/雨排切换阀门检查列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevRainvalve tPsDevRainvalve) {
@@ -49,10 +60,22 @@ public class TPsDevRainvalveController extends BaseController {
         return util.exportExcel(list, "rainvalve");
     }
 
+    @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevRainvalve tPsDevRainvalve) {
+        List<TPsDevRainvalve> list = tPsDevRainvalveService.selectTPsDevRainvalveList(tPsDevRainvalve);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevRainvalve item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getValveName(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "污水/雨排切换阀门");
+    }
+
     /**
      * 获取污水/雨排切换阀门检查详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevRainvalveService.selectTPsDevRainvalveById(id));
@@ -61,7 +84,7 @@ public class TPsDevRainvalveController extends BaseController {
     /**
      * 新增污水/雨排切换阀门检查
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevRainvalve tPsDevRainvalve) {
@@ -71,7 +94,7 @@ public class TPsDevRainvalveController extends BaseController {
     /**
      * 修改污水/雨排切换阀门检查
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevRainvalve tPsDevRainvalve) {
@@ -81,10 +104,96 @@ public class TPsDevRainvalveController extends BaseController {
     /**
      * 删除污水/雨排切换阀门检查
      */
-    @PreAuthorize("@ss.hasPermi('dev:rainvalve:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevRainvalveService.deleteTPsDevRainvalveByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "雨水阀基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevRainvalve> list = new ArrayList<TPsDevRainvalve>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevRainvalve entity = new TPsDevRainvalve();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setValveName(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "14" (rainvalve)
+                entity.setPatrolType("14");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevRainvalve t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的valveName
+                TPsDevRainvalve exist = new TPsDevRainvalve();
+                exist.setValveName(t.getValveName());
+                List<TPsDevRainvalve> existList = tPsDevRainvalveService.selectTPsDevRainvalveList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevRainvalveService.updateTPsDevRainvalve(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevSteamController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevSteam;
 import com.ruoyi.project.ps.dev.service.ITPsDevSteamService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevSteamController extends BaseController {
     /**
      * 查询消防蒸汽系统基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevSteam tPsDevSteam) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevSteamController extends BaseController {
     /**
      * 导出消防蒸汽系统基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "消防蒸汽系统基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevSteam tPsDevSteam) {
@@ -49,10 +60,22 @@ public class TPsDevSteamController extends BaseController {
         return util.exportExcel(list, "steam");
     }
 
+    @Log(title = "消防蒸汽系统基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevSteam tPsDevSteam) {
+        List<TPsDevSteam> list = tPsDevSteamService.selectTPsDevSteamList(tPsDevSteam);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevSteam item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getSteamName(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "消防蒸汽系统");
+    }
+
     /**
      * 获取消防蒸汽系统基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevSteamService.selectTPsDevSteamById(id));
@@ -61,7 +84,7 @@ public class TPsDevSteamController extends BaseController {
     /**
      * 新增消防蒸汽系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "消防蒸汽系统基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevSteam tPsDevSteam) {
@@ -71,7 +94,7 @@ public class TPsDevSteamController extends BaseController {
     /**
      * 修改消防蒸汽系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "消防蒸汽系统基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevSteam tPsDevSteam) {
@@ -81,10 +104,96 @@ public class TPsDevSteamController extends BaseController {
     /**
      * 删除消防蒸汽系统基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:steam:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "消防蒸汽系统基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevSteamService.deleteTPsDevSteamByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "蒸汽基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevSteam> list = new ArrayList<TPsDevSteam>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevSteam entity = new TPsDevSteam();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setSteamName(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "15" (steam)
+                entity.setPatrolType("15");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevSteam t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的steamName
+                TPsDevSteam exist = new TPsDevSteam();
+                exist.setSteamName(t.getSteamName());
+                List<TPsDevSteam> existList = tPsDevSteamService.selectTPsDevSteamList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevSteamService.updateTPsDevSteam(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevSumpController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevSump;
 import com.ruoyi.project.ps.dev.service.ITPsDevSumpService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevSumpController extends BaseController {
     /**
      * 查询雨排井基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevSump tPsDevSump) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevSumpController extends BaseController {
     /**
      * 导出雨排井基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "雨排井基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevSump tPsDevSump) {
@@ -49,10 +60,22 @@ public class TPsDevSumpController extends BaseController {
         return util.exportExcel(list, "sump");
     }
 
+    @Log(title = "雨排井基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevSump tPsDevSump) {
+        List<TPsDevSump> list = tPsDevSumpService.selectTPsDevSumpList(tPsDevSump);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevSump item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getSumpNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "雨排井");
+    }
+
     /**
      * 获取雨排井基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevSumpService.selectTPsDevSumpById(id));
@@ -61,7 +84,7 @@ public class TPsDevSumpController extends BaseController {
     /**
      * 新增雨排井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "雨排井基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevSump tPsDevSump) {
@@ -71,7 +94,7 @@ public class TPsDevSumpController extends BaseController {
     /**
      * 修改雨排井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "雨排井基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevSump tPsDevSump) {
@@ -81,10 +104,96 @@ public class TPsDevSumpController extends BaseController {
     /**
      * 删除雨排井基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:sump:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "雨排井基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevSumpService.deleteTPsDevSumpByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "集水坑基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevSump> list = new ArrayList<TPsDevSump>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevSump entity = new TPsDevSump();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setSumpNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "16" (sump)
+                entity.setPatrolType("16");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevSump t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的sumpNo
+                TPsDevSump exist = new TPsDevSump();
+                exist.setSumpNo(t.getSumpNo());
+                List<TPsDevSump> existList = tPsDevSumpService.selectTPsDevSumpList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevSumpService.updateTPsDevSump(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevUtilitystationController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevUtilitystation;
 import com.ruoyi.project.ps.dev.service.ITPsDevUtilitystationService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevUtilitystationController extends BaseController {
     /**
      * 查询公用站基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevUtilitystation tPsDevUtilitystation) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevUtilitystationController extends BaseController {
     /**
      * 导出公用站基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "公用站基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevUtilitystation tPsDevUtilitystation) {
@@ -49,10 +60,22 @@ public class TPsDevUtilitystationController extends BaseController {
         return util.exportExcel(list, "utilitystation");
     }
 
+    @Log(title = "公用站基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevUtilitystation tPsDevUtilitystation) {
+        List<TPsDevUtilitystation> list = tPsDevUtilitystationService.selectTPsDevUtilitystationList(tPsDevUtilitystation);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevUtilitystation item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getUtilityStationName(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "公用站");
+    }
+
     /**
      * 获取公用站基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevUtilitystationService.selectTPsDevUtilitystationById(id));
@@ -61,7 +84,7 @@ public class TPsDevUtilitystationController extends BaseController {
     /**
      * 新增公用站基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "公用站基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevUtilitystation tPsDevUtilitystation) {
@@ -71,7 +94,7 @@ public class TPsDevUtilitystationController extends BaseController {
     /**
      * 修改公用站基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "公用站基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevUtilitystation tPsDevUtilitystation) {
@@ -81,10 +104,96 @@ public class TPsDevUtilitystationController extends BaseController {
     /**
      * 删除公用站基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:utilitystation:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "公用站基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevUtilitystationService.deleteTPsDevUtilitystationByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "公用站基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevUtilitystation> list = new ArrayList<TPsDevUtilitystation>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevUtilitystation entity = new TPsDevUtilitystation();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setUtilityStationName(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "17" (utilitystation)
+                entity.setPatrolType("17");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevUtilitystation t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的utilityStationName
+                TPsDevUtilitystation exist = new TPsDevUtilitystation();
+                exist.setUtilityStationName(t.getUtilityStationName());
+                List<TPsDevUtilitystation> existList = tPsDevUtilitystationService.selectTPsDevUtilitystationList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevUtilitystationService.updateTPsDevUtilitystation(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 115 - 6
master/src/main/java/com/ruoyi/project/ps/dev/controller/TPsDevVentvalveController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.ps.dev.controller;
 
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.poi.QRCodeEntity;
+import com.ruoyi.common.utils.poi.QRCodeUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -8,10 +11,18 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.dev.domain.TPsDevVentvalve;
 import com.ruoyi.project.ps.dev.service.ITPsDevVentvalveService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,7 +40,7 @@ public class TPsDevVentvalveController extends BaseController {
     /**
      * 查询余压阀基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsDevVentvalve tPsDevVentvalve) {
         startPage();
@@ -40,7 +51,7 @@ public class TPsDevVentvalveController extends BaseController {
     /**
      * 导出余压阀基础信息列表
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "余压阀基础信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsDevVentvalve tPsDevVentvalve) {
@@ -49,10 +60,22 @@ public class TPsDevVentvalveController extends BaseController {
         return util.exportExcel(list, "ventvalve");
     }
 
+    @Log(title = "余压阀基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportQRCode")
+    public void exportQRCode(HttpServletResponse response, TPsDevVentvalve tPsDevVentvalve) {
+        List<TPsDevVentvalve> list = tPsDevVentvalveService.selectTPsDevVentvalveList(tPsDevVentvalve);
+        List<QRCodeEntity> qrCodeEntities = new ArrayList<>();
+        for (TPsDevVentvalve item : list) {
+            qrCodeEntities.add(new QRCodeEntity(item.getId(), item.getVentvalveNo(), item.getPatrolType(), item.getPosition()));
+        }
+        QRCodeUtil<QRCodeEntity> util = new QRCodeUtil<>(QRCodeEntity.class);
+        util.exportQRCodeAsZip(response, qrCodeEntities, "余压阀");
+    }
+
     /**
      * 获取余压阀基础信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsDevVentvalveService.selectTPsDevVentvalveById(id));
@@ -61,7 +84,7 @@ public class TPsDevVentvalveController extends BaseController {
     /**
      * 新增余压阀基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "余压阀基础信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsDevVentvalve tPsDevVentvalve) {
@@ -71,7 +94,7 @@ public class TPsDevVentvalveController extends BaseController {
     /**
      * 修改余压阀基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "余压阀基础信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsDevVentvalve tPsDevVentvalve) {
@@ -81,10 +104,96 @@ public class TPsDevVentvalveController extends BaseController {
     /**
      * 删除余压阀基础信息
      */
-    @PreAuthorize("@ss.hasPermi('dev:ventvalve:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "余压阀基础信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tPsDevVentvalveService.deleteTPsDevVentvalveByIds(ids));
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('ps:patrol:import')")
+    @Log(title = "通风阀基础信息", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TPsDevVentvalve> list = new ArrayList<TPsDevVentvalve>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                int cellNum = row.getLastCellNum();
+                TPsDevVentvalve entity = new TPsDevVentvalve();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setVentvalveNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                // status 直接设置为 "1"
+                entity.setStatus("1");
+                // patrolType 根据自身类型自动设置为 "18" (ventvalve)
+                entity.setPatrolType("18");
+                entity.setCreaterCode(userId.toString());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+                logger.error("导入第" + (i + 1) + "行数据失败", e);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TPsDevVentvalve t : list) {
+            failNum++;
+            try {
+                // 检查是否存在相同的ventvalveNo
+                TPsDevVentvalve exist = new TPsDevVentvalve();
+                exist.setVentvalveNo(t.getVentvalveNo());
+                List<TPsDevVentvalve> existList = tPsDevVentvalveService.selectTPsDevVentvalveList(exist);
+                if (existList != null && !existList.isEmpty()) {
+                    // 更新已存在的数据
+                    t.setId(existList.get(0).getId());
+                    t.setUpdaterCode(userId.toString());
+                    tPsDevVentvalveService.updateTPsDevVentvalve(t);
+                } else {
+                    // 新增数据
+                    this.add(t);
+                }
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + list.size());
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
+    }
+
 }

+ 100 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionAlarmController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionAlarm;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionAlarmService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/alarm")
 public class TPsInspectionAlarmController extends BaseController {
+
     @Autowired
     private ITPsInspectionAlarmService tPsInspectionAlarmService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询手动启动火灾报警器检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionAlarm tPsInspectionAlarm) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionAlarmController extends BaseController {
     /**
      * 导出手动启动火灾报警器检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "手动启动火灾报警器检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionAlarm tPsInspectionAlarm) {
@@ -52,7 +65,7 @@ public class TPsInspectionAlarmController extends BaseController {
     /**
      * 获取手动启动火灾报警器检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionAlarmService.selectTPsInspectionAlarmById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionAlarmController extends BaseController {
     /**
      * 新增手动启动火灾报警器检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "手动启动火灾报警器检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionAlarm tPsInspectionAlarm) {
@@ -70,18 +83,99 @@ public class TPsInspectionAlarmController extends BaseController {
 
     /**
      * 修改手动启动火灾报警器检查记录
+     *
+     * @param tPsInspectionAlarm 手动启动火灾报警器检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "手动启动火灾报警器检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionAlarm tPsInspectionAlarm) {
+        Date date = new Date();
+        TPsInspectionAlarm alarm = tPsInspectionAlarmService.selectTPsInspectionAlarmById(tPsInspectionAlarm.getId());
+
+        if (alarm.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(alarm.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionAlarm.getAppearance(), tPsInspectionAlarm.getAlarmSign(), tPsInspectionAlarm.getGlassRetainer())) {
+            // 当前数据标记为存在问题
+            tPsInspectionAlarm.setIssuesStatus(1L);
+            tPsInspectionAlarm.setUpdatedate(date);
+            tPsInspectionAlarm.setUpdaterCode(getUserId().toString());
+            tPsInspectionAlarmService.updateTPsInspectionAlarm(tPsInspectionAlarm);
+
+            // 存档历史问题数据
+            TPsInspectionAlarm entity = new TPsInspectionAlarm();
+            entity.setDevNo(alarm.getDevNo());
+            entity.setPosition(alarm.getPosition());
+            entity.setAppearance(tPsInspectionAlarm.getAppearance());
+            entity.setAlarmSign(tPsInspectionAlarm.getAlarmSign());
+            entity.setGlassRetainer(tPsInspectionAlarm.getGlassRetainer());
+            entity.setMonth(alarm.getMonth());
+            entity.setYear(alarm.getYear());
+            entity.setPlanId(alarm.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionAlarmService.insertTPsInspectionAlarm(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionAlarm.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(alarm.getDevNo() + "_" + alarm.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (alarm.getIssuesStatus() == 1) {
+                tPsInspectionAlarm.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionAlarm.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionAlarm.setCheckStatus("1");
+            tPsInspectionAlarm.setConfirmer(getNickName());
+            tPsInspectionAlarm.setCheckDate(date);
+            tPsInspectionAlarm.setUpdatedate(date);
+            tPsInspectionAlarm.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionAlarmService.updateTPsInspectionAlarm(tPsInspectionAlarm));
     }
 
     /**
      * 删除手动启动火灾报警器检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:alarm:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "手动启动火灾报警器检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 577 - 0
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionAppController.java

@@ -0,0 +1,577 @@
+package com.ruoyi.project.ps.inspection.controller;
+
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.ps.inspection.domain.*;
+import com.ruoyi.project.ps.inspection.dto.InspectionQueryRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+import java.util.Map;
+
+/**
+ * 巡检记录App共通Controller
+ * 提供给移动端App使用的统一接口
+ *
+ * @author system
+ * @date 2025-01-XX
+ */
+@RestController
+@RequestMapping("/app/ps/inspection")
+public class TPsInspectionAppController extends BaseController {
+
+    // 注入各个Controller
+    @Autowired
+    private TPsInspectionAlarmController alarmController;
+    @Autowired
+    private TPsInspectionExtinguisherController extinguisherController;
+    @Autowired
+    private TPsInspectionHydrantController hydrantController;
+    @Autowired
+    private TPsInspectionFiredoorController firedoorController;
+    @Autowired
+    private TPsInspectionLiftController liftController;
+    @Autowired
+    private TPsInspectionCabinetController cabinetController;
+    @Autowired
+    private TPsInspectionCallsystemController callsystemController;
+    @Autowired
+    private TPsInspectionFgsController fgsController;
+    @Autowired
+    private TPsInspectionCurtainController curtainController;
+    @Autowired
+    private TPsInspectionSteamController steamController;
+    @Autowired
+    private TPsInspectionMonitorController monitorController;
+    @Autowired
+    private TPsInspectionCofferController cofferController;
+    @Autowired
+    private TPsInspectionSumpController sumpController;
+    @Autowired
+    private TPsInspectionPitController pitController;
+    @Autowired
+    private TPsInspectionRainvalveController rainvalveController;
+    @Autowired
+    private TPsInspectionVentvalveController ventvalveController;
+    @Autowired
+    private TPsInspectionUtilitystationController utilitystationController;
+    @Autowired
+    private TPsInspectionEyewashController eyewashController;
+
+    /**
+     * 查询巡检记录列表(App接口)
+     *
+     * @param request 查询请求参数
+     * @return 查询结果
+     */
+    @PostMapping("/list")
+    public AjaxResult list(@RequestBody InspectionQueryRequest request) {
+        if (request.getType() == null || request.getType().isEmpty()) {
+            return AjaxResult.error("巡检记录类型不能为空");
+        }
+
+        try {
+            TableDataInfo dataTable = queryByType(request);
+            return AjaxResult.success(dataTable);
+        } catch (Exception e) {
+            logger.error("查询巡检记录失败", e);
+            return AjaxResult.error("查询失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 修改巡检记录(App接口)
+     *
+     * @param request 修改请求参数(包含type和具体的数据对象)
+     * @return 修改结果
+     */
+    @PostMapping("/update")
+    public AjaxResult update(@RequestBody Map<String, Object> request) {
+        String type = (String) request.get("type");
+        if (type == null || type.isEmpty()) {
+            return AjaxResult.error("巡检记录类型不能为空");
+        }
+
+        try {
+            return updateByType(type, request);
+        } catch (Exception e) {
+            logger.error("修改巡检记录失败", e);
+            return AjaxResult.error("修改失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 根据类型查询数据,调用对应Controller的list方法
+     */
+    private TableDataInfo queryByType(InspectionQueryRequest request) {
+        String type = request.getType().toLowerCase();
+
+        switch (type) {
+            case "alarm":
+                TPsInspectionAlarm alarm = new TPsInspectionAlarm();
+                copyCommonFields(request, alarm);
+                return alarmController.list(alarm);
+
+            case "extinguisher":
+                TPsInspectionExtinguisher extinguisher = new TPsInspectionExtinguisher();
+                copyCommonFields(request, extinguisher);
+                return extinguisherController.list(extinguisher);
+
+            case "hydrant":
+                TPsInspectionHydrant hydrant = new TPsInspectionHydrant();
+                copyCommonFields(request, hydrant);
+                return hydrantController.list(hydrant);
+
+            case "firedoor":
+                TPsInspectionFiredoor firedoor = new TPsInspectionFiredoor();
+                copyCommonFields(request, firedoor);
+                return firedoorController.list(firedoor);
+
+            case "lift":
+                TPsInspectionLift lift = new TPsInspectionLift();
+                copyCommonFields(request, lift);
+                return liftController.list(lift);
+
+            case "cabinet":
+                TPsInspectionCabinet cabinet = new TPsInspectionCabinet();
+                copyCommonFields(request, cabinet);
+                return cabinetController.list(cabinet);
+
+            case "callsystem":
+                TPsInspectionCallsystem callsystem = new TPsInspectionCallsystem();
+                copyCommonFields(request, callsystem);
+                return callsystemController.list(callsystem);
+
+            case "fgs":
+                TPsInspectionFgs fgs = new TPsInspectionFgs();
+                copyCommonFields(request, fgs);
+                return fgsController.list(fgs);
+
+            case "curtain":
+                TPsInspectionCurtain curtain = new TPsInspectionCurtain();
+                copyCommonFields(request, curtain);
+                return curtainController.list(curtain);
+
+            case "steam":
+                TPsInspectionSteam steam = new TPsInspectionSteam();
+                copyCommonFields(request, steam);
+                return steamController.list(steam);
+
+            case "monitor":
+                TPsInspectionMonitor monitor = new TPsInspectionMonitor();
+                copyCommonFields(request, monitor);
+                return monitorController.list(monitor);
+
+            case "coffer":
+                TPsInspectionCoffer coffer = new TPsInspectionCoffer();
+                copyCommonFields(request, coffer);
+                return cofferController.list(coffer);
+
+            case "sump":
+                TPsInspectionSump sump = new TPsInspectionSump();
+                copyCommonFields(request, sump);
+                return sumpController.list(sump);
+
+            case "pit":
+                TPsInspectionPit pit = new TPsInspectionPit();
+                copyCommonFields(request, pit);
+                return pitController.list(pit);
+
+            case "rainvalve":
+                TPsInspectionRainvalve rainvalve = new TPsInspectionRainvalve();
+                copyCommonFields(request, rainvalve);
+                return rainvalveController.list(rainvalve);
+
+            case "ventvalve":
+                TPsInspectionVentvalve ventvalve = new TPsInspectionVentvalve();
+                copyCommonFields(request, ventvalve);
+                return ventvalveController.list(ventvalve);
+
+            case "utilitystation":
+                TPsInspectionUtilitystation utilitystation = new TPsInspectionUtilitystation();
+                copyCommonFields(request, utilitystation);
+                return utilitystationController.list(utilitystation);
+
+            case "eyewash":
+                TPsInspectionEyewash eyewash = new TPsInspectionEyewash();
+                copyCommonFields(request, eyewash);
+                return eyewashController.list(eyewash);
+
+            default:
+                throw new IllegalArgumentException("不支持的巡检记录类型:" + type);
+        }
+    }
+
+    /**
+     * 根据类型更新数据,调用对应Controller的edit方法
+     */
+    @SuppressWarnings("unchecked")
+    private AjaxResult updateByType(String type, Map<String, Object> request) {
+        type = type.toLowerCase();
+        Map<String, Object> data = (Map<String, Object>) request.get("data");
+
+        if (data == null) {
+            throw new IllegalArgumentException("更新数据不能为空");
+        }
+
+        switch (type) {
+            case "alarm":
+                TPsInspectionAlarm alarm = convertToAlarm(data);
+                return alarmController.edit(alarm);
+
+            case "extinguisher":
+                TPsInspectionExtinguisher extinguisher = convertToExtinguisher(data);
+                return extinguisherController.edit(extinguisher);
+
+            case "hydrant":
+                TPsInspectionHydrant hydrant = convertToHydrant(data);
+                return hydrantController.edit(hydrant);
+
+            case "firedoor":
+                TPsInspectionFiredoor firedoor = convertToFiredoor(data);
+                return firedoorController.edit(firedoor);
+
+            case "lift":
+                TPsInspectionLift lift = convertToLift(data);
+                return liftController.edit(lift);
+
+            case "cabinet":
+                TPsInspectionCabinet cabinet = convertToCabinet(data);
+                return cabinetController.edit(cabinet);
+
+            case "callsystem":
+                TPsInspectionCallsystem callsystem = convertToCallsystem(data);
+                return callsystemController.edit(callsystem);
+
+            case "fgs":
+                TPsInspectionFgs fgs = convertToFgs(data);
+                return fgsController.edit(fgs);
+
+            case "curtain":
+                TPsInspectionCurtain curtain = convertToCurtain(data);
+                return curtainController.edit(curtain);
+
+            case "steam":
+                TPsInspectionSteam steam = convertToSteam(data);
+                return steamController.edit(steam);
+
+            case "monitor":
+                TPsInspectionMonitor monitor = convertToMonitor(data);
+                return monitorController.edit(monitor);
+
+            case "coffer":
+                TPsInspectionCoffer coffer = convertToCoffer(data);
+                return cofferController.edit(coffer);
+
+            case "sump":
+                TPsInspectionSump sump = convertToSump(data);
+                return sumpController.edit(sump);
+
+            case "pit":
+                TPsInspectionPit pit = convertToPit(data);
+                return pitController.edit(pit);
+
+            case "rainvalve":
+                TPsInspectionRainvalve rainvalve = convertToRainvalve(data);
+                return rainvalveController.edit(rainvalve);
+
+            case "ventvalve":
+                TPsInspectionVentvalve ventvalve = convertToVentvalve(data);
+                return ventvalveController.edit(ventvalve);
+
+            case "utilitystation":
+                TPsInspectionUtilitystation utilitystation = convertToUtilitystation(data);
+                return utilitystationController.edit(utilitystation);
+
+            case "eyewash":
+                TPsInspectionEyewash eyewash = convertToEyewash(data);
+                return eyewashController.edit(eyewash);
+
+            default:
+                throw new IllegalArgumentException("不支持的巡检记录类型:" + type);
+        }
+    }
+
+    /**
+     * 复制通用字段到实体对象
+     */
+    private void copyCommonFields(InspectionQueryRequest request, Object entity) {
+        if (request.getId() != null) {
+            setFieldValue(entity, "id", request.getId());
+        }
+        if (request.getDevNo() != null) {
+            setFieldValue(entity, "devNo", request.getDevNo());
+        }
+        if (request.getPosition() != null) {
+            setFieldValue(entity, "position", request.getPosition());
+        }
+        if (request.getMonth() != null) {
+            setFieldValue(entity, "month", request.getMonth());
+        }
+        if (request.getYear() != null) {
+            setFieldValue(entity, "year", request.getYear());
+        }
+        if (request.getPlanId() != null) {
+            setFieldValue(entity, "planId", request.getPlanId());
+        }
+        if (request.getDeptId() != null) {
+            setFieldValue(entity, "deptId", request.getDeptId());
+        }
+        if (request.getCheckStatus() != null) {
+            setFieldValue(entity, "checkStatus", request.getCheckStatus());
+        }
+        if (request.getIssuesStatus() != null) {
+            setFieldValue(entity, "issuesStatus", request.getIssuesStatus());
+        }
+        if (request.getIssuesFlag() != null) {
+            setFieldValue(entity, "issuesFlag", request.getIssuesFlag());
+        }
+    }
+
+    /**
+     * 使用反射设置字段值
+     */
+    private void setFieldValue(Object obj, String fieldName, Object value) {
+        try {
+            java.lang.reflect.Field field = obj.getClass().getDeclaredField(fieldName);
+            field.setAccessible(true);
+            field.set(obj, value);
+        } catch (Exception e) {
+            // 忽略不存在的字段
+        }
+    }
+
+    /**
+     * 将Map转换为Alarm对象
+     */
+    private TPsInspectionAlarm convertToAlarm(Map<String, Object> data) {
+        TPsInspectionAlarm alarm = new TPsInspectionAlarm();
+        convertMapToObject(data, alarm);
+        return alarm;
+    }
+
+    /**
+     * 将Map转换为Extinguisher对象
+     */
+    private TPsInspectionExtinguisher convertToExtinguisher(Map<String, Object> data) {
+        TPsInspectionExtinguisher extinguisher = new TPsInspectionExtinguisher();
+        convertMapToObject(data, extinguisher);
+        return extinguisher;
+    }
+
+    /**
+     * 将Map转换为Hydrant对象
+     */
+    private TPsInspectionHydrant convertToHydrant(Map<String, Object> data) {
+        TPsInspectionHydrant hydrant = new TPsInspectionHydrant();
+        convertMapToObject(data, hydrant);
+        return hydrant;
+    }
+
+    /**
+     * 将Map转换为Firedoor对象
+     */
+    private TPsInspectionFiredoor convertToFiredoor(Map<String, Object> data) {
+        TPsInspectionFiredoor firedoor = new TPsInspectionFiredoor();
+        convertMapToObject(data, firedoor);
+        return firedoor;
+    }
+
+    /**
+     * 将Map转换为Lift对象
+     */
+    private TPsInspectionLift convertToLift(Map<String, Object> data) {
+        TPsInspectionLift lift = new TPsInspectionLift();
+        convertMapToObject(data, lift);
+        return lift;
+    }
+
+    /**
+     * 将Map转换为Cabinet对象
+     */
+    private TPsInspectionCabinet convertToCabinet(Map<String, Object> data) {
+        TPsInspectionCabinet cabinet = new TPsInspectionCabinet();
+        convertMapToObject(data, cabinet);
+        return cabinet;
+    }
+
+    /**
+     * 将Map转换为Callsystem对象
+     */
+    private TPsInspectionCallsystem convertToCallsystem(Map<String, Object> data) {
+        TPsInspectionCallsystem callsystem = new TPsInspectionCallsystem();
+        convertMapToObject(data, callsystem);
+        return callsystem;
+    }
+
+    /**
+     * 将Map转换为Fgs对象
+     */
+    private TPsInspectionFgs convertToFgs(Map<String, Object> data) {
+        TPsInspectionFgs fgs = new TPsInspectionFgs();
+        convertMapToObject(data, fgs);
+        return fgs;
+    }
+
+    /**
+     * 将Map转换为Curtain对象
+     */
+    private TPsInspectionCurtain convertToCurtain(Map<String, Object> data) {
+        TPsInspectionCurtain curtain = new TPsInspectionCurtain();
+        convertMapToObject(data, curtain);
+        return curtain;
+    }
+
+    /**
+     * 将Map转换为Steam对象
+     */
+    private TPsInspectionSteam convertToSteam(Map<String, Object> data) {
+        TPsInspectionSteam steam = new TPsInspectionSteam();
+        convertMapToObject(data, steam);
+        return steam;
+    }
+
+    /**
+     * 将Map转换为Monitor对象
+     */
+    private TPsInspectionMonitor convertToMonitor(Map<String, Object> data) {
+        TPsInspectionMonitor monitor = new TPsInspectionMonitor();
+        convertMapToObject(data, monitor);
+        return monitor;
+    }
+
+    /**
+     * 将Map转换为Coffer对象
+     */
+    private TPsInspectionCoffer convertToCoffer(Map<String, Object> data) {
+        TPsInspectionCoffer coffer = new TPsInspectionCoffer();
+        convertMapToObject(data, coffer);
+        return coffer;
+    }
+
+    /**
+     * 将Map转换为Sump对象
+     */
+    private TPsInspectionSump convertToSump(Map<String, Object> data) {
+        TPsInspectionSump sump = new TPsInspectionSump();
+        convertMapToObject(data, sump);
+        return sump;
+    }
+
+    /**
+     * 将Map转换为Pit对象
+     */
+    private TPsInspectionPit convertToPit(Map<String, Object> data) {
+        TPsInspectionPit pit = new TPsInspectionPit();
+        convertMapToObject(data, pit);
+        return pit;
+    }
+
+    /**
+     * 将Map转换为Rainvalve对象
+     */
+    private TPsInspectionRainvalve convertToRainvalve(Map<String, Object> data) {
+        TPsInspectionRainvalve rainvalve = new TPsInspectionRainvalve();
+        convertMapToObject(data, rainvalve);
+        return rainvalve;
+    }
+
+    /**
+     * 将Map转换为Ventvalve对象
+     */
+    private TPsInspectionVentvalve convertToVentvalve(Map<String, Object> data) {
+        TPsInspectionVentvalve ventvalve = new TPsInspectionVentvalve();
+        convertMapToObject(data, ventvalve);
+        return ventvalve;
+    }
+
+    /**
+     * 将Map转换为Utilitystation对象
+     */
+    private TPsInspectionUtilitystation convertToUtilitystation(Map<String, Object> data) {
+        TPsInspectionUtilitystation utilitystation = new TPsInspectionUtilitystation();
+        convertMapToObject(data, utilitystation);
+        return utilitystation;
+    }
+
+    /**
+     * 将Map转换为Eyewash对象
+     */
+    private TPsInspectionEyewash convertToEyewash(Map<String, Object> data) {
+        TPsInspectionEyewash eyewash = new TPsInspectionEyewash();
+        convertMapToObject(data, eyewash);
+        return eyewash;
+    }
+
+    /**
+     * 将Map转换为对象(使用反射)
+     */
+    private void convertMapToObject(Map<String, Object> map, Object obj) {
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+
+            // 将下划线命名转换为驼峰命名
+            String fieldName = toCamelCase(key);
+
+            try {
+                java.lang.reflect.Field field = obj.getClass().getDeclaredField(fieldName);
+                field.setAccessible(true);
+
+                // 类型转换
+                if (value != null) {
+                    Class<?> fieldType = field.getType();
+                    if (fieldType == Long.class || fieldType == long.class) {
+                        if (value instanceof Number) {
+                            field.set(obj, ((Number) value).longValue());
+                        } else if (value instanceof String) {
+                            field.set(obj, Long.parseLong((String) value));
+                        }
+                    } else if (fieldType == Integer.class || fieldType == int.class) {
+                        if (value instanceof Number) {
+                            field.set(obj, ((Number) value).intValue());
+                        } else if (value instanceof String) {
+                            field.set(obj, Integer.parseInt((String) value));
+                        }
+                    } else if (fieldType == String.class) {
+                        field.set(obj, value.toString());
+                    } else {
+                        field.set(obj, value);
+                    }
+                }
+            } catch (Exception e) {
+                // 忽略不存在的字段
+            }
+        }
+    }
+
+    /**
+     * 下划线命名转驼峰命名
+     */
+    private String toCamelCase(String str) {
+        if (str == null || str.isEmpty()) {
+            return str;
+        }
+        StringBuilder result = new StringBuilder();
+        boolean nextUpperCase = false;
+        for (int i = 0; i < str.length(); i++) {
+            char c = str.charAt(i);
+            if (c == '_') {
+                nextUpperCase = true;
+            } else {
+                if (nextUpperCase) {
+                    result.append(Character.toUpperCase(c));
+                    nextUpperCase = false;
+                } else {
+                    result.append(c);
+                }
+            }
+        }
+        return result.toString();
+    }
+}
+

+ 102 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCabinetController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionCabinet;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionCabinetService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/cabinet")
 public class TPsInspectionCabinetController extends BaseController {
+
     @Autowired
     private ITPsInspectionCabinetService tPsInspectionCabinetService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询玻璃门消火栓箱和泡沫栓箱检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionCabinet tPsInspectionCabinet) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionCabinetController extends BaseController {
     /**
      * 导出玻璃门消火栓箱和泡沫栓箱检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionCabinet tPsInspectionCabinet) {
@@ -52,7 +65,7 @@ public class TPsInspectionCabinetController extends BaseController {
     /**
      * 获取玻璃门消火栓箱和泡沫栓箱检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionCabinetService.selectTPsInspectionCabinetById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionCabinetController extends BaseController {
     /**
      * 新增玻璃门消火栓箱和泡沫栓箱检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionCabinet tPsInspectionCabinet) {
@@ -70,18 +83,101 @@ public class TPsInspectionCabinetController extends BaseController {
 
     /**
      * 修改玻璃门消火栓箱和泡沫栓箱检查记录
+     *
+     * @param tPsInspectionCabinet 玻璃门消火栓箱和泡沫栓箱检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionCabinet tPsInspectionCabinet) {
+        Date date = new Date();
+        TPsInspectionCabinet cabinet = tPsInspectionCabinetService.selectTPsInspectionCabinetById(tPsInspectionCabinet.getId());
+
+        if (cabinet.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(cabinet.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionCabinet.getAppearance(), tPsInspectionCabinet.getInternalItems(), tPsInspectionCabinet.getValve(), tPsInspectionCabinet.getPassage())) {
+            // 当前数据标记为存在问题
+            tPsInspectionCabinet.setIssuesStatus(1L);
+            tPsInspectionCabinet.setUpdatedate(date);
+            tPsInspectionCabinet.setUpdaterCode(getUserId().toString());
+            tPsInspectionCabinetService.updateTPsInspectionCabinet(tPsInspectionCabinet);
+
+            // 存档历史问题数据
+            TPsInspectionCabinet entity = new TPsInspectionCabinet();
+            entity.setPosition(cabinet.getPosition());
+            entity.setModelNo(cabinet.getModelNo());
+            entity.setBoxNo(cabinet.getBoxNo());
+            entity.setAppearance(tPsInspectionCabinet.getAppearance());
+            entity.setInternalItems(tPsInspectionCabinet.getInternalItems());
+            entity.setValve(tPsInspectionCabinet.getValve());
+            entity.setPassage(tPsInspectionCabinet.getPassage());
+            entity.setMonth(cabinet.getMonth());
+            entity.setYear(cabinet.getYear());
+            entity.setPlanId(cabinet.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionCabinetService.insertTPsInspectionCabinet(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionCabinet.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(cabinet.getBoxNo() + "_" + cabinet.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (cabinet.getIssuesStatus() == 1) {
+                tPsInspectionCabinet.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionCabinet.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionCabinet.setCheckStatus("1");
+            tPsInspectionCabinet.setConfirmer(getNickName());
+            tPsInspectionCabinet.setCheckDate(date);
+            tPsInspectionCabinet.setUpdatedate(date);
+            tPsInspectionCabinet.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionCabinetService.updateTPsInspectionCabinet(tPsInspectionCabinet));
     }
 
     /**
      * 删除玻璃门消火栓箱和泡沫栓箱检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:cabinet:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "玻璃门消火栓箱和泡沫栓箱检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCallsystemController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionCallsystem;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionCallsystemService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/callsystem")
 public class TPsInspectionCallsystemController extends BaseController {
+
     @Autowired
     private ITPsInspectionCallsystemService tPsInspectionCallsystemService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询现场呼叫系统检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionCallsystem tPsInspectionCallsystem) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionCallsystemController extends BaseController {
     /**
      * 导出现场呼叫系统检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场呼叫系统检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionCallsystem tPsInspectionCallsystem) {
@@ -52,7 +65,7 @@ public class TPsInspectionCallsystemController extends BaseController {
     /**
      * 获取现场呼叫系统检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionCallsystemService.selectTPsInspectionCallsystemById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionCallsystemController extends BaseController {
     /**
      * 新增现场呼叫系统检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场呼叫系统检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionCallsystem tPsInspectionCallsystem) {
@@ -70,18 +83,100 @@ public class TPsInspectionCallsystemController extends BaseController {
 
     /**
      * 修改现场呼叫系统检查记录
+     *
+     * @param tPsInspectionCallsystem 现场呼叫系统检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场呼叫系统检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionCallsystem tPsInspectionCallsystem) {
+        Date date = new Date();
+        TPsInspectionCallsystem callsystem = tPsInspectionCallsystemService.selectTPsInspectionCallsystemById(tPsInspectionCallsystem.getId());
+
+        if (callsystem.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(callsystem.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionCallsystem.getAppearance(), tPsInspectionCallsystem.getBroadcast(), tPsInspectionCallsystem.getCorrespond(), tPsInspectionCallsystem.getChannelUnobstructed())) {
+            // 当前数据标记为存在问题
+            tPsInspectionCallsystem.setIssuesStatus(1L);
+            tPsInspectionCallsystem.setUpdatedate(date);
+            tPsInspectionCallsystem.setUpdaterCode(getUserId().toString());
+            tPsInspectionCallsystemService.updateTPsInspectionCallsystem(tPsInspectionCallsystem);
+
+            // 存档历史问题数据
+            TPsInspectionCallsystem entity = new TPsInspectionCallsystem();
+            entity.setDevNo(callsystem.getDevNo());
+            entity.setPosition(callsystem.getPosition());
+            entity.setAppearance(tPsInspectionCallsystem.getAppearance());
+            entity.setBroadcast(tPsInspectionCallsystem.getBroadcast());
+            entity.setCorrespond(tPsInspectionCallsystem.getCorrespond());
+            entity.setChannelUnobstructed(tPsInspectionCallsystem.getChannelUnobstructed());
+            entity.setMonth(callsystem.getMonth());
+            entity.setYear(callsystem.getYear());
+            entity.setPlanId(callsystem.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionCallsystemService.insertTPsInspectionCallsystem(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionCallsystem.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(callsystem.getDevNo() + "_" + callsystem.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (callsystem.getIssuesStatus() == 1) {
+                tPsInspectionCallsystem.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionCallsystem.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionCallsystem.setCheckStatus("1");
+            tPsInspectionCallsystem.setConfirmer(getNickName());
+            tPsInspectionCallsystem.setCheckDate(date);
+            tPsInspectionCallsystem.setUpdatedate(date);
+            tPsInspectionCallsystem.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionCallsystemService.updateTPsInspectionCallsystem(tPsInspectionCallsystem));
     }
 
     /**
      * 删除现场呼叫系统检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:callsystem:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场呼叫系统检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCofferController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionCoffer;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionCofferService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/coffer")
 public class TPsInspectionCofferController extends BaseController {
+
     @Autowired
     private ITPsInspectionCofferService tPsInspectionCofferService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询围堰检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionCoffer tPsInspectionCoffer) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionCofferController extends BaseController {
     /**
      * 导出围堰检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "围堰检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionCoffer tPsInspectionCoffer) {
@@ -52,7 +65,7 @@ public class TPsInspectionCofferController extends BaseController {
     /**
      * 获取围堰检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionCofferService.selectTPsInspectionCofferById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionCofferController extends BaseController {
     /**
      * 新增围堰检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "围堰检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionCoffer tPsInspectionCoffer) {
@@ -70,18 +83,100 @@ public class TPsInspectionCofferController extends BaseController {
 
     /**
      * 修改围堰检查记录
+     *
+     * @param tPsInspectionCoffer 围堰检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "围堰检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionCoffer tPsInspectionCoffer) {
+        Date date = new Date();
+        TPsInspectionCoffer coffer = tPsInspectionCofferService.selectTPsInspectionCofferById(tPsInspectionCoffer.getId());
+
+        if (coffer.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(coffer.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionCoffer.getFloorOk(), tPsInspectionCoffer.getWallOk(), tPsInspectionCoffer.getSignOk(), tPsInspectionCoffer.getDrainOk())) {
+            // 当前数据标记为存在问题
+            tPsInspectionCoffer.setIssuesStatus(1L);
+            tPsInspectionCoffer.setUpdatedate(date);
+            tPsInspectionCoffer.setUpdaterCode(getUserId().toString());
+            tPsInspectionCofferService.updateTPsInspectionCoffer(tPsInspectionCoffer);
+
+            // 存档历史问题数据
+            TPsInspectionCoffer entity = new TPsInspectionCoffer();
+            entity.setCofferNo(coffer.getCofferNo());
+            entity.setPosition(coffer.getPosition());
+            entity.setFloorOk(tPsInspectionCoffer.getFloorOk());
+            entity.setWallOk(tPsInspectionCoffer.getWallOk());
+            entity.setSignOk(tPsInspectionCoffer.getSignOk());
+            entity.setDrainOk(tPsInspectionCoffer.getDrainOk());
+            entity.setMonth(coffer.getMonth());
+            entity.setYear(coffer.getYear());
+            entity.setPlanId(coffer.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionCofferService.insertTPsInspectionCoffer(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionCoffer.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(coffer.getCofferNo() + "_" + coffer.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (coffer.getIssuesStatus() == 1) {
+                tPsInspectionCoffer.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionCoffer.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionCoffer.setCheckStatus("1");
+            tPsInspectionCoffer.setConfirmer(getNickName());
+            tPsInspectionCoffer.setCheckDate(date);
+            tPsInspectionCoffer.setUpdatedate(date);
+            tPsInspectionCoffer.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionCofferService.updateTPsInspectionCoffer(tPsInspectionCoffer));
     }
 
     /**
      * 删除围堰检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:coffer:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "围堰检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionCurtainController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionCurtain;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionCurtainService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/curtain")
 public class TPsInspectionCurtainController extends BaseController {
+
     @Autowired
     private ITPsInspectionCurtainService tPsInspectionCurtainService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询现场消防水幕检测记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionCurtain tPsInspectionCurtain) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionCurtainController extends BaseController {
     /**
      * 导出现场消防水幕检测记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionCurtain tPsInspectionCurtain) {
@@ -52,7 +65,7 @@ public class TPsInspectionCurtainController extends BaseController {
     /**
      * 获取现场消防水幕检测记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionCurtainService.selectTPsInspectionCurtainById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionCurtainController extends BaseController {
     /**
      * 新增现场消防水幕检测记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionCurtain tPsInspectionCurtain) {
@@ -70,18 +83,100 @@ public class TPsInspectionCurtainController extends BaseController {
 
     /**
      * 修改现场消防水幕检测记录
+     *
+     * @param tPsInspectionCurtain 现场消防水幕检测记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionCurtain tPsInspectionCurtain) {
+        Date date = new Date();
+        TPsInspectionCurtain curtain = tPsInspectionCurtainService.selectTPsInspectionCurtainById(tPsInspectionCurtain.getId());
+
+        if (curtain.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(curtain.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionCurtain.getAppearance(), tPsInspectionCurtain.getDiscloseOk(), tPsInspectionCurtain.getNoOdds(), tPsInspectionCurtain.getPressureTest())) {
+            // 当前数据标记为存在问题
+            tPsInspectionCurtain.setIssuesStatus(1L);
+            tPsInspectionCurtain.setUpdatedate(date);
+            tPsInspectionCurtain.setUpdaterCode(getUserId().toString());
+            tPsInspectionCurtainService.updateTPsInspectionCurtain(tPsInspectionCurtain);
+
+            // 存档历史问题数据
+            TPsInspectionCurtain entity = new TPsInspectionCurtain();
+            entity.setPosition(curtain.getPosition());
+            entity.setCurtainName(curtain.getCurtainName());
+            entity.setAppearance(tPsInspectionCurtain.getAppearance());
+            entity.setDiscloseOk(tPsInspectionCurtain.getDiscloseOk());
+            entity.setNoOdds(tPsInspectionCurtain.getNoOdds());
+            entity.setPressureTest(tPsInspectionCurtain.getPressureTest());
+            entity.setMonth(curtain.getMonth());
+            entity.setYear(curtain.getYear());
+            entity.setPlanId(curtain.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionCurtainService.insertTPsInspectionCurtain(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionCurtain.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(curtain.getCurtainName() + "_" + curtain.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (curtain.getIssuesStatus() == 1) {
+                tPsInspectionCurtain.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionCurtain.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionCurtain.setCheckStatus("1");
+            tPsInspectionCurtain.setConfirmer(getNickName());
+            tPsInspectionCurtain.setCheckDate(date);
+            tPsInspectionCurtain.setUpdatedate(date);
+            tPsInspectionCurtain.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionCurtainService.updateTPsInspectionCurtain(tPsInspectionCurtain));
     }
 
     /**
      * 删除现场消防水幕检测记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:curtain:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场消防水幕检测记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 106 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionExtinguisherController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionExtinguisher;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionExtinguisherService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/extinguisher")
 public class TPsInspectionExtinguisherController extends BaseController {
+
     @Autowired
     private ITPsInspectionExtinguisherService tPsInspectionExtinguisherService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询现场灭火器检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionExtinguisher tPsInspectionExtinguisher) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionExtinguisherController extends BaseController {
     /**
      * 导出现场灭火器检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场灭火器检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionExtinguisher tPsInspectionExtinguisher) {
@@ -52,7 +65,7 @@ public class TPsInspectionExtinguisherController extends BaseController {
     /**
      * 获取现场灭火器检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionExtinguisherService.selectTPsInspectionExtinguisherById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionExtinguisherController extends BaseController {
     /**
      * 新增现场灭火器检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场灭火器检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionExtinguisher tPsInspectionExtinguisher) {
@@ -70,18 +83,105 @@ public class TPsInspectionExtinguisherController extends BaseController {
 
     /**
      * 修改现场灭火器检查记录
+     *
+     * @param tPsInspectionExtinguisher 现场灭火器检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场灭火器检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionExtinguisher tPsInspectionExtinguisher) {
+        Date date = new Date();
+        TPsInspectionExtinguisher extinguisher = tPsInspectionExtinguisherService.selectTPsInspectionExtinguisherById(tPsInspectionExtinguisher.getId());
+
+        if (extinguisher.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(extinguisher.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionExtinguisher.getCheck1(), tPsInspectionExtinguisher.getCheck2(), tPsInspectionExtinguisher.getCheck3(), tPsInspectionExtinguisher.getCheck4())) {
+            // 当前数据标记为存在问题
+            tPsInspectionExtinguisher.setIssuesStatus(1L);
+            tPsInspectionExtinguisher.setUpdatedate(date);
+            tPsInspectionExtinguisher.setUpdaterCode(getUserId().toString());
+            tPsInspectionExtinguisherService.updateTPsInspectionExtinguisher(tPsInspectionExtinguisher);
+
+            // 存档历史问题数据
+            TPsInspectionExtinguisher entity = new TPsInspectionExtinguisher();
+            entity.setFireExtinguisherNo(extinguisher.getFireExtinguisherNo());
+            entity.setPosition(extinguisher.getPosition());
+            entity.setFireExtinguisherModel(extinguisher.getFireExtinguisherModel());
+            entity.setCheck1(tPsInspectionExtinguisher.getCheck1());
+            entity.setCheck2(tPsInspectionExtinguisher.getCheck2());
+            entity.setCheck3(tPsInspectionExtinguisher.getCheck3());
+            entity.setCheck4(tPsInspectionExtinguisher.getCheck4());
+            entity.setWeight1(tPsInspectionExtinguisher.getWeight1());
+            entity.setWeight2(tPsInspectionExtinguisher.getWeight2());
+            entity.setWeight3(tPsInspectionExtinguisher.getWeight3());
+            entity.setWeight4(tPsInspectionExtinguisher.getWeight4());
+            entity.setMonth(extinguisher.getMonth());
+            entity.setYear(extinguisher.getYear());
+            entity.setPlanId(extinguisher.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionExtinguisherService.insertTPsInspectionExtinguisher(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionExtinguisher.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(extinguisher.getFireExtinguisherNo() + "_" + extinguisher.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (extinguisher.getIssuesStatus() == 1) {
+                tPsInspectionExtinguisher.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionExtinguisher.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionExtinguisher.setCheckStatus("1");
+            tPsInspectionExtinguisher.setConfirmer(getNickName());
+            tPsInspectionExtinguisher.setCheckDate(date);
+            tPsInspectionExtinguisher.setUpdatedate(date);
+            tPsInspectionExtinguisher.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionExtinguisherService.updateTPsInspectionExtinguisher(tPsInspectionExtinguisher));
     }
 
     /**
      * 删除现场灭火器检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:extinguisher:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场灭火器检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 108 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionEyewashController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionEyewash;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionEyewashService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/eyewash")
 public class TPsInspectionEyewashController extends BaseController {
+
     @Autowired
     private ITPsInspectionEyewashService tPsInspectionEyewashService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询洗眼器巡检记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionEyewash tPsInspectionEyewash) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionEyewashController extends BaseController {
     /**
      * 导出洗眼器巡检记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionEyewash tPsInspectionEyewash) {
@@ -52,7 +65,7 @@ public class TPsInspectionEyewashController extends BaseController {
     /**
      * 获取洗眼器巡检记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionEyewashService.selectTPsInspectionEyewashById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionEyewashController extends BaseController {
     /**
      * 新增洗眼器巡检记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionEyewash tPsInspectionEyewash) {
@@ -70,18 +83,107 @@ public class TPsInspectionEyewashController extends BaseController {
 
     /**
      * 修改洗眼器巡检记录
+     *
+     * @param tPsInspectionEyewash 洗眼器巡检记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionEyewash tPsInspectionEyewash) {
+        Date date = new Date();
+        TPsInspectionEyewash eyewash = tPsInspectionEyewashService.selectTPsInspectionEyewashById(tPsInspectionEyewash.getId());
+
+        if (eyewash.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(eyewash.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionEyewash.getSignageOk(), tPsInspectionEyewash.getAccessClear(), tPsInspectionEyewash.getPartsOk(), tPsInspectionEyewash.getValveOpenLocked(), tPsInspectionEyewash.getDustcapOk(), tPsInspectionEyewash.getWaterHeight(), tPsInspectionEyewash.getWaterClean(), tPsInspectionEyewash.getWaterTemp(), tPsInspectionEyewash.getLeversOk(), tPsInspectionEyewash.getErcNotified(), tPsInspectionEyewash.getLocalAlarmOk(), tPsInspectionEyewash.getAlarmSignalOk())) {
+            // 当前数据标记为存在问题
+            tPsInspectionEyewash.setIssuesStatus(1L);
+            tPsInspectionEyewash.setUpdatedate(date);
+            tPsInspectionEyewash.setUpdaterCode(getUserId().toString());
+            tPsInspectionEyewashService.updateTPsInspectionEyewash(tPsInspectionEyewash);
+
+            // 存档历史问题数据
+            TPsInspectionEyewash entity = new TPsInspectionEyewash();
+            entity.setDevNo(eyewash.getDevNo());
+            entity.setSignageOk(tPsInspectionEyewash.getSignageOk());
+            entity.setAccessClear(tPsInspectionEyewash.getAccessClear());
+            entity.setPartsOk(tPsInspectionEyewash.getPartsOk());
+            entity.setValveOpenLocked(tPsInspectionEyewash.getValveOpenLocked());
+            entity.setDustcapOk(tPsInspectionEyewash.getDustcapOk());
+            entity.setWaterHeight(tPsInspectionEyewash.getWaterHeight());
+            entity.setWaterClean(tPsInspectionEyewash.getWaterClean());
+            entity.setWaterTemp(tPsInspectionEyewash.getWaterTemp());
+            entity.setLeversOk(tPsInspectionEyewash.getLeversOk());
+            entity.setErcNotified(tPsInspectionEyewash.getErcNotified());
+            entity.setLocalAlarmOk(tPsInspectionEyewash.getLocalAlarmOk());
+            entity.setAlarmSignalOk(tPsInspectionEyewash.getAlarmSignalOk());
+            entity.setMonth(eyewash.getMonth());
+            entity.setYear(eyewash.getYear());
+            entity.setPlanId(eyewash.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionEyewashService.insertTPsInspectionEyewash(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionEyewash.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(eyewash.getDevNo());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (eyewash.getIssuesStatus() == 1) {
+                tPsInspectionEyewash.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionEyewash.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionEyewash.setCheckStatus("1");
+            tPsInspectionEyewash.setConfirmer(getNickName());
+            tPsInspectionEyewash.setCheckDate(date);
+            tPsInspectionEyewash.setUpdatedate(date);
+            tPsInspectionEyewash.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionEyewashService.updateTPsInspectionEyewash(tPsInspectionEyewash));
     }
 
     /**
      * 删除洗眼器巡检记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:eyewash:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "洗眼器巡检记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionFgsController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionFgs;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionFgsService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/fgs")
 public class TPsInspectionFgsController extends BaseController {
+
     @Autowired
     private ITPsInspectionFgsService tPsInspectionFgsService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询FGS Mini板检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionFgs tPsInspectionFgs) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionFgsController extends BaseController {
     /**
      * 导出FGS Mini板检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "FGS Mini板检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionFgs tPsInspectionFgs) {
@@ -52,7 +65,7 @@ public class TPsInspectionFgsController extends BaseController {
     /**
      * 获取FGS Mini板检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionFgsService.selectTPsInspectionFgsById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionFgsController extends BaseController {
     /**
      * 新增FGS Mini板检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "FGS Mini板检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionFgs tPsInspectionFgs) {
@@ -70,18 +83,100 @@ public class TPsInspectionFgsController extends BaseController {
 
     /**
      * 修改FGS Mini板检查记录
+     *
+     * @param tPsInspectionFgs FGS Mini板检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "FGS Mini板检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionFgs tPsInspectionFgs) {
+        Date date = new Date();
+        TPsInspectionFgs fgs = tPsInspectionFgsService.selectTPsInspectionFgsById(tPsInspectionFgs.getId());
+
+        if (fgs.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(fgs.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionFgs.getAppearance(), tPsInspectionFgs.getTestLightOk(), tPsInspectionFgs.getTestAlarm(), tPsInspectionFgs.getWindTemp())) {
+            // 当前数据标记为存在问题
+            tPsInspectionFgs.setIssuesStatus(1L);
+            tPsInspectionFgs.setUpdatedate(date);
+            tPsInspectionFgs.setUpdaterCode(getUserId().toString());
+            tPsInspectionFgsService.updateTPsInspectionFgs(tPsInspectionFgs);
+
+            // 存档历史问题数据
+            TPsInspectionFgs entity = new TPsInspectionFgs();
+            entity.setFgsNo(fgs.getFgsNo());
+            entity.setPosition(fgs.getPosition());
+            entity.setAppearance(tPsInspectionFgs.getAppearance());
+            entity.setTestLightOk(tPsInspectionFgs.getTestLightOk());
+            entity.setTestAlarm(tPsInspectionFgs.getTestAlarm());
+            entity.setWindTemp(tPsInspectionFgs.getWindTemp());
+            entity.setMonth(fgs.getMonth());
+            entity.setYear(fgs.getYear());
+            entity.setPlanId(fgs.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionFgsService.insertTPsInspectionFgs(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionFgs.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(fgs.getFgsNo() + "_" + fgs.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (fgs.getIssuesStatus() == 1) {
+                tPsInspectionFgs.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionFgs.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionFgs.setCheckStatus("1");
+            tPsInspectionFgs.setConfirmer(getNickName());
+            tPsInspectionFgs.setCheckDate(date);
+            tPsInspectionFgs.setUpdatedate(date);
+            tPsInspectionFgs.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionFgsService.updateTPsInspectionFgs(tPsInspectionFgs));
     }
 
     /**
      * 删除FGS Mini板检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:fgs:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "FGS Mini板检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 102 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionFiredoorController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionFiredoor;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionFiredoorService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/firedoor")
 public class TPsInspectionFiredoorController extends BaseController {
+
     @Autowired
     private ITPsInspectionFiredoorService tPsInspectionFiredoorService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询安全防火门防爆门检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionFiredoor tPsInspectionFiredoor) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionFiredoorController extends BaseController {
     /**
      * 导出安全防火门防爆门检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "安全防火门防爆门检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionFiredoor tPsInspectionFiredoor) {
@@ -52,7 +65,7 @@ public class TPsInspectionFiredoorController extends BaseController {
     /**
      * 获取安全防火门防爆门检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionFiredoorService.selectTPsInspectionFiredoorById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionFiredoorController extends BaseController {
     /**
      * 新增安全防火门防爆门检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "安全防火门防爆门检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionFiredoor tPsInspectionFiredoor) {
@@ -70,18 +83,101 @@ public class TPsInspectionFiredoorController extends BaseController {
 
     /**
      * 修改安全防火门防爆门检查记录
+     *
+     * @param tPsInspectionFiredoor 安全防火门防爆门检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "安全防火门防爆门检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionFiredoor tPsInspectionFiredoor) {
+        Date date = new Date();
+        TPsInspectionFiredoor firedoor = tPsInspectionFiredoorService.selectTPsInspectionFiredoorById(tPsInspectionFiredoor.getId());
+
+        if (firedoor.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(firedoor.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionFiredoor.getAppearance(), tPsInspectionFiredoor.getSeamless(), tPsInspectionFiredoor.getCloserStatus(), tPsInspectionFiredoor.getChannelUnobstructed())) {
+            // 当前数据标记为存在问题
+            tPsInspectionFiredoor.setIssuesStatus(1L);
+            tPsInspectionFiredoor.setUpdatedate(date);
+            tPsInspectionFiredoor.setUpdaterCode(getUserId().toString());
+            tPsInspectionFiredoorService.updateTPsInspectionFiredoor(tPsInspectionFiredoor);
+
+            // 存档历史问题数据
+            TPsInspectionFiredoor entity = new TPsInspectionFiredoor();
+            entity.setDoorNo(firedoor.getDoorNo());
+            entity.setDoorName(firedoor.getDoorName());
+            entity.setPosition(firedoor.getPosition());
+            entity.setAppearance(tPsInspectionFiredoor.getAppearance());
+            entity.setSeamless(tPsInspectionFiredoor.getSeamless());
+            entity.setCloserStatus(tPsInspectionFiredoor.getCloserStatus());
+            entity.setChannelUnobstructed(tPsInspectionFiredoor.getChannelUnobstructed());
+            entity.setMonth(firedoor.getMonth());
+            entity.setYear(firedoor.getYear());
+            entity.setPlanId(firedoor.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionFiredoorService.insertTPsInspectionFiredoor(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionFiredoor.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(firedoor.getDoorNo() + "_" + firedoor.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (firedoor.getIssuesStatus() == 1) {
+                tPsInspectionFiredoor.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionFiredoor.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionFiredoor.setCheckStatus("1");
+            tPsInspectionFiredoor.setConfirmer(getNickName());
+            tPsInspectionFiredoor.setCheckDate(date);
+            tPsInspectionFiredoor.setUpdatedate(date);
+            tPsInspectionFiredoor.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionFiredoorService.updateTPsInspectionFiredoor(tPsInspectionFiredoor));
     }
 
     /**
      * 删除安全防火门防爆门检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:firedoor:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "安全防火门防爆门检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 104 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionHydrantController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionHydrant;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionHydrantService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/hydrant")
 public class TPsInspectionHydrantController extends BaseController {
+
     @Autowired
     private ITPsInspectionHydrantService tPsInspectionHydrantService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询地上消火栓和消防水带箱检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionHydrant tPsInspectionHydrant) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionHydrantController extends BaseController {
     /**
      * 导出地上消火栓和消防水带箱检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "地上消火栓和消防水带箱检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionHydrant tPsInspectionHydrant) {
@@ -52,7 +65,7 @@ public class TPsInspectionHydrantController extends BaseController {
     /**
      * 获取地上消火栓和消防水带箱检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionHydrantService.selectTPsInspectionHydrantById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionHydrantController extends BaseController {
     /**
      * 新增地上消火栓和消防水带箱检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "地上消火栓和消防水带箱检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionHydrant tPsInspectionHydrant) {
@@ -70,18 +83,103 @@ public class TPsInspectionHydrantController extends BaseController {
 
     /**
      * 修改地上消火栓和消防水带箱检查记录
+     *
+     * @param tPsInspectionHydrant 地上消火栓和消防水带箱检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "地上消火栓和消防水带箱检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionHydrant tPsInspectionHydrant) {
+        Date date = new Date();
+        TPsInspectionHydrant hydrant = tPsInspectionHydrantService.selectTPsInspectionHydrantById(tPsInspectionHydrant.getId());
+
+        if (hydrant.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(hydrant.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionHydrant.getHydrantStatus(), tPsInspectionHydrant.getHoseQty(), tPsInspectionHydrant.getWrenchQty(), tPsInspectionHydrant.getAppearance(), tPsInspectionHydrant.getLeakStatus(), tPsInspectionHydrant.getItemStatus(), tPsInspectionHydrant.getAccessStatus())) {
+            // 当前数据标记为存在问题
+            tPsInspectionHydrant.setIssuesStatus(1L);
+            tPsInspectionHydrant.setUpdatedate(date);
+            tPsInspectionHydrant.setUpdaterCode(getUserId().toString());
+            tPsInspectionHydrantService.updateTPsInspectionHydrant(tPsInspectionHydrant);
+
+            // 存档历史问题数据
+            TPsInspectionHydrant entity = new TPsInspectionHydrant();
+            entity.setEquipId(hydrant.getEquipId());
+            entity.setPosition(hydrant.getPosition());
+            entity.setHydrantStatus(tPsInspectionHydrant.getHydrantStatus());
+            entity.setHoseQty(tPsInspectionHydrant.getHoseQty());
+            entity.setWrenchQty(tPsInspectionHydrant.getWrenchQty());
+            entity.setAppearance(tPsInspectionHydrant.getAppearance());
+            entity.setLeakStatus(tPsInspectionHydrant.getLeakStatus());
+            entity.setItemStatus(tPsInspectionHydrant.getItemStatus());
+            entity.setAccessStatus(tPsInspectionHydrant.getAccessStatus());
+            entity.setMonth(hydrant.getMonth());
+            entity.setYear(hydrant.getYear());
+            entity.setPlanId(hydrant.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionHydrantService.insertTPsInspectionHydrant(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionHydrant.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(hydrant.getEquipId() + "_" + hydrant.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (hydrant.getIssuesStatus() == 1) {
+                tPsInspectionHydrant.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionHydrant.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionHydrant.setCheckStatus("1");
+            tPsInspectionHydrant.setConfirmer(getNickName());
+            tPsInspectionHydrant.setCheckDate(date);
+            tPsInspectionHydrant.setUpdatedate(date);
+            tPsInspectionHydrant.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionHydrantService.updateTPsInspectionHydrant(tPsInspectionHydrant));
     }
 
     /**
      * 删除地上消火栓和消防水带箱检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:hydrant:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "地上消火栓和消防水带箱检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 103 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionLiftController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionLift;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionLiftService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/lift")
 public class TPsInspectionLiftController extends BaseController {
+
     @Autowired
     private ITPsInspectionLiftService tPsInspectionLiftService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询电梯检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionLift tPsInspectionLift) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionLiftController extends BaseController {
     /**
      * 导出电梯检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "电梯检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionLift tPsInspectionLift) {
@@ -52,7 +65,7 @@ public class TPsInspectionLiftController extends BaseController {
     /**
      * 获取电梯检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionLiftService.selectTPsInspectionLiftById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionLiftController extends BaseController {
     /**
      * 新增电梯检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "电梯检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionLift tPsInspectionLift) {
@@ -70,18 +83,102 @@ public class TPsInspectionLiftController extends BaseController {
 
     /**
      * 修改电梯检查记录
+     *
+     * @param tPsInspectionLift 电梯检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "电梯检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionLift tPsInspectionLift) {
+        Date date = new Date();
+        TPsInspectionLift lift = tPsInspectionLiftService.selectTPsInspectionLiftById(tPsInspectionLift.getId());
+
+        if (lift.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(lift.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionLift.getElevatorDoor(), tPsInspectionLift.getFloorOk(), tPsInspectionLift.getExplosionTelephone(), tPsInspectionLift.getFanOk(), tPsInspectionLift.getLightOk(), tPsInspectionLift.getRunSmoothly())) {
+            // 当前数据标记为存在问题
+            tPsInspectionLift.setIssuesStatus(1L);
+            tPsInspectionLift.setUpdatedate(date);
+            tPsInspectionLift.setUpdaterCode(getUserId().toString());
+            tPsInspectionLiftService.updateTPsInspectionLift(tPsInspectionLift);
+
+            // 存档历史问题数据
+            TPsInspectionLift entity = new TPsInspectionLift();
+            entity.setDevNo(lift.getDevNo());
+            entity.setPosition(lift.getPosition());
+            entity.setElevatorDoor(tPsInspectionLift.getElevatorDoor());
+            entity.setFloorOk(tPsInspectionLift.getFloorOk());
+            entity.setExplosionTelephone(tPsInspectionLift.getExplosionTelephone());
+            entity.setFanOk(tPsInspectionLift.getFanOk());
+            entity.setLightOk(tPsInspectionLift.getLightOk());
+            entity.setRunSmoothly(tPsInspectionLift.getRunSmoothly());
+            entity.setMonth(lift.getMonth());
+            entity.setYear(lift.getYear());
+            entity.setPlanId(lift.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionLiftService.insertTPsInspectionLift(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionLift.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(lift.getDevNo() + "_" + lift.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (lift.getIssuesStatus() == 1) {
+                tPsInspectionLift.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionLift.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionLift.setCheckStatus("1");
+            tPsInspectionLift.setConfirmer(getNickName());
+            tPsInspectionLift.setCheckDate(date);
+            tPsInspectionLift.setUpdatedate(date);
+            tPsInspectionLift.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionLiftService.updateTPsInspectionLift(tPsInspectionLift));
     }
 
     /**
      * 删除电梯检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:lift:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "电梯检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 102 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionMonitorController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionMonitor;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionMonitorService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/monitor")
 public class TPsInspectionMonitorController extends BaseController {
+
     @Autowired
     private ITPsInspectionMonitorService tPsInspectionMonitorService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询现场消防炮检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionMonitor tPsInspectionMonitor) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionMonitorController extends BaseController {
     /**
      * 导出现场消防炮检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场消防炮检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionMonitor tPsInspectionMonitor) {
@@ -52,7 +65,7 @@ public class TPsInspectionMonitorController extends BaseController {
     /**
      * 获取现场消防炮检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionMonitorService.selectTPsInspectionMonitorById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionMonitorController extends BaseController {
     /**
      * 新增现场消防炮检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场消防炮检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionMonitor tPsInspectionMonitor) {
@@ -70,18 +83,101 @@ public class TPsInspectionMonitorController extends BaseController {
 
     /**
      * 修改现场消防炮检查记录
+     *
+     * @param tPsInspectionMonitor 现场消防炮检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场消防炮检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionMonitor tPsInspectionMonitor) {
+        Date date = new Date();
+        TPsInspectionMonitor monitor = tPsInspectionMonitorService.selectTPsInspectionMonitorById(tPsInspectionMonitor.getId());
+
+        if (monitor.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(monitor.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionMonitor.getCannonRotate(), tPsInspectionMonitor.getValveSwitch(), tPsInspectionMonitor.getDirectJet(), tPsInspectionMonitor.getRotateSpray(), tPsInspectionMonitor.getWaterPressure())) {
+            // 当前数据标记为存在问题
+            tPsInspectionMonitor.setIssuesStatus(1L);
+            tPsInspectionMonitor.setUpdatedate(date);
+            tPsInspectionMonitor.setUpdaterCode(getUserId().toString());
+            tPsInspectionMonitorService.updateTPsInspectionMonitor(tPsInspectionMonitor);
+
+            // 存档历史问题数据
+            TPsInspectionMonitor entity = new TPsInspectionMonitor();
+            entity.setDevNo(monitor.getDevNo());
+            entity.setPosition(monitor.getPosition());
+            entity.setCannonRotate(tPsInspectionMonitor.getCannonRotate());
+            entity.setValveSwitch(tPsInspectionMonitor.getValveSwitch());
+            entity.setDirectJet(tPsInspectionMonitor.getDirectJet());
+            entity.setRotateSpray(tPsInspectionMonitor.getRotateSpray());
+            entity.setWaterPressure(tPsInspectionMonitor.getWaterPressure());
+            entity.setMonth(monitor.getMonth());
+            entity.setYear(monitor.getYear());
+            entity.setPlanId(monitor.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionMonitorService.insertTPsInspectionMonitor(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionMonitor.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(monitor.getDevNo() + "_" + monitor.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (monitor.getIssuesStatus() == 1) {
+                tPsInspectionMonitor.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionMonitor.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionMonitor.setCheckStatus("1");
+            tPsInspectionMonitor.setConfirmer(getNickName());
+            tPsInspectionMonitor.setCheckDate(date);
+            tPsInspectionMonitor.setUpdatedate(date);
+            tPsInspectionMonitor.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionMonitorService.updateTPsInspectionMonitor(tPsInspectionMonitor));
     }
 
     /**
      * 删除现场消防炮检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:monitor:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场消防炮检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 100 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionPitController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionPit;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionPitService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/pit")
 public class TPsInspectionPitController extends BaseController {
+
     @Autowired
     private ITPsInspectionPitService tPsInspectionPitService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询现场地井检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionPit tPsInspectionPit) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionPitController extends BaseController {
     /**
      * 导出现场地井检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "现场地井检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionPit tPsInspectionPit) {
@@ -52,7 +65,7 @@ public class TPsInspectionPitController extends BaseController {
     /**
      * 获取现场地井检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionPitService.selectTPsInspectionPitById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionPitController extends BaseController {
     /**
      * 新增现场地井检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "现场地井检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionPit tPsInspectionPit) {
@@ -70,18 +83,99 @@ public class TPsInspectionPitController extends BaseController {
 
     /**
      * 修改现场地井检查记录
+     *
+     * @param tPsInspectionPit 现场地井检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "现场地井检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionPit tPsInspectionPit) {
+        Date date = new Date();
+        TPsInspectionPit pit = tPsInspectionPitService.selectTPsInspectionPitById(tPsInspectionPit.getId());
+
+        if (pit.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(pit.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionPit.getAroundPit(), tPsInspectionPit.getManholeCover(), tPsInspectionPit.getInsidePit())) {
+            // 当前数据标记为存在问题
+            tPsInspectionPit.setIssuesStatus(1L);
+            tPsInspectionPit.setUpdatedate(date);
+            tPsInspectionPit.setUpdaterCode(getUserId().toString());
+            tPsInspectionPitService.updateTPsInspectionPit(tPsInspectionPit);
+
+            // 存档历史问题数据
+            TPsInspectionPit entity = new TPsInspectionPit();
+            entity.setDevNo(pit.getDevNo());
+            entity.setPosition(pit.getPosition());
+            entity.setAroundPit(tPsInspectionPit.getAroundPit());
+            entity.setManholeCover(tPsInspectionPit.getManholeCover());
+            entity.setInsidePit(tPsInspectionPit.getInsidePit());
+            entity.setMonth(pit.getMonth());
+            entity.setYear(pit.getYear());
+            entity.setPlanId(pit.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionPitService.insertTPsInspectionPit(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionPit.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(pit.getDevNo() + "_" + pit.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (pit.getIssuesStatus() == 1) {
+                tPsInspectionPit.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionPit.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionPit.setCheckStatus("1");
+            tPsInspectionPit.setConfirmer(getNickName());
+            tPsInspectionPit.setCheckDate(date);
+            tPsInspectionPit.setUpdatedate(date);
+            tPsInspectionPit.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionPitService.updateTPsInspectionPit(tPsInspectionPit));
     }
 
     /**
      * 删除现场地井检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:pit:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "现场地井检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 100 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionRainvalveController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionRainvalve;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionRainvalveService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/rainvalve")
 public class TPsInspectionRainvalveController extends BaseController {
+
     @Autowired
     private ITPsInspectionRainvalveService tPsInspectionRainvalveService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询污水/雨排切换阀门检查列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionRainvalve tPsInspectionRainvalve) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionRainvalveController extends BaseController {
     /**
      * 导出污水/雨排切换阀门检查列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionRainvalve tPsInspectionRainvalve) {
@@ -52,7 +65,7 @@ public class TPsInspectionRainvalveController extends BaseController {
     /**
      * 获取污水/雨排切换阀门检查详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionRainvalveService.selectTPsInspectionRainvalveById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionRainvalveController extends BaseController {
     /**
      * 新增污水/雨排切换阀门检查
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionRainvalve tPsInspectionRainvalve) {
@@ -70,18 +83,99 @@ public class TPsInspectionRainvalveController extends BaseController {
 
     /**
      * 修改污水/雨排切换阀门检查
+     *
+     * @param tPsInspectionRainvalve 污水/雨排切换阀门检查对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionRainvalve tPsInspectionRainvalve) {
+        Date date = new Date();
+        TPsInspectionRainvalve rainvalve = tPsInspectionRainvalveService.selectTPsInspectionRainvalveById(tPsInspectionRainvalve.getId());
+
+        if (rainvalve.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(rainvalve.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionRainvalve.getAppearance(), tPsInspectionRainvalve.getNoLeak(), tPsInspectionRainvalve.getCheckingStatus())) {
+            // 当前数据标记为存在问题
+            tPsInspectionRainvalve.setIssuesStatus(1L);
+            tPsInspectionRainvalve.setUpdatedate(date);
+            tPsInspectionRainvalve.setUpdaterCode(getUserId().toString());
+            tPsInspectionRainvalveService.updateTPsInspectionRainvalve(tPsInspectionRainvalve);
+
+            // 存档历史问题数据
+            TPsInspectionRainvalve entity = new TPsInspectionRainvalve();
+            entity.setPosition(rainvalve.getPosition());
+            entity.setValveName(rainvalve.getValveName());
+            entity.setAppearance(tPsInspectionRainvalve.getAppearance());
+            entity.setNoLeak(tPsInspectionRainvalve.getNoLeak());
+            entity.setCheckingStatus(tPsInspectionRainvalve.getCheckingStatus());
+            entity.setMonth(rainvalve.getMonth());
+            entity.setYear(rainvalve.getYear());
+            entity.setPlanId(rainvalve.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionRainvalveService.insertTPsInspectionRainvalve(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionRainvalve.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(rainvalve.getValveName() + "_" + rainvalve.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (rainvalve.getIssuesStatus() == 1) {
+                tPsInspectionRainvalve.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionRainvalve.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionRainvalve.setCheckStatus("1");
+            tPsInspectionRainvalve.setConfirmer(getNickName());
+            tPsInspectionRainvalve.setCheckDate(date);
+            tPsInspectionRainvalve.setUpdatedate(date);
+            tPsInspectionRainvalve.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionRainvalveService.updateTPsInspectionRainvalve(tPsInspectionRainvalve));
     }
 
     /**
      * 删除污水/雨排切换阀门检查
      */
-    @PreAuthorize("@ss.hasPermi('inspection:rainvalve:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "污水/雨排切换阀门检查", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionSteamController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionSteam;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionSteamService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/steam")
 public class TPsInspectionSteamController extends BaseController {
+
     @Autowired
     private ITPsInspectionSteamService tPsInspectionSteamService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询消防蒸汽系统检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionSteam tPsInspectionSteam) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionSteamController extends BaseController {
     /**
      * 导出消防蒸汽系统检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "消防蒸汽系统检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionSteam tPsInspectionSteam) {
@@ -52,7 +65,7 @@ public class TPsInspectionSteamController extends BaseController {
     /**
      * 获取消防蒸汽系统检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionSteamService.selectTPsInspectionSteamById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionSteamController extends BaseController {
     /**
      * 新增消防蒸汽系统检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "消防蒸汽系统检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionSteam tPsInspectionSteam) {
@@ -70,18 +83,100 @@ public class TPsInspectionSteamController extends BaseController {
 
     /**
      * 修改消防蒸汽系统检查记录
+     *
+     * @param tPsInspectionSteam 消防蒸汽系统检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "消防蒸汽系统检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionSteam tPsInspectionSteam) {
+        Date date = new Date();
+        TPsInspectionSteam steam = tPsInspectionSteamService.selectTPsInspectionSteamById(tPsInspectionSteam.getId());
+
+        if (steam.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(steam.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionSteam.getFunctionalTest(), tPsInspectionSteam.getValveOk(), tPsInspectionSteam.getDiscloseOk(), tPsInspectionSteam.getPressureTest())) {
+            // 当前数据标记为存在问题
+            tPsInspectionSteam.setIssuesStatus(1L);
+            tPsInspectionSteam.setUpdatedate(date);
+            tPsInspectionSteam.setUpdaterCode(getUserId().toString());
+            tPsInspectionSteamService.updateTPsInspectionSteam(tPsInspectionSteam);
+
+            // 存档历史问题数据
+            TPsInspectionSteam entity = new TPsInspectionSteam();
+            entity.setPosition(steam.getPosition());
+            entity.setSteamName(steam.getSteamName());
+            entity.setFunctionalTest(tPsInspectionSteam.getFunctionalTest());
+            entity.setValveOk(tPsInspectionSteam.getValveOk());
+            entity.setDiscloseOk(tPsInspectionSteam.getDiscloseOk());
+            entity.setPressureTest(tPsInspectionSteam.getPressureTest());
+            entity.setMonth(steam.getMonth());
+            entity.setYear(steam.getYear());
+            entity.setPlanId(steam.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionSteamService.insertTPsInspectionSteam(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionSteam.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(steam.getSteamName() + "_" + steam.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (steam.getIssuesStatus() == 1) {
+                tPsInspectionSteam.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionSteam.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionSteam.setCheckStatus("1");
+            tPsInspectionSteam.setConfirmer(getNickName());
+            tPsInspectionSteam.setCheckDate(date);
+            tPsInspectionSteam.setUpdatedate(date);
+            tPsInspectionSteam.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionSteamService.updateTPsInspectionSteam(tPsInspectionSteam));
     }
 
     /**
      * 删除消防蒸汽系统检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:steam:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "消防蒸汽系统检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionSumpController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionSump;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionSumpService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/sump")
 public class TPsInspectionSumpController extends BaseController {
+
     @Autowired
     private ITPsInspectionSumpService tPsInspectionSumpService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询雨排井检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionSump tPsInspectionSump) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionSumpController extends BaseController {
     /**
      * 导出雨排井检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "雨排井检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionSump tPsInspectionSump) {
@@ -52,7 +65,7 @@ public class TPsInspectionSumpController extends BaseController {
     /**
      * 获取雨排井检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionSumpService.selectTPsInspectionSumpById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionSumpController extends BaseController {
     /**
      * 新增雨排井检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "雨排井检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionSump tPsInspectionSump) {
@@ -70,18 +83,100 @@ public class TPsInspectionSumpController extends BaseController {
 
     /**
      * 修改雨排井检查记录
+     *
+     * @param tPsInspectionSump 雨排井检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "雨排井检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionSump tPsInspectionSump) {
+        Date date = new Date();
+        TPsInspectionSump sump = tPsInspectionSumpService.selectTPsInspectionSumpById(tPsInspectionSump.getId());
+
+        if (sump.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(sump.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionSump.getAroundSump(), tPsInspectionSump.getManholeCover(), tPsInspectionSump.getInsideSump(), tPsInspectionSump.getBoxPad())) {
+            // 当前数据标记为存在问题
+            tPsInspectionSump.setIssuesStatus(1L);
+            tPsInspectionSump.setUpdatedate(date);
+            tPsInspectionSump.setUpdaterCode(getUserId().toString());
+            tPsInspectionSumpService.updateTPsInspectionSump(tPsInspectionSump);
+
+            // 存档历史问题数据
+            TPsInspectionSump entity = new TPsInspectionSump();
+            entity.setSumpNo(sump.getSumpNo());
+            entity.setPosition(sump.getPosition());
+            entity.setAroundSump(tPsInspectionSump.getAroundSump());
+            entity.setManholeCover(tPsInspectionSump.getManholeCover());
+            entity.setInsideSump(tPsInspectionSump.getInsideSump());
+            entity.setBoxPad(tPsInspectionSump.getBoxPad());
+            entity.setMonth(sump.getMonth());
+            entity.setYear(sump.getYear());
+            entity.setPlanId(sump.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionSumpService.insertTPsInspectionSump(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionSump.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(sump.getSumpNo() + "_" + sump.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (sump.getIssuesStatus() == 1) {
+                tPsInspectionSump.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionSump.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionSump.setCheckStatus("1");
+            tPsInspectionSump.setConfirmer(getNickName());
+            tPsInspectionSump.setCheckDate(date);
+            tPsInspectionSump.setUpdatedate(date);
+            tPsInspectionSump.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionSumpService.updateTPsInspectionSump(tPsInspectionSump));
     }
 
     /**
      * 删除雨排井检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:sump:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "雨排井检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 102 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionUtilitystationController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionUtilitystation;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionUtilitystationService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/utilitystation")
 public class TPsInspectionUtilitystationController extends BaseController {
+
     @Autowired
     private ITPsInspectionUtilitystationService tPsInspectionUtilitystationService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询公用站检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionUtilitystation tPsInspectionUtilitystation) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionUtilitystationController extends BaseController {
     /**
      * 导出公用站检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "公用站检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionUtilitystation tPsInspectionUtilitystation) {
@@ -52,7 +65,7 @@ public class TPsInspectionUtilitystationController extends BaseController {
     /**
      * 获取公用站检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionUtilitystationService.selectTPsInspectionUtilitystationById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionUtilitystationController extends BaseController {
     /**
      * 新增公用站检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "公用站检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionUtilitystation tPsInspectionUtilitystation) {
@@ -70,18 +83,101 @@ public class TPsInspectionUtilitystationController extends BaseController {
 
     /**
      * 修改公用站检查记录
+     *
+     * @param tPsInspectionUtilitystation 公用站检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "公用站检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionUtilitystation tPsInspectionUtilitystation) {
+        Date date = new Date();
+        TPsInspectionUtilitystation utilitystation = tPsInspectionUtilitystationService.selectTPsInspectionUtilitystationById(tPsInspectionUtilitystation.getId());
+
+        if (utilitystation.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(utilitystation.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionUtilitystation.getNoLeak(), tPsInspectionUtilitystation.getValveStatus(), tPsInspectionUtilitystation.getQuickConnectCoupling(), tPsInspectionUtilitystation.getHoseOk(), tPsInspectionUtilitystation.getHoseNodamage())) {
+            // 当前数据标记为存在问题
+            tPsInspectionUtilitystation.setIssuesStatus(1L);
+            tPsInspectionUtilitystation.setUpdatedate(date);
+            tPsInspectionUtilitystation.setUpdaterCode(getUserId().toString());
+            tPsInspectionUtilitystationService.updateTPsInspectionUtilitystation(tPsInspectionUtilitystation);
+
+            // 存档历史问题数据
+            TPsInspectionUtilitystation entity = new TPsInspectionUtilitystation();
+            entity.setPosition(utilitystation.getPosition());
+            entity.setUtilityStationName(utilitystation.getUtilityStationName());
+            entity.setNoLeak(tPsInspectionUtilitystation.getNoLeak());
+            entity.setValveStatus(tPsInspectionUtilitystation.getValveStatus());
+            entity.setQuickConnectCoupling(tPsInspectionUtilitystation.getQuickConnectCoupling());
+            entity.setHoseOk(tPsInspectionUtilitystation.getHoseOk());
+            entity.setHoseNodamage(tPsInspectionUtilitystation.getHoseNodamage());
+            entity.setMonth(utilitystation.getMonth());
+            entity.setYear(utilitystation.getYear());
+            entity.setPlanId(utilitystation.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionUtilitystationService.insertTPsInspectionUtilitystation(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionUtilitystation.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(utilitystation.getUtilityStationName() + "_" + utilitystation.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (utilitystation.getIssuesStatus() == 1) {
+                tPsInspectionUtilitystation.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionUtilitystation.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionUtilitystation.setCheckStatus("1");
+            tPsInspectionUtilitystation.setConfirmer(getNickName());
+            tPsInspectionUtilitystation.setCheckDate(date);
+            tPsInspectionUtilitystation.setUpdatedate(date);
+            tPsInspectionUtilitystation.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionUtilitystationService.updateTPsInspectionUtilitystation(tPsInspectionUtilitystation));
     }
 
     /**
      * 删除公用站检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:utilitystation:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "公用站检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 101 - 6
master/src/main/java/com/ruoyi/project/ps/inspection/controller/TPsInspectionVentvalveController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.ps.inspection.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -8,10 +9,15 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.ps.inspection.domain.TPsInspectionVentvalve;
 import com.ruoyi.project.ps.inspection.service.ITPsInspectionVentvalveService;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolIssues;
+import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolIssuesService;
+import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,13 +29,20 @@ import java.util.List;
 @RestController
 @RequestMapping("/ps/inspection/ventvalve")
 public class TPsInspectionVentvalveController extends BaseController {
+
     @Autowired
     private ITPsInspectionVentvalveService tPsInspectionVentvalveService;
 
+    @Autowired
+    private ITPsPatrolPlanService tPsPatrolPlanService;
+
+    @Autowired
+    private ITPsPatrolIssuesService tPsPatrolIssuesService;
+
     /**
      * 查询余压阀检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPsInspectionVentvalve tPsInspectionVentvalve) {
         startPage();
@@ -40,7 +53,7 @@ public class TPsInspectionVentvalveController extends BaseController {
     /**
      * 导出余压阀检查记录列表
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:list')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:list')")
     @Log(title = "余压阀检查记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPsInspectionVentvalve tPsInspectionVentvalve) {
@@ -52,7 +65,7 @@ public class TPsInspectionVentvalveController extends BaseController {
     /**
      * 获取余压阀检查记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:query')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPsInspectionVentvalveService.selectTPsInspectionVentvalveById(id));
@@ -61,7 +74,7 @@ public class TPsInspectionVentvalveController extends BaseController {
     /**
      * 新增余压阀检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:add')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:add')")
     @Log(title = "余压阀检查记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPsInspectionVentvalve tPsInspectionVentvalve) {
@@ -70,18 +83,100 @@ public class TPsInspectionVentvalveController extends BaseController {
 
     /**
      * 修改余压阀检查记录
+     *
+     * @param tPsInspectionVentvalve 余压阀检查记录对象,包含更新后的检查信息
+     * @return AjaxResult 统一返回结果,表示操作是否成功
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:edit')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:edit')")
     @Log(title = "余压阀检查记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPsInspectionVentvalve tPsInspectionVentvalve) {
+        Date date = new Date();
+        TPsInspectionVentvalve ventvalve = tPsInspectionVentvalveService.selectTPsInspectionVentvalveById(tPsInspectionVentvalve.getId());
+
+        if (ventvalve.getCheckStatus().equals("1")) {
+            return AjaxResult.error("该设备已检查!");
+        }
+
+        // 查询对应的巡检计划
+        TPsPatrolPlan plan = tPsPatrolPlanService.selectTPsPatrolPlanById(ventvalve.getPlanId());
+
+        // 判断计划状态是否已确认,若已确认则不允许重复操作
+        if (plan.getStatus() == 1) {
+            return AjaxResult.error("计划已确认,请勿重复操作!");
+        }
+
+        // 检查是否存在异常项
+        if (StringUtils.isNotEquals("1", tPsInspectionVentvalve.getAppearance(), tPsInspectionVentvalve.getSeamless(), tPsInspectionVentvalve.getFunctionalTest(), tPsInspectionVentvalve.getNoBlock())) {
+            // 当前数据标记为存在问题
+            tPsInspectionVentvalve.setIssuesStatus(1L);
+            tPsInspectionVentvalve.setUpdatedate(date);
+            tPsInspectionVentvalve.setUpdaterCode(getUserId().toString());
+            tPsInspectionVentvalveService.updateTPsInspectionVentvalve(tPsInspectionVentvalve);
+
+            // 存档历史问题数据
+            TPsInspectionVentvalve entity = new TPsInspectionVentvalve();
+            entity.setPosition(ventvalve.getPosition());
+            entity.setVentvalveNo(ventvalve.getVentvalveNo());
+            entity.setAppearance(tPsInspectionVentvalve.getAppearance());
+            entity.setSeamless(tPsInspectionVentvalve.getSeamless());
+            entity.setFunctionalTest(tPsInspectionVentvalve.getFunctionalTest());
+            entity.setNoBlock(tPsInspectionVentvalve.getNoBlock());
+            entity.setMonth(ventvalve.getMonth());
+            entity.setYear(ventvalve.getYear());
+            entity.setPlanId(ventvalve.getPlanId());
+            entity.setIssuesStatus(1L);
+            entity.setConfirmer(getNickName());
+            entity.setCheckDate(date);
+            entity.setIssuesFlag(1L);
+            entity.setCheckStatus("1");
+            entity.setCreatedate(date);
+            entity.setCreaterCode(getUserId().toString());
+            tPsInspectionVentvalveService.insertTPsInspectionVentvalve(entity);
+
+            // 创建并保存问题关联记录
+            TPsPatrolIssues issues = new TPsPatrolIssues();
+            issues.setLinkOldId(tPsInspectionVentvalve.getId());
+            issues.setLinkNewId(entity.getId());
+            issues.setPatrolType("1");
+            issues.setDevDescribe(ventvalve.getVentvalveNo() + "_" + ventvalve.getPosition());
+            issues.setStatus(0L);// 待处理
+            tPsPatrolIssuesService.insertTPsPatrolIssues(issues);
+        } else {
+            // 若之前标记为问题但现在恢复正常,则清除问题状态及相关记录
+            if (ventvalve.getIssuesStatus() == 1) {
+                tPsInspectionVentvalve.setIssuesStatus(0L);
+                TPsPatrolIssues issues = new TPsPatrolIssues();
+                issues.setLinkOldId(tPsInspectionVentvalve.getId());
+                for (TPsPatrolIssues item : tPsPatrolIssuesService.selectTPsPatrolIssuesList(issues)) {
+                    item.setStatus(1L);// 已处理
+                    tPsPatrolIssuesService.updateTPsPatrolIssues(item);
+                }
+            }
+
+            // 更新检查状态及时间等字段
+            tPsInspectionVentvalve.setCheckStatus("1");
+            tPsInspectionVentvalve.setConfirmer(getNickName());
+            tPsInspectionVentvalve.setCheckDate(date);
+            tPsInspectionVentvalve.setUpdatedate(date);
+            tPsInspectionVentvalve.setUpdaterCode(getUserId().toString());
+
+            // 如果无问题则更新巡检计划中的完成数量与未完成数量
+            if (plan.getUncheckedNum() != 0) {
+                plan.setCheckedNum(plan.getCheckedNum() + 1);
+                plan.setUncheckedNum(plan.getUncheckedNum() - 1);
+            }
+            tPsPatrolPlanService.updateTPsPatrolPlan(plan);
+        }
+
+        // 返回最终更新结果
         return toAjax(tPsInspectionVentvalveService.updateTPsInspectionVentvalve(tPsInspectionVentvalve));
     }
 
     /**
      * 删除余压阀检查记录
      */
-    @PreAuthorize("@ss.hasPermi('inspection:ventvalve:remove')")
+    @PreAuthorize("@ss.hasPermi('ps:patrol:remove')")
     @Log(title = "余压阀检查记录", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 3 - 3
master/src/main/java/com/ruoyi/project/ps/inspection/domain/TPsInspectionSump.java

@@ -192,11 +192,11 @@ public class TPsInspectionSump extends BaseEntity {
         return sumpNo;
     }
 
-    public void setposition(String position) {
+    public void setPosition(String position) {
         this.position = position;
     }
 
-    public String getposition() {
+    public String getPosition() {
         return position;
     }
 
@@ -357,7 +357,7 @@ public class TPsInspectionSump extends BaseEntity {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("id", getId())
                 .append("sumpNo", getSumpNo())
-                .append("position", getposition())
+                .append("position", getPosition())
                 .append("aroundSump", getAroundSump())
                 .append("manholeCover", getManholeCover())
                 .append("insideSump", getInsideSump())

+ 184 - 0
master/src/main/java/com/ruoyi/project/ps/inspection/dto/InspectionQueryRequest.java

@@ -0,0 +1,184 @@
+package com.ruoyi.project.ps.inspection.dto;
+
+import java.io.Serializable;
+
+/**
+ * 巡检记录查询请求DTO
+ *
+ * @author system
+ * @date 2025-01-XX
+ */
+public class InspectionQueryRequest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 巡检记录类型
+     * alarm, extinguisher, hydrant, firedoor, lift, cabinet, callsystem, fgs, curtain, steam, monitor, coffer, sump, pit, rainvalve, ventvalve, utilitystation, eyewash
+     */
+    private String type;
+
+    /**
+     * 记录ID
+     */
+    private Long id;
+
+    /**
+     * 设备编号/位号
+     */
+    private String devNo;
+
+    /**
+     * 位置
+     */
+    private String position;
+
+    /**
+     * 月份
+     */
+    private Long month;
+
+    /**
+     * 年份
+     */
+    private Long year;
+
+    /**
+     * 计划ID
+     */
+    private Long planId;
+
+    /**
+     * 部门ID
+     */
+    private Long deptId;
+
+    /**
+     * 检查状态
+     */
+    private String checkStatus;
+
+    /**
+     * 问题状态
+     */
+    private Long issuesStatus;
+
+    /**
+     * 问题标志
+     */
+    private Long issuesFlag;
+
+    /**
+     * 页码
+     */
+    private Integer pageNum;
+
+    /**
+     * 每页数量
+     */
+    private Integer pageSize;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDevNo() {
+        return devNo;
+    }
+
+    public void setDevNo(String devNo) {
+        this.devNo = devNo;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public Long getMonth() {
+        return month;
+    }
+
+    public void setMonth(Long month) {
+        this.month = month;
+    }
+
+    public Long getYear() {
+        return year;
+    }
+
+    public void setYear(Long year) {
+        this.year = year;
+    }
+
+    public Long getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(Long planId) {
+        this.planId = planId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(String checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public Long getIssuesStatus() {
+        return issuesStatus;
+    }
+
+    public void setIssuesStatus(Long issuesStatus) {
+        this.issuesStatus = issuesStatus;
+    }
+
+    public Long getIssuesFlag() {
+        return issuesFlag;
+    }
+
+    public void setIssuesFlag(Long issuesFlag) {
+        this.issuesFlag = issuesFlag;
+    }
+
+    public Integer getPageNum() {
+        return pageNum;
+    }
+
+    public void setPageNum(Integer pageNum) {
+        this.pageNum = pageNum;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}
+

+ 16 - 6
master/src/main/java/com/ruoyi/project/ps/patrol/domain/TPsPatrolIssues.java

@@ -26,7 +26,8 @@ public class TPsPatrolIssues extends BaseEntity {
      * 关联表id
      */
     @Excel(name = "关联表id")
-    private Long linkId;
+    private Long linkOldId;
+    private Long linkNewId;
 
     /**
      * 关联数据类型
@@ -108,12 +109,20 @@ public class TPsPatrolIssues extends BaseEntity {
         return id;
     }
 
-    public void setLinkId(Long linkId) {
-        this.linkId = linkId;
+    public Long getLinkOldId() {
+        return linkOldId;
     }
 
-    public Long getLinkId() {
-        return linkId;
+    public void setLinkOldId(Long linkOldId) {
+        this.linkOldId = linkOldId;
+    }
+
+    public Long getLinkNewId() {
+        return linkNewId;
+    }
+
+    public void setLinkNewId(Long linkNewId) {
+        this.linkNewId = linkNewId;
     }
 
     public void setPatrolType(String patrolType) {
@@ -200,7 +209,8 @@ public class TPsPatrolIssues extends BaseEntity {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("id", getId())
-                .append("linkId", getLinkId())
+                .append("linkOldId", getLinkOldId())
+                .append("linkNewId", getLinkNewId())
                 .append("patrolType", getPatrolType())
                 .append("delFlag", getDelFlag())
                 .append("createrCode", getCreaterCode())

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevAlarmMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevCabinetMapper.xml

@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevCallsystemMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevCofferMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevCurtainMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevExtinguisherMapper.xml

@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevEyewashMapper.xml

@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevFgsMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevFiredoorMapper.xml

@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevHydrantMapper.xml

@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevLiftMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevMonitorMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevPitMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevRainvalveMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevSteamMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevSumpMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevUtilitystationMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
master/src/main/resources/mybatis/ps/dev/TPsDevVentvalveMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             and d.del_flag = 0
         </where>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionAlarmMapper.xml

@@ -37,8 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionAlarmList" parameterType="TPsInspectionAlarm" resultMap="TPsInspectionAlarmResult">
         <include refid="selectTPsInspectionAlarmVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="alarmSign != null  and alarmSign != ''"> and alarm_sign = #{alarmSign}</if>
             <if test="glassRetainer != null  and glassRetainer != ''"> and glass_retainer = #{glassRetainer}</if>

+ 4 - 3
master/src/main/resources/mybatis/ps/inspection/TPsInspectionCabinetMapper.xml

@@ -39,9 +39,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionCabinetList" parameterType="TPsInspectionCabinet" resultMap="TPsInspectionCabinetResult">
         <include refid="selectTPsInspectionCabinetVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
-            <if test="modelNo != null  and modelNo != ''"> and model_no = #{modelNo}</if>
-            <if test="boxNo != null  and boxNo != ''"> and box_no = #{boxNo}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
+            <if test="modelNo != null  and modelNo != ''"> and model_no like concat(concat('%', #{modelNo}), '%')</if>
+            <if test="boxNo != null  and boxNo != ''"> and box_no like concat(concat('%', #{boxNo}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="internalItems != null  and internalItems != ''"> and internal_items = #{internalItems}</if>
             <if test="valve != null  and valve != ''"> and valve = #{valve}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionCallsystemMapper.xml

@@ -38,8 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionCallsystemList" parameterType="TPsInspectionCallsystem" resultMap="TPsInspectionCallsystemResult">
         <include refid="selectTPsInspectionCallsystemVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="broadcast != null  and broadcast != ''"> and broadcast = #{broadcast}</if>
             <if test="correspond != null  and correspond != ''"> and correspond = #{correspond}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionCofferMapper.xml

@@ -38,8 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionCofferList" parameterType="TPsInspectionCoffer" resultMap="TPsInspectionCofferResult">
         <include refid="selectTPsInspectionCofferVo"/>
         <where>  
-            <if test="cofferNo != null  and cofferNo != ''"> and coffer_no = #{cofferNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="cofferNo != null  and cofferNo != ''"> and coffer_no like concat(concat('%', #{cofferNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="floorOk != null  and floorOk != ''"> and floor_ok = #{floorOk}</if>
             <if test="wallOk != null  and wallOk != ''"> and wall_ok = #{wallOk}</if>
             <if test="signOk != null  and signOk != ''"> and sign_ok = #{signOk}</if>

+ 2 - 1
master/src/main/resources/mybatis/ps/inspection/TPsInspectionCurtainMapper.xml

@@ -38,7 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionCurtainList" parameterType="TPsInspectionCurtain" resultMap="TPsInspectionCurtainResult">
         <include refid="selectTPsInspectionCurtainVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="curtainName != null  and curtainName != ''"> and curtain_name like concat(concat('%', #{curtainName}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="discloseOk != null  and discloseOk != ''"> and disclose_ok = #{discloseOk}</if>

+ 4 - 3
master/src/main/resources/mybatis/ps/inspection/TPsInspectionExtinguisherMapper.xml

@@ -45,9 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionExtinguisherList" parameterType="TPsInspectionExtinguisher" resultMap="TPsInspectionExtinguisherResult">
         <include refid="selectTPsInspectionExtinguisherVo"/>
         <where>  
-            <if test="fireExtinguisherNo != null "> and fire_extinguisher_no = #{fireExtinguisherNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
-            <if test="fireExtinguisherModel != null  and fireExtinguisherModel != ''"> and fire_extinguisher_model = #{fireExtinguisherModel}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="fireExtinguisherNo != null  and fireExtinguisherNo != ''"> and fire_extinguisher_no like concat(concat('%', #{fireExtinguisherNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
+            <if test="fireExtinguisherModel != null  and fireExtinguisherModel != ''"> and fire_extinguisher_model like concat(concat('%', #{fireExtinguisherModel}), '%')</if>
             <if test="check1 != null  and check1 != ''"> and check_1 = #{check1}</if>
             <if test="check2 != null  and check2 != ''"> and check_2 = #{check2}</if>
             <if test="check3 != null  and check3 != ''"> and check_3 = #{check3}</if>

+ 2 - 1
master/src/main/resources/mybatis/ps/inspection/TPsInspectionEyewashMapper.xml

@@ -45,7 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionEyewashList" parameterType="TPsInspectionEyewash" resultMap="TPsInspectionEyewashResult">
         <include refid="selectTPsInspectionEyewashVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
             <if test="signageOk != null  and signageOk != ''"> and signage_ok = #{signageOk}</if>
             <if test="accessClear != null  and accessClear != ''"> and access_clear = #{accessClear}</if>
             <if test="partsOk != null  and partsOk != ''"> and parts_ok = #{partsOk}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionFgsMapper.xml

@@ -38,8 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionFgsList" parameterType="TPsInspectionFgs" resultMap="TPsInspectionFgsResult">
         <include refid="selectTPsInspectionFgsVo"/>
         <where>  
-            <if test="fgsNo != null  and fgsNo != ''"> and fgs_no = #{fgsNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="fgsNo != null  and fgsNo != ''"> and fgs_no like concat(concat('%', #{fgsNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="testLightOk != null  and testLightOk != ''"> and test_light_ok = #{testLightOk}</if>
             <if test="testAlarm != null  and testAlarm != ''"> and test_alarm = #{testAlarm}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionFiredoorMapper.xml

@@ -39,9 +39,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionFiredoorList" parameterType="TPsInspectionFiredoor" resultMap="TPsInspectionFiredoorResult">
         <include refid="selectTPsInspectionFiredoorVo"/>
         <where>  
-            <if test="doorNo != null  and doorNo != ''"> and door_no = #{doorNo}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="doorNo != null  and doorNo != ''"> and door_no like concat(concat('%', #{doorNo}), '%')</if>
             <if test="doorName != null  and doorName != ''"> and door_name like concat(concat('%', #{doorName}), '%')</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="seamless != null  and seamless != ''"> and seamless = #{seamless}</if>
             <if test="closerStatus != null  and closerStatus != ''"> and closer_status = #{closerStatus}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionHydrantMapper.xml

@@ -42,8 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionHydrantList" parameterType="TPsInspectionHydrant" resultMap="TPsInspectionHydrantResult">
         <include refid="selectTPsInspectionHydrantVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
-            <if test="equipId != null  and equipId != ''"> and equip_id = #{equipId}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
+            <if test="equipId != null  and equipId != ''"> and equip_id like concat(concat('%', #{equipId}), '%')</if>
             <if test="hydrantStatus != null  and hydrantStatus != ''"> and hydrant_status = #{hydrantStatus}</if>
             <if test="hoseQty != null  and hoseQty != ''"> and hose_qty = #{hoseQty}</if>
             <if test="wrenchQty != null  and wrenchQty != ''"> and wrench_qty = #{wrenchQty}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionLiftMapper.xml

@@ -40,8 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionLiftList" parameterType="TPsInspectionLift" resultMap="TPsInspectionLiftResult">
         <include refid="selectTPsInspectionLiftVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="elevatorDoor != null  and elevatorDoor != ''"> and elevator_door = #{elevatorDoor}</if>
             <if test="floorOk != null  and floorOk != ''"> and floor_ok = #{floorOk}</if>
             <if test="explosionTelephone != null  and explosionTelephone != ''"> and explosion_telephone = #{explosionTelephone}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionMonitorMapper.xml

@@ -39,8 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionMonitorList" parameterType="TPsInspectionMonitor" resultMap="TPsInspectionMonitorResult">
         <include refid="selectTPsInspectionMonitorVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="cannonRotate != null  and cannonRotate != ''"> and cannon_rotate = #{cannonRotate}</if>
             <if test="valveSwitch != null  and valveSwitch != ''"> and valve_switch = #{valveSwitch}</if>
             <if test="directJet != null  and directJet != ''"> and direct_jet = #{directJet}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionPitMapper.xml

@@ -37,8 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionPitList" parameterType="TPsInspectionPit" resultMap="TPsInspectionPitResult">
         <include refid="selectTPsInspectionPitVo"/>
         <where>  
-            <if test="devNo != null  and devNo != ''"> and dev_no = #{devNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="devNo != null  and devNo != ''"> and dev_no like concat(concat('%', #{devNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="aroundPit != null  and aroundPit != ''"> and around_pit = #{aroundPit}</if>
             <if test="manholeCover != null  and manholeCover != ''"> and manhole_cover = #{manholeCover}</if>
             <if test="insidePit != null  and insidePit != ''"> and inside_pit = #{insidePit}</if>

+ 2 - 1
master/src/main/resources/mybatis/ps/inspection/TPsInspectionRainvalveMapper.xml

@@ -37,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionRainvalveList" parameterType="TPsInspectionRainvalve" resultMap="TPsInspectionRainvalveResult">
         <include refid="selectTPsInspectionRainvalveVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="valveName != null  and valveName != ''"> and valve_name like concat(concat('%', #{valveName}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="noLeak != null  and noLeak != ''"> and no_leak = #{noLeak}</if>

+ 2 - 1
master/src/main/resources/mybatis/ps/inspection/TPsInspectionSteamMapper.xml

@@ -38,7 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionSteamList" parameterType="TPsInspectionSteam" resultMap="TPsInspectionSteamResult">
         <include refid="selectTPsInspectionSteamVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="steamName != null  and steamName != ''"> and steam_name like concat(concat('%', #{steamName}), '%')</if>
             <if test="functionalTest != null  and functionalTest != ''"> and functional_test = #{functionalTest}</if>
             <if test="valveOk != null  and valveOk != ''"> and valve_ok = #{valveOk}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionSumpMapper.xml

@@ -38,8 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionSumpList" parameterType="TPsInspectionSump" resultMap="TPsInspectionSumpResult">
         <include refid="selectTPsInspectionSumpVo"/>
         <where>  
-            <if test="sumpNo != null  and sumpNo != ''"> and sump_no = #{sumpNo}</if>
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="sumpNo != null  and sumpNo != ''"> and sump_no like concat(concat('%', #{sumpNo}), '%')</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="aroundSump != null  and aroundSump != ''"> and around_sump = #{aroundSump}</if>
             <if test="manholeCover != null  and manholeCover != ''"> and manhole_cover = #{manholeCover}</if>
             <if test="insideSump != null  and insideSump != ''"> and inside_sump = #{insideSump}</if>

+ 2 - 1
master/src/main/resources/mybatis/ps/inspection/TPsInspectionUtilitystationMapper.xml

@@ -39,7 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionUtilitystationList" parameterType="TPsInspectionUtilitystation" resultMap="TPsInspectionUtilitystationResult">
         <include refid="selectTPsInspectionUtilitystationVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
             <if test="utilityStationName != null  and utilityStationName != ''"> and utility_station_name like concat(concat('%', #{utilityStationName}), '%')</if>
             <if test="noLeak != null  and noLeak != ''"> and no_leak = #{noLeak}</if>
             <if test="valveStatus != null  and valveStatus != ''"> and valve_status = #{valveStatus}</if>

+ 3 - 2
master/src/main/resources/mybatis/ps/inspection/TPsInspectionVentvalveMapper.xml

@@ -38,8 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTPsInspectionVentvalveList" parameterType="TPsInspectionVentvalve" resultMap="TPsInspectionVentvalveResult">
         <include refid="selectTPsInspectionVentvalveVo"/>
         <where>  
-            <if test="position != null  and position != ''"> and position = #{position}</if>
-            <if test="ventvalveNo != null  and ventvalveNo != ''"> and ventvalve_no = #{ventvalveNo}</if>
+            <if test="id != null "> and d.id = #{id}</if>
+            <if test="position != null  and position != ''"> and position like concat(concat('%', #{position}), '%')</if>
+            <if test="ventvalveNo != null  and ventvalveNo != ''"> and ventvalve_no like concat(concat('%', #{ventvalveNo}), '%')</if>
             <if test="appearance != null  and appearance != ''"> and appearance = #{appearance}</if>
             <if test="seamless != null  and seamless != ''"> and seamless = #{seamless}</if>
             <if test="functionalTest != null  and functionalTest != ''"> and functional_test = #{functionalTest}</if>

+ 12 - 7
master/src/main/resources/mybatis/ps/patrol/TPsPatrolIssuesMapper.xml

@@ -6,7 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="TPsPatrolIssues" id="TPsPatrolIssuesResult">
         <result property="id"    column="id"    />
-        <result property="linkId"    column="link_id"    />
+        <result property="linkOldId"    column="link_old_id"    />
+        <result property="linkNewId"    column="link_new_id"    />
         <result property="patrolType"    column="patrol_type"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="createrCode"    column="creater_code"    />
@@ -21,14 +22,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTPsPatrolIssuesVo">
-        select d.id, d.link_id, d.patrol_type, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.dev_describe, d.status ,s.dept_name from t_ps_patrol_issues d
+        select d.id, d.link_old_id,d.link_new_id, d.patrol_type, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.dev_describe, d.status ,s.dept_name from t_ps_patrol_issues d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
     <select id="selectTPsPatrolIssuesList" parameterType="TPsPatrolIssues" resultMap="TPsPatrolIssuesResult">
         <include refid="selectTPsPatrolIssuesVo"/>
         <where>  
-            <if test="linkId != null "> and link_id = #{linkId}</if>
+            <if test="linkOldId != null "> and link_old_id = #{linkOldId}</if>
+            <if test="linkNewId != null "> and link_new_id = #{linkNewId}</if>
             <if test="patrolType != null  and patrolType != ''"> and patrol_type = #{patrolType}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
@@ -37,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="devDescribe != null  and devDescribe != ''"> and dev_describe = #{devDescribe}</if>
-            <if test="status != null "> and status = #{status}</if>
+            <if test="status != null "> and d.status = #{status}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -56,7 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into t_ps_patrol_issues
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
-            <if test="linkId != null">link_id,</if>
+            <if test="linkOldId != null">link_old_id,</if>
+            <if test="linkNewId != null">link_new_id,</if>
             <if test="patrolType != null and patrolType != ''">patrol_type,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createrCode != null">creater_code,</if>
@@ -70,7 +73,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
-            <if test="linkId != null">#{linkId},</if>
+            <if test="linkOldId != null">#{linkOldId},</if>
+            <if test="linkNewId != null">#{linkNewId},</if>
             <if test="patrolType != null and patrolType != ''">#{patrolType},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createrCode != null">#{createrCode},</if>
@@ -87,7 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateTPsPatrolIssues" parameterType="TPsPatrolIssues">
         update t_ps_patrol_issues
         <trim prefix="SET" suffixOverrides=",">
-            <if test="linkId != null">link_id = #{linkId},</if>
+            <if test="linkOldId != null">link_old_id = #{linkOldId},</if>
+            <if test="linkNewId != null">link_new_id = #{linkNewId},</if>
             <if test="patrolType != null and patrolType != ''">patrol_type = #{patrolType},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createrCode != null">creater_code = #{createrCode},</if>

+ 58 - 76
ui/src/views/ps/dev/alarm/index.vue

@@ -32,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:alarm:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -43,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:alarm:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -54,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:alarm:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -64,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:alarm:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -74,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:alarm:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="alarmList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -110,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:alarm:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -118,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:alarm:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -142,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -193,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -212,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -227,7 +193,7 @@
 </template>
 
 <script>
-import {addAlarm, delAlarm, exportAlarm, getAlarm, importTemplate, listAlarm, updateAlarm} from "@/api/ps/dev/alarm";
+import {addAlarm, delAlarm, exportAlarm, getAlarm, listAlarm, updateAlarm} from "@/api/ps/dev/alarm";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -236,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Alarm",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -261,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'alarm',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -287,15 +255,21 @@ export default {
         remarks: null,
         deptId: null,
         status: null,
-        patrolType: null
+        patrolType: '1'
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -347,8 +321,8 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
-        patrolType: null
+        status: "1",
+        patrolType: "1"
       };
       this.resetForm("form");
     },
@@ -438,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -451,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/alarm/exportQRCode', {
+        ...this.queryParams
+      }, `alarmQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 62 - 140
ui/src/views/ps/dev/cabinet/index.vue

@@ -28,68 +28,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -103,7 +41,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:cabinet:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -114,7 +52,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:cabinet:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -125,7 +63,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:cabinet:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -135,7 +73,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:cabinet:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -145,36 +83,36 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:cabinet:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="cabinetList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
+      <el-table-column label="编号" align="center" prop="boxNo" :show-overflow-tooltip="true"/>
       <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="型号" align="center" prop="modelNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="编号" align="center" prop="boxNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -182,7 +120,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:cabinet:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -190,7 +128,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:cabinet:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -208,58 +146,23 @@
     <!-- 添加或修改玻璃门消火栓箱和泡沫栓箱基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="编号" prop="boxNo">
+          <el-input v-model="form.boxNo" placeholder="请输入编号"/>
+        </el-form-item>
         <el-form-item label="位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
         <el-form-item label="型号" prop="modelNo">
           <el-input v-model="form.modelNo" placeholder="请输入型号"/>
         </el-form-item>
-        <el-form-item label="编号" prop="boxNo">
-          <el-input v-model="form.boxNo" placeholder="请输入编号"/>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -268,13 +171,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -287,10 +190,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -307,7 +211,6 @@ import {
   delCabinet,
   exportCabinet,
   getCabinet,
-  importTemplate,
   listCabinet,
   updateCabinet
 } from "@/api/ps/dev/cabinet";
@@ -319,6 +222,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Cabinet",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -344,14 +248,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'cabinet',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -377,9 +282,18 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        boxNo: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        modelNo: [
+          {required: true, message: "型号不能为空", trigger: "blur"}
+        ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -432,7 +346,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -523,9 +437,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -536,12 +448,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/cabinet/exportQRCode', {
+        ...this.queryParams
+      }, `cabinetQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 55 - 136
ui/src/views/ps/dev/callsystem/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:callsystem:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:callsystem:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:callsystem:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:callsystem:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:callsystem:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="callsystemList" @selection-change="handleSelectionChange"
               :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:callsystem:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:callsystem:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -204,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delCallsystem,
   exportCallsystem,
   getCallsystem,
-  importTemplate,
   listCallsystem,
   updateCallsystem
 } from "@/api/ps/dev/callsystem";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Callsystem",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'callsystem',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/callsystem/exportQRCode', {
+        ...this.queryParams
+      }, `callsystemQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 56 - 137
ui/src/views/ps/dev/coffer/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:coffer:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:coffer:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:coffer:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:coffer:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:coffer:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="cofferList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="ID" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="cofferNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:coffer:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:coffer:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -197,56 +135,21 @@
 
     <!-- 添加或修改围堰基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="编号" prop="cofferNo">
           <el-input v-model="form.cofferNo" placeholder="请输入编号"/>
         </el-form-item>
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delCoffer,
   exportCoffer,
   getCoffer,
-  importTemplate,
   listCoffer,
   updateCoffer
 } from "@/api/ps/dev/coffer";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Coffer",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'coffer',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        cofferNo: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/coffer/exportQRCode', {
+        ...this.queryParams
+      }, `cofferQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 58 - 139
ui/src/views/ps/dev/curtain/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:curtain:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:curtain:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:curtain:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:curtain:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:curtain:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="curtainList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="名称" align="center" prop="curtainName" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:curtain:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:curtain:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -198,55 +136,20 @@
     <!-- 添加或修改现场消防水幕检测记录对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
-        </el-form-item>
         <el-form-item label="名称" prop="curtainName">
           <el-input v-model="form.curtainName" placeholder="请输入名称"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delCurtain,
   exportCurtain,
   getCurtain,
-  importTemplate,
   listCurtain,
   updateCurtain
 } from "@/api/ps/dev/curtain";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Curtain",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'curtain',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        curtainName: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/curtain/exportQRCode', {
+        ...this.queryParams
+      }, `curtainQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 71 - 155
ui/src/views/ps/dev/extinguisher/index.vue

@@ -19,83 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="灭火器型号" prop="fireExtinguisherModel">
-        <el-input
-          v-model="queryParams.fireExtinguisherModel"
-          placeholder="请输入灭火器型号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="灭火器类型(1=常规,2=二氧化碳)" prop="devType">
-        <el-select v-model="queryParams.devType" placeholder="请选择灭火器类型(1=常规,2=二氧化碳)" clearable
-                   size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -109,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:extinguisher:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -120,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:extinguisher:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -131,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:extinguisher:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -141,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:extinguisher:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -151,38 +74,43 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:extinguisher:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="extinguisherList" @selection-change="handleSelectionChange"
               :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="现场编号" align="center" prop="fireExtinguisherNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="灭火器型号" align="center" prop="fireExtinguisherModel" :show-overflow-tooltip="true"/>
-      <el-table-column label="灭火器类型(1=常规,2=二氧化碳)" align="center" prop="devType"
-                       :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="灭火器类型" align="center" prop="devType" :show-overflow-tooltip="true">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+          <span v-if="scope.row.devType === '1'">常规</span>
+          <span v-else-if="scope.row.devType === '2'">二氧化碳</span>
+          <span v-else>{{ scope.row.devType }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -190,7 +118,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:extinguisher:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -198,7 +126,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:extinguisher:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -215,7 +143,7 @@
 
     <!-- 添加或修改现场灭火器基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="现场编号" prop="fireExtinguisherNo">
           <el-input v-model="form.fireExtinguisherNo" placeholder="请输入现场编号"/>
         </el-form-item>
@@ -225,54 +153,20 @@
         <el-form-item label="灭火器型号" prop="fireExtinguisherModel">
           <el-input v-model="form.fireExtinguisherModel" placeholder="请输入灭火器型号"/>
         </el-form-item>
-        <el-form-item label="灭火器类型(1=常规,2=二氧化碳)" prop="devType">
-          <el-select v-model="form.devType" placeholder="请选择灭火器类型(1=常规,2=二氧化碳)">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="灭火器类型" prop="devType">
+          <el-radio-group v-model="form.devType">
+            <el-radio label="1">常规</el-radio>
+            <el-radio label="2">二氧化碳</el-radio>
+          </el-radio-group>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -281,13 +175,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -300,10 +194,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -320,7 +215,6 @@ import {
   delExtinguisher,
   exportExtinguisher,
   getExtinguisher,
-  importTemplate,
   listExtinguisher,
   updateExtinguisher
 } from "@/api/ps/dev/extinguisher";
@@ -332,6 +226,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Extinguisher",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -357,14 +252,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'extinguisher',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -391,9 +287,21 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        fireExtinguisherNo: [
+          {required: true, message: "现场编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        fireExtinguisherModel: [
+          {required: true, message: "灭火器型号不能为空", trigger: "blur"}
+        ],
+        devType: [
+          {required: true, message: "灭火器类型不能为空", trigger: "blur"}
+        ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -447,7 +355,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -538,9 +446,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -551,12 +457,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/extinguisher/exportQRCode', {
+        ...this.queryParams
+      }, `extinguisherQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 52 - 136
ui/src/views/ps/dev/eyewash/index.vue

@@ -10,68 +10,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -85,7 +23,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:eyewash:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -96,7 +34,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:eyewash:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -107,7 +45,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:eyewash:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -117,7 +55,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:eyewash:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -127,34 +65,34 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:eyewash:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="eyewashList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="ID" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -162,7 +100,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:eyewash:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -170,7 +108,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:eyewash:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -191,49 +129,14 @@
         <el-form-item label="位号" prop="devNo">
           <el-input v-model="form.devNo" placeholder="请输入位号"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -242,13 +145,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -261,10 +164,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -281,7 +185,6 @@ import {
   delEyewash,
   exportEyewash,
   getEyewash,
-  importTemplate,
   listEyewash,
   updateEyewash
 } from "@/api/ps/dev/eyewash";
@@ -293,6 +196,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Eyewash",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -318,14 +222,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'eyewash',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -349,9 +254,12 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -402,7 +310,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -493,9 +401,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -506,12 +412,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/eyewash/exportQRCode', {
+        ...this.queryParams
+      }, `eyewashQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 61 - 141
ui/src/views/ps/dev/fgs/index.vue

@@ -10,77 +10,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="编号" prop="position">
+      <el-form-item label="位置" prop="position">
         <el-input
           v-model="queryParams.position"
-          placeholder="请输入编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
+          placeholder="请输入位置"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:fgs:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:fgs:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:fgs:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:fgs:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:fgs:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="fgsList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="ID" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="fgsNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="编号" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:fgs:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:fgs:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -201,52 +139,17 @@
         <el-form-item label="编号" prop="fgsNo">
           <el-input v-model="form.fgsNo" placeholder="请输入编号"/>
         </el-form-item>
-        <el-form-item label="编号" prop="position">
-          <el-input v-model="form.position" placeholder="请输入编号"/>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
+        <el-form-item label="位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -289,7 +193,7 @@
 </template>
 
 <script>
-import {addFgs, delFgs, exportFgs, getFgs, importTemplate, listFgs, updateFgs} from "@/api/ps/dev/fgs";
+import {addFgs, delFgs, exportFgs, getFgs, listFgs, updateFgs} from "@/api/ps/dev/fgs";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -298,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Fgs",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -323,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'fgs',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -355,9 +261,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        fgsNo: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -409,7 +321,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -500,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -513,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/fgs/exportQRCode', {
+        ...this.queryParams
+      }, `fgsQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 59 - 137
ui/src/views/ps/dev/firedoor/index.vue

@@ -28,68 +28,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -103,7 +41,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:firedoor:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -114,7 +52,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:firedoor:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -125,7 +63,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:firedoor:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -135,7 +73,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:firedoor:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -145,36 +83,36 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:firedoor:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="firedoorList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="设备类型" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="doorNo" :show-overflow-tooltip="true"/>
       <el-table-column label="名称" align="center" prop="doorName" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -182,7 +120,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:firedoor:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -190,7 +128,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:firedoor:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -207,7 +145,7 @@
 
     <!-- 添加或修改安全防火门防爆门基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="编号" prop="doorNo">
           <el-input v-model="form.doorNo" placeholder="请输入编号"/>
         </el-form-item>
@@ -217,49 +155,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -268,13 +171,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -287,10 +190,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -307,7 +211,6 @@ import {
   delFiredoor,
   exportFiredoor,
   getFiredoor,
-  importTemplate,
   listFiredoor,
   updateFiredoor
 } from "@/api/ps/dev/firedoor";
@@ -319,6 +222,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Firedoor",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -344,14 +248,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'firedoor',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -377,9 +282,18 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        doorNo: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
         ],
+        doorName: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
+        ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -432,7 +346,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -523,9 +437,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -536,12 +448,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/firedoor/exportQRCode', {
+        ...this.queryParams
+      }, `firedoorQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 67 - 152
ui/src/views/ps/dev/hydrant/index.vue

@@ -1,15 +1,6 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="位置" prop="position">
-        <el-input
-          v-model="queryParams.position"
-          placeholder="请输入位置"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="器材编号" prop="equipId">
         <el-input
           v-model="queryParams.equipId"
@@ -19,73 +10,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="设备类型" prop="devType">
-        <el-select v-model="queryParams.devType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
+      <el-form-item label="位置" prop="position">
         <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
+          v-model="queryParams.position"
+          placeholder="请输入位置"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -99,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:hydrant:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -110,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:hydrant:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -121,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:hydrant:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -131,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:hydrant:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -141,36 +74,36 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:hydrant:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="hydrantList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="器材编号" align="center" prop="equipId" :show-overflow-tooltip="true"/>
+      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="设备类型" align="center" prop="devType" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -178,7 +111,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:hydrant:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -186,7 +119,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:hydrant:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -203,61 +136,24 @@
 
     <!-- 添加或修改地上消火栓和消防水带箱基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
-        </el-form-item>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="器材编号" prop="equipId">
           <el-input v-model="form.equipId" placeholder="请输入器材编号"/>
         </el-form-item>
-        <el-form-item label="设备类型" prop="devType">
-          <el-select v-model="form.devType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        <el-form-item label="位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="设备类型" prop="devType">
+          <el-input v-model="form.devType" placeholder="请输入设备类型"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -266,13 +162,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -285,10 +181,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -305,7 +202,6 @@ import {
   delHydrant,
   exportHydrant,
   getHydrant,
-  importTemplate,
   listHydrant,
   updateHydrant
 } from "@/api/ps/dev/hydrant";
@@ -317,6 +213,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Hydrant",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -342,14 +239,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'hydrant',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -375,9 +273,18 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        equipId: [
+          {required: true, message: "器材编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        devType: [
+          {required: true, message: "设备类型不能为空", trigger: "blur"}
+        ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -430,7 +337,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -521,9 +428,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -534,12 +439,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/hydrant/exportQRCode', {
+        ...this.queryParams
+      }, `hydrantQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 56 - 136
ui/src/views/ps/dev/lift/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:lift:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:lift:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:lift:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:lift:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:lift:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="liftList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="ID" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:lift:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:lift:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -204,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -289,7 +193,7 @@
 </template>
 
 <script>
-import {addLift, delLift, exportLift, getLift, importTemplate, listLift, updateLift} from "@/api/ps/dev/lift";
+import {addLift, delLift, exportLift, getLift, listLift, updateLift} from "@/api/ps/dev/lift";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -298,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Lift",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -323,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'lift',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -355,9 +261,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -409,7 +321,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -500,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -513,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/lift/exportQRCode', {
+        ...this.queryParams
+      }, `liftQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 55 - 136
ui/src/views/ps/dev/monitor/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:monitor:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:monitor:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:monitor:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:monitor:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:monitor:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monitorList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:monitor:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:monitor:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -204,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delMonitor,
   exportMonitor,
   getMonitor,
-  importTemplate,
   listMonitor,
   updateMonitor
 } from "@/api/ps/dev/monitor";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Monitor",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'monitor',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/monitor/exportQRCode', {
+        ...this.queryParams
+      }, `monitorQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 56 - 136
ui/src/views/ps/dev/pit/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:pit:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:pit:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:pit:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:pit:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:pit:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="pitList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="设备类型" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:pit:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:pit:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -204,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -289,7 +193,7 @@
 </template>
 
 <script>
-import {addPit, delPit, exportPit, getPit, importTemplate, listPit, updatePit} from "@/api/ps/dev/pit";
+import {addPit, delPit, exportPit, getPit, listPit, updatePit} from "@/api/ps/dev/pit";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -298,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Pit",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -323,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'pit',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -355,9 +261,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        devNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -409,7 +321,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -500,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -513,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/pit/exportQRCode', {
+        ...this.queryParams
+      }, `pitQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 58 - 139
ui/src/views/ps/dev/rainvalve/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:rainvalve:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:rainvalve:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:rainvalve:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:rainvalve:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:rainvalve:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="rainvalveList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="名称" align="center" prop="valveName" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:rainvalve:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:rainvalve:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -198,55 +136,20 @@
     <!-- 添加或修改污水/雨排切换阀门检查对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
-        </el-form-item>
         <el-form-item label="名称" prop="valveName">
           <el-input v-model="form.valveName" placeholder="请输入名称"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delRainvalve,
   exportRainvalve,
   getRainvalve,
-  importTemplate,
   listRainvalve,
   updateRainvalve
 } from "@/api/ps/dev/rainvalve";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Rainvalve",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'rainvalve',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        valveName: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/rainvalve/exportQRCode', {
+        ...this.queryParams
+      }, `rainvalveQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 59 - 139
ui/src/views/ps/dev/steam/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:steam:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:steam:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:steam:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:steam:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:steam:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="steamList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="ID" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="名称" align="center" prop="steamName" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:steam:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:steam:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -198,55 +136,20 @@
     <!-- 添加或修改消防蒸汽系统基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
-        </el-form-item>
         <el-form-item label="名称" prop="steamName">
           <el-input v-model="form.steamName" placeholder="请输入名称"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -289,7 +193,7 @@
 </template>
 
 <script>
-import {addSteam, delSteam, exportSteam, getSteam, importTemplate, listSteam, updateSteam} from "@/api/ps/dev/steam";
+import {addSteam, delSteam, exportSteam, getSteam, listSteam, updateSteam} from "@/api/ps/dev/steam";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -298,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Steam",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -323,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'steam',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -355,9 +261,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        steamName: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -409,7 +321,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -500,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -513,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/steam/exportQRCode', {
+        ...this.queryParams
+      }, `steamQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 56 - 136
ui/src/views/ps/dev/sump/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:sump:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:sump:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:sump:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:sump:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:sump:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="sumpList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="设备类型" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="sumpNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:sump:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:sump:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -204,49 +142,14 @@
         <el-form-item label="现场位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -289,7 +193,7 @@
 </template>
 
 <script>
-import {addSump, delSump, exportSump, getSump, importTemplate, listSump, updateSump} from "@/api/ps/dev/sump";
+import {addSump, delSump, exportSump, getSump, listSump, updateSump} from "@/api/ps/dev/sump";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -298,6 +202,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Sump",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -323,14 +228,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'sump',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -355,9 +261,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        sumpNo: [
+          {required: true, message: "位号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -409,7 +321,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -500,9 +412,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -513,12 +423,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/sump/exportQRCode', {
+        ...this.queryParams
+      }, `sumpQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 59 - 140
ui/src/views/ps/dev/utilitystation/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:utilitystation:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:utilitystation:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:utilitystation:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:utilitystation:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:utilitystation:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="utilitystationList" @selection-change="handleSelectionChange"
               :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="utilityStationName" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:utilitystation:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:utilitystation:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -197,56 +135,21 @@
 
     <!-- 添加或修改公用站基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="现场位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入现场位置"/>
-        </el-form-item>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="编号" prop="utilityStationName">
           <el-input v-model="form.utilityStationName" placeholder="请输入编号"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="现场位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delUtilitystation,
   exportUtilitystation,
   getUtilitystation,
-  importTemplate,
   listUtilitystation,
   updateUtilitystation
 } from "@/api/ps/dev/utilitystation";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Utilitystation",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'utilitystation',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        utilityStationName: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/utilitystation/exportQRCode', {
+        ...this.queryParams
+      }, `utilitystationQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 59 - 140
ui/src/views/ps/dev/ventvalve/index.vue

@@ -19,68 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备类型" prop="patrolType">
-        <el-select v-model="queryParams.patrolType" placeholder="请选择设备类型" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -94,7 +32,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['dev:ventvalve:add']"
+          v-hasPermi="['ps:patrol:add']"
         >新增
         </el-button>
       </el-col>
@@ -105,7 +43,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['dev:ventvalve:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >修改
         </el-button>
       </el-col>
@@ -116,7 +54,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['dev:ventvalve:remove']"
+          v-hasPermi="['ps:patrol:remove']"
         >删除
         </el-button>
       </el-col>
@@ -126,7 +64,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          v-hasPermi="['dev:ventvalve:edit']"
+          v-hasPermi="['ps:patrol:edit']"
         >导入
         </el-button>
       </el-col>
@@ -136,35 +74,35 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['dev:ventvalve:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['ps:patrol:export']"
+          icon="el-icon-download"
+          plain
+          size="mini"
+          type="warning"
+          @click="handleExportQRCode"
+        >导出设备二维码
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="ventvalveList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="ventvalveNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <dict-tag :options="dict.type.dev_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备类型" align="center" prop="patrolType" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -172,7 +110,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['dev:ventvalve:edit']"
+            v-hasPermi="['ps:patrol:edit']"
           >修改
           </el-button>
           <el-button
@@ -180,7 +118,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['dev:ventvalve:remove']"
+            v-hasPermi="['ps:patrol:remove']"
           >删除
           </el-button>
         </template>
@@ -197,56 +135,21 @@
 
     <!-- 添加或修改余压阀基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="现场位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入现场位置"/>
-        </el-form-item>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="编号" prop="ventvalveNo">
           <el-input v-model="form.ventvalveNo" placeholder="请输入编号"/>
         </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
+        <el-form-item label="现场位置" prop="position">
+          <el-input v-model="form.position" placeholder="请输入现场位置"/>
         </el-form-item>
-        <el-form-item label="状态">
+        <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio label="1">启用</el-radio>
+            <el-radio label="0">停用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="设备类型" prop="patrolType">
-          <el-select v-model="form.patrolType" placeholder="请选择设备类型">
-            <el-option label="请选择字典生成" value=""/>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,13 +158,13 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
         ref="upload"
         :limit="1"
         accept=".xlsx, .xls"
         :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :action="upload.url"
         :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress"
         :on-success="handleFileSuccess"
@@ -274,10 +177,11 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -294,7 +198,6 @@ import {
   delVentvalve,
   exportVentvalve,
   getVentvalve,
-  importTemplate,
   listVentvalve,
   updateVentvalve
 } from "@/api/ps/dev/ventvalve";
@@ -306,6 +209,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Ventvalve",
   components: {Treeselect},
+  dicts: ['dev_status'],
   data() {
     return {
       // 遮罩层
@@ -331,14 +235,15 @@ export default {
       open: false,
       // 用户导入参数
       upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'ventvalve',
         // 是否显示弹出层(用户导入)
         open: false,
         // 弹出层标题(用户导入)
         title: "",
         // 是否禁用上传
         isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
         // 设置上传的请求头部
         headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
@@ -363,9 +268,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
+        ventvalveNo: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "现场位置不能为空", trigger: "blur"}
         ],
+        status: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ]
       }
     };
   },
@@ -417,7 +328,7 @@ export default {
         updatedate: null,
         remarks: null,
         deptId: null,
-        status: "0",
+        status: "1",
         patrolType: null
       };
       this.resetForm("form");
@@ -508,9 +419,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
+      this.$refs['downloadFileForm'].submit()
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -521,12 +430,22 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      if (response.data[0] != null) {
+        this.$alert('成功导入' + response.msg + '条数据,' + '第' + response.data + '行数据出现错误导入失败' + '。', '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+      }
       this.getList();
     },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    /** 导出按钮操作 */
+    handleExportQRCode() {
+      this.download2('ps/dev/ventvalve/exportQRCode', {
+        ...this.queryParams
+      }, `ventvalveQRCode_${new Date().getTime()}.zip`)
     }
   }
 };

+ 117 - 471
ui/src/views/ps/inspection/alarm/index.vue

@@ -19,55 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="外观及卫生" prop="appearance">
-        <el-input
-          v-model="queryParams.appearance"
-          placeholder="请输入外观及卫生"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="标识" prop="alarmSign">
-        <el-input
-          v-model="queryParams.alarmSign"
-          placeholder="请输入标识"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="玻璃压片" prop="glassRetainer">
-        <el-input
-          v-model="queryParams.glassRetainer"
-          placeholder="请输入玻璃压片"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="确认人" prop="confirmer">
-        <el-input
-          v-model="queryParams.confirmer"
-          placeholder="请输入确认人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="检查状态" prop="checkStatus">
-        <el-select v-model="queryParams.checkStatus" placeholder="请选择检查状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="检查时间" prop="checkDate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.checkDate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择检查时间">
-        </el-date-picker>
-      </el-form-item>
       <el-form-item label="月度" prop="month">
         <el-input
           v-model="queryParams.month"
@@ -86,82 +37,24 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="计划id" prop="planId">
-        <el-input
+      <el-form-item label="巡检计划" prop="planId">
+        <el-select
           v-model="queryParams.planId"
-          placeholder="请输入计划id"
+          placeholder="请选择巡检计划"
           clearable
           size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="检测是否有问题1:是,0:否" prop="issuesStatus">
-        <el-select v-model="queryParams.issuesStatus" placeholder="请选择检测是否有问题1:是,0:否" clearable
-                   size="small">
-          <el-option label="请选择字典生成" value=""/>
+          filterable
+          @change="handleQuery"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="item in planOptions"
+            :key="item.id"
+            :label="item.planName"
+            :value="item.id"
+          />
         </el-select>
       </el-form-item>
-      <el-form-item label="是否为问题记录数据" prop="issuesFlag">
-        <el-input
-          v-model="queryParams.issuesFlag"
-          placeholder="请输入是否为问题记录数据"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -169,55 +62,13 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['inspection:alarm:add']"
-        >新增
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['inspection:alarm:edit']"
-        >修改
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['inspection:alarm:remove']"
-        >删除
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['inspection:alarm:edit']"
-        >导入
-        </el-button>
-      </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['inspection:alarm:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
@@ -227,56 +78,21 @@
     <el-table v-loading="loading" :data="alarmList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位号" align="center" prop="devNo" :show-overflow-tooltip="true"/>
       <el-table-column label="现场位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="外观及卫生" align="center" prop="appearance" :show-overflow-tooltip="true"/>
       <el-table-column label="标识" align="center" prop="alarmSign" :show-overflow-tooltip="true"/>
       <el-table-column label="玻璃压片" align="center" prop="glassRetainer" :show-overflow-tooltip="true"/>
       <el-table-column label="确认人" align="center" prop="confirmer" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查状态" align="center" prop="checkStatus" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查时间" align="center" prop="checkDate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="月度" align="center" prop="month" :show-overflow-tooltip="true"/>
-      <el-table-column label="年度" align="center" prop="year" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="计划id" align="center" prop="planId" :show-overflow-tooltip="true"/>
-      <el-table-column label="检测是否有问题1:是,0:否" align="center" prop="issuesStatus"
-                       :show-overflow-tooltip="true"/>
-      <el-table-column label="是否为问题记录数据" align="center" prop="issuesFlag" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="80">
         <template slot-scope="scope">
           <el-button
+            icon="el-icon-picture-outline"
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['inspection:alarm:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['inspection:alarm:remove']"
-          >删除
+            @click="openFileDialog(scope.row)"
+          >附件
           </el-button>
         </template>
       </el-table-column>
@@ -290,151 +106,55 @@
       @pagination="getList"
     />
 
-    <!-- 添加或修改手动启动火灾报警器检查记录对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位号" prop="devNo">
-          <el-input v-model="form.devNo" placeholder="请输入位号"/>
-        </el-form-item>
-        <el-form-item label="现场位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入现场位置"/>
-        </el-form-item>
-        <el-form-item label="外观及卫生" prop="appearance">
-          <el-input v-model="form.appearance" placeholder="请输入外观及卫生"/>
-        </el-form-item>
-        <el-form-item label="标识" prop="alarmSign">
-          <el-input v-model="form.alarmSign" placeholder="请输入标识"/>
-        </el-form-item>
-        <el-form-item label="玻璃压片" prop="glassRetainer">
-          <el-input v-model="form.glassRetainer" placeholder="请输入玻璃压片"/>
-        </el-form-item>
-        <el-form-item label="确认人" prop="confirmer">
-          <el-input v-model="form.confirmer" placeholder="请输入确认人"/>
-        </el-form-item>
-        <el-form-item label="检查状态">
-          <el-radio-group v-model="form.checkStatus">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="检查时间" prop="checkDate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.checkDate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择检查时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="月度" prop="month">
-          <el-input v-model="form.month" placeholder="请输入月度"/>
-        </el-form-item>
-        <el-form-item label="年度" prop="year">
-          <el-input v-model="form.year" placeholder="请输入年度"/>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="计划id" prop="planId">
-          <el-input v-model="form.planId" placeholder="请输入计划id"/>
-        </el-form-item>
-        <el-form-item label="检测是否有问题1:是,0:否">
-          <el-radio-group v-model="form.issuesStatus">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="是否为问题记录数据" prop="issuesFlag">
-          <el-input v-model="form.issuesFlag" placeholder="请输入是否为问题记录数据"/>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-    <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-      <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
-        <i class="el-icon-upload"></i>
-        <div class="el-upload__text">
-          将文件拖到此处,或
-          <em>点击上传</em>
-        </div>
-        <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
-          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
-        </div>
-        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
-      </el-upload>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitFileForm">确 定</el-button>
-        <el-button @click="upload.open = false">取 消</el-button>
-      </div>
+
+    <el-dialog :close-on-click-modal="false" :visible.sync="file.open" append-to-body title="附件详情" width="50%">
+      <el-tabs v-model="tabName" :stretch="true" type="border-card" @tab-click="getFileList">
+        <el-tab-pane label="常规附件" name="a">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+        <el-tab-pane label="异常附件" name="b">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+        <el-tab-pane label="异常整改后附件" name="c">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+      </el-tabs>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import {
-  addAlarm,
-  delAlarm,
   exportAlarm,
-  getAlarm,
-  importTemplate,
-  listAlarm,
-  updateAlarm
+  listAlarm
 } from "@/api/ps/inspection/alarm";
 import {treeselect} from "@/api/system/dept";
-import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {allFileList} from "@/api/common/commonfile";
+import {listPlan} from "@/api/ps/patrol/plan";
 
 export default {
   name: "Alarm",
   components: {Treeselect},
   data() {
     return {
+      tabName: 'a',
+      file: {
+        open: false,
+        fileList: [],
+        queryParams: {
+          pId: null,
+          pType: 'ps-alarm',
+          pValue: ''
+        },
+      },
       // 遮罩层
       loading: true,
       // 选中数组
@@ -449,28 +169,11 @@ export default {
       total: 0,
       // 手动启动火灾报警器检查记录表格数据
       alarmList: [],
-      // 弹出层标题
-      title: "",
       // 部门树选项
       deptOptions: undefined,
+      // 巡检计划选项
+      planOptions: [],
       clientHeight: 300,
-      // 是否显示弹出层
-      open: false,
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: {Authorization: "Bearer " + getToken()},
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/inspection/alarm/importData"
-      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -494,32 +197,49 @@ export default {
         planId: null,
         issuesStatus: null,
         issuesFlag: null
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
-        ],
       }
     };
   },
-  watch: {
-    // 根据名称筛选部门树
-    deptName(val) {
-      this.$refs.tree.filter(val);
-    }
-  },
   created() {
+    if (this.$route.query.planId) {
+      this.queryParams.planId = parseInt(this.$route.query.planId)
+    }
+    if (this.$route.query.id) {
+      this.queryParams.id = parseInt(this.$route.query.id)
+      this.queryParams.issuesFlag = '1';
+    }
     //设置表格高度对应屏幕高度
     this.$nextTick(() => {
       this.clientHeight = document.body.clientHeight - 250
     })
-    this.getList();
+    this.getPlanList();
     this.getTreeselect();
   },
   methods: {
+    openFileDialog(row) {
+      this.file.queryParams.pId = row.id;
+      this.tabName = 'a'
+      this.file.open = true;
+      this.getFileList({})
+    },
+    getFileList(tab) {
+      this.file.fileList = [];
+      let value = 'regular';
+      if (tab.name == 'a') {
+        value = 'regular';
+      } else if (tab.name == 'b') {
+        value = 'issue';
+      } else if (tab.name == 'c') {
+        value = 'repair';
+      }
+      this.file.queryParams.pValue = value;
+      allFileList(this.file.queryParams).then(response => {
+        this.file.fileList = response;
+      })
+    },
+    getFileUrl(url) {
+      return process.env.VUE_APP_BASE_API + url;
+    },
     /** 查询手动启动火灾报警器检查记录列表 */
     getList() {
       this.loading = true;
@@ -535,37 +255,40 @@ export default {
         this.deptOptions = response.data;
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        devNo: null,
-        position: null,
-        appearance: null,
-        alarmSign: null,
-        glassRetainer: null,
-        confirmer: null,
-        checkStatus: "0",
-        checkDate: null,
-        month: null,
-        year: null,
-        delFlag: null,
-        createrCode: null,
-        createdate: null,
-        updaterCode: null,
-        updatedate: null,
-        remarks: null,
-        deptId: null,
-        planId: null,
-        issuesStatus: 0,
-        issuesFlag: null
+    /** 查询巡检计划列表 */
+    getPlanList() {
+      const now = new Date();
+      const currentYear = now.getFullYear();
+      const currentMonth = now.getMonth() + 1;
+      
+      const query = {
+        planYear: currentYear,
+        planMonth: currentMonth,
+        patrolType: '1'
       };
-      this.resetForm("form");
+      
+      listPlan(query).then(response => {
+        this.planOptions = response.rows || [];
+        
+        // 如果没有从路由参数传入planId,则默认选择当月最后一个计划
+        if (!this.$route.query.planId && this.planOptions.length > 0) {
+          // 按创建时间降序排序,取第一个(最新的)
+          const sortedPlans = [...this.planOptions].sort((a, b) => {
+            const dateA = new Date(a.createdate);
+            const dateB = new Date(b.createdate);
+            return dateB - dateA;
+          });
+          
+          // 选择当月最后一个计划(创建时间最新的)
+          this.queryParams.planId = sortedPlans[0].id;
+        }
+        
+        // 获取计划列表后再查询数据
+        this.getList();
+      }).catch(() => {
+        // 如果获取计划列表失败,仍然查询数据
+        this.getList();
+      });
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -583,56 +306,6 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加手动启动火灾报警器检查记录";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getAlarm(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改手动启动火灾报警器检查记录";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateAlarm(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addAlarm(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm('是否确认删除?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function () {
-        return delAlarm(ids);
-      }).then(() => {
-        this.getList();
-        this.msgSuccess("删除成功");
-      })
-    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
@@ -645,33 +318,6 @@ export default {
       }).then(response => {
         this.download(response.msg);
       })
-    },
-    /** 导入按钮操作 */
-    handleImport() {
-      this.upload.title = "用户导入";
-      this.upload.open = true;
-    },
-    /** 下载模板操作 */
-    importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
-    },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload.open = false;
-      this.upload.isUploading = false;
-      this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
-      this.getList();
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
     }
   }
 };

+ 122 - 484
ui/src/views/ps/inspection/cabinet/index.vue

@@ -28,64 +28,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="外观" prop="appearance">
-        <el-input
-          v-model="queryParams.appearance"
-          placeholder="请输入外观"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="内物品" prop="internalItems">
-        <el-input
-          v-model="queryParams.internalItems"
-          placeholder="请输入内物品"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="阀门" prop="valve">
-        <el-input
-          v-model="queryParams.valve"
-          placeholder="请输入阀门"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="通道" prop="passage">
-        <el-input
-          v-model="queryParams.passage"
-          placeholder="请输入通道"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="确认人" prop="confirmer">
-        <el-input
-          v-model="queryParams.confirmer"
-          placeholder="请输入确认人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="检查状态" prop="checkStatus">
-        <el-select v-model="queryParams.checkStatus" placeholder="请选择检查状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="检查时间" prop="checkDate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.checkDate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择检查时间">
-        </el-date-picker>
-      </el-form-item>
       <el-form-item label="月度" prop="month">
         <el-input
           v-model="queryParams.month"
@@ -104,82 +46,24 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.createdate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.updatedate"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="计划id" prop="planId">
-        <el-input
+      <el-form-item label="巡检计划" prop="planId">
+        <el-select
           v-model="queryParams.planId"
-          placeholder="请输入计划id"
+          placeholder="请选择巡检计划"
           clearable
           size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="检测是否有问题1:是,0:否" prop="issuesStatus">
-        <el-select v-model="queryParams.issuesStatus" placeholder="请选择检测是否有问题1:是,0:否" clearable
-                   size="small">
-          <el-option label="请选择字典生成" value=""/>
+          filterable
+          @change="handleQuery"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="item in planOptions"
+            :key="item.id"
+            :label="item.planName"
+            :value="item.id"
+          />
         </el-select>
       </el-form-item>
-      <el-form-item label="是否为问题记录数据" prop="issuesFlag">
-        <el-input
-          v-model="queryParams.issuesFlag"
-          placeholder="请输入是否为问题记录数据"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -187,55 +71,13 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['inspection:cabinet:add']"
-        >新增
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['inspection:cabinet:edit']"
-        >修改
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['inspection:cabinet:remove']"
-        >删除
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['inspection:cabinet:edit']"
-        >导入
-        </el-button>
-      </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['inspection:cabinet:list']"
+          v-hasPermi="['ps:patrol:list']"
         >导出
         </el-button>
       </el-col>
@@ -245,7 +87,6 @@
     <el-table v-loading="loading" :data="cabinetList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
       <el-table-column label="型号" align="center" prop="modelNo" :show-overflow-tooltip="true"/>
       <el-table-column label="编号" align="center" prop="boxNo" :show-overflow-tooltip="true"/>
@@ -254,49 +95,15 @@
       <el-table-column label="阀门" align="center" prop="valve" :show-overflow-tooltip="true"/>
       <el-table-column label="通道" align="center" prop="passage" :show-overflow-tooltip="true"/>
       <el-table-column label="确认人" align="center" prop="confirmer" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查状态" align="center" prop="checkStatus" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查时间" align="center" prop="checkDate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="月度" align="center" prop="month" :show-overflow-tooltip="true"/>
-      <el-table-column label="年度" align="center" prop="year" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
-      <el-table-column label="计划id" align="center" prop="planId" :show-overflow-tooltip="true"/>
-      <el-table-column label="检测是否有问题1:是,0:否" align="center" prop="issuesStatus"
-                       :show-overflow-tooltip="true"/>
-      <el-table-column label="是否为问题记录数据" align="center" prop="issuesFlag" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="80">
         <template slot-scope="scope">
           <el-button
+            icon="el-icon-picture-outline"
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['inspection:cabinet:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['inspection:cabinet:remove']"
-          >删除
+            @click="openFileDialog(scope.row)"
+          >附件
           </el-button>
         </template>
       </el-table-column>
@@ -310,157 +117,54 @@
       @pagination="getList"
     />
 
-    <!-- 添加或修改玻璃门消火栓箱和泡沫栓箱检查记录对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
-        </el-form-item>
-        <el-form-item label="型号" prop="modelNo">
-          <el-input v-model="form.modelNo" placeholder="请输入型号"/>
-        </el-form-item>
-        <el-form-item label="编号" prop="boxNo">
-          <el-input v-model="form.boxNo" placeholder="请输入编号"/>
-        </el-form-item>
-        <el-form-item label="外观" prop="appearance">
-          <el-input v-model="form.appearance" placeholder="请输入外观"/>
-        </el-form-item>
-        <el-form-item label="内物品" prop="internalItems">
-          <el-input v-model="form.internalItems" placeholder="请输入内物品"/>
-        </el-form-item>
-        <el-form-item label="阀门" prop="valve">
-          <el-input v-model="form.valve" placeholder="请输入阀门"/>
-        </el-form-item>
-        <el-form-item label="通道" prop="passage">
-          <el-input v-model="form.passage" placeholder="请输入通道"/>
-        </el-form-item>
-        <el-form-item label="确认人" prop="confirmer">
-          <el-input v-model="form.confirmer" placeholder="请输入确认人"/>
-        </el-form-item>
-        <el-form-item label="检查状态">
-          <el-radio-group v-model="form.checkStatus">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="检查时间" prop="checkDate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.checkDate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择检查时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="月度" prop="month">
-          <el-input v-model="form.month" placeholder="请输入月度"/>
-        </el-form-item>
-        <el-form-item label="年度" prop="year">
-          <el-input v-model="form.year" placeholder="请输入年度"/>
-        </el-form-item>
-        <el-form-item label="删除标识0未删除" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除标识0未删除"/>
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人"/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.createdate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人"/>
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.updatedate"
-                          type="date"
-                          value-format="yyyy-MM-dd"
-                          placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号"/>
-        </el-form-item>
-        <el-form-item label="计划id" prop="planId">
-          <el-input v-model="form.planId" placeholder="请输入计划id"/>
-        </el-form-item>
-        <el-form-item label="检测是否有问题1:是,0:否">
-          <el-radio-group v-model="form.issuesStatus">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="是否为问题记录数据" prop="issuesFlag">
-          <el-input v-model="form.issuesFlag" placeholder="请输入是否为问题记录数据"/>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-    <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-      <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
-        <i class="el-icon-upload"></i>
-        <div class="el-upload__text">
-          将文件拖到此处,或
-          <em>点击上传</em>
-        </div>
-        <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport"/>
-          是否更新已经存在的用户数据
-          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
-        </div>
-        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
-      </el-upload>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitFileForm">确 定</el-button>
-        <el-button @click="upload.open = false">取 消</el-button>
-      </div>
+    <el-dialog :close-on-click-modal="false" :visible.sync="file.open" append-to-body title="附件详情" width="50%">
+      <el-tabs v-model="tabName" :stretch="true" type="border-card" @tab-click="getFileList">
+        <el-tab-pane label="常规附件" name="a">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+        <el-tab-pane label="异常附件" name="b">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+        <el-tab-pane label="异常整改后附件" name="c">
+          <el-empty v-if="file.fileList.length==0" description="如你所见,这里什么都没有"></el-empty>
+          <el-image v-for="item in file.fileList" v-else :key="item.fileUrl"
+                    :src="getFileUrl(item.fileUrl)"></el-image>
+        </el-tab-pane>
+      </el-tabs>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import {
-  addCabinet,
-  delCabinet,
   exportCabinet,
-  getCabinet,
-  importTemplate,
-  listCabinet,
-  updateCabinet
+  listCabinet
 } from "@/api/ps/inspection/cabinet";
 import {treeselect} from "@/api/system/dept";
-import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {allFileList} from "@/api/common/commonfile";
+import {listPlan} from "@/api/ps/patrol/plan";
 
 export default {
   name: "Cabinet",
   components: {Treeselect},
   data() {
     return {
+      tabName: 'a',
+      file: {
+        open: false,
+        fileList: [],
+        queryParams: {
+          pId: null,
+          pType: 'ps-cabinet',
+          pValue: ''
+        },
+      },
       // 遮罩层
       loading: true,
       // 选中数组
@@ -475,28 +179,12 @@ export default {
       total: 0,
       // 玻璃门消火栓箱和泡沫栓箱检查记录表格数据
       cabinetList: [],
-      // 弹出层标题
-      title: "",
+      
       // 部门树选项
       deptOptions: undefined,
+      // 巡检计划选项
+      planOptions: [],
       clientHeight: 300,
-      // 是否显示弹出层
-      open: false,
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: {Authorization: "Bearer " + getToken()},
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/inspection/cabinet/importData"
-      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -522,15 +210,7 @@ export default {
         planId: null,
         issuesStatus: null,
         issuesFlag: null
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        delFlag: [
-          {required: true, message: "删除标识0未删除不能为空", trigger: "blur"}
-        ],
-      }
+           }
     };
   },
   watch: {
@@ -540,15 +220,46 @@ export default {
     }
   },
   created() {
+    if (this.$route.query.planId) {
+      this.queryParams.planId = parseInt(this.$route.query.planId)
+    }
+    if (this.$route.query.id) {
+      this.queryParams.id = parseInt(this.$route.query.id)
+      this.queryParams.issuesFlag = '1';
+    }
     //设置表格高度对应屏幕高度
     this.$nextTick(() => {
       this.clientHeight = document.body.clientHeight - 250
     })
-    this.getList();
+    this.getPlanList();
     this.getTreeselect();
   },
   methods: {
-    /** 查询玻璃门消火栓箱和泡沫栓箱检查记录列表 */
+    openFileDialog(row) {
+      this.file.queryParams.pId = row.id;
+      this.tabName = 'a'
+      this.file.open = true;
+      this.getFileList({})
+    },
+    getFileList(tab) {
+      this.file.fileList = [];
+      let value = 'regular';
+      if (tab.name == 'a') {
+        value = 'regular';
+      } else if (tab.name == 'b') {
+        value = 'issue';
+      } else if (tab.name == 'c') {
+        value = 'repair';
+      }
+      this.file.queryParams.pValue = value;
+      allFileList(this.file.queryParams).then(response => {
+        this.file.fileList = response;
+      })
+    },
+    getFileUrl(url) {
+      return process.env.VUE_APP_BASE_API + url;
+    },
+/** 查询玻璃门消火栓箱和泡沫栓箱检查记录列表 */
     getList() {
       this.loading = true;
       listCabinet(this.queryParams).then(response => {
@@ -563,40 +274,42 @@ export default {
         this.deptOptions = response.data;
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        position: null,
-        modelNo: null,
-        boxNo: null,
-        appearance: null,
-        internalItems: null,
-        valve: null,
-        passage: null,
-        confirmer: null,
-        checkStatus: "0",
-        checkDate: null,
-        month: null,
-        year: null,
-        delFlag: null,
-        createrCode: null,
-        createdate: null,
-        updaterCode: null,
-        updatedate: null,
-        remarks: null,
-        deptId: null,
-        planId: null,
-        issuesStatus: 0,
-        issuesFlag: null
+    /** 查询巡检计划列表 */
+    getPlanList() {
+      const now = new Date();
+      const currentYear = now.getFullYear();
+      const currentMonth = now.getMonth() + 1;
+      
+      const query = {
+        planYear: currentYear,
+        planMonth: currentMonth,
+        patrolType: '2'
       };
-      this.resetForm("form");
+      
+      listPlan(query).then(response => {
+        this.planOptions = response.rows || [];
+        
+        // 如果没有从路由参数传入planId,则默认选择当月最后一个计划
+        if (!this.$route.query.planId && this.planOptions.length > 0) {
+          // 按创建时间降序排序,取第一个(最新的)
+          const sortedPlans = [...this.planOptions].sort((a, b) => {
+            const dateA = new Date(a.createdate);
+            const dateB = new Date(b.createdate);
+            return dateB - dateA;
+          });
+          
+          // 选择当月最后一个计划(创建时间最新的)
+          this.queryParams.planId = sortedPlans[0].id;
+        }
+        
+        // 获取计划列表后再查询数据
+        this.getList();
+      }).catch(() => {
+        // 如果获取计划列表失败,仍然查询数据
+        this.getList();
+      });
     },
+
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -613,56 +326,7 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加玻璃门消火栓箱和泡沫栓箱检查记录";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getCabinet(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改玻璃门消火栓箱和泡沫栓箱检查记录";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateCabinet(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addCabinet(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm('是否确认删除?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function () {
-        return delCabinet(ids);
-      }).then(() => {
-        this.getList();
-        this.msgSuccess("删除成功");
-      })
-    },
+
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
@@ -676,33 +340,7 @@ export default {
         this.download(response.msg);
       })
     },
-    /** 导入按钮操作 */
-    handleImport() {
-      this.upload.title = "用户导入";
-      this.upload.open = true;
-    },
-    /** 下载模板操作 */
-    importTemplate() {
-      importTemplate().then(response => {
-        this.download(response.msg);
-      });
-    },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload.open = false;
-      this.upload.isUploading = false;
-      this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
-      this.getList();
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
-    }
+
   }
 };
 </script>

Some files were not shown because too many files changed in this diff