Browse Source

cpms优化

jiangbiao 1 year ago
parent
commit
2e35e8eb24

+ 14 - 1
cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsController.java

@@ -6,9 +6,12 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson2.JSON;
+import com.cpms.common.core.domain.entity.SysDictData;
 import com.cpms.common.utils.DateUtils;
 import com.cpms.common.utils.file.ExcelUtils;
 import com.cpms.project.asset.service.ITLeakagePointsService;
+import com.cpms.system.service.ISysDictDataService;
+import com.cpms.system.service.ISysDictTypeService;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -38,6 +41,9 @@ public class TLeakagePointsController extends BaseController
     @Autowired
     private ITLeakagePointsService tLeakagePointsService;
 
+    @Autowired
+    private ISysDictTypeService sysDictTypeService;
+
     /**
      * 查询漏点清单列表
      */
@@ -112,6 +118,9 @@ public class TLeakagePointsController extends BaseController
     public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
         //获取操作人员ID
         Long userId = getUserId();
+
+        List<SysDictData> dictData = sysDictTypeService.selectDictDataByType("leakage_result");
+        logger.info(JSON.toJSONString(dictData));
         //报错行数统计
         List<Integer> failRow = new ArrayList<>();
         Workbook workbook = ExcelUtils.getWorkBook(file);
@@ -155,7 +164,11 @@ public class TLeakagePointsController extends BaseController
                     } else if (j == 10) {
                         entity.setPressurePlugging(cellValue);
                     } else if (j == 11) {
-                        entity.setLeakageEliminationResult(cellValue);
+                        for (SysDictData data : dictData) {
+                            if (data.getDictLabel().equals(cellValue)){
+                                entity.setLeakageEliminationResult(data.getDictValue());
+                            }
+                        }
                     } else if (j == 12) {
                         entity.setNextCheckDate(DateUtils.parseDate(cellValue));
                     } else if (j == 13) {

+ 8 - 2
cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsPatrolController.java

@@ -13,6 +13,7 @@ import com.cpms.project.asset.domain.TLeakagePointsRecord;
 import com.cpms.project.asset.service.ITLeakagePointsPatrolService;
 import com.cpms.project.asset.service.ITLeakagePointsRecordService;
 import com.cpms.project.asset.service.ITLeakagePointsService;
+import com.cpms.system.service.ISysDictDataService;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -44,6 +45,9 @@ public class TLeakagePointsPatrolController extends BaseController {
     @Autowired
     private ITLeakagePointsService tLeakagePointsService;
 
+    @Autowired
+    private ISysDictDataService sysDictDataService;
+
     /**
      * 查询漏点巡检列表
      */
@@ -157,8 +161,10 @@ public class TLeakagePointsPatrolController extends BaseController {
             patrol.setRecords(tLeakagePointsRecordService.selectTLeakagePointsRecordList(record));
             row0.createCell(3).setCellValue(DateUtils.dateTime(patrol.getCheckDateM()));
             row0.createCell(5).setCellValue(DateUtils.dateTime(patrol.getCheckDateN()));
-            row1.createCell(3).setCellValue(patrol.getTeamM() + "班");
-            row1.createCell(5).setCellValue(patrol.getTeamN() + "班");
+            row1.createCell(3).setCellValue(
+                    sysDictDataService.selectDictLabel("team_divide",patrol.getTeamM()) + "班");
+            row1.createCell(5).setCellValue(
+                    sysDictDataService.selectDictLabel("team_divide",patrol.getTeamN())  + "班");
             int i = 3;
             for (TLeakagePointsRecord patrolRecord : patrol.getRecords()) {
                 i++;

+ 1 - 3
cpms-admin/src/main/resources/application.yml

@@ -7,9 +7,7 @@ ruoyi:
   # 版权年份
   copyrightYear: 2024
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-#  部署
 #  profile: C:/cpmsFile/uploadPath
-#  本地
   profile: D:/cpmsFile/uploadPath
   # 获取ip地址开关
   addressEnabled: false
@@ -100,7 +98,7 @@ token:
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz
   # 令牌有效期(默认30分钟)
-  expireTime: 3000
+  expireTime: 240
 
 # MyBatis配置
 mybatis:

+ 1 - 0
cpms-admin/src/main/resources/mapper/moc/TMocMapper.xml

@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             and del_flag=0
         </where>
+        order by createdate desc
     </select>
     
     <select id="selectTMocById" parameterType="Long" resultMap="TMocResult">

+ 1 - 0
cpms-admin/src/main/resources/mapper/process/TClassdOverviewMapper.xml

@@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
         and del_flag=0
         </where>
+        order by createdate desc
     </select>
     
     <select id="selectTClassdOverviewById" parameterType="Long" resultMap="TClassdOverviewResult">

+ 1 - 0
cpms-admin/src/main/resources/mapper/process/TLockValveMapper.xml

@@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
         and del_flag=0
         </where>
+        order by createdate desc
     </select>
     
     <select id="selectTLockValveById" parameterType="Long" resultMap="TLockValveResult">

+ 1 - 0
cpms-admin/src/main/resources/mapper/process/TSifOverviewMapper.xml

@@ -84,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pfdavg != null  and pfdavg != ''"> and pfdavg = #{pfdavg}</if>
         and a.del_flag=0
         </where>
+        order by a.createdate desc
     </select>
     
     <select id="selectTSifOverviewById" parameterType="Long" resultMap="TSifOverviewResult">

+ 1 - 0
cpms-admin/src/main/resources/mapper/process/TValveCsocscMapper.xml

@@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
         and del_flag=0
         </where>
+        order by createdate desc
     </select>
     
     <select id="selectTValveCsocscById" parameterType="Long" resultMap="TValveCsocscResult">

+ 1 - 0
cpms-admin/src/main/resources/mapper/process/TValveNoncMapper.xml

@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
         and del_flag=0
         </where>
+        order by createdate desc
     </select>
     
     <select id="selectTValveNoncById" parameterType="Long" resultMap="TValveNoncResult">

+ 2 - 0
cpms-ui/src/views/asset/points/index.vue

@@ -654,6 +654,8 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.leakageEliminationResults=[]
+      this.queryParams.leakageEliminationResult=null;
       this.handleQuery();
     },
     // 多选框选中数据