From 05b0a78ffa5a5aaa3fd95d5ea72dd0a70907b57c Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Thu, 18 Jan 2024 10:50:44 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E9=A3=8E=E9=99=A9=E9=9A=90=E6=82=A3?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E7=B3=BB=E7=BB=9F=E4=BB=A3=E7=A0=81=E8=BF=81?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/hiddenDanger/Constants.java | 66 +++++++ .../safeproduct/hiddenDanger/dto/HDPlanDTO.java | 27 +++ .../hiddenDanger/dto/HDTaskCheckItemDTO.java | 22 +++ .../safeproduct/hiddenDanger/dto/HDTaskDTO.java | 33 ++++ .../hiddenDanger/dto/PlanCheckItemDTO.java | 22 +++ .../hiddenDanger/entity/HDPlanEntity.java | 91 ++++++++++ .../hiddenDanger/entity/HDTaskCheckItemEntity.java | 84 +++++++++ .../hiddenDanger/entity/HDTaskEntity.java | 83 +++++++++ .../hiddenDanger/entity/PlanCheckItemEntity.java | 58 ++++++ .../hiddenDanger/schedule/XxlJobConstants.java | 8 + .../safeproduct/hiddenDanger/vo/HDPlanVO.java | 45 +++++ .../hiddenDanger/vo/HDTaskCheckItemVO.java | 32 ++++ .../safeproduct/hiddenDanger/vo/HDTaskVO.java | 44 +++++ .../hiddenDanger/vo/PlanCheckItemVO.java | 22 +++ .../hiddenDanger/wrapper/HDPlanWrapper.java | 37 ++++ .../wrapper/HDTaskCheckItemWrapper.java | 37 ++++ .../hiddenDanger/wrapper/HDTaskWrapper.java | 39 ++++ .../hiddenDanger/wrapper/PlanCheckItemWrapper.java | 26 +++ .../controller/HiddenDangerPlanController.java | 81 +++++++++ .../HiddenDangerTaskCheckItemController.java | 79 ++++++++ .../controller/HiddenDangerTaskController.java | 72 ++++++++ .../controller/PlanCheckItemController.java | 62 +++++++ .../mapper/HiddenDangerPlanMapper.java | 8 + .../hiddenDanger/mapper/HiddenDangerPlanMapper.xml | 5 + .../mapper/HiddenDangerTaskCheckItemMapper.java | 8 + .../mapper/HiddenDangerTaskMapper.java | 15 ++ .../hiddenDanger/mapper/HiddenDangerTaskMapper.xml | 13 ++ .../hiddenDanger/mapper/PlanCheckItemMapper.java | 15 ++ .../schedule/HiddenDangerPlanSchedule.java | 200 +++++++++++++++++++++ .../service/IHiddenDangerPlanService.java | 16 ++ .../service/IHiddenDangerTaskCheckItemService.java | 16 ++ .../service/IHiddenDangerTaskService.java | 32 ++++ .../service/IPlanCheckItemService.java | 13 ++ .../service/impl/HiddenDangerPlanServiceImpl.java | 73 ++++++++ .../impl/HiddenDangerTaskCheckItemService.java | 57 ++++++ .../service/impl/HiddenDangerTaskServiceImpl.java | 128 +++++++++++++ .../service/impl/PlanCheckItemServiceImpl.java | 53 ++++++ 37 files changed, 1722 insertions(+) create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDPlanDTO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskCheckItemDTO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskDTO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/PlanCheckItemDTO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDPlanEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskCheckItemEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/PlanCheckItemEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/XxlJobConstants.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDPlanVO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskCheckItemVO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskVO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/PlanCheckItemVO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDPlanWrapper.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskCheckItemWrapper.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskWrapper.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/PlanCheckItemWrapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerPlanController.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskCheckItemController.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskController.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/PlanCheckItemController.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskCheckItemMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/PlanCheckItemMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerPlanService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskCheckItemService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IPlanCheckItemService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskCheckItemService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskServiceImpl.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/PlanCheckItemServiceImpl.java diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java new file mode 100644 index 0000000..494e1fa --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java @@ -0,0 +1,66 @@ +package com.hnac.hzims.safeproduct.hiddenDanger; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springblade.core.log.exception.ServiceException; +import org.springframework.util.Assert; + +import java.util.Arrays; +import java.util.Optional; + +public interface Constants { + + @AllArgsConstructor + enum PlanStatusEnum { + NOT_START(0,"未开始"), + HAVE(1,"进行中"), + STOPPED(2,"已停止") + ; + @Getter + private final Integer status; + @Getter + private final String describe; + } + + @AllArgsConstructor + enum TaskStatusEnum { + NOT_START(0,"未开始"), + HAVE(1,"进行中"), + FINISH(2,"已完成"), + NON_FINISH(3,"未完成") + ; + @Getter + private Integer status; + @Getter + private String describe; + } + + @AllArgsConstructor + enum CycleEnum { + /**一天一次**/ + CYCLE_ONE("1",1,"day"), + /**一周一次**/ + CYCLE_TWO("2",1,"week"), + /**一月一次**/ + CYCLE_THREE("3",1,"month"), + /**一季一次**/ + CYCLE_FOUR("4",1,"quarter"), + /**一年一次**/ + CYCLE_FIVE("5",1,"year") + ; + @Getter + private String cycle; + @Getter + private int days; + @Getter + private String cycleType; + + public static CycleEnum getCycleEnumByCycle(String cycle) { + Optional cycleEnum = Arrays.stream(CycleEnum.class.getEnumConstants()).filter(e -> cycle.equals(e.getCycle())).findFirst(); + Assert.isTrue(cycleEnum.isPresent(),() -> { + throw new ServiceException("未找到对应的周期"); + }); + return cycleEnum.get(); + } + } +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDPlanDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDPlanDTO.java new file mode 100644 index 0000000..d66ff80 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDPlanDTO.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.dto; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName HDPlanDTO + * @description: + * @author: hx + * @create: 2023-09-19 11:29 + * @Version 4.0 + **/ +@EqualsAndHashCode +@ApiModel("隐患排查计划DTO") +@Data +public class HDPlanDTO extends HDPlanEntity implements Serializable { + + @ApiModelProperty("隐患排查计划排查项列表") + List checkItemDTOS; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskCheckItemDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskCheckItemDTO.java new file mode 100644 index 0000000..3300c9a --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskCheckItemDTO.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.dto; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @ClassName HDTaskCheckItemDTO + * @description: + * @author: hx + * @create: 2023-09-19 20:26 + * @Version 4.0 + **/ +@EqualsAndHashCode +@Data +@ApiModel("隐患任务排查项DTO") +public class HDTaskCheckItemDTO extends HDTaskCheckItemEntity implements Serializable { + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskDTO.java new file mode 100644 index 0000000..52af5ff --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/HDTaskDTO.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.dto; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @ClassName HDTaskDTO + * @description: + * @author: hx + * @create: 2023-09-19 15:57 + * @Version 4.0 + **/ +@ApiModel("隐患排查任务DTO") +@Data +@EqualsAndHashCode +public class HDTaskDTO extends HDTaskEntity implements Serializable { + + @ApiModelProperty("年月") + private String yearMonth; + + @ApiModelProperty("开始时间") + private LocalDateTime taskStartTime; + + @ApiModelProperty("结束时间") + private LocalDateTime taskEndTime; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/PlanCheckItemDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/PlanCheckItemDTO.java new file mode 100644 index 0000000..5eac642 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/dto/PlanCheckItemDTO.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.dto; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @ClassName PlanCheckItemDTO + * @description: + * @author: hx + * @create: 2023-10-07 14:01 + * @Version 4.0 + **/ +@Data +@ApiModel("隐患排查计划排查项DTO") +@EqualsAndHashCode +public class PlanCheckItemDTO extends PlanCheckItemEntity implements Serializable { + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDPlanEntity.java new file mode 100644 index 0000000..8c63818 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDPlanEntity.java @@ -0,0 +1,91 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @ClassName HDPlanEntity + * @description: + * @author: hx + * @create: 2023-09-19 10:51 + * @Version 4.0 + **/ +@Data +@ApiModel("隐患计划") +@EqualsAndHashCode +@TableName("hzims_hidden_danger_plan") +public class HDPlanEntity extends TenantEntity implements Serializable { + + @ApiModelProperty(value = "计划名称",required = true) + @QueryField(condition = SqlCondition.LIKE) + @NotNull + private String planName; + + @ApiModelProperty(value = "站点编号",required = true) + @QueryField(condition = SqlCondition.LIKE) + @NotNull + private String stationCode; + + @ApiModelProperty(value = "排查类型,字典:hd_check_type",required = true) + @QueryField(condition = SqlCondition.EQUAL) + private String checkType; + + @JsonFormat(pattern = DateUtil.PATTERN_DATE) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATE) + @ApiModelProperty(value = "排查日期(开始日期)",required = true) + @QueryField(condition = SqlCondition.EQUAL) + private LocalDate checkStartDate; + + @JsonFormat(pattern = DateUtil.PATTERN_DATE) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATE) + @ApiModelProperty(value = "排查日期(结束日期)",required = true) + @QueryField(condition = SqlCondition.EQUAL) + private LocalDate checkEndDate; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查周期,字典:hd_check_cycle") + private String cycle; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查风险点ID") + private Long categoryId; + + @QueryField(condition = SqlCondition.LIKE) + @ApiModelProperty(value = "排查风险点名称") + private String categoryName; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "计划类型:1为定时计划,2为临时计划,字典:hd_plan_type") + private String planType; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "是否启用:0为停用,1为启用") + private Boolean enable; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查人员ID") + private Long checkUserId; + + /**计划近期生成任务最后时间**/ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private LocalDateTime lastGenerateTaskTime; + + /**下一次任务生成时间**/ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private LocalDateTime nextGenerateTaskTime; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskCheckItemEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskCheckItemEntity.java new file mode 100644 index 0000000..64d045e --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskCheckItemEntity.java @@ -0,0 +1,84 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @ClassName HDTaskCheckItemEntity + * @description: + * @author: hx + * @create: 2023-09-19 20:06 + * @Version 4.0 + **/ +@Data +@ApiModel("隐患任务排查项") +@EqualsAndHashCode +@TableName("hzims_hidden_danger_task_item") +public class HDTaskCheckItemEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("隐患排查任务ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long taskId; + + @ApiModelProperty("风险点ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long categoryId; + + @ApiModelProperty("风险点名称") + @QueryField(condition = SqlCondition.LIKE) + private String categoryName; + + @ApiModelProperty("风险点类型") + @QueryField(condition = SqlCondition.EQUAL) + private String riskType; + + @ApiModelProperty("检查项ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long checkItemId; + + @ApiModelProperty("检查项") + @QueryField(condition = SqlCondition.LIKE) + private String checkItemName; + + @ApiModelProperty("区域/位置ID") + private String areaId; + + @ApiModelProperty("区域/位置") + private String areaName; + + @ApiModelProperty("上传附件") + private String attachment; + + @ApiModelProperty("排查备注") + private String remark; + + @ApiModelProperty(value = "事故诱因") + @QueryField(condition = SqlCondition.LIKE) + private String accidentIncentive; + + @ApiModelProperty(value = "导致后果") + @QueryField(condition = SqlCondition.LIKE) + private String causeConsequence; + + @ApiModelProperty("排查人ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long checkUserId; + + @ApiModelProperty("排查时间") + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + private LocalDateTime checkTime; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskEntity.java new file mode 100644 index 0000000..a70b534 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/HDTaskEntity.java @@ -0,0 +1,83 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @ClassName HDTaskEntity + * @description: + * @author: hx + * @create: 2023-09-19 15:32 + * @Version 4.0 + **/ +@Data +@ApiModel("隐患任务") +@EqualsAndHashCode +@TableName("hzims_hidden_danger_task") +public class HDTaskEntity extends TenantEntity implements Serializable { + + @ApiModelProperty(value = "隐患排查计划ID",required = true) + private Long planId; + + @ApiModelProperty(value = "隐患排查计划名称",required = true) + @QueryField(condition = SqlCondition.LIKE) + private String planName; + + @ApiModelProperty(value = "站点编号",required = true) + @QueryField(condition = SqlCondition.LIKE) + @NotNull + private String stationCode; + + @ApiModelProperty("风险点类别") + private Integer categoryType; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查风险点ID") + private Long categoryId; + + @QueryField(condition = SqlCondition.LIKE) + @ApiModelProperty(value = "排查风险点名称") + private String categoryName; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "计划类型:1为定时计划,2为临时计划,字典:hd_plan_type") + private String planType; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查周期,字典:hd_check_cycle") + private String cycle; + + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "开始时间",required = true) + @QueryField(condition = SqlCondition.EQUAL) + private LocalDateTime startTime; + + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "结束时间",required = true) + @QueryField(condition = SqlCondition.EQUAL) + private LocalDateTime endTime; + + @ApiModelProperty("流程ID") + @QueryField(condition = SqlCondition.EQUAL) + private String processInstanceId; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty(value = "排查人员ID") + private Long checkUserId; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/PlanCheckItemEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/PlanCheckItemEntity.java new file mode 100644 index 0000000..fca0157 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/entity/PlanCheckItemEntity.java @@ -0,0 +1,58 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.io.Serializable; + +@ApiModel("计划风险排查项") +@Data +@EqualsAndHashCode +@TableName("hzims_hidden_danger_plan_item") +public class PlanCheckItemEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("隐患排查任务ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long planId; + + @ApiModelProperty("区域/位置ID") + private String areaId; + + @ApiModelProperty("区域/位置") + private String areaName; + + @ApiModelProperty("风险点ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long categoryId; + + @ApiModelProperty("风险点名称") + @QueryField(condition = SqlCondition.LIKE) + private String categoryName; + + @ApiModelProperty("风险点类型") + @QueryField(condition = SqlCondition.EQUAL) + private String riskType; + + @ApiModelProperty("检查项ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long checkItemId; + + @ApiModelProperty("检查项") + @QueryField(condition = SqlCondition.LIKE) + private String checkItemName; + + @ApiModelProperty(value = "事故诱因") + @QueryField(condition = SqlCondition.LIKE) + private String accidentIncentive; + + @ApiModelProperty(value = "导致后果") + @QueryField(condition = SqlCondition.LIKE) + private String causeConsequence; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/XxlJobConstants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/XxlJobConstants.java new file mode 100644 index 0000000..f7dc6e1 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/XxlJobConstants.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.schedule; + +public interface XxlJobConstants { + + /**根据隐患排查计划生成任务**/ + String GENERATE_HD_TASK_BY_PLAN = "generateHDTaskByPlan"; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDPlanVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDPlanVO.java new file mode 100644 index 0000000..a5bf361 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDPlanVO.java @@ -0,0 +1,45 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.vo; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName HDPlanVO + * @description: + * @author: hx + * @create: 2023-09-19 11:31 + * @Version 4.0 + **/ +@Data +@Api("隐患排查计划VO") +@EqualsAndHashCode +public class HDPlanVO extends HDPlanEntity implements Serializable { + + @ApiModelProperty("创建人名称") + private String creatorName; + + @ApiModelProperty("更新人名称") + private String updateUserName; + + @ApiModelProperty("排查类型名称") + private String checkTypeName; + + @ApiModelProperty("排查周期名称") + private String cycleName; + + @ApiModelProperty("计划类型名称") + private String planTypeName; + + @ApiModelProperty("排查人名称") + private String checkUserName; + + @ApiModelProperty("隐患排查计划排查项列表") + List checkItemVOS; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskCheckItemVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskCheckItemVO.java new file mode 100644 index 0000000..3dca3b5 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskCheckItemVO.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.vo; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @ClassName HDTaskCheckItemVO + * @description: + * @author: hx + * @create: 2023-09-19 20:27 + * @Version 4.0 + **/ +@EqualsAndHashCode +@Data +@ApiModel("隐患任务排查项VO") +public class HDTaskCheckItemVO extends HDTaskCheckItemEntity implements Serializable { + + @ApiModelProperty("创建人名称") + private String creatorName; + + @ApiModelProperty("更新人名称") + private String updateUserName; + + @ApiModelProperty("排查人名称") + private String checkUserName; + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskVO.java new file mode 100644 index 0000000..7dc5597 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/HDTaskVO.java @@ -0,0 +1,44 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.vo; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName HDTaskVO + * @description: + * @author: hx + * @create: 2023-09-19 15:58 + * @Version 4.0 + **/ +@ApiModel("隐患排查任务VO") +@Data +@EqualsAndHashCode +public class HDTaskVO extends HDTaskEntity implements Serializable { + + @ApiModelProperty("创建人名称") + private String creatorName; + + @ApiModelProperty("更新人名称") + private String updateUserName; + + @ApiModelProperty("排查周期名称") + private String cycleName; + + @ApiModelProperty("计划类型名称") + private String planTypeName; + + @ApiModelProperty("排查人名称") + private String checkUserName; + + @ApiModelProperty("是否异常") + private Boolean isAbnormal = false; + + @ApiModelProperty("隐患任务排查项列表") + private List checkItemVOList; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/PlanCheckItemVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/PlanCheckItemVO.java new file mode 100644 index 0000000..214aaec --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/vo/PlanCheckItemVO.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.vo; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @ClassName PlanCheckItemVO + * @description: + * @author: hx + * @create: 2023-10-07 14:01 + * @Version 4.0 + **/ +@Data +@ApiModel("隐患排查计划排查项VO") +@EqualsAndHashCode +public class PlanCheckItemVO extends PlanCheckItemEntity implements Serializable { + +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDPlanWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDPlanWrapper.java new file mode 100644 index 0000000..82930c6 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDPlanWrapper.java @@ -0,0 +1,37 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.wrapper; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDPlanVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.DictCache; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; + +import java.util.Optional; + +/** + * @ClassName HDPlanWrapper + * @description: + * @author: hx + * @create: 2023-09-19 13:50 + * @Version 4.0 + **/ +public class HDPlanWrapper extends BaseEntityWrapper { + + public static HDPlanWrapper build() { + return new HDPlanWrapper(); + } + + @Override + public HDPlanVO entityVO(HDPlanEntity entity) { + HDPlanVO planVO = BeanUtil.copy(entity,HDPlanVO.class); + planVO.setCreatorName(Optional.ofNullable(entity.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + planVO.setUpdateUserName(Optional.ofNullable(entity.getUpdateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + planVO.setCheckUserName(Optional.ofNullable(entity.getCheckUserId()).map(UserCache::getUser).map(User::getName).orElse(null)); + planVO.setCheckTypeName(Optional.ofNullable(entity.getCheckType()).map(dictKey -> DictCache.getValue("hd_check_type",dictKey)).orElse(null)); + planVO.setCycleName(Optional.ofNullable(entity.getCycle()).map(dictKey -> DictCache.getValue("hd_check_cycle",dictKey)).orElse(null)); + planVO.setPlanTypeName(Optional.ofNullable(entity.getPlanType()).map(dictKey -> DictCache.getValue("hd_plan_type",dictKey)).orElse(null)); + return planVO; + } +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskCheckItemWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskCheckItemWrapper.java new file mode 100644 index 0000000..71d6d87 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskCheckItemWrapper.java @@ -0,0 +1,37 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.wrapper; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskCheckItemVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; + +import java.util.Optional; + +/** + * @ClassName HDTaskCheckItemWrapper + * @description: + * @author: hx + * @create: 2023-09-19 20:28 + * @Version 4.0 + **/ + +public class HDTaskCheckItemWrapper extends BaseEntityWrapper { + + public static HDTaskCheckItemWrapper build() { + return new HDTaskCheckItemWrapper(); + } + + @Override + public HDTaskCheckItemVO entityVO(HDTaskCheckItemEntity entity) { + HDTaskCheckItemVO checkItemVO = BeanUtil.copy(entity,HDTaskCheckItemVO.class); + + checkItemVO.setCreatorName(Optional.ofNullable(entity.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + checkItemVO.setUpdateUserName(Optional.ofNullable(entity.getUpdateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + if(entity.getCheckUserId()!=null) { + checkItemVO.setCheckUserName(UserCache.getUser(entity.getCheckUserId()).getName()); + } + return checkItemVO; + } +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskWrapper.java new file mode 100644 index 0000000..5164522 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/HDTaskWrapper.java @@ -0,0 +1,39 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.wrapper; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.DictCache; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; + +import java.util.Optional; + +/** + * @ClassName HDTaskWrapper + * @description: + * @author: hx + * @create: 2023-09-19 15:59 + * @Version 4.0 + **/ +public class HDTaskWrapper extends BaseEntityWrapper { + + public static HDTaskWrapper build() { + return new HDTaskWrapper(); + } + + @Override + public HDTaskVO entityVO(HDTaskEntity entity) { + if(entity == null){ + return null; + } + HDTaskVO taskVO = BeanUtil.copy(entity,HDTaskVO.class); + taskVO.setCreatorName(Optional.ofNullable(entity.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + taskVO.setUpdateUserName(Optional.ofNullable(entity.getUpdateUser()).map(UserCache::getUser).map(User::getName).orElse(null)); + taskVO.setCheckUserName(Optional.ofNullable(entity.getCheckUserId()).map(UserCache::getUser).map(User::getName).orElse(null)); + taskVO.setCycleName(Optional.ofNullable(entity.getCycle()).map(dictKey -> DictCache.getValue("hd_check_cycle",dictKey)).orElse(null)); + taskVO.setPlanTypeName(Optional.ofNullable(entity.getPlanType()).map(dictKey -> DictCache.getValue("hd_plan_type",dictKey)).orElse(null)); + return taskVO; + } +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/PlanCheckItemWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/PlanCheckItemWrapper.java new file mode 100644 index 0000000..70569cf --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/wrapper/PlanCheckItemWrapper.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.wrapper; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.PlanCheckItemVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +/** + * @ClassName PlanCheckItemWrapper + * @description: + * @author: hx + * @create: 2023-10-07 14:05 + * @Version 4.0 + **/ +public class PlanCheckItemWrapper extends BaseEntityWrapper { + + public static PlanCheckItemWrapper build() { + return new PlanCheckItemWrapper(); + } + + @Override + public PlanCheckItemVO entityVO(PlanCheckItemEntity entity) { + PlanCheckItemVO vo = BeanUtil.copy(entity,PlanCheckItemVO.class); + return vo; + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerPlanController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerPlanController.java new file mode 100644 index 0000000..2a41607 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerPlanController.java @@ -0,0 +1,81 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDPlanDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.schedule.HiddenDangerPlanSchedule; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerPlanService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDPlanVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.HDPlanWrapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.web.bind.annotation.*; + +import java.io.Serializable; + +/** + * @ClassName HDPlanController + * @description: + * @author: hx + * @create: 2023-09-19 11:34 + * @Version 4.0 + **/ +@RestController +@RequestMapping("/hiddenDanger/plan") +@Api(value = "隐患计划管理",tags = "隐患计划管理") +@AllArgsConstructor +public class HiddenDangerPlanController extends BladeController implements Serializable { + + private final IHiddenDangerPlanService hdPlanService; + private final HiddenDangerPlanSchedule planSchedule; + + @GetMapping("/page") + @ApiOperation("分页查询") + @ApiOperationSupport(order = 1) + public R> page(HDPlanDTO request, Query query) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(HDPlanEntity.class, BeanUtil.copy(request, HDPlanEntity.class)); + queryWrapper.orderByDesc(HDPlanEntity::getCreateTime); + IPage page = hdPlanService.page(Condition.getPage(query),queryWrapper); + page.setRecords(HDPlanWrapper.build().listVO(page.getRecords())); + return R.data(page); + } + + @GetMapping("/detail/{id}") + @ApiOperation("查询详情") + @ApiOperationSupport(order = 2) + public R detail(@PathVariable @ApiParam("主键ID") Long id) { + return R.data(hdPlanService.detail(id)); + } + + @PutMapping("/updateById") + @ApiOperation("根据ID编辑隐患排查计划") + @ApiOperationSupport(order = 3) + public R updateById(@RequestBody HDPlanDTO request) { + return R.status(hdPlanService.doUpdate(request)); + } + + @PostMapping("/save") + @ApiOperation("新增隐患排查计划") + @ApiOperationSupport(order = 4) + public R save(@RequestBody HDPlanDTO request) { + return R.status(hdPlanService.doSave(request)); + } + + @PostMapping("/generateTask") + @ApiOperation("生成隐患排查任务") + @ApiOperationSupport(order = 5) + public R generateTask() { + planSchedule.generateTask(null); + return R.success("操作成功!"); + } + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskCheckItemController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskCheckItemController.java new file mode 100644 index 0000000..bf7df6d --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskCheckItemController.java @@ -0,0 +1,79 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskCheckItemVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.HDTaskCheckItemWrapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.web.bind.annotation.*; + +/** + * @ClassName HDTaskCheckItemController + * @description: + * @author: hx + * @create: 2023-09-19 20:39 + * @Version 4.0 + **/ +@RestController +@RequestMapping("/hiddenDanger/task/checkItem") +@Api(value = "隐患任务排查项管理",tags = "隐患任务排查项管理") +@AllArgsConstructor +public class HiddenDangerTaskCheckItemController extends BladeController { + + private final IHiddenDangerTaskCheckItemService hdTaskCheckItemService; + + @GetMapping("/page") + @ApiOperation("分页查询") + @ApiOperationSupport(order = 1) + public R> page(HDTaskCheckItemDTO request, Query query) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(HDTaskCheckItemEntity.class, BeanUtil.copy(request, HDTaskCheckItemEntity.class)); + queryWrapper.orderByAsc(HDTaskCheckItemEntity::getAreaName).orderByAsc(HDTaskCheckItemEntity::getCategoryName).orderByAsc(HDTaskCheckItemEntity::getCheckItemName); + IPage page = hdTaskCheckItemService.page(Condition.getPage(query),queryWrapper); + page.setRecords(HDTaskCheckItemWrapper.build().listVO(page.getRecords())); + return R.data(page); + } + + @GetMapping("/detail/{id}") + @ApiOperation("查询详情") + @ApiOperationSupport(order = 2) + public R detail(@PathVariable @ApiParam("主键ID") Long id) { + HDTaskCheckItemEntity Task = hdTaskCheckItemService.getById(id); + return R.data(HDTaskCheckItemWrapper.build().entityVO(Task)); + } + + @PutMapping("/updateById") + @ApiOperation("根据ID编辑隐患排查计划") + @ApiOperationSupport(order = 3) + public R updateById(@RequestBody HDTaskCheckItemDTO request) { + HDTaskCheckItemEntity Task = BeanUtil.copy(request, HDTaskCheckItemEntity.class); + return R.status(hdTaskCheckItemService.updateById(Task)); + } + + @PostMapping("/save") + @ApiOperation("新增隐患排查计划") + @ApiOperationSupport(order = 4) + public R save(@RequestBody HDTaskCheckItemDTO request) { + HDTaskCheckItemEntity Task = BeanUtil.copy(request, HDTaskCheckItemEntity.class); + return R.status(hdTaskCheckItemService.save(Task)); + } + + @PostMapping("/troubleshooting") + @ApiOperation("执行排查项") + @ApiOperationSupport(order = 5) + public R troubleshooting(@RequestBody HDTaskCheckItemDTO req) { + return R.status(hdTaskCheckItemService.troubleshooting(req)); + } + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskController.java new file mode 100644 index 0000000..e700907 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/HiddenDangerTaskController.java @@ -0,0 +1,72 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.web.bind.annotation.*; + +import java.io.Serializable; + +/** + * @ClassName HDTaskController + * @description: + * @author: hx + * @create: 2023-09-19 16:03 + * @Version 4.0 + **/ +@RestController +@RequestMapping("/hiddenDanger/task") +@Api(value = "隐患任务管理",tags = "隐患任务管理") +@AllArgsConstructor +public class HiddenDangerTaskController extends BladeController implements Serializable { + + private final IHiddenDangerTaskService hdTaskService; + + @GetMapping("/page") + @ApiOperation("分页查询") + @ApiOperationSupport(order = 1) + public R> page(HDTaskDTO request, Query query) { + return R.data(hdTaskService.page(request,query)); + } + + @GetMapping("/detail/{id}") + @ApiOperation("查询详情") + @ApiOperationSupport(order = 2) + public R detail(@PathVariable @ApiParam("主键ID") Long id) { + return R.data(hdTaskService.detail(id)); + } + + @PutMapping("/updateById") + @ApiOperation("根据ID编辑隐患排查计划") + @ApiOperationSupport(order = 3) + public R updateById(@RequestBody HDTaskDTO request) { + HDTaskEntity Task = BeanUtil.copy(request, HDTaskEntity.class); + return R.status(hdTaskService.updateById(Task)); + } + + @PostMapping("/save") + @ApiOperation("新增隐患排查计划") + @ApiOperationSupport(order = 4) + public R save(@RequestBody HDTaskDTO request) { + HDTaskEntity Task = BeanUtil.copy(request, HDTaskEntity.class); + return R.status(hdTaskService.save(Task)); + } + + @GetMapping("/finishTask") + @ApiOperation("完成隐患排查任务") + @ApiOperationSupport(order = 5) + public R finishTask(@RequestParam @ApiParam("任务ID") Long taskId) { + return R.status(hdTaskService.finishTask(taskId)); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/PlanCheckItemController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/PlanCheckItemController.java new file mode 100644 index 0000000..5e5a914 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/controller/PlanCheckItemController.java @@ -0,0 +1,62 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.PlanCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IPlanCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.PlanCheckItemVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.PlanCheckItemWrapper; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.web.bind.annotation.*; + +@RestController +@AllArgsConstructor +@RequestMapping("/hdPlan/checkItem") +public class PlanCheckItemController extends BladeController { + + private final IPlanCheckItemService planCheckItemService; + + @GetMapping("/page") + @ApiOperation("分页查询") + @ApiOperationSupport(order = 1) + public R> page(PlanCheckItemDTO request, Query query) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(PlanCheckItemEntity.class, BeanUtil.copy(request, PlanCheckItemEntity.class)); + queryWrapper.orderByAsc(PlanCheckItemEntity::getAreaName).orderByAsc(PlanCheckItemEntity::getCategoryName).orderByAsc(PlanCheckItemEntity::getCheckItemName); + IPage page = planCheckItemService.page(Condition.getPage(query),queryWrapper); + page.setRecords(PlanCheckItemWrapper.build().listVO(page.getRecords())); + return R.data(page); + } + + @GetMapping("/detail/{id}") + @ApiOperation("查询详情") + @ApiOperationSupport(order = 2) + public R detail(@PathVariable @ApiParam("主键ID") Long id) { + return R.data(PlanCheckItemWrapper.build().entityVO(planCheckItemService.getById(id))); + } + + @PutMapping("/updateById") + @ApiOperation("根据ID编辑隐患排查计划") + @ApiOperationSupport(order = 3) + public R updateById(@RequestBody PlanCheckItemDTO request) { + PlanCheckItemEntity Task = BeanUtil.copy(request, PlanCheckItemEntity.class); + return R.status(planCheckItemService.updateById(Task)); + } + + @PostMapping("/save") + @ApiOperation("新增隐患排查计划") + @ApiOperationSupport(order = 4) + public R save(@RequestBody PlanCheckItemDTO request) { + PlanCheckItemEntity Task = BeanUtil.copy(request, PlanCheckItemEntity.class); + return R.status(planCheckItemService.save(Task)); + } + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.java new file mode 100644 index 0000000..74eba90 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.mapper; + +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +public interface HiddenDangerPlanMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.xml new file mode 100644 index 0000000..4a8ebf9 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerPlanMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskCheckItemMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskCheckItemMapper.java new file mode 100644 index 0000000..d149eae --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskCheckItemMapper.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; + +public interface HiddenDangerTaskCheckItemMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.java new file mode 100644 index 0000000..1b32040 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.statistic.vo.RiskDangerAccidentMonthCountVO; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; + +public interface HiddenDangerTaskMapper extends UserDataScopeBaseMapper { + + List getDangerMonthTrend(@Param("ew") QueryWrapper ew); + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.xml new file mode 100644 index 0000000..53dba82 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/HiddenDangerTaskMapper.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/PlanCheckItemMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/PlanCheckItemMapper.java new file mode 100644 index 0000000..53e1a3e --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/mapper/PlanCheckItemMapper.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; + +/** + * @ClassName PlanCheckItemMapper + * @description: + * @author: hx + * @create: 2023-10-07 14:34 + * @Version 4.0 + **/ +public interface PlanCheckItemMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java new file mode 100644 index 0000000..6f1aa37 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java @@ -0,0 +1,200 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.schedule; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.hnac.hzims.safeproduct.hiddenDanger.Constants; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerPlanService; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskService; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IPlanCheckItemService; +import com.hnac.hzims.safeproduct.risk.entity.HazardCategory; +import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService; +import com.hnac.hzims.safeproduct.risk.service.HazardSourceService; +import com.hnac.hzims.safeproduct.risk.service.IRiskCheckService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.*; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import static com.hnac.hzims.safeproduct.hiddenDanger.schedule.XxlJobConstants.GENERATE_HD_TASK_BY_PLAN; + +/** + * @ClassName HDPlanSchedule + * @description: + * @author: hx + * @create: 2023-09-19 16:10 + * @Version 4.0 + **/ +@Component +@AllArgsConstructor +@Slf4j +public class HiddenDangerPlanSchedule { + + private final IHiddenDangerPlanService hdPlanService; + private final IHiddenDangerTaskService hdTaskService; + private final IRiskCheckService riskCheckService; + private final HazardSourceService hazardSourceService; + private final IHiddenDangerTaskCheckItemService taskCheckItemService; + private final IPlanCheckItemService planCheckItemService; + private final HazardCategoryService hazardCategoryService; + + /** + * 生成任务 + * @param params 生成任务日期 + * @return 工作流ID + */ + @XxlJob(GENERATE_HD_TASK_BY_PLAN) + public ReturnT generateTask(String params) { + LocalDate currentDate = StringUtil.isNoneBlank(params) ? LocalDate.parse(params, DateUtil.DATE_FORMATTER) : LocalDate.now(); + // 处理未开始的计划 + // this.dealNonStartPlan(currentDate); + // 将结束日期在当前日期之前的计划置为已停止 + this.stopHDPlan(currentDate); + // 查找出当天有任务生成的计划 + List generateTaskPlans = this.getGenerateTaskPlanList(currentDate); + if(CollectionUtil.isEmpty(generateTaskPlans)) { + return ReturnT.SUCCESS; + } + // 生成任务 + this.generateTask(generateTaskPlans,currentDate); + generateTaskPlans.forEach(plan -> { + plan.setLastGenerateTaskTime(LocalDateTime.now()); + Constants.CycleEnum cycleEnumByCycle = Constants.CycleEnum.getCycleEnumByCycle(plan.getCycle()); + plan.setNextGenerateTaskTime(HiddenDangerPlanSchedule.plusDateTime(LocalDateTime.of(currentDate,LocalTime.MIN),cycleEnumByCycle.getCycleType(),cycleEnumByCycle.getDays())); + plan.setStatus(Constants.PlanStatusEnum.HAVE.getStatus()); + }); + hdPlanService.updateBatchById(generateTaskPlans); + return ReturnT.SUCCESS; + } + + /** + * 处理未开始计划 + * @param currentDate + */ + public void dealNonStartPlan(LocalDate currentDate) { + LambdaUpdateWrapper queryWrapper = Wrappers.lambdaUpdate() + .set(HDPlanEntity::getStatus,Constants.PlanStatusEnum.HAVE.getStatus()) + .le(HDPlanEntity::getCheckStartDate,currentDate) + .ge(HDPlanEntity::getCheckEndDate,currentDate) + .eq(HDPlanEntity::getEnable,true) + .eq(HDPlanEntity::getStatus,Constants.PlanStatusEnum.NOT_START.getStatus()); + hdPlanService.update(queryWrapper); + } + + /** + * 变更已结束的隐患计划的状态 + * @param currentDate 日期 + */ + private void stopHDPlan(LocalDate currentDate) { + LambdaUpdateWrapper queryWrapper = Wrappers.lambdaUpdate() + .set(HDPlanEntity::getStatus, Constants.PlanStatusEnum.STOPPED.getStatus()) + .eq(HDPlanEntity::getEnable,true) + .lt(HDPlanEntity::getCheckEndDate, currentDate); + hdPlanService.update(queryWrapper); + } + + /** + * 获取待生成任务的计划 + * @param currentDate 日期 + * @return 待生成任务的计划 + */ + private List getGenerateTaskPlanList(LocalDate currentDate) { + List result = Lists.newArrayList(); + // 未生成任务的计划 + List noTaskPlanList = hdPlanService.list(Wrappers.lambdaQuery() + .eq(HDPlanEntity::getStatus, Constants.PlanStatusEnum.NOT_START.getStatus()) + .eq(HDPlanEntity::getEnable,true) + ); + if(CollectionUtil.isNotEmpty(noTaskPlanList)) { + result.addAll(noTaskPlanList); + } + // 已经生成过任务的计划 + List existTaskPlanList = hdPlanService.list(Wrappers.lambdaQuery() + .eq(HDPlanEntity::getStatus, Constants.PlanStatusEnum.HAVE.getStatus()) + .eq(HDPlanEntity::getNextGenerateTaskTime,LocalDateTime.of(currentDate,LocalTime.MIN)) + .eq(HDPlanEntity::getEnable,true) + ); + if(CollectionUtil.isNotEmpty(existTaskPlanList)) { + result.addAll(existTaskPlanList); + } + return result; + } + + /** + * 生成任务 + * @param planList 计划列表 + */ + private void generateTask(List planList,LocalDate currentDate) { + List taskList = planList.stream().map(plan -> BeanUtil.copy(plan, HDTaskEntity.class)).peek(task -> { + task.setPlanId(task.getId()); + task.setId(null); + task.setCreateTime(null); + task.setUpdateTime(null); + // 设置计划开始结束时间 + task.setStartTime(LocalDateTime.of(currentDate, LocalTime.MIN)); + task.setCategoryType(Optional.ofNullable(hazardCategoryService.getById(task.getCategoryId())).map(HazardCategory::getCategory).orElse(null)); + Constants.CycleEnum cycleEnumByCycle = Constants.CycleEnum.getCycleEnumByCycle(task.getCycle()); + task.setEndTime(HiddenDangerPlanSchedule.plusDateTime(LocalDateTime.of(currentDate,LocalTime.MIN),cycleEnumByCycle.getCycleType(),cycleEnumByCycle.getDays())); + task.setStatus(Constants.TaskStatusEnum.HAVE.getStatus()); + }).collect(Collectors.toList()); + hdTaskService.saveBatch(taskList); + // 保存隐患任务的风险排查项 + List riskCheckEntityList = Lists.newArrayList(); + taskList.forEach(task -> { + List planCheckItemList = planCheckItemService.list(Wrappers.lambdaQuery().eq(PlanCheckItemEntity::getPlanId, task.getPlanId())); + List checkItemList = planCheckItemList.stream().map(check -> { + HDTaskCheckItemEntity taskCheckItem = BeanUtil.copy(check, HDTaskCheckItemEntity.class); + taskCheckItem.setId(null); + taskCheckItem.setCreateTime(null); + taskCheckItem.setUpdateTime(null); + taskCheckItem.setStatus(null); + taskCheckItem.setTaskId(task.getId()); + taskCheckItem.setCreateUser(task.getCreateUser()); + taskCheckItem.setUpdateUser(task.getUpdateUser()); + taskCheckItem.setCreateDept(task.getCreateDept()); + return taskCheckItem; + }).collect(Collectors.toList()); + riskCheckEntityList.addAll(checkItemList); + }); + taskCheckItemService.saveBatch(riskCheckEntityList); + taskCheckItemService.update(Wrappers.lambdaUpdate().set(HDTaskCheckItemEntity::getStatus,null).in(HDTaskCheckItemEntity::getId,riskCheckEntityList.stream().map(HDTaskCheckItemEntity::getId).filter(Func::isNotEmpty).collect(Collectors.toList()))); + } + + /** + * 计算时间 + * @param date 时间 + * @param dateType 时间类型 + * @param nums 数量 + * @return 计算后的时间 + */ + public static LocalDateTime plusDateTime(LocalDateTime date,String dateType,int nums) { + switch(dateType) { + case com.hnac.hzims.common.utils.DateUtil.YEAR: + return date.plusYears(nums); + case com.hnac.hzims.common.utils.DateUtil.QUARTER: + return date.plusMonths(nums*4); + case com.hnac.hzims.common.utils.DateUtil.MONTH: + return date.plusMonths(nums); + case com.hnac.hzims.common.utils.DateUtil.WEEK: + return date.plusDays(nums*7); + case com.hnac.hzims.common.utils.DateUtil.DAY: + return date.plusDays(nums); + default: + return date; + } + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerPlanService.java new file mode 100644 index 0000000..1237e1b --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerPlanService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service; + +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDPlanDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDPlanVO; +import org.springblade.core.mp.base.BaseService; + +public interface IHiddenDangerPlanService extends BaseService { + + Boolean doSave(HDPlanDTO planDTO); + + Boolean doUpdate(HDPlanDTO planDTO); + + HDPlanVO detail(Long id); + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskCheckItemService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskCheckItemService.java new file mode 100644 index 0000000..cc80e06 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskCheckItemService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service; + +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskCheckItemVO; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +public interface IHiddenDangerTaskCheckItemService extends BaseService { + + List getList(HDTaskCheckItemDTO req); + + Boolean troubleshooting(HDTaskCheckItemDTO req); + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskService.java new file mode 100644 index 0000000..2e5a821 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IHiddenDangerTaskService.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskVO; +import com.hnac.hzims.safeproduct.statistic.vo.RiskDangerAccidentMonthCountVO; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; + +import java.util.List; + +/** + * @ClassName IHDTaskService + * @description: + * @author: hx + * @create: 2023-09-19 16:04 + * @Version 4.0 + **/ +public interface IHiddenDangerTaskService extends BaseService { + + List list(HDTaskDTO req); + + List getMonthTaskCount(HDTaskDTO req); + + HDTaskVO detail(Long id); + + IPage page(HDTaskDTO request, Query query); + + Boolean finishTask(Long taskId); + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IPlanCheckItemService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IPlanCheckItemService.java new file mode 100644 index 0000000..f98f7b2 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/IPlanCheckItemService.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service; + +import com.hnac.hzims.safeproduct.hiddenDanger.dto.PlanCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +public interface IPlanCheckItemService extends BaseService { + + Boolean doSaveOrUpdateBatch(List itemList); + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java new file mode 100644 index 0000000..b0cd2fe --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java @@ -0,0 +1,73 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.safeproduct.hiddenDanger.Constants; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDPlanDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDPlanEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.mapper.HiddenDangerPlanMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerPlanService; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IPlanCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDPlanVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.PlanCheckItemWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +@Service +@AllArgsConstructor +@Slf4j +public class HiddenDangerPlanServiceImpl extends BaseServiceImpl implements IHiddenDangerPlanService { + + private final IPlanCheckItemService planCheckItemService; + + /** + * 保存隐患排查计划 + * @param planDTO 隐患排查计划 + * @return 保存结果 + */ + @Override + public Boolean doSave(HDPlanDTO planDTO) { + planDTO.setStatus(Constants.PlanStatusEnum.NOT_START.getStatus()); + HDPlanEntity plan = BeanUtil.copy(planDTO, HDPlanEntity.class); + if(this.save(plan)) { + if(CollectionUtil.isNotEmpty(planDTO.getCheckItemDTOS())) { + return planCheckItemService.doSaveOrUpdateBatch(planDTO.getCheckItemDTOS().stream().peek(d -> d.setPlanId(plan.getId())).collect(Collectors.toList())); + } + return true; + } + return false; + } + + /** + * 编辑隐患排查计划 + * @param planDTO 隐患排查计划 + * @return 执行结果 + */ + @Override + public Boolean doUpdate(HDPlanDTO planDTO) { + HDPlanEntity plan = BeanUtil.copy(planDTO, HDPlanEntity.class); + if(this.updateById(plan)) { + if(CollectionUtil.isNotEmpty(planDTO.getCheckItemDTOS())) { + return planCheckItemService.doSaveOrUpdateBatch(planDTO.getCheckItemDTOS().stream().peek(d -> d.setPlanId(plan.getId())).collect(Collectors.toList())); + } + return true; + } + return false; + } + + @Override + public HDPlanVO detail(Long id) { + HDPlanEntity plan = this.getById(id); + HDPlanVO planVO = BeanUtil.copy(plan, HDPlanVO.class); + List checkItemList = planCheckItemService.list(Wrappers.lambdaQuery().eq(PlanCheckItemEntity::getPlanId, id)); + planVO.setCheckItemVOS(PlanCheckItemWrapper.build().listVO(checkItemList)); + return planVO; + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskCheckItemService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskCheckItemService.java new file mode 100644 index 0000000..1204255 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskCheckItemService.java @@ -0,0 +1,57 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.mapper.HiddenDangerTaskCheckItemMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskCheckItemVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.HDTaskCheckItemWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @ClassName HDTaskCheckItemService + * @description: + * @author: hx + * @create: 2023-09-19 20:37 + * @Version 4.0 + **/ +@Service +@AllArgsConstructor +@Slf4j +public class HiddenDangerTaskCheckItemService extends BaseServiceImpl implements IHiddenDangerTaskCheckItemService { + + @Override + public List getList(HDTaskCheckItemDTO req) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(HDTaskCheckItemEntity.class, req); + List checkItemEntityList = this.list(queryWrapper); + return HDTaskCheckItemWrapper.build().listVO(checkItemEntityList); + } + + /** + * 执行排查项 + * @param req 执行排查项结果 + * @return 结果 + */ + @Override + public Boolean troubleshooting(HDTaskCheckItemDTO req) { + LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate() + .set(HDTaskCheckItemEntity::getCheckUserId, AuthUtil.getUserId()) + .set(HDTaskCheckItemEntity::getCheckTime, LocalDateTime.now()) + .set(HDTaskCheckItemEntity::getStatus, req.getStatus()) + .set(HDTaskCheckItemEntity::getRemark, req.getRemark()) + .set(HDTaskCheckItemEntity::getAttachment,req.getAttachment()) + .eq(HDTaskCheckItemEntity::getId, req.getId()); + return this.update(lambdaUpdateWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskServiceImpl.java new file mode 100644 index 0000000..a04de51 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerTaskServiceImpl.java @@ -0,0 +1,128 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.hiddenDanger.Constants; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.HDTaskDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.HDTaskEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.mapper.HiddenDangerTaskMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskCheckItemService; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerTaskService; +import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDTaskVO; +import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.HDTaskWrapper; +import com.hnac.hzims.safeproduct.statistic.vo.RiskDangerAccidentMonthCountVO; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @ClassName HDTaskServiceImpl + * @description: + * @author: hx + * @create: 2023-09-19 16:05 + * @Version 4.0 + **/ +@Service +@AllArgsConstructor +@Slf4j +public class HiddenDangerTaskServiceImpl extends BaseServiceImpl implements IHiddenDangerTaskService { + + private final IHiddenDangerTaskCheckItemService taskCheckItemService; + + /** + * 隐患排查任务列表查询 + * @param req 筛选条件 + * @return 任务列表 + */ + @Override + public List list(HDTaskDTO req) { + return HDTaskWrapper.build().listVO(this.list(this.getQueryWrapper(req))); + } + + @Override + public List getMonthTaskCount(HDTaskDTO req) { + return this.baseMapper.getDangerMonthTrend(this.getQueryWrapper(req)); + } + + @Override + public HDTaskVO detail(Long id) { + HDTaskEntity task = this.getById(id); + HDTaskVO taskVO = HDTaskWrapper.build().entityVO(task); + HDTaskCheckItemDTO itemDTO = new HDTaskCheckItemDTO(); + itemDTO.setTaskId(id); + taskVO.setCheckItemVOList(taskCheckItemService.getList(itemDTO)); + return taskVO; + } + + @Override + public IPage page(HDTaskDTO request, Query query) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(HDTaskEntity.class, BeanUtil.copy(request, HDTaskEntity.class)); + queryWrapper.orderByDesc(HDTaskEntity::getCreateTime); + IPage page = this.page(Condition.getPage(query),queryWrapper); + page.setRecords(HDTaskWrapper.build().listVO(page.getRecords())); + if(CollectionUtil.isNotEmpty(page.getRecords())) { + List taskIdList = (List) page.getRecords().stream().map(t -> ((HDTaskVO) t).getId()).collect(Collectors.toList()); + List abnormalItem = taskCheckItemService.list(Wrappers.lambdaQuery() + .eq(HDTaskCheckItemEntity::getStatus, 0) + .in(HDTaskCheckItemEntity::getTaskId, taskIdList) + ); + List abnormalTaskId = abnormalItem.stream().map(HDTaskCheckItemEntity::getTaskId).distinct().collect(Collectors.toList()); + page.getRecords().stream().filter(t -> abnormalTaskId.contains(((HDTaskVO) t).getId())).forEach(t -> ((HDTaskVO) t).setIsAbnormal(true)); + } + return page; + } + + /** + * 完成隐患排查任务 + * @param taskId 任务ID + * @return 执行结果 + */ + @Override + public Boolean finishTask(Long taskId) { + List unfinishItemList = taskCheckItemService.list( + Wrappers.lambdaQuery().eq(HDTaskCheckItemEntity::getTaskId, taskId) + .isNull(HDTaskCheckItemEntity::getCheckTime) + ); + Assert.isTrue(CollectionUtil.isEmpty(unfinishItemList),() -> { + throw new ServiceException("存在未完成的排查项:" +unfinishItemList.stream().map(HDTaskCheckItemEntity::getCheckItemName).collect(Collectors.joining(","))+ ",任务无法提交!"); + }); + return this.update( + Wrappers.lambdaUpdate() + .set(HDTaskEntity::getStatus, Constants.TaskStatusEnum.FINISH.getStatus()) + .eq(HDTaskEntity::getId,taskId) + ); + } + + private QueryWrapper getQueryWrapper(HDTaskDTO req) { + QueryWrapper queryWrapper = Wrappers.query(); + if(StringUtil.isNotBlank(req.getStationCode())) { + queryWrapper.eq("station_code",req.getStationCode()); + } + if(StringUtil.isNotBlank(req.getYearMonth())) { + queryWrapper.eq("DATE_FORMAT(start_time,'%Y-%m')",req.getYearMonth()); + } + if(ObjectUtil.isNotEmpty(req.getTaskStartTime())) { + queryWrapper.ge("start_time",req.getTaskStartTime()); + } + if(ObjectUtil.isNotEmpty(req.getTaskEndTime())) { + queryWrapper.le("start_time",req.getTaskEndTime()); + } + return queryWrapper; + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/PlanCheckItemServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/PlanCheckItemServiceImpl.java new file mode 100644 index 0000000..58a3c41 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/PlanCheckItemServiceImpl.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.safeproduct.hiddenDanger.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.safeproduct.hiddenDanger.dto.PlanCheckItemDTO; +import com.hnac.hzims.safeproduct.hiddenDanger.entity.PlanCheckItemEntity; +import com.hnac.hzims.safeproduct.hiddenDanger.mapper.PlanCheckItemMapper; +import com.hnac.hzims.safeproduct.hiddenDanger.service.IPlanCheckItemService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @ClassName PlanCheckItemServiceImpl + * @description: + * @author: hx + * @create: 2023-10-07 14:35 + * @Version 4.0 + **/ +@Service +@AllArgsConstructor +@Slf4j +public class PlanCheckItemServiceImpl extends BaseServiceImpl implements IPlanCheckItemService { + + /** + * 保存/编辑计划排查项 + * @param itemList 排查项列表 + * @return + */ + @Override + public Boolean doSaveOrUpdateBatch(List itemList) { + Assert.isTrue(!itemList.stream().map(PlanCheckItemDTO::getPlanId).anyMatch(Func::isEmpty),() -> { + throw new ServiceException("保存计划排查项是必须包含计划ID"); + }); + List idList = itemList.stream().map(PlanCheckItemDTO::getId).filter(Func::isNotEmpty).distinct().collect(Collectors.toList()); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery().select(PlanCheckItemEntity::getId) + .eq(PlanCheckItemEntity::getPlanId, itemList.get(0).getPlanId()) + .notIn(CollectionUtil.isNotEmpty(idList),PlanCheckItemEntity::getId, idList); + List removeIdList = this.listObjs(wrapper, Func::toLong); + this.deleteLogic(removeIdList); + return this.saveOrUpdateBatch(JSONArray.parseArray(JSON.toJSONString(itemList),PlanCheckItemEntity.class)); + } +}