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 @@
<module>sk-module-equipment</module>
<module>sk-module-biz</module>
<module>sk-module-alarm</module>
<module>sk-module-analysis</module>
<module>sk-module-analysis</module>
</modules>
<repositories>
......@@ -66,7 +66,7 @@
<aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version>
<aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
<kingtroldata.core.version>2.0.3</kingtroldata.core.version>
<kingtroldata.flow.version>2.0.4</kingtroldata.flow.version>
<kingtroldata.flow.version>2.0.6</kingtroldata.flow.version>
<flowable.version>6.4.2</flowable.version>
<log4j2.version>2.17.0</log4j2.version>
</properties>
......@@ -155,11 +155,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency> -->
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- commons -->
<dependency>
......
......@@ -101,7 +101,7 @@ spring:
driver-class-name: com.mysql.jdbc.Driver
# 多数据源配置
pg-db:
url: jdbc:postgresql://20.0.99.4:10086/postgres?useUnicode=true&characterEncoding=UTF8
url: jdbc:postgresql://112.123.135.140:10086/postgres?useUnicode=true&characterEncoding=UTF8
username: postgres
password: jkauto@123
driver-class-name: org.postgresql.Driver
......
......@@ -65,7 +65,6 @@ public class WorkAnalysisController {
}
endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比
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 ";
sql += getWorkProgressSql(departIds, startTime, endTime, month);
sql += " where d.depart_type =1 ";
......
package com.skua.modules.equipment.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -96,4 +98,9 @@ public class EquipmentMaintainTask {
@ApiModelProperty(value = "修改时间")
private Date updateTime;
private Integer delFlag;
@TableField(exist = false)
@ApiModelProperty(value = "维保类型")
@Dict(dicCode = "maintenance_type")
private String maintenanceType;
}
......
......@@ -24,9 +24,13 @@ public interface EquipmentMaintainPlanMapper extends BaseMapper<EquipmentMaintai
void addPlanStandard(@Param("id") String id, @Param("planId") String planId, @Param("standardId") String standardId);
void deletePlanStandard(@Param("planId") String planId);
void deletePlan(@Param("planId") String planId);
void deletePlan(@Param("planId") String planId);
void addPlanSparePart(@Param("id") String id, @Param("planId") String planId, @Param("sparePartId") String sparePartId, @Param("num") Integer num);
void deletePlanSparePart(@Param("planId") String planId);
void deletePlanSparePart(@Param("planId") String planId);
List<EquipmentMaintainPlanVO> queryCustomPageList(Page<EquipmentMaintainPlanVO> pageList, @Param("equipmentMaintainPlanDTO") EquipmentMaintainPlanDTO equipmentMaintainPlanDTO);
EquipmentMaintainPlanVO queryById(@Param("id") String id);
......
......@@ -35,36 +35,40 @@
<select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainPlanDTO"
resultType="com.skua.modules.equipment.vo.EquipmentMaintainPlanVO">
SELECT
emp.id AS id,
emp.depart_id,
(select depart_name from sys_depart where id=emp.depart_id) AS departName,
emp.plan_name AS planName,
(select equipment_name from equipment_info where id=epe.equipment_id) AS equipmentName,
CONCAT( emp.cycle, emp.cycle_unit ) AS cycle,
emp.start_time AS startTime,
emp.end_time AS endTime,
emp.plan_arranger_id,
(select realname from sys_user where id=emp.plan_arranger_id) AS planArrangerName,
emp.plan_accepter_id,
(select realname from sys_user where id=emp.plan_accepter_id) AS planAccepterName,
emp.release_status AS releaseStatus,
ems.maintenance_mode AS maintenanceMode,
ems.maintenance_level AS maintenanceLevel
emp.id AS id,
emp.depart_id,
emp.maintenance_type,
(select depart_name from sys_depart where id=emp.depart_id) AS departName,
emp.plan_name AS planName,
(select equipment_name from equipment_info where id=epe.equipment_id) AS equipmentName,
CONCAT( emp.cycle, emp.cycle_unit ) AS cycle,
emp.start_time AS startTime,
emp.end_time AS endTime,
emp.plan_arranger_id,
(select realname from sys_user where id=emp.plan_arranger_id) AS planArrangerName,
emp.plan_accepter_id,
(select realname from sys_user where id=emp.plan_accepter_id) AS planAccepterName,
emp.release_status AS releaseStatus,
ems.maintenance_mode AS maintenanceMode,
ems.maintenance_level AS maintenanceLevel
FROM
equipment_maintain_plan emp
equipment_maintain_plan emp
LEFT JOIN equipment_maintain_plan_equip epe ON epe.plan_id = emp.id
LEFT JOIN equipment_maintain_plan_standard eps ON eps.plan_id = emp.id
LEFT JOIN equipment_maintain_standard ems ON ems.id = eps.standard_id
<where>
emp.del_flag=0
<if test="equipmentMaintainPlanDTO.departId !=null and equipmentMaintainPlanDTO.departId !=''">
and emp.depart_id=#{equipmentMaintainPlanDTO.departId}
and emp.depart_id=#{equipmentMaintainPlanDTO.departId}
</if>
<if test="equipmentMaintainPlanDTO.planName !=null and equipmentMaintainPlanDTO.planName !=''">
and emp.plan_name like concat(concat('%', #{equipmentMaintainPlanDTO.planName}), '%')
and emp.plan_name like concat(concat('%', #{equipmentMaintainPlanDTO.planName}), '%')
</if>
<if test="equipmentMaintainPlanDTO.maintenanceType !=null and equipmentMaintainPlanDTO.maintenanceType !=''">
and emp.maintenance_type=#{equipmentMaintainPlanDTO.maintenanceType}
</if>
<if test="equipmentMaintainPlanDTO.planArrangerId !=null and equipmentMaintainPlanDTO.planArrangerId !=''">
and emp.plan_arranger_id = #{equipmentMaintainPlanDTO.planArrangerId}
and emp.plan_arranger_id = #{equipmentMaintainPlanDTO.planArrangerId}
</if>
GROUP BY emp.id
order by emp.create_time desc
......
......@@ -4,32 +4,33 @@
<select id="queryCustomPageList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainTaskDTO"
resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskVO">
SELECT
ei.equipment_name as equipmentName,
emt.id AS id ,
emt.downtime AS downtime,
emt.end_time AS endTime,
emt.start_time AS startTime,
emt.depart_id,
(select depart_name from sys_depart where id=emt.depart_id) AS depart_name,
emt.maintain_plan_name AS maintainPlanName,
emt.maintain_mode AS maintainMode,
emt.maintain_level AS maintainLevel,
emt.maintainer_id AS maintainerId,
(select realname from sys_user where id=emt.maintainer_id) AS maintainerName,
emt.maintain_time AS maintainTime,
emt.plan_id AS planId,
emt.real_start_time AS realStartTime,
emt.real_end_time AS realEndTime,
emt.working_hours AS workingHours,
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,
emt.picture_url AS pictureUrl,
emt.equipment_id AS equipmentId,
emt.results_enforcement AS resultsEnforcement,
emp.plan_accepter_id AS planAccepterId,
emp.plan_arranger_id,
emt.device_administrator_id AS deviceAdministratorId,
emp.cycle AS cycle,
emp.cycle_unit AS cycleUnit
ei.equipment_name as equipmentName,
emt.id AS id ,
emt.downtime AS downtime,
emt.end_time AS endTime,
emt.start_time AS startTime,
emt.depart_id,
(select depart_name from sys_depart where id=emt.depart_id) AS depart_name,
emt.maintain_plan_name AS maintainPlanName,
emt.maintain_mode AS maintainMode,
emt.maintain_level AS maintainLevel,
emt.maintainer_id AS maintainerId,
(select realname from sys_user where id=emt.maintainer_id) AS maintainerName,
emt.maintain_time AS maintainTime,
emt.plan_id AS planId,
emt.real_start_time AS realStartTime,
emt.real_end_time AS realEndTime,
emt.working_hours AS workingHours,
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,
emt.picture_url AS pictureUrl,
emt.equipment_id AS equipmentId,
emt.results_enforcement AS resultsEnforcement,
emp.plan_accepter_id AS planAccepterId,
emp.plan_arranger_id,
emt.device_administrator_id AS deviceAdministratorId,
emp.maintenance_type,
emp.cycle AS cycle,
emp.cycle_unit AS cycleUnit
FROM
equipment_maintain_task emt
LEFT JOIN equipment_maintain_plan emp ON emp.id=emt.plan_id
......@@ -43,12 +44,12 @@
<if test="equipmentMaintainTask.getType==1 and equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!=''">
AND emt.maintainer_id = #{equipmentMaintainTask.planArrangerId}
</if>
<if test="equipmentMaintainTask.equipmentId !=null and equipmentMaintainTask.equipmentId !=''">
and emt.equipment_id=#{equipmentMaintainTask.equipmentId}
</if>
<if test="equipmentMaintainTask.equipmentName !=null and equipmentMaintainTask.equipmentName !=''">
and ei.equipment_name like concat('%',#{equipmentMaintainTask.equipmentName},'%')
</if>
<if test="equipmentMaintainTask.equipmentId !=null and equipmentMaintainTask.equipmentId !=''">
and emt.equipment_id=#{equipmentMaintainTask.equipmentId}
</if>
<if test="equipmentMaintainTask.equipmentName !=null and equipmentMaintainTask.equipmentName !=''">
and ei.equipment_name like concat('%',#{equipmentMaintainTask.equipmentName},'%')
</if>
<if test="equipmentMaintainTask.planId !=null and equipmentMaintainTask.planId !=''">
and emt.plan_id=#{equipmentMaintainTask.planId}
</if>
......@@ -56,23 +57,26 @@
and emt. depart_id=#{equipmentMaintainTask.departId}
</if>
<if test="equipmentMaintainTask.maintainPlanName !=null and equipmentMaintainTask.maintainPlanName !=''">
and emt. maintain_plan_name like concat('%',#{equipmentMaintainTask.maintainPlanName},'%')
and emt.maintain_plan_name like concat('%',#{equipmentMaintainTask.maintainPlanName},'%')
</if>
<if test="equipmentMaintainTask.maintainMode !=null and equipmentMaintainTask.maintainMode !=''">
and emt. maintain_mode=#{equipmentMaintainTask.maintainMode}
and emt.maintain_mode=#{equipmentMaintainTask.maintainMode}
</if>
<if test="equipmentMaintainTask.maintainLevel !=null and equipmentMaintainTask.maintainLevel !=''">
and emt. maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%')
and emt.maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%')
</if>
<if test="equipmentMaintainTask.maintainerId !=null and equipmentMaintainTask.maintainerId !=''">
and emt. maintainer_id=#{equipmentMaintainTask.maintainerId}
and emt.maintainer_id=#{equipmentMaintainTask.maintainerId}
</if>
<if test="equipmentMaintainTask.maintenanceType !=null and equipmentMaintainTask.maintenanceType !=''">
and emp.maintenance_type = #{equipmentMaintainTask.maintenanceType}
</if>
<if test="equipmentMaintainTask.taskStartTime !=null and equipmentMaintainTask.taskStartTime !=''">
and emt. real_end_time BETWEEN #{equipmentMaintainTask.taskStartTime} and
and emt.real_end_time BETWEEN #{equipmentMaintainTask.taskStartTime} and
#{equipmentMaintainTask.taskEndTime}
</if>
<if test="equipmentMaintainTask.resultsEnforcement !=null and equipmentMaintainTask.resultsEnforcement !=''">
and emt. results_enforcement=#{equipmentMaintainTask.resultsEnforcement}
and emt.results_enforcement=#{equipmentMaintainTask.resultsEnforcement}
</if>
<if test="equipmentMaintainTask.maintainTime !=null ">
and #{equipmentMaintainTask.maintainTime}>= emt. maintain_time
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!