ly 2 månader sedan
förälder
incheckning
9ee53863b1
20 ändrade filer med 1018 tillägg och 174 borttagningar
  1. 18 1
      master/src/main/java/com/ruoyi/project/listener/yearSemsApprove/YearEndSucessListener.java
  2. 328 0
      master/src/main/java/com/ruoyi/project/sems/controller/TMeasureCuiHomeController.java
  3. 132 83
      master/src/main/java/com/ruoyi/project/sems/controller/TMeasureThicknessController.java
  4. 5 5
      master/src/main/java/com/ruoyi/project/sems/controller/TReportHiYlgdController.java
  5. 5 5
      master/src/main/java/com/ruoyi/project/sems/controller/TReportHiYlrqController.java
  6. 52 0
      master/src/main/java/com/ruoyi/project/sems/domain/TMeasureThickness.java
  7. 7 6
      master/src/main/resources/mybatis/plant/TTargetactionMapper.xml
  8. 7 6
      master/src/main/resources/mybatis/plant/TTargetagreementMapper.xml
  9. 7 6
      master/src/main/resources/mybatis/plant/TTargetyardstickMapper.xml
  10. 14 0
      master/src/main/resources/mybatis/sems/TMeasureThicknessMapper.xml
  11. BIN
      master/src/main/resources/static/template/sems/thicknessData.xlsx
  12. 45 0
      ui/src/api/sems/thickness.js
  13. 2 2
      ui/src/views/login.vue
  14. 31 2
      ui/src/views/sems/thickness/home/dashboard/botPie.vue
  15. 29 1
      ui/src/views/sems/thickness/home/dashboard/botPieRight.vue
  16. 36 5
      ui/src/views/sems/thickness/home/dashboard/midLeft.vue
  17. 30 3
      ui/src/views/sems/thickness/home/dashboard/midRight.vue
  18. 61 6
      ui/src/views/sems/thickness/home/dashboard/topLine.vue
  19. 168 13
      ui/src/views/sems/thickness/home/index.vue
  20. 41 30
      ui/src/views/sems/thickness/thicknessData/index.vue

+ 18 - 1
master/src/main/java/com/ruoyi/project/listener/yearSemsApprove/YearEndSucessListener.java

@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import java.io.Serializable;
+import java.time.ZoneId;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Map;
@@ -74,6 +75,13 @@ public class YearEndSucessListener implements Serializable, ExecutionListener {
                     cal.add(Calendar.YEAR, 1);
                     reportYlrqEntity.setNextCheckDate(cal.getTime());
 
+                    // 转换为 LocalDate 获取年份
+                    int year = new Date().toInstant()
+                            .atZone(ZoneId.systemDefault())
+                            .toLocalDate()
+                            .getYear();
+                    reportYlrqEntity.setYearReportNo(reportYlrqEntity.getPlantCode() +"-" + reportYlrqEntity.getDevno().replace(" ", "")+  "-"+ year +  "-" + i);
+
                     tReportYlrqService.updateTReportYlrq(reportYlrqEntity);
                     new Thread(() -> {
                         tReportYlrqMapper.sysnReport(reportYlrqEntity);
@@ -82,7 +90,7 @@ public class YearEndSucessListener implements Serializable, ExecutionListener {
                     reportYlrqEntity.setBuildDate(new Date());
                     reportYlrqEntity.setApproveId(approveEntity.getProcessId());
                     reportYlrqEntity.setReportId(Long.parseLong(i));
-                    reportYlrqEntity.setYearReportNo(i);
+                    reportYlrqEntity.setYearReportNo(reportYlrqEntity.getPlantCode() +"-" + reportYlrqEntity.getDevno().replace(" ", "")+ "-"+ year +  "-" + i);
                     tReportHiYlrqService.insertTReportHiYlrq(reportYlrqEntity);
                 }
                 break;
@@ -104,6 +112,14 @@ public class YearEndSucessListener implements Serializable, ExecutionListener {
                     cal.setTime(reportYlgdEntity.getCheckDate());
                     cal.add(Calendar.YEAR, 1);
                     reportYlgdEntity.setNextCheckDate(cal.getTime());
+
+                    // 转换为 LocalDate 获取年份
+                    int year = new Date().toInstant()
+                            .atZone(ZoneId.systemDefault())
+                            .toLocalDate()
+                            .getYear();
+                    reportYlgdEntity.setYearReportNo(reportYlgdEntity.getPlantCode() + "-"+ year +  "-" + i);
+
                     tReportYlgdService.updateTReportYlgd(reportYlgdEntity);
 
                     new Thread(() -> {
@@ -114,6 +130,7 @@ public class YearEndSucessListener implements Serializable, ExecutionListener {
                     reportYlgdEntity.setBuildDate(new Date());
                     reportYlgdEntity.setApproveId(approveEntity.getProcessId());
                     reportYlgdEntity.setReportId(Long.parseLong(i));
+                    reportYlgdEntity.setYearReportNo(reportYlgdEntity.getPlantCode() + "-"+ year +  "-" + i);
                     tReportHiYlgdService.insertTReportHiYlgd(reportYlgdEntity);
                 }
                 break;

+ 328 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TMeasureCuiHomeController.java

@@ -0,0 +1,328 @@
+package com.ruoyi.project.sems.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.framework.web.controller.BaseController;
+
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.project.officeConvert.OfficeConvertController;
+
+import com.ruoyi.project.sems.domain.TMeasureThickness;
+import com.ruoyi.project.sems.domain.TSpecdevYlgd;
+import com.ruoyi.project.sems.mapper.TMeasureStressMapper;
+import com.ruoyi.project.sems.service.ITMeasureLoopService;
+import com.ruoyi.project.sems.service.ITMeasureRecordService;
+import com.ruoyi.project.sems.service.ITMeasureStressService;
+import com.ruoyi.project.sems.service.ITMeasureThicknessService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.Year;
+import java.util.*;
+
+/**
+ * 定点测厚Controller
+ *
+ * @author ruoyi
+ * @date 2021-07-07
+ */
+@RestController
+@RequestMapping("/sems/cuihome")
+public class TMeasureCuiHomeController extends BaseController {
+    @Autowired
+    private ITMeasureThicknessService tMeasureThicknessService;
+    @Autowired
+    private ITMeasureRecordService tMeasureRecordService;
+    @Autowired
+    private OfficeConvertController officeConvertController;
+    @Resource
+    private TMeasureStressMapper tMeasureStressMapper;
+    @Autowired
+    private ITMeasureStressService tMeasureStressService;
+    @Autowired
+    private ITMeasureLoopService tMeasureLoopService;
+
+
+    /**
+     * 首页数据
+     */
+    @RequestMapping(value = "data")
+    public AjaxResult homeData(@RequestBody Map<String, Object> params) {
+        logger.info(JSON.toJSONString(params));
+        LocalDate today = LocalDate.now();
+        LocalDate oneMonthLater = today.plusMonths(1);
+        Date sqlDate = java.sql.Date.valueOf(oneMonthLater);
+
+        List plantIds = (List) params.get("plantIds");
+        if (plantIds == null) {
+            plantIds = new ArrayList();
+        }
+        if (plantIds.size() == 0) {
+            plantIds.add("1");
+        }
+       int sbAll = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code",plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag" , 0)
+        );
+        int gdAll = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code",plantIds)
+                .and(wrapper -> wrapper
+                        .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                        .or()                     // 或
+                        .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                )
+                .eq("del_flag" , 0)
+        );
+
+        int sbWarn = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code",plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag" , 0)
+                .isNotNull("NEXT_WARN_DATE") // 添加非空条件
+                .and(wrapper -> wrapper
+                        .le("NEXT_WARN_DATE", sqlDate)
+                )
+
+        );
+
+        int gdWarn = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code",plantIds)
+                .and(wrapper -> wrapper
+                        .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                        .or()                     // 或
+                        .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                )
+                .eq("del_flag" , 0)
+                .isNotNull("NEXT_WARN_DATE") // 添加非空条件
+                .and(wrapper -> wrapper
+                        .le("NEXT_WARN_DATE", sqlDate)
+                )
+        );
+        //
+        Map<String, Object> res = new HashMap<String, Object>();
+        res.put("sbAll" ,sbAll) ;
+        res.put("gdAll" ,gdAll) ;
+        res.put("sbWarn" ,sbWarn) ;
+        res.put("gdWarn" ,gdWarn) ;
+        return AjaxResult.success(res);
+    }
+
+    /**
+     * 管道预估寿命数据
+     */
+    @RequestMapping(value = "gdData")
+    public AjaxResult gdData(@RequestBody Map<String, Object> params) {
+        List plantIds = (List) params.get("plantIds");
+        if (plantIds == null) {
+            plantIds = new ArrayList();
+        }
+        if (plantIds.size() == 0) {
+            plantIds.add("1");
+        }
+        // 1. 获取当前年份
+        int currentYear = Year.now().getValue();
+
+        // 2. 创建包含当前年份及未来十年的年份列表
+        List<Integer> targetYears = new ArrayList<>();
+        for (int i = 0; i <= 10; i++) {
+            targetYears.add(currentYear + i);
+        }
+
+        // 3. 存储查询结果(年份 -> 过期数据)
+        Map<Integer, List<String>> expiredDataByYear = new HashMap<>();
+        List<Integer> resData = new ArrayList<>();
+        // 4. 遍历每个年份并查询数据
+        for (int year : targetYears) {
+            TMeasureThickness t = new TMeasureThickness();
+            int estRemainMin =year - currentYear;
+            int gd = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                    .in("plant_code", plantIds)
+                    .and(wrapper -> wrapper
+                            .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                            .or()                     // 或
+                            .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                    )
+                    .eq("del_flag", 0)
+                    .between("EST_REMAIN", estRemainMin, estRemainMin + 1)
+            );
+            resData.add(gd);
+        }
+
+        Map<String, Object> res = new HashMap<String, Object>();
+        res.put("targetYears" ,targetYears) ;
+        res.put("resData" ,resData) ;
+        return AjaxResult.success(res);
+    }
+
+    /**
+     * 管道预估寿命数据
+     */
+    @RequestMapping(value = "sbData")
+    public AjaxResult sbData(@RequestBody Map<String, Object> params) {
+        List plantIds = (List) params.get("plantIds");
+        if (plantIds == null) {
+            plantIds = new ArrayList();
+        }
+        if (plantIds.size() == 0) {
+            plantIds.add("1");
+        }
+        // 1. 获取当前年份
+        int currentYear = Year.now().getValue();
+
+        // 2. 创建包含当前年份及未来十年的年份列表
+        List<Integer> targetYears = new ArrayList<>();
+        for (int i = 0; i <= 10; i++) {
+            targetYears.add(currentYear + i);
+        }
+
+        // 3. 存储查询结果(年份 -> 过期数据)
+        Map<Integer, List<String>> expiredDataByYear = new HashMap<>();
+        List<Integer> resData = new ArrayList<>();
+        // 4. 遍历每个年份并查询数据
+        for (int year : targetYears) {
+            TMeasureThickness t = new TMeasureThickness();
+            int estRemainMin =year - currentYear;
+            int gd = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                    .in("plant_code", plantIds)
+                    .eq("dev_type" , "设备")
+                    .eq("del_flag", 0)
+                    .between("EST_REMAIN", estRemainMin, estRemainMin + 1)
+            );
+            resData.add(gd);
+        }
+
+        Map<String, Object> res = new HashMap<String, Object>();
+        res.put("targetYears" ,targetYears) ;
+        res.put("resData" ,resData) ;
+        return AjaxResult.success(res);
+    }
+
+    /**
+     * 管道预估寿命数据
+     */
+    @RequestMapping(value = "gdDataPie")
+    public AjaxResult gdDataPie(@RequestBody Map<String, Object> params) {
+        List plantIds = (List) params.get("plantIds");
+        if (plantIds == null) {
+            plantIds = new ArrayList();
+        }
+        if (plantIds.size() == 0) {
+            plantIds.add("1");
+        }
+
+
+        // 3. 存储查询结果(年份 -> 过期数据)
+        List<Integer> resData = new ArrayList<>();
+        // 4. 遍历每个年份并查询数据
+            int gd = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                    .in("plant_code", plantIds)
+                    .and(wrapper -> wrapper
+                            .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                            .or()                     // 或
+                            .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                    )
+                    .eq("del_flag", 0)
+                    .between("EST_REMAIN", 0, 3)
+            );
+            resData.add(gd);
+
+        int gd2 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .and(wrapper -> wrapper
+                        .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                        .or()                     // 或
+                        .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                )
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 3, 6)
+        );
+        resData.add(gd2);
+
+        int gd3 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .and(wrapper -> wrapper
+                        .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                        .or()                     // 或
+                        .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                )
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 6, 10)
+        );
+        resData.add(gd3);
+
+        int gd4 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .and(wrapper -> wrapper
+                        .ne("dev_type", "设备")    // 排除 dev_type = '设备'
+                        .or()                     // 或
+                        .isNull("dev_type")       // 包含 dev_type 为 null 的记录
+                )
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 10, 999)
+        );
+        resData.add(gd4);
+
+        Map<String, Object> res = new HashMap<String, Object>();
+        res.put("resData" ,resData) ;
+        return AjaxResult.success(res);
+    }
+
+    /**
+     * 管道预估寿命数据
+     */
+    @RequestMapping(value = "sbDataPie")
+    public AjaxResult sbDataPie(@RequestBody Map<String, Object> params) {
+        List plantIds = (List) params.get("plantIds");
+        if (plantIds == null) {
+            plantIds = new ArrayList();
+        }
+        if (plantIds.size() == 0) {
+            plantIds.add("1");
+        }
+
+
+        // 3. 存储查询结果(年份 -> 过期数据)
+        List<Integer> resData = new ArrayList<>();
+        // 4. 遍历每个年份并查询数据
+        int gd = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 0, 3)
+        );
+        resData.add(gd);
+
+        int gd2 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 3, 6)
+        );
+        resData.add(gd2);
+
+        int gd3 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 6, 10)
+        );
+        resData.add(gd3);
+
+        int gd4 = tMeasureThicknessService.count(new QueryWrapper<TMeasureThickness>()
+                .in("plant_code", plantIds)
+                .eq("dev_type" , "设备")
+                .eq("del_flag", 0)
+                .between("EST_REMAIN", 10, 999)
+        );
+        resData.add(gd4);
+
+        Map<String, Object> res = new HashMap<String, Object>();
+        res.put("resData" ,resData) ;
+        return AjaxResult.success(res);
+    }
+
+}

+ 132 - 83
master/src/main/java/com/ruoyi/project/sems/controller/TMeasureThicknessController.java

@@ -184,89 +184,123 @@ public class TMeasureThicknessController extends BaseController {
                     }
                     String cellValue = ExcelUtils.getCellValue(cell);
                     logger.info("cellValue:" + cellValue);
-                    if (j == 0) {
-                        //序号
-                    } else if (j == 1) {
-                        entity.setPlantCode(cellValue);//装置名称
-                    } else if (j == 2) {
-                        entity.setUnitCode(cellValue);//单元名称
-                    } else if (j == 3) {
-                        entity.setTagno(cellValue);//单位内编号
-                    } else if (j == 4) {
-                        entity.setPosition(cellValue);//测厚部位CML
-                    } else if (j == 5) {
-                        entity.setLoopNo(cellValue);//回路编号
-                    } else if (j == 6) {
-                        entity.setMeasureNo(cellValue);//检测编号
-                    } else if (j == 7) {
-                        entity.setEquipmentName(cellValue);//设备/管线名称
-                    } else if (j == 8) {
-                        entity.setMaterial(cellValue);//材质
-                    } else if (j == 9) {
-                        entity.setNominalTickness(cellValue);//公称壁厚(mm)
-                    } else if (j == 10) {
-                        entity.setThicknessMin(cellValue);//最小允许壁厚(mm)
-                    } else if (j == 11) {
-                        entity.setStCorrosion(cellValue);//短期腐蚀速率(mm/year)
-                    } else if (j == 12) {
-                        entity.setLtCorrosion(cellValue);//长期腐蚀速率(mm/year)
-                    } else if (j == 13) {
-                        entity.setMeasureCycle(cellValue);//长期腐蚀速率(mm/year)
-                    } else if (j == 14) {
-                        if (cellValue.length() > 3) {//下次测厚日期
-                            entity.setNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
-                        }
-                    } else if (j == 15) {
-                        entity.setInspectionMethod(cellValue);//检测方法
-                    } else if (j == 16) {
-                        entity.setCorAllowance(cellValue);//腐蚀裕度(mm)
-                    } else if (j == 17) {
-                        entity.setOriginalThickness(cellValue);//原始壁厚(mm)
-                    } else if (j == 18) {
-                        entity.setMedium(cellValue);//介质
-                    } else if (j == 19) {
-                        entity.setPressure(cellValue);//压力(MPa)
-                    } else if (j == 20) {
-                        entity.setSpecification(cellValue); //规格
-                    } else if (j == 21) {
-                        entity.setFlowRate(cellValue);//流速(m/s)
-                    } else if (j == 22) {
-                        //温度(℃)
-                        entity.setTemperature(cellValue);
-                    }else if (j == 23) {
-                        //设备类型
-                        entity.setDevType(cellValue);
-                    }else if (j == 24) {
-                        //设计温度(℃)
-                        entity.setDesTemp(cellValue);
-                    }else if (j == 25) {
-                        //设计压力
-                        entity.setDesPressure(cellValue);
-                    } else if (j == 26) {
-                        //腐蚀类型
-                        entity.setCorrosionType(cellValue);
-                    } else if (j == 27) {
-                        entity.setAnalysis(cellValue);//原因分析
-                    } else if (j == 28) {
-                        entity.setMethodCause(cellValue);//治理方法及依据
-                    } else if (j == 29) {
-                        entity.setEffectTracing(cellValue); //效果跟踪
-                    } else if (j == 30) {
-                        entity.setRaiser(cellValue);//提出人
-                    } else if (j == 31) {
-                        if (cellValue.length() > 3) {//提出时间
-                            entity.setRaiserDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
-                        }
-                    } else if (j == 32) {
-                        entity.setOtherContent(cellValue);//其他检测方法内容
-                    } else if (j == 33) {
-                        entity.setRecorder(cellValue);//记录人
-                    } else if (j == 34) {
-                        if (cellValue.length() > 3) {//记录时间
-                            entity.setRecorderDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
-                        }
-                    } else if (j == 35) {
-                        entity.setRemarks(cellValue);//备注
+
+                    switch (j) {
+                        case 0:  // 序号(不需要处理)
+                            break;
+                        case 1:  // 装置名称
+                            entity.setPlantCode(cellValue);
+                            break;
+                        case 2:  // 单元名称
+                            entity.setUnitCode(cellValue);
+                            break;
+                        case 3:  // 回路图号
+                            entity.setLoopNo(cellValue);
+                            break;
+                        case 4:  // 单位内编号
+                            entity.setTagno(cellValue);
+                            break;
+                        case 5:  // 测厚部位CML
+                            entity.setPosition(cellValue);
+                            break;
+                        case 6:  // 检测编号
+                            entity.setMeasureNo(cellValue);
+                            break;
+                        case 7:  // 设备/管线名称
+                            entity.setEquipmentName(cellValue);
+                            break;
+                        case 8:  // 设备类型
+                            entity.setDevType(cellValue);
+                            break;
+                        case 9:  // 材质
+                            entity.setMaterial(cellValue);
+                            break;
+                        case 10: // 设计温度(℃)
+                            entity.setDesTemp(cellValue);
+                            break;
+                        case 11: // 设计压力(MPag)
+                            entity.setDesPressure(cellValue);
+                            break;
+                        case 12: // 工作温度(℃)
+                            entity.setTemperature(cellValue);
+                            break;
+                        case 13: // 工作压力(MPag)
+                            entity.setPressure(cellValue);
+                            break;
+                        case 14: // 规格
+                            entity.setSpecification(cellValue);
+                            break;
+                        case 15: // 介质
+                            entity.setMedium(cellValue);
+                            break;
+                        case 16: // 流速(m/s)
+                            entity.setFlowRate(cellValue);
+                            break;
+                        case 17: // 名义壁厚(mm)
+                            entity.setNominalTickness(cellValue);
+                            break;
+                        case 18: // 原始壁厚(mm)
+                            entity.setOriginalThickness(cellValue);
+                            break;
+                        case 19: // 最小允许壁厚(mm)
+                            entity.setThicknessMin(cellValue);
+                            break;
+                        case 20: // 腐蚀裕度(mm)
+                            entity.setCorAllowance(cellValue);
+                            break;
+                        case 21: // 腐蚀类型
+                            entity.setCorrosionType(cellValue);
+                            break;
+                        case 22: // 检测方法
+                            entity.setInspectionMethod(cellValue);
+                            break;
+                        case 23: // 安装日期
+                            if (cellValue != null && cellValue.length() > 3) {
+                                entity.setInstallDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                            }
+                            break;
+                        case 24: // 短期腐蚀速率(mm/year)
+                            entity.setStCorrosion(cellValue);
+                            break;
+                        case 25: // 长期腐蚀速率(mm/year)
+                            entity.setLtCorrosion(cellValue);
+                            break;
+                        case 26: // 测厚周期(月)
+                            entity.setMeasureCycle(cellValue);
+                            break;
+                        case 27: // 下次测厚日期
+                            if (cellValue != null && cellValue.length() > 3) {
+                                entity.setNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                            }
+                            break;
+                        case 28: // 原因分析
+                            entity.setAnalysis(cellValue);
+                            break;
+                        case 29: // 治理方法及依据
+                            entity.setMethodCause(cellValue);
+                            break;
+                        case 30: // 效果跟踪
+                            entity.setEffectTracing(cellValue);
+                            break;
+                        case 31: // 提出人
+                            entity.setRaiser(cellValue);
+                            break;
+                        case 32: // 提出时间
+                            if (cellValue != null && cellValue.length() > 3) {
+                                entity.setRaiserDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                            }
+                            break;
+                        case 33: // 记录人
+                            entity.setRecorder(cellValue);
+                            break;
+                        case 34: // 记录时间
+                            if (cellValue != null && cellValue.length() > 3) {
+                                entity.setRecorderDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                            }
+                            break;
+                        case 35: // 备注
+                            entity.setRemarks(cellValue);
+                            break;
                     }
                 }
                 entity.setCreateBy(userId.toString());
@@ -282,6 +316,7 @@ public class TMeasureThicknessController extends BaseController {
         int failNum = 0;
         for (TMeasureThickness t : list
         ) {
+            t.setThicknessMin(calculateTsd(t));
             failNum++;
             try {
                 tMeasureThicknessService.insertTMeasureThickness(t);
@@ -822,6 +857,20 @@ public class TMeasureThicknessController extends BaseController {
      */
     public String calculateTsd(TMeasureThickness thickness) {
         try {
+            // 1. 前置检查:任何条件失败则立即返回空字符串(Guard Clauses 思想)
+            if (StringUtils.isEmpty(thickness.getDesPressure())
+                    || StringUtils.isEmpty(thickness.getDesTemp())
+                    || StringUtils.isEmpty(thickness.getMaterial())
+                    || StringUtils.isEmpty(thickness.getDevType())
+                    || StringUtils.isEmpty(thickness.getSpecification())) {
+                return thickness.getThicknessMin();
+            }
+
+            // 2. 直接处理核心逻辑:仅对"管道"类型操作,非管道类型返回空字符串
+            if (!"管道".equals(thickness.getDevType())) {
+                return thickness.getThicknessMin();
+            }
+
             // 转换所有参数为 double
             double p = 0;
 

+ 5 - 5
master/src/main/java/com/ruoyi/project/sems/controller/TReportHiYlgdController.java

@@ -156,11 +156,11 @@ public class TReportHiYlgdController extends BaseController {
                 }
             }
             // 转换为 LocalDate 获取年份
-            int year = reportHiYlgd.getCheckDate().toInstant()
-                    .atZone(ZoneId.systemDefault())
-                    .toLocalDate()
-                    .getYear();
-            reportHiYlgd.setYearReportNo(reportHiYlgd.getPlantCode() + "-"+ year +  "-" + reportHiYlgd.getYearReportNo());
+//            int year = reportHiYlgd.getCheckDate().toInstant()
+//                    .atZone(ZoneId.systemDefault())
+//                    .toLocalDate()
+//                    .getYear();
+//            reportHiYlgd.setYearReportNo(reportHiYlgd.getPlantCode() + "-"+ year +  "-" + reportHiYlgd.getYearReportNo());
             map.put("reportHiYlgd", reportHiYlgd);
             TReportYlgd reportYlgd = tReportYlgdService.selectTReportYlgdById(reportHiYlgd.getReportId());
             TSpecdevYlgd devYlgd = tSpecdevYlgdService.selectTSpecdevYlgdById(reportYlgd.getDevId());

+ 5 - 5
master/src/main/java/com/ruoyi/project/sems/controller/TReportHiYlrqController.java

@@ -156,11 +156,11 @@ public class TReportHiYlrqController extends BaseController {
                 }
             }
             // 转换为 LocalDate 获取年份
-            int year = tReportHiYlrq.getCheckDate().toInstant()
-                    .atZone(ZoneId.systemDefault())
-                    .toLocalDate()
-                    .getYear();
-            tReportHiYlrq.setYearReportNo(tReportHiYlrq.getPlantCode() + "-"+ year +  "-" + tReportHiYlrq.getYearReportNo());
+//            int year = tReportHiYlrq.getCheckDate().toInstant()
+//                    .atZone(ZoneId.systemDefault())
+//                    .toLocalDate()
+//                    .getYear();
+//            tReportHiYlrq.setYearReportNo(tReportHiYlrq.getPlantCode() + "-"+ year +  "-" + tReportHiYlrq.getYearReportNo());
             map.put("reportHiYlrq", tReportHiYlrq);
             TReportYlrq reportYlrq = tReportYlrqService.selectTReportYlrqById(tReportHiYlrq.getReportId());
             TSpecdevYlrq devYlrq = tSpecdevYlrqService.selectTSpecdevYlrqById(reportYlrq.getDevId());

+ 52 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TMeasureThickness.java

@@ -283,6 +283,42 @@ public class TMeasureThickness extends BaseEntity
     @TableField(exist = false)
     private String measureDateWarn;
 
+    @TableField(exist = false)
+    private String minLife;
+    @TableField(exist = false)
+    private String maxLife;
+
+    @TableField(exist = false)
+    private String year;
+    @TableField(exist = false)
+    private String plants;
+    @TableField(exist = false)
+    private String isPipe;
+
+    public String getMinLife() {
+        return minLife;
+    }
+
+    public void setMinLife(String minLife) {
+        this.minLife = minLife;
+    }
+
+    public String getMaxLife() {
+        return maxLife;
+    }
+
+    public void setMaxLife(String maxLife) {
+        this.maxLife = maxLife;
+    }
+
+    public String getIsPipe() {
+        return isPipe;
+    }
+
+    public void setIsPipe(String isPipe) {
+        this.isPipe = isPipe;
+    }
+
     public Date getNextWarnDate() {
         return nextWarnDate;
     }
@@ -821,6 +857,22 @@ public class TMeasureThickness extends BaseEntity
         this.desTemp = desTemp;
     }
 
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getPlants() {
+        return plants;
+    }
+
+    public void setPlants(String plants) {
+        this.plants = plants;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 7 - 6
master/src/main/resources/mybatis/plant/TTargetactionMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.plant.mapper.TTargetactionMapper">
-    
+
     <resultMap type="TTargetaction" id="TTargetactionResult">
         <result property="id"    column="id"    />
         <result property="targetreviewId"    column="targetreview_id"    />
@@ -26,17 +26,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTTargetactionList" parameterType="TTargetaction" resultMap="TTargetactionResult">
         <include refid="selectTTargetactionVo"/>
-        <where>  
+        <where>
             <if test="targetreviewId != null "> and targetreview_id = #{targetreviewId}</if>
             and d.del_flag = 0
         </where>
+        order by d.id
     </select>
-    
+
     <select id="selectTTargetactionById" parameterType="Long" resultMap="TTargetactionResult">
         <include refid="selectTTargetactionVo"/>
         where d.id = #{id}
     </select>
-        
+
     <insert id="insertTTargetaction" parameterType="TTargetaction">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_targetaction.NEXTVAL as id FROM DUAL
@@ -97,5 +98,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 7 - 6
master/src/main/resources/mybatis/plant/TTargetagreementMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.plant.mapper.TTargetagreementMapper">
-    
+
     <resultMap type="TTargetagreement" id="TTargetagreementResult">
         <result property="id"    column="id"    />
         <result property="year"    column="year"    />
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTTargetagreementList" parameterType="TTargetagreement" resultMap="TTargetagreementResult">
         <include refid="selectTTargetagreementVo"/>
-        <where>  
+        <where>
             <if test="year != null "> and year = #{year}</if>
             <if test="employeeid != null  and employeeid != ''"> and employeeid = #{employeeid}</if>
             <if test="appraiser != null  and appraiser != ''"> and appraiser = #{appraiser}</if>
@@ -40,8 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by d.id
     </select>
-    
+
     <select id="selectTTargetagreementById" parameterType="Long" resultMap="TTargetagreementResult">
         <include refid="selectTTargetagreementVo"/>
         where d.id = #{id}
@@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and d.year = #{year}
         and d.del_flag = 0
     </select>
-        
+
     <insert id="insertTTargetagreement" parameterType="TTargetagreement" useGeneratedKeys="true" keyProperty="id">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_targetagreement.NEXTVAL as id FROM DUAL
@@ -122,5 +123,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 7 - 6
master/src/main/resources/mybatis/plant/TTargetyardstickMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.plant.mapper.TTargetyardstickMapper">
-    
+
     <resultMap type="TTargetyardstick" id="TTargetyardstickResult">
         <result property="id"    column="id"    />
         <result property="agreementId"    column="agreement_id"    />
@@ -27,12 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTTargetyardstickList" parameterType="TTargetyardstick" resultMap="TTargetyardstickResult">
         <include refid="selectTTargetyardstickVo"/>
-        <where>  
+        <where>
             <if test="agreementId != null "> and agreement_id = #{agreementId}</if>
             and d.del_flag = 0
         </where>
+        order by d.id
     </select>
-    
+
     <select id="selectTTargetyardstickById" parameterType="Long" resultMap="TTargetyardstickResult">
         <include refid="selectTTargetyardstickVo"/>
         where id = #{id}
@@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where agreement_id = #{agreementId}
         and d.del_flag = 0
     </select>
-        
+
     <insert id="insertTTargetyardstick" parameterType="TTargetyardstick">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_targetyardstick.NEXTVAL as id FROM DUAL
@@ -113,5 +114,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 14 - 0
master/src/main/resources/mybatis/sems/TMeasureThicknessMapper.xml

@@ -198,6 +198,20 @@
                     and  SYSDATE + INTERVAL '3' MONTH   >  next_warn_date
                 </if>
             </if>
+            <if test="plants != null  and plants != ''">
+                and
+                d.plant_code in
+                <foreach collection="plants.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="isPipe == 1 "> and (dev_type is null or dev_type != '设备')</if>
+            <if test="isPipe == 0 "> and dev_type == '设备'</if>
+            <if test="year != null and year != ''">
+                AND EST_REMAIN BETWEEN ( #{year} - EXTRACT(YEAR FROM SYSDATE) )
+                AND (  #{year} -EXTRACT(YEAR FROM SYSDATE) + 1)
+            </if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->

BIN
master/src/main/resources/static/template/sems/thicknessData.xlsx


+ 45 - 0
ui/src/api/sems/thickness.js

@@ -59,3 +59,48 @@ export function exportThickness(query) {
     params: query
   })
 }
+
+// 导出定点测厚
+export function homedata(data) {
+  return request({
+    url: '/sems/cuihome/data',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出定点测厚
+export function gdData(data) {
+  return request({
+    url: '/sems/cuihome/gdData',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出定点测厚
+export function sbData(data) {
+  return request({
+    url: '/sems/cuihome/sbData',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出定点测厚
+export function sbDataPie(data) {
+  return request({
+    url: '/sems/cuihome/sbDataPie',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出定点测厚
+export function gdDataPie(data) {
+  return request({
+    url: '/sems/cuihome/gdDataPie',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 2
ui/src/views/login.vue

@@ -261,8 +261,8 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  background-image: url("../assets/image/CPMS20210107.jpg");
-  //background-image: url("../assets/image/cpms-test.jpg");
+  //background-image: url("../assets/image/CPMS20210107.jpg");
+  background-image: url("../assets/image/cpms-test.jpg");
   background-size: cover;
 }
 

+ 31 - 2
ui/src/views/sems/thickness/home/dashboard/botPie.vue

@@ -4,6 +4,7 @@
 
 <script>
 import * as echarts from 'echarts';
+import {gdDataPie} from "@/api/sems/thickness";
 
 export default {
   props: {
@@ -35,6 +36,7 @@ export default {
   },
   data() {
     return {
+      devDatas:null,
       chart: null,
       colorArr: [
         "#218de0",
@@ -75,6 +77,34 @@ export default {
     this.chart = null;
   },
   methods: {
+    updateData(param) {
+      console.log('botpie 收到数据:', param);
+      let params = {
+        'plantIds': param,
+      }
+      gdDataPie(params).then(response => {
+        this.devDatas = response.data.resData
+        // 先取默认 normaldata
+        let newData = [
+          { name: '不足三年' },
+          { name: '3~6年' },
+          { name: '6~10年' },
+          { name: '>10年' }
+        ];
+
+        // 假设 this.devDatas 是按顺序对应的
+        newData = newData.map((item, index) => {
+          return {
+            name: item.name,
+            value: this.devDatas[index] || 0  // 防止 devDatas 数据不足时的安全处理
+          }
+        });
+
+        this.chartData = newData
+        this.initChart()
+      });
+
+    },
     // 初始化图表
     initChart() {
       this.chart = echarts.init(this.$el, 'macarons');
@@ -142,9 +172,8 @@ export default {
           // 主饼图
           {
             type: "pie",
-            radius: "70%",
+            radius: "55%",
             center: ["35%", "50%"],
-            roseType: "radius",
             label: {
               padding: [0, -75],
               alignTo: 'labelLine',

+ 29 - 1
ui/src/views/sems/thickness/home/dashboard/botPieRight.vue

@@ -4,6 +4,7 @@
 
 <script>
 import * as echarts from 'echarts';
+import {sbDataPie} from "@/api/sems/thickness";
 
 export default {
   props: {
@@ -68,7 +69,7 @@ export default {
         data.push({value: item.value, name: item.name});
         data.push({
           name: '',
-          value: sum / 100,
+          value: 0,
           itemStyle: {color: 'transparent'}
         });
       });
@@ -96,6 +97,33 @@ export default {
     window.removeEventListener('resize', this.handleResize)
   },
   methods: {
+    updateData(param) {
+      console.log('botR 收到数据:', param);
+      let params = {
+        'plantIds': param,
+      }
+      sbDataPie(params).then(response => {
+        this.devDatas = response.data.resData
+        // 先取默认 normaldata
+        let newData = [
+          { name: '不足三年' },
+          { name: '3~6年' },
+          { name: '6~10年' },
+          { name: '>10年' }
+        ];
+
+        // 假设 this.devDatas 是按顺序对应的
+        newData = newData.map((item, index) => {
+          return {
+            name: item.name,
+            value: this.devDatas[index] || 0  // 防止 devDatas 数据不足时的安全处理
+          }
+        });
+
+        this.normaldata = newData
+        this.initChart()
+      });
+    },
     initChart() {
       this.chart = echarts.init(this.$el)
       this.setOptions()

+ 36 - 5
ui/src/views/sems/thickness/home/dashboard/midLeft.vue

@@ -1,11 +1,12 @@
 <template>
-
   <div :class="className" :style="{height:height,width:width}">
+
   </div>
 </template>
 
 <script>
 import * as echarts from 'echarts';
+import {gdData, homedata} from "@/api/sems/thickness";
 
 export default {
   props: {
@@ -32,7 +33,12 @@ export default {
   },
   data() {
     return {
-      chart: null
+      // 定点测厚表格数据
+      thicknessList: [],
+      chart: null,
+      devDatas: null,
+      year: null,
+      plants:[]
     }
   },
   watch: {
@@ -56,10 +62,35 @@ export default {
     this.chart = null
   },
   methods: {
+      updateData(param) {
+        let params = {
+          'plantIds': param,
+        }
+        gdData(params).then(response => {
+          this.devDatas = response.data.resData
+          this.year = response.data.targetYears
+          this.initChart()
+        });
+
+      },
     initChart() {
       this.chart = echarts.init(this.$el, 'macarons')
       this.setOptions(this.chartData)
+      // 绑定柱子点击事件
+      this.chart.on('click', (params) => {
+        console.log('点击了柱子:', params);
+        // 你可以在这里做任何你要做的逻辑,比如跳转、弹窗、传值等等
+        // alert(`点击了 ${params.name},值为:${params.value}`);
+        let p = {
+          year : params.name,
+          plants: this.plants,
+          isPipe: 1
+        }
+
+        this.$emit('call-show', p);
+      });
     },
+
     setOptions() {
       this.chart.setOption({
         // backgroundColor: "#041139",
@@ -78,11 +109,11 @@ export default {
             color: '#fff',
             fontSize: 14
           },
-          data: ['2025', '2026', '2027', '2028', '2029', '2030', '2031', '2032', '2033', '2034']
+          data: this.year
         },
         yAxis: {
           type: 'value',
-          interval: 100,
+          interval: 1,
           splitLine: false,
           axisLabel: {
             color: '#fff'
@@ -99,7 +130,7 @@ export default {
         },
         series: [
           {
-            data: [0, 0, 0, 0, 0, 0, 1, 1, 0, 2],
+            data: this.devDatas,
             type: "pictorialBar",
             symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
             label: {

+ 30 - 3
ui/src/views/sems/thickness/home/dashboard/midRight.vue

@@ -6,6 +6,7 @@
 
 <script>
 import * as echarts from 'echarts';
+import {sbData} from "@/api/sems/thickness";
 
 export default {
   props: {
@@ -32,7 +33,8 @@ export default {
   },
   data() {
     return {
-      chart: null
+      chart: null,
+      devDatas: null
     }
   },
   watch: {
@@ -56,9 +58,33 @@ export default {
     this.chart = null
   },
   methods: {
+    updateData(param) {
+      console.log('Midright 收到数据:', param);
+      let params = {
+        'plantIds': param,
+      }
+      sbData(params).then(response => {
+        this.devDatas = response.data.resData
+        this.year = response.data.targetYears
+        this.initChart()
+      });
+    },
     initChart() {
       this.chart = echarts.init(this.$el, 'macarons')
       this.setOptions(this.chartData)
+      // 绑定柱子点击事件
+      this.chart.on('click', (params) => {
+        console.log('点击了柱子:', params);
+        // 你可以在这里做任何你要做的逻辑,比如跳转、弹窗、传值等等
+        // alert(`点击了 ${params.name},值为:${params.value}`);
+        let p = {
+          year : params.name,
+          plants: this.plants,
+          isPipe: 1
+        }
+
+        this.$emit('call-show', p);
+      });
     },
     setOptions() {
       this.chart.setOption({
@@ -112,11 +138,12 @@ export default {
             axisTick: {
               show: false,
             },
-            data: ['2025', '2026', '2027', '2028', '2029', '2030', '2031', '2032', '2033', '2034'],
+            data: this.year,
           },
         ],
         yAxis: [
           {
+            minInterval: 1,  // 关键设置:防止出现小于1的刻度
             type: "value",
             name: "",
             nameTextStyle: {
@@ -166,7 +193,7 @@ export default {
                 },
               ]),
             },
-            data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
+            data: this.devDatas,
           },
         ],
       })

+ 61 - 6
ui/src/views/sems/thickness/home/dashboard/topLine.vue

@@ -4,7 +4,21 @@
       <dv-border-box-8 :dur="10">
       <div class="card-panel" style="text-align: center;align-items: center;justify-content: center;display: flex;">
 
-        <el-select v-model="form.plant" :placeholder="$t('请选择') + $t('装置')" filterable clearable size="small" style="margin:auto;width: 80%">
+        <el-select
+          v-model="form.plant"
+          :placeholder="$t('请选择') + $t('装置')"
+          filterable
+          clearable
+          size="small"
+          multiple
+          collapse-tags
+          style="margin:auto;width: 80%"
+          @change="handleSelectChange"
+        >
+          <el-option
+            label="全选"
+            value="ALL"
+          />
           <el-option
             v-for="dict in plantOptions"
             :key="dict.name"
@@ -26,7 +40,7 @@
           <div class="card-panel-text" >
             管道数量
           </div>
-          <count-to :duration="3000" :end-val="21" :start-val="0" class="card-panel-num"/>
+          <count-to :duration="3000" :end-val="devDatas.gdAll" :start-val="0" class="card-panel-num"/>
         </div>
       </div>
       </dv-border-box-8>
@@ -41,7 +55,7 @@
           <div class="card-panel-text">
             设备数量
           </div>
-          <count-to :duration="3000" :end-val="2" :start-val="0" class="card-panel-num"/>
+          <count-to :duration="3000" :end-val="devDatas.sbAll" :start-val="0" class="card-panel-num"/>
         </div>
       </div>
       </dv-border-box-8>
@@ -56,7 +70,7 @@
           <div class="card-panel-text">
             待测厚管道数量
           </div>
-          <count-to :duration="3000" :end-val="0" :start-val="0" class="card-panel-num"/>
+          <count-to :duration="3000" :end-val="devDatas.gdWarn" :start-val="0" class="card-panel-num"/>
         </div>
       </div>
       </dv-border-box-8>
@@ -71,7 +85,7 @@
           <div class="card-panel-text">
             待测厚设备数量
           </div>
-          <count-to :duration="3000" :end-val="0" :start-val="0" class="card-panel-num"/>
+          <count-to :duration="3000" :end-val="devDatas.sbWarn" :start-val="0" class="card-panel-num"/>
         </div>
       </div>
       </dv-border-box-8>
@@ -81,7 +95,9 @@
 
 <script>
 import CountTo from 'vue-count-to'
-import {mylistPlant} from "@/api/system/plant";
+import {listUnit, mylistPlant} from "@/api/system/plant";
+import {homedata} from "@/api/sems/thickness";
+import {devData} from "@/api/sems/home";
 
 export default {
   components: {
@@ -89,6 +105,13 @@ export default {
   },
   data() {
     return {
+      devDatas: {
+        sbAll: 0,
+        gdAll: 0,
+        sbWarn: 0,
+        gdWarn: 0,
+      },
+
       plantOptions: [],
       form:{}
     }
@@ -96,13 +119,45 @@ export default {
   created() {
     mylistPlant({pType: 1}).then(response => {
       this.plantOptions = response.data;
+      const allValues = this.plantOptions.map(item => item.name);
+      this.form.plant = [...allValues];
     });
+    this.getCuiData()
   },
+  methods: {
+    handleSelectChange(val) {
+      const allValues = this.plantOptions.map(item => item.name);
+      if (val.includes('ALL')) {
+        // 判断是否已经是全选状态
+        const isAllSelected = allValues.every(v => val.includes(v));
+        if (isAllSelected) {
+          // 如果已经全选,再次点击则清空
+          this.form.plant = [];
+        } else {
+          // 否则选中全部
+          this.form.plant = [...allValues];
+        }
+      }
+      this.$emit('call-update', this.form.plant);
+      this.getCuiData()
+    },
+    getCuiData(){
+      let params = {
+        'plantIds': this.form.plant,
+      }
+      homedata(params).then(response => {
+        this.devDatas = response.data
 
+
+      });
+    }
+
+  }
 }
 </script>
 
 <style lang="scss" scoped>
+
 .panel-group {
   margin-top: 18px;
 

+ 168 - 13
ui/src/views/sems/thickness/home/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="dashboard-editor-container">
-    <top-line/>
+    <top-line @call-update="handleUpdate" />
     <el-row>
       <el-col :span="12">
         <dv-decoration-1 style="width:100%;height:20px;" />
         <div>
           <dv-border-box-3>
-            <mid-left :chart-data="{}"/>
+            <mid-left ref="midLeft" @call-show="showTable" :chart-data="{}"/>
           </dv-border-box-3>
         </div>
       </el-col>
@@ -14,7 +14,7 @@
         <dv-decoration-1 style="width:100%;height:20px;" />
         <div>
           <dv-border-box-3>
-            <mid-right :chart-data="{}"/>
+            <mid-right ref="midRight" @call-show="showTable" :chart-data="{}"/>
           </dv-border-box-3>
         </div>
       </el-col>
@@ -22,15 +22,81 @@
     <el-row>
       <el-col :span="12">
         <dv-border-box-9>
-          <bot-pie/>
+          <bot-pie ref="botPie"/>
         </dv-border-box-9>
       </el-col>
       <el-col :span="12">
         <dv-border-box-9>
-          <bot-pie-right/>
+          <bot-pie-right ref="botPieRight"/>
         </dv-border-box-9>
       </el-col>
     </el-row>
+    <el-dialog  :close-on-click-modal="false" :title="title" :visible.sync="open" width="85%" >
+      <el-button
+        type="warning"
+        icon="el-icon-download"
+        size="mini"
+        @click="handleExport"
+      >{{ $t('导出') }}</el-button>
+      <el-table v-loading="loading" :data="thicknessList"  :height="clientHeight" border>
+        <el-table-column :label="$t('装置名称')" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('单元名称')" align="center" prop="unitCode" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('腐蚀回路图号')" align="center" prop="loopNo" :show-overflow-tooltip="true">
+        </el-table-column>
+        <el-table-column :label="$t('单位内编号')" align="center" prop="tagno" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('测厚部位CML')" align="center"  prop="position" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('检测编号')" align="center" prop="measureNo" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('设备/管线名称')" align="center" prop="equipmentName" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('材质')" align="center" prop="material" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('名义壁厚(mm)')" align="center" prop="nominalTickness" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('最小允许壁厚(mm)')" align="center" prop="thicknessMin" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('短期腐蚀速率(mm/year)')" align="center" prop="stCorrosion" :show-overflow-tooltip="true"/>
+        <el-table-column :label="$t('长期腐蚀速率(mm/year)')" align="center" prop="ltCorrosion" :show-overflow-tooltip="true"/>
+        <el-table-column
+          prop="measureCycle"
+          header-align="center"
+          align="center"
+          :label="$t('测厚周期(月)')">
+        </el-table-column>
+        <el-table-column
+          prop="installDate"
+          header-align="center"
+          align="center"
+          label="安装日期"/>
+        <el-table-column
+          prop="firstMeasureDate"
+          header-align="center"
+          align="center"
+          :label="$t('首次测厚日期')"/>
+        <el-table-column
+          prop="newMeasureDate"
+          header-align="center"
+          align="center"
+          :label="$t('最近测厚日期')"/>
+
+        <el-table-column :label="$t('预估剩余寿命(year)')" align="center" prop="estRemain" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <span  v-if="scope.row.estRemain"> {{ scope.row.estRemain }}</span>
+            <span v-else-if="!scope.row.thicknessMin">缺少最小允许壁厚</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="nextWarnDate"
+          header-align="center"
+          align="center"
+          :label="$t('下次测厚日期')">
+        </el-table-column>
+        <el-table-column :label="$t('检测方法')" align="center" prop="inspectionMethod"/>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-dialog>
+
   </div>
 </template>
 
@@ -44,14 +110,108 @@ import MidLeft from "@/views/sems/thickness/home/dashboard/midLeft.vue";
 import BotPie from "@/views/sems/thickness/home/dashboard/botPie.vue";
 import MidRight from "@/views/sems/thickness/home/dashboard/midRight.vue";
 import BotPieRight from "@/views/sems/thickness/home/dashboard/botPieRight.vue";
+import {exportThickness, listThickness} from "@/api/sems/thickness";
 
 export default {
   name: 'Index',
   components: {BotPieRight, MidRight, BotPie, MidLeft, TopLine, NoticeChart, PieChart, PanelGroup},
   data() {
-    return {}
+    return {
+
+      // 总条数
+      total: 0,
+      // 定点测厚表格数据
+      thicknessList: [],
+      dataList: [],
+      open: false,
+      title: '设备列表',
+      // 遮罩层
+      loading: true,
+      // 弹出层标题
+      queryParams: {
+        plants: "",
+        pageNum: 1,
+        pageSize: 20,
+        plantCode: null,
+        unitCode: null,
+        tagno: null,
+        status: null,
+        remarks: null,
+        position: null,
+        recorder: null,
+        recorderDate: null,
+        equipmentName: null,
+        material: null,
+        corAllowance: null,
+        originalThickness: null,
+        medium: null,
+        pressure: null,
+        specification: null,
+        flowRate: null,
+        temperature: null,
+        corrosionType: null,
+        inspectionMethod: null,
+        photo: null,
+        analysis: null,
+        nominalTickness: null,
+        thicknessMin: null,
+        stCorrosion: null,
+        ltCorrosion: null,
+        estRemain: null,
+        methodCause: null,
+        effectTracing: null,
+        raiser: null,
+        raiserDate: null,
+        locationUrl: null,
+        analysisUrl: null,
+        measureCycle: null,
+        recordUrl: null,
+        otherContent: null,
+        estRemainWarn: null,
+        measureDateWarn: null,
+      }, // 查询参数
+    }
   },
-  methods: {}
+  methods: {
+    handleUpdate(param) {
+      // 父组件统一调度,分别调用兄弟组件
+      this.$refs.midLeft.updateData(param);
+      this.$refs.midRight.updateData(param);
+      this.$refs.botPie.updateData(param);
+      this.$refs.botPieRight.updateData(param);
+    },
+    showTable(param) {
+      // 父组件统一调度,分别调用兄弟组件
+      console.log("showTable")
+      console.log(param)
+      this.queryParams.year = param.year
+      this.queryParams.plants = param.plants
+      this.queryParams.isPipe = param.isPipe
+      this.getList()
+    },
+    getList() {
+      this.open = true
+      this.loading = true;
+      listThickness(this.queryParams).then(response => {
+        this.thicknessList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm(this.$t('是否确认导出所有定点测厚数据项?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return exportThickness(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+  }
 }
 </script>
 
@@ -63,10 +223,5 @@ export default {
 
 }
 
-/*
-@media (max-width: 1024px) {
-  .chart-wrapper {
-    padding: 8px;
-  }
-}*/
+
 </style>

+ 41 - 30
ui/src/views/sems/thickness/thicknessData/index.vue

@@ -240,7 +240,7 @@
         align="center"
         :label="$t('下次测厚日期')">
       </el-table-column>
-      <el-table-column :label="$t('检测方法')" align="center" prop="inspectionMethod" :formatter="inspectionMethodFormat" />
+      <el-table-column :label="$t('检测方法')" align="center" prop="inspectionMethod"/>
       <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button type="text" size="small" @click="handleView(scope.row)">{{ $t('查看') }}</el-button>
@@ -494,7 +494,10 @@
         </el-form-item>
 
         <!-- 腐蚀类型(原代码中没有此字段,暂留空) -->
-
+        <el-form-item :label="$t('腐蚀类型')" prop="corrosionType">
+          <el-input v-model="form.corrosionType"
+                    :placeholder="$t('请输入') + $t('腐蚀类型')" />
+        </el-form-item>
         <!-- 检测方法 -->
         <el-form-item :label="$t('检测方法')">
           <el-select
@@ -1149,6 +1152,14 @@
     </span>
         </el-descriptions-item>
 
+        <!-- 检测方法 (单独一行) -->
+        <el-descriptions-item :span="6">
+          <template slot="label">
+            {{ $t('腐蚀类型') }}
+          </template>
+          {{ dataForm.corrosionType }}
+        </el-descriptions-item>
+
         <!-- 检测方法 (单独一行) -->
         <el-descriptions-item :span="6">
           <template slot="label">
@@ -1860,39 +1871,39 @@ export default {
         equipmentName: [
           { required: true, message: this.$t('设备/管线名称')+this.$t('不能为空'), trigger: "blur" }
         ],
-        material: [
-          { required: true, message: this.$t('材质')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        corAllowance: [
-          { required: true, message: this.$t('腐蚀裕度(mm)')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        originalThickness: [
-          { required: true, message: this.$t('原始壁厚(mm)')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        medium: [
-          { required: true, message: this.$t('介质')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        pressure: [
-          { required: true, message: this.$t('工作压力')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        specification: [
-          { required: true, message: this.$t('规格')+this.$t('不能为空'), trigger: "blur" }
-        ],
+        // material: [
+        //   { required: true, message: this.$t('材质')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // corAllowance: [
+        //   { required: true, message: this.$t('腐蚀裕度(mm)')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // originalThickness: [
+        //   { required: true, message: this.$t('原始壁厚(mm)')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // medium: [
+        //   { required: true, message: this.$t('介质')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // pressure: [
+        //   { required: true, message: this.$t('工作压力')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // specification: [
+        //   { required: true, message: this.$t('规格')+this.$t('不能为空'), trigger: "blur" }
+        // ],
 /*        flowRate: [
           { required: true, message: this.$t('流速(m/s)')+this.$t('不能为空'), trigger: "blur" }
         ],*/
-        temperature: [
-          { required: true, message: this.$t('工作温度(℃)')+this.$t('不能为空'), trigger: "blur" }
-        ],
-        corrosionType: [
-          { required: true, message: this.$t('腐蚀类型')+this.$t('不能为空'), trigger: "change" }
-        ],
+        // temperature: [
+        //   { required: true, message: this.$t('工作温度(℃)')+this.$t('不能为空'), trigger: "blur" }
+        // ],
+        // corrosionType: [
+        //   { required: true, message: this.$t('腐蚀类型')+this.$t('不能为空'), trigger: "change" }
+        // ],
         /*analysis: [
           { required: true, message: "原因分析不能为空", trigger: "blur" }
         ],*/
-        nominalTickness: [
-          { required: true, message: this.$t('名义壁厚(mm)')+this.$t('不能为空'), trigger: "blur" }
-        ],
+        // nominalTickness: [
+        //   { required: true, message: this.$t('名义壁厚(mm)')+this.$t('不能为空'), trigger: "blur" }
+        // ],
         // thicknessMin: [
         //   { required: true, message: this.$t('最小允许壁厚(mm)')+this.$t('不能为空'), trigger: "blur" }
         // ],
@@ -2371,7 +2382,7 @@ export default {
     wordView(row) {
       wordView(row.id).then(response => {
         console.log(response.msg)
-        this.handleSee("每周检查记录", response.msg)
+        this.handleSee("定点测厚报告", response.msg)
       });
     },
     handleSee(fileName, url) {