6713ebed 张雷

feat(equipment): 增加维保类型筛选功能

- 在 EquipmentMaintainPlanMapper 和 EquipmentMaintainTaskMapper 中添加维保类型筛选条件
- 在 EquipmentMaintainTask 实体中添加 maintenanceType 字段
- 更新相关 SQL 查询语句,支持维保类型筛选- 调整 pom.xml 中的依赖版本:
  - kingtroldata.flow.version 升级到2.0.6
  - spring-boot-devtools 依赖被移除
  - spring-boot-starter-data-jpa 依赖被添加
1 个父辈 5bf47ad3
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 <module>sk-module-equipment</module> 24 <module>sk-module-equipment</module>
25 <module>sk-module-biz</module> 25 <module>sk-module-biz</module>
26 <module>sk-module-alarm</module> 26 <module>sk-module-alarm</module>
27 <module>sk-module-analysis</module> 27 <module>sk-module-analysis</module>
28 </modules> 28 </modules>
29 29
30 <repositories> 30 <repositories>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
66 <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version> 66 <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version>
67 <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version> 67 <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
68 <kingtroldata.core.version>2.0.3</kingtroldata.core.version> 68 <kingtroldata.core.version>2.0.3</kingtroldata.core.version>
69 <kingtroldata.flow.version>2.0.4</kingtroldata.flow.version> 69 <kingtroldata.flow.version>2.0.6</kingtroldata.flow.version>
70 <flowable.version>6.4.2</flowable.version> 70 <flowable.version>6.4.2</flowable.version>
71 <log4j2.version>2.17.0</log4j2.version> 71 <log4j2.version>2.17.0</log4j2.version>
72 </properties> 72 </properties>
...@@ -155,11 +155,10 @@ ...@@ -155,11 +155,10 @@
155 <groupId>org.springframework.boot</groupId> 155 <groupId>org.springframework.boot</groupId>
156 <artifactId>spring-boot-starter-actuator</artifactId> 156 <artifactId>spring-boot-starter-actuator</artifactId>
157 </dependency> 157 </dependency>
158 <!-- <dependency> 158 <dependency>
159 <groupId>org.springframework.boot</groupId> 159 <groupId>org.springframework.boot</groupId>
160 <artifactId>spring-boot-devtools</artifactId> 160 <artifactId>spring-boot-starter-data-jpa</artifactId>
161 <optional>true</optional> 161 </dependency>
162 </dependency> -->
163 162
164 <!-- commons --> 163 <!-- commons -->
165 <dependency> 164 <dependency>
......
...@@ -101,7 +101,7 @@ spring: ...@@ -101,7 +101,7 @@ spring:
101 driver-class-name: com.mysql.jdbc.Driver 101 driver-class-name: com.mysql.jdbc.Driver
102 # 多数据源配置 102 # 多数据源配置
103 pg-db: 103 pg-db:
104 url: jdbc:postgresql://20.0.99.4:10086/postgres?useUnicode=true&characterEncoding=UTF8 104 url: jdbc:postgresql://112.123.135.140:10086/postgres?useUnicode=true&characterEncoding=UTF8
105 username: postgres 105 username: postgres
106 password: jkauto@123 106 password: jkauto@123
107 driver-class-name: org.postgresql.Driver 107 driver-class-name: org.postgresql.Driver
......
...@@ -65,7 +65,6 @@ public class WorkAnalysisController { ...@@ -65,7 +65,6 @@ public class WorkAnalysisController {
65 } 65 }
66 endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比 66 endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比
67 67
68
69 String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,ifnull(aaa.count,0) 'nh_num' ,ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(ddd.count,0) 'yy_month_num',ifnull(fff.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d "; 68 String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,ifnull(aaa.count,0) 'nh_num' ,ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(ddd.count,0) 'yy_month_num',ifnull(fff.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d ";
70 sql += getWorkProgressSql(departIds, startTime, endTime, month); 69 sql += getWorkProgressSql(departIds, startTime, endTime, month);
71 sql += " where d.depart_type =1 "; 70 sql += " where d.depart_type =1 ";
......
1 package com.skua.modules.equipment.entity; 1 package com.skua.modules.equipment.entity;
2 2
3 import com.baomidou.mybatisplus.annotation.IdType; 3 import com.baomidou.mybatisplus.annotation.IdType;
4 import com.baomidou.mybatisplus.annotation.TableField;
4 import com.baomidou.mybatisplus.annotation.TableId; 5 import com.baomidou.mybatisplus.annotation.TableId;
5 import com.baomidou.mybatisplus.annotation.TableName; 6 import com.baomidou.mybatisplus.annotation.TableName;
6 import com.fasterxml.jackson.annotation.JsonFormat; 7 import com.fasterxml.jackson.annotation.JsonFormat;
8 import com.skua.core.aspect.annotation.Dict;
7 import io.swagger.annotations.ApiModel; 9 import io.swagger.annotations.ApiModel;
8 import io.swagger.annotations.ApiModelProperty; 10 import io.swagger.annotations.ApiModelProperty;
9 import lombok.Data; 11 import lombok.Data;
...@@ -96,4 +98,9 @@ public class EquipmentMaintainTask { ...@@ -96,4 +98,9 @@ public class EquipmentMaintainTask {
96 @ApiModelProperty(value = "修改时间") 98 @ApiModelProperty(value = "修改时间")
97 private Date updateTime; 99 private Date updateTime;
98 private Integer delFlag; 100 private Integer delFlag;
101
102 @TableField(exist = false)
103 @ApiModelProperty(value = "维保类型")
104 @Dict(dicCode = "maintenance_type")
105 private String maintenanceType;
99 } 106 }
......
...@@ -24,9 +24,13 @@ public interface EquipmentMaintainPlanMapper extends BaseMapper<EquipmentMaintai ...@@ -24,9 +24,13 @@ public interface EquipmentMaintainPlanMapper extends BaseMapper<EquipmentMaintai
24 void addPlanStandard(@Param("id") String id, @Param("planId") String planId, @Param("standardId") String standardId); 24 void addPlanStandard(@Param("id") String id, @Param("planId") String planId, @Param("standardId") String standardId);
25 25
26 void deletePlanStandard(@Param("planId") String planId); 26 void deletePlanStandard(@Param("planId") String planId);
27 void deletePlan(@Param("planId") String planId); 27
28 void deletePlan(@Param("planId") String planId);
29
28 void addPlanSparePart(@Param("id") String id, @Param("planId") String planId, @Param("sparePartId") String sparePartId, @Param("num") Integer num); 30 void addPlanSparePart(@Param("id") String id, @Param("planId") String planId, @Param("sparePartId") String sparePartId, @Param("num") Integer num);
29 void deletePlanSparePart(@Param("planId") String planId); 31
32 void deletePlanSparePart(@Param("planId") String planId);
33
30 List<EquipmentMaintainPlanVO> queryCustomPageList(Page<EquipmentMaintainPlanVO> pageList, @Param("equipmentMaintainPlanDTO") EquipmentMaintainPlanDTO equipmentMaintainPlanDTO); 34 List<EquipmentMaintainPlanVO> queryCustomPageList(Page<EquipmentMaintainPlanVO> pageList, @Param("equipmentMaintainPlanDTO") EquipmentMaintainPlanDTO equipmentMaintainPlanDTO);
31 35
32 EquipmentMaintainPlanVO queryById(@Param("id") String id); 36 EquipmentMaintainPlanVO queryById(@Param("id") String id);
......
...@@ -35,36 +35,40 @@ ...@@ -35,36 +35,40 @@
35 <select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainPlanDTO" 35 <select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainPlanDTO"
36 resultType="com.skua.modules.equipment.vo.EquipmentMaintainPlanVO"> 36 resultType="com.skua.modules.equipment.vo.EquipmentMaintainPlanVO">
37 SELECT 37 SELECT
38 emp.id AS id, 38 emp.id AS id,
39 emp.depart_id, 39 emp.depart_id,
40 (select depart_name from sys_depart where id=emp.depart_id) AS departName, 40 emp.maintenance_type,
41 emp.plan_name AS planName, 41 (select depart_name from sys_depart where id=emp.depart_id) AS departName,
42 (select equipment_name from equipment_info where id=epe.equipment_id) AS equipmentName, 42 emp.plan_name AS planName,
43 CONCAT( emp.cycle, emp.cycle_unit ) AS cycle, 43 (select equipment_name from equipment_info where id=epe.equipment_id) AS equipmentName,
44 emp.start_time AS startTime, 44 CONCAT( emp.cycle, emp.cycle_unit ) AS cycle,
45 emp.end_time AS endTime, 45 emp.start_time AS startTime,
46 emp.plan_arranger_id, 46 emp.end_time AS endTime,
47 (select realname from sys_user where id=emp.plan_arranger_id) AS planArrangerName, 47 emp.plan_arranger_id,
48 emp.plan_accepter_id, 48 (select realname from sys_user where id=emp.plan_arranger_id) AS planArrangerName,
49 (select realname from sys_user where id=emp.plan_accepter_id) AS planAccepterName, 49 emp.plan_accepter_id,
50 emp.release_status AS releaseStatus, 50 (select realname from sys_user where id=emp.plan_accepter_id) AS planAccepterName,
51 ems.maintenance_mode AS maintenanceMode, 51 emp.release_status AS releaseStatus,
52 ems.maintenance_level AS maintenanceLevel 52 ems.maintenance_mode AS maintenanceMode,
53 ems.maintenance_level AS maintenanceLevel
53 FROM 54 FROM
54 equipment_maintain_plan emp 55 equipment_maintain_plan emp
55 LEFT JOIN equipment_maintain_plan_equip epe ON epe.plan_id = emp.id 56 LEFT JOIN equipment_maintain_plan_equip epe ON epe.plan_id = emp.id
56 LEFT JOIN equipment_maintain_plan_standard eps ON eps.plan_id = emp.id 57 LEFT JOIN equipment_maintain_plan_standard eps ON eps.plan_id = emp.id
57 LEFT JOIN equipment_maintain_standard ems ON ems.id = eps.standard_id 58 LEFT JOIN equipment_maintain_standard ems ON ems.id = eps.standard_id
58 <where> 59 <where>
59 emp.del_flag=0 60 emp.del_flag=0
60 <if test="equipmentMaintainPlanDTO.departId !=null and equipmentMaintainPlanDTO.departId !=''"> 61 <if test="equipmentMaintainPlanDTO.departId !=null and equipmentMaintainPlanDTO.departId !=''">
61 and emp.depart_id=#{equipmentMaintainPlanDTO.departId} 62 and emp.depart_id=#{equipmentMaintainPlanDTO.departId}
62 </if> 63 </if>
63 <if test="equipmentMaintainPlanDTO.planName !=null and equipmentMaintainPlanDTO.planName !=''"> 64 <if test="equipmentMaintainPlanDTO.planName !=null and equipmentMaintainPlanDTO.planName !=''">
64 and emp.plan_name like concat(concat('%', #{equipmentMaintainPlanDTO.planName}), '%') 65 and emp.plan_name like concat(concat('%', #{equipmentMaintainPlanDTO.planName}), '%')
66 </if>
67 <if test="equipmentMaintainPlanDTO.maintenanceType !=null and equipmentMaintainPlanDTO.maintenanceType !=''">
68 and emp.maintenance_type=#{equipmentMaintainPlanDTO.maintenanceType}
65 </if> 69 </if>
66 <if test="equipmentMaintainPlanDTO.planArrangerId !=null and equipmentMaintainPlanDTO.planArrangerId !=''"> 70 <if test="equipmentMaintainPlanDTO.planArrangerId !=null and equipmentMaintainPlanDTO.planArrangerId !=''">
67 and emp.plan_arranger_id = #{equipmentMaintainPlanDTO.planArrangerId} 71 and emp.plan_arranger_id = #{equipmentMaintainPlanDTO.planArrangerId}
68 </if> 72 </if>
69 GROUP BY emp.id 73 GROUP BY emp.id
70 order by emp.create_time desc 74 order by emp.create_time desc
......
...@@ -4,32 +4,33 @@ ...@@ -4,32 +4,33 @@
4 <select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainTaskDTO" 4 <select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainTaskDTO"
5 resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskVO"> 5 resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskVO">
6 SELECT 6 SELECT
7 ei.equipment_name as equipmentName, 7 ei.equipment_name as equipmentName,
8 emt.id AS id , 8 emt.id AS id ,
9 emt.downtime AS downtime, 9 emt.downtime AS downtime,
10 emt.end_time AS endTime, 10 emt.end_time AS endTime,
11 emt.start_time AS startTime, 11 emt.start_time AS startTime,
12 emt.depart_id, 12 emt.depart_id,
13 (select depart_name from sys_depart where id=emt.depart_id) AS depart_name, 13 (select depart_name from sys_depart where id=emt.depart_id) AS depart_name,
14 emt.maintain_plan_name AS maintainPlanName, 14 emt.maintain_plan_name AS maintainPlanName,
15 emt.maintain_mode AS maintainMode, 15 emt.maintain_mode AS maintainMode,
16 emt.maintain_level AS maintainLevel, 16 emt.maintain_level AS maintainLevel,
17 emt.maintainer_id AS maintainerId, 17 emt.maintainer_id AS maintainerId,
18 (select realname from sys_user where id=emt.maintainer_id) AS maintainerName, 18 (select realname from sys_user where id=emt.maintainer_id) AS maintainerName,
19 emt.maintain_time AS maintainTime, 19 emt.maintain_time AS maintainTime,
20 emt.plan_id AS planId, 20 emt.plan_id AS planId,
21 emt.real_start_time AS realStartTime, 21 emt.real_start_time AS realStartTime,
22 emt.real_end_time AS realEndTime, 22 emt.real_end_time AS realEndTime,
23 emt.working_hours AS workingHours, 23 emt.working_hours AS workingHours,
24 case when (emt.real_end_time &lt;= emt.end_time and emt.working_hours &lt;= emp.limit_duration) then 1 else 2 end AS complete_tag, 24 case when (emt.real_end_time &lt;= emt.end_time and emt.working_hours &lt;= emp.limit_duration) then 1 else 2 end AS complete_tag,
25 emt.picture_url AS pictureUrl, 25 emt.picture_url AS pictureUrl,
26 emt.equipment_id AS equipmentId, 26 emt.equipment_id AS equipmentId,
27 emt.results_enforcement AS resultsEnforcement, 27 emt.results_enforcement AS resultsEnforcement,
28 emp.plan_accepter_id AS planAccepterId, 28 emp.plan_accepter_id AS planAccepterId,
29 emp.plan_arranger_id, 29 emp.plan_arranger_id,
30 emt.device_administrator_id AS deviceAdministratorId, 30 emt.device_administrator_id AS deviceAdministratorId,
31 emp.cycle AS cycle, 31 emp.maintenance_type,
32 emp.cycle_unit AS cycleUnit 32 emp.cycle AS cycle,
33 emp.cycle_unit AS cycleUnit
33 FROM 34 FROM
34 equipment_maintain_task emt 35 equipment_maintain_task emt
35 LEFT JOIN equipment_maintain_plan emp ON emp.id=emt.plan_id 36 LEFT JOIN equipment_maintain_plan emp ON emp.id=emt.plan_id
...@@ -43,12 +44,12 @@ ...@@ -43,12 +44,12 @@
43 <if test="equipmentMaintainTask.getType==1 and equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!=''"> 44 <if test="equipmentMaintainTask.getType==1 and equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!=''">
44 AND emt.maintainer_id = #{equipmentMaintainTask.planArrangerId} 45 AND emt.maintainer_id = #{equipmentMaintainTask.planArrangerId}
45 </if> 46 </if>
46 <if test="equipmentMaintainTask.equipmentId !=null and equipmentMaintainTask.equipmentId !=''"> 47 <if test="equipmentMaintainTask.equipmentId !=null and equipmentMaintainTask.equipmentId !=''">
47 and emt.equipment_id=#{equipmentMaintainTask.equipmentId} 48 and emt.equipment_id=#{equipmentMaintainTask.equipmentId}
48 </if> 49 </if>
49 <if test="equipmentMaintainTask.equipmentName !=null and equipmentMaintainTask.equipmentName !=''"> 50 <if test="equipmentMaintainTask.equipmentName !=null and equipmentMaintainTask.equipmentName !=''">
50 and ei.equipment_name like concat('%',#{equipmentMaintainTask.equipmentName},'%') 51 and ei.equipment_name like concat('%',#{equipmentMaintainTask.equipmentName},'%')
51 </if> 52 </if>
52 <if test="equipmentMaintainTask.planId !=null and equipmentMaintainTask.planId !=''"> 53 <if test="equipmentMaintainTask.planId !=null and equipmentMaintainTask.planId !=''">
53 and emt.plan_id=#{equipmentMaintainTask.planId} 54 and emt.plan_id=#{equipmentMaintainTask.planId}
54 </if> 55 </if>
...@@ -56,23 +57,26 @@ ...@@ -56,23 +57,26 @@
56 and emt. depart_id=#{equipmentMaintainTask.departId} 57 and emt. depart_id=#{equipmentMaintainTask.departId}
57 </if> 58 </if>
58 <if test="equipmentMaintainTask.maintainPlanName !=null and equipmentMaintainTask.maintainPlanName !=''"> 59 <if test="equipmentMaintainTask.maintainPlanName !=null and equipmentMaintainTask.maintainPlanName !=''">
59 and emt. maintain_plan_name like concat('%',#{equipmentMaintainTask.maintainPlanName},'%') 60 and emt.maintain_plan_name like concat('%',#{equipmentMaintainTask.maintainPlanName},'%')
60 </if> 61 </if>
61 <if test="equipmentMaintainTask.maintainMode !=null and equipmentMaintainTask.maintainMode !=''"> 62 <if test="equipmentMaintainTask.maintainMode !=null and equipmentMaintainTask.maintainMode !=''">
62 and emt. maintain_mode=#{equipmentMaintainTask.maintainMode} 63 and emt.maintain_mode=#{equipmentMaintainTask.maintainMode}
63 </if> 64 </if>
64 <if test="equipmentMaintainTask.maintainLevel !=null and equipmentMaintainTask.maintainLevel !=''"> 65 <if test="equipmentMaintainTask.maintainLevel !=null and equipmentMaintainTask.maintainLevel !=''">
65 and emt. maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%') 66 and emt.maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%')
66 </if> 67 </if>
67 <if test="equipmentMaintainTask.maintainerId !=null and equipmentMaintainTask.maintainerId !=''"> 68 <if test="equipmentMaintainTask.maintainerId !=null and equipmentMaintainTask.maintainerId !=''">
68 and emt. maintainer_id=#{equipmentMaintainTask.maintainerId} 69 and emt.maintainer_id=#{equipmentMaintainTask.maintainerId}
70 </if>
71 <if test="equipmentMaintainTask.maintenanceType !=null and equipmentMaintainTask.maintenanceType !=''">
72 and emp.maintenance_type = #{equipmentMaintainTask.maintenanceType}
69 </if> 73 </if>
70 <if test="equipmentMaintainTask.taskStartTime !=null and equipmentMaintainTask.taskStartTime !=''"> 74 <if test="equipmentMaintainTask.taskStartTime !=null and equipmentMaintainTask.taskStartTime !=''">
71 and emt. real_end_time BETWEEN #{equipmentMaintainTask.taskStartTime} and 75 and emt.real_end_time BETWEEN #{equipmentMaintainTask.taskStartTime} and
72 #{equipmentMaintainTask.taskEndTime} 76 #{equipmentMaintainTask.taskEndTime}
73 </if> 77 </if>
74 <if test="equipmentMaintainTask.resultsEnforcement !=null and equipmentMaintainTask.resultsEnforcement !=''"> 78 <if test="equipmentMaintainTask.resultsEnforcement !=null and equipmentMaintainTask.resultsEnforcement !=''">
75 and emt. results_enforcement=#{equipmentMaintainTask.resultsEnforcement} 79 and emt.results_enforcement=#{equipmentMaintainTask.resultsEnforcement}
76 </if> 80 </if>
77 <if test="equipmentMaintainTask.maintainTime !=null "> 81 <if test="equipmentMaintainTask.maintainTime !=null ">
78 and #{equipmentMaintainTask.maintainTime}>= emt. maintain_time 82 and #{equipmentMaintainTask.maintainTime}>= emt. maintain_time
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!