hazardList;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardLibraryDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardLibraryDTO.java
new file mode 100644
index 0000000..bcad4c0
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardLibraryDTO.java
@@ -0,0 +1,15 @@
+package com.hnac.hzims.safeproduct.hazard.dto;
+
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode
+@ApiModel(value = "危险源库DTO对象",description = "危险源库DTO对象")
+public class HazardLibraryDTO extends HazardLibraryEntity implements Serializable {
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/entity/HazardLibraryEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/entity/HazardLibraryEntity.java
new file mode 100644
index 0000000..0975d00
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/entity/HazardLibraryEntity.java
@@ -0,0 +1,61 @@
+package com.hnac.hzims.safeproduct.hazard.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+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 javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@TableName("hzims_hazard_library")
+@Data
+@ApiModel("危险源库")
+@EqualsAndHashCode
+public class HazardLibraryEntity extends TenantEntity implements Serializable {
+
+ @ApiModelProperty(value = "站点类型")
+ @QueryField(condition = SqlCondition.EQUAL)
+ @NotNull
+ private Integer stationType;
+
+ @ApiModelProperty("站点类型名称")
+ @NotNull
+ private String stationTypeName;
+
+ @ApiModelProperty(value = "危险源类型")
+ @NotNull
+ @QueryField(condition = SqlCondition.EQUAL)
+ private String type;
+
+ @ApiModelProperty("危险源名称")
+ @QueryField(condition = SqlCondition.LIKE)
+ @NotNull
+ private String name;
+
+ @ApiModelProperty("所在部位")
+ private String position;
+
+ @ApiModelProperty(value = "危险因素")
+ @NotNull
+ private String dangerEle;
+
+ @ApiModelProperty(value = "可能导致的事故")
+ @NotNull
+ private String cause;
+
+ @ApiModelProperty(value = "措施")
+ private String measures;
+
+ @ApiModelProperty(value = "风险等级 10=稍有危险 20=一般危险 30=显著危险 40=高度危险")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @QueryField(condition = SqlCondition.EQUAL)
+ private Integer level;
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/DangerSourceLevelEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java
similarity index 95%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/DangerSourceLevelEnum.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java
index 34cd297..ad93f58 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/DangerSourceLevelEnum.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.enums;
+package com.hnac.hzims.safeproduct.hazard.enums;
import org.springblade.core.tool.utils.StringUtil;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourcePositionVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourcePositionVO.java
similarity index 87%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourcePositionVO.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourcePositionVO.java
index 2be6933..1371e2e 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourcePositionVO.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourcePositionVO.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.vo;
+package com.hnac.hzims.safeproduct.hazard.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourceVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java
similarity index 81%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourceVO.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java
index db7e6f6..edab947 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourceVO.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java
@@ -1,7 +1,8 @@
-package com.hnac.hzims.safeproduct.vo;
+package com.hnac.hzims.safeproduct.hazard.vo;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
-import com.hnac.hzims.safeproduct.enums.DangerSourceLevelEnum;
+import com.hnac.hzims.safeproduct.hazard.enums.DangerSourceLevelEnum;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourcePositionVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/HazardLibraryVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/HazardLibraryVO.java
new file mode 100644
index 0000000..f116aa3
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/HazardLibraryVO.java
@@ -0,0 +1,15 @@
+package com.hnac.hzims.safeproduct.hazard.vo;
+
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode
+@ApiModel(value = "危险源库VO对象",description = "危险源库VO对象")
+public class HazardLibraryVO extends HazardLibraryEntity implements Serializable {
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/DocumentManagement.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/DocumentManagement.java
index fafbe44..c082a3f 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/DocumentManagement.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/DocumentManagement.java
@@ -1,16 +1,15 @@
package com.hnac.hzims.safeproduct.management.entity;
-import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
+import org.springblade.core.mp.base.BaseEntity;
/**
*
- * 文档管理
+ * 电站安全标准化文档管理
*
*
* @author dfy
@@ -20,13 +19,9 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("document_management")
-public class DocumentManagement implements Serializable {
+public class DocumentManagement extends BaseEntity{
private static final long serialVersionUID=1L;
-
- @TableId(value = "id", type = IdType.AUTO)
- private Long id;
-
/**
* 文档名称
*/
@@ -34,41 +29,33 @@ public class DocumentManagement implements Serializable {
private String documentName;
/**
- * 文档路径
+ * 电站编码
*/
- @TableField("document_url")
- private String documentUrl;
+ @TableField("station_code")
+ private String stationCode;
/**
- * 创建人Id
+ * 指标项id
*/
- @TableField("creator_id")
- private Long creatorId;
+ @TableField("indicator_management_id")
+ private String indicatorManagementId;
/**
- * 创建人名称
- */
- @TableField("creator_name")
- private String creatorName;
-
- /**
- * 创建时间
+ * 文档路径
*/
- @TableField("create_time")
- private LocalDateTime createTime;
+ @TableField("document_url")
+ private String documentUrl;
/**
- * 更新时间
+ * 电站名称
*/
- @TableField("update_time")
- private LocalDateTime updateTime;
+ @TableField(exist = false)
+ private String stationName;
/**
- * 逻辑删除
+ * 项目名称
*/
- @TableLogic
- @TableField("is_deleted")
- private Integer isDeleted;
-
+ @TableField(exist = false)
+ private String productName;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/RatingScale.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/RatingScale.java
index 9345a44..d7f8584 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/RatingScale.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/RatingScale.java
@@ -27,7 +27,7 @@ public class RatingScale implements Serializable {
/**
* 编号
*/
- @TableId(value = "id", type = IdType.AUTO)
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
@@ -49,6 +49,18 @@ public class RatingScale implements Serializable {
private String reviewDescription;
/**
+ * 电站编码
+ */
+ @TableField("station_code")
+ private String stationCode;
+
+ /**
+ * 评分时间
+ */
+ @TableField("score_time")
+ private LocalDateTime scoreTime;
+
+ /**
* 创建时间
*/
@TableField("create_time")
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardNecessary.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardNecessary.java
new file mode 100644
index 0000000..b3e9cd3
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardNecessary.java
@@ -0,0 +1,33 @@
+package com.hnac.hzims.safeproduct.management.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ *
+ * 安全标准必要条件
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("safe_standard_necessary")
+public class SafeStandardNecessary extends BaseEntity {
+
+ /**
+ * 名称
+ */
+ @TableField("name")
+ private String name;
+
+ @TableField(exist = false)
+ private String check;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardResult.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardResult.java
new file mode 100644
index 0000000..f0734ff
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardResult.java
@@ -0,0 +1,44 @@
+package com.hnac.hzims.safeproduct.management.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 安全标准必要条件结果
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("safe_standard_result")
+public class SafeStandardResult extends BaseEntity {
+
+ /**
+ * 必要条件id
+ */
+ @TableField("necessary_id")
+ private Long necessaryId;
+
+ /**
+ * 电站编码
+ */
+ @TableField("station_code")
+ private String stationCode;
+
+ /**
+ * 评分时间
+ */
+ @TableField("score_time")
+ private LocalDateTime scoreTime;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetManagement.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetManagement.java
index be6f001..7e2fe76 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetManagement.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetManagement.java
@@ -5,7 +5,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
-import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@@ -21,17 +20,21 @@ import java.util.List;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("target_management")
-public class TargetManagement implements Serializable {
-
- private static final long serialVersionUID = 1L;
+public class TargetManagement {
/**
* 编号
*/
- @TableId(value = "id", type = IdType.AUTO)
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
+ * 模板id
+ */
+ @TableField("template_id")
+ private Long templateId;
+
+ /**
* 名称
*/
@TableField("name")
@@ -72,10 +75,11 @@ public class TargetManagement implements Serializable {
*/
@TableLogic
@TableField("is_deleted")
- private Boolean deleted;
-
+ private Boolean isDeleted;
@TableField(exist = false)
private List children;
+ @TableField(exist = false)
+ private List childrens;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetTemplate.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetTemplate.java
new file mode 100644
index 0000000..7e88bb8
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetTemplate.java
@@ -0,0 +1,57 @@
+package com.hnac.hzims.safeproduct.management.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("target_template")
+public class TargetTemplate implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
+ private Long id;
+
+ /**
+ * 模板名称
+ */
+ @TableField("template_name")
+ private String templateName;
+
+ /**
+ * 模板状态 0-未启用,1-启用
+ */
+ @TableField("state")
+ private Integer state;
+
+ /**
+ * 创建时间
+ */
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新时间
+ */
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+ /**
+ * 逻辑删除
+ */
+ @TableLogic
+ @TableField("is_deleted")
+ private Boolean isDeleted;
+
+ @TableField(exist = false)
+ private List targetManagement;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/DocumentManagementQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/DocumentManagementQueryVo.java
index 375c018..9f3180a 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/DocumentManagementQueryVo.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/DocumentManagementQueryVo.java
@@ -17,4 +17,10 @@ public class DocumentManagementQueryVo {
*/
@TableField("document_name")
private String documentName;
+
+ @TableField("station_code")
+ private String stationCode;
+
+ @TableField("indicator_management_id")
+ private Long indicatorManagementId;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/RatingScaleVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/RatingScaleVo.java
index b2527d1..eacaa89 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/RatingScaleVo.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/RatingScaleVo.java
@@ -26,4 +26,9 @@ public class RatingScaleVo {
* 评审描述
*/
private String reviewDescription;
+
+ /**
+ * 电站编码
+ */
+ private String stationCode;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/TargetTemplateQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/TargetTemplateQueryVo.java
new file mode 100644
index 0000000..d049dc6
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/TargetTemplateQueryVo.java
@@ -0,0 +1,19 @@
+package com.hnac.hzims.safeproduct.management.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+@Data
+public class TargetTemplateQueryVo {
+ /**
+ * 模板名称
+ */
+ @TableField("template_name")
+ private String templateName;
+
+ /**
+ * 模板状态 0-未启用,1-启用
+ */
+ @TableField("state")
+ private Integer state;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/constants/HazardRiskConstants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/constants/HazardRiskConstants.java
new file mode 100644
index 0000000..dff7561
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/constants/HazardRiskConstants.java
@@ -0,0 +1,58 @@
+package com.hnac.hzims.safeproduct.risk.constants;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardRiskConstants {
+
+ String END = "流程结束";
+
+ String EXAMINE = "examine";
+
+ String REVIEW = "review";
+
+ /**
+ * 风险排查用户
+ */
+ String HAZARD_RISK_KEY = "hazard_risk";
+
+ /**
+ * 风险排查用户
+ */
+ String TROUBLE = "trouble";
+
+ /**
+ * LS 风险评估方法 : L * C/S
+ */
+ Integer LS = 1;
+
+ /**
+ * LEC 风险评估方法 : L * E * C/S
+ */
+ Integer LEC = 2;
+
+ /**
+ * 风险等级 : 1-低风险 2-一般风险 3-较大风险 4-重大风险
+ */
+ List HAZARD_LEVELS = Arrays.asList(1L,2L,3L,4L);
+
+ Integer SIGNIFICANT_RISK = 1;
+
+ /**
+ * 流程步骤 :
+ * 1 - 危险源排查
+ * 2 - 排查结果审核
+ * 3 - 重大风险整改
+ * 4 - 整改审核
+ */
+ String HAZARD_RISK_NEW_PROPERTY = "defaultExpression";
+
+ String HAZARD_RISK_NEW_PROPERTY_1 = "1";
+ String HAZARD_RISK_NEW_PROPERTY_2 = "2";
+ String HAZARD_RISK_NEW_PROPERTY_3 = "3";
+ String HAZARD_RISK_NEW_PROPERTY_4 = "4";
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/CorrelationDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/CorrelationDTO.java
new file mode 100644
index 0000000..eaad69b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/CorrelationDTO.java
@@ -0,0 +1,25 @@
+package com.hnac.hzims.safeproduct.risk.dto;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@Data
+@ApiModel("风险点实体类DTO")
+@EqualsAndHashCode(callSuper = false)
+public class CorrelationDTO {
+
+ @ApiModelProperty(value = "作业区域Id")
+ private Long workId;
+
+ @ApiModelProperty(value = "危险源列表")
+ private List sources;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardRiskProcessDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardRiskProcessDTO.java
new file mode 100644
index 0000000..aa33da3
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardRiskProcessDTO.java
@@ -0,0 +1,22 @@
+package com.hnac.hzims.safeproduct.risk.dto;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardEstimate;
+import com.hnac.hzims.safeproduct.risk.entity.HazardTask;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@Data
+@ApiModel("风险流程启动实体类")
+@EqualsAndHashCode(callSuper = false)
+public class HazardRiskProcessDTO extends HazardTask {
+
+ @ApiModelProperty(value = "危险源Id集合")
+ private List estimates;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardSourceDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardSourceDTO.java
new file mode 100644
index 0000000..0547c82
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardSourceDTO.java
@@ -0,0 +1,22 @@
+package com.hnac.hzims.safeproduct.risk.dto;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName HazardSourceDTO
+ * @description: 风险点DTO
+ * @author: hx
+ * @create: 2023-09-18 14:11
+ * @Version 4.0
+ **/
+@Data
+@ApiModel("风险点实体类DTO")
+@EqualsAndHashCode(callSuper = false)
+public class HazardSourceDTO extends HazardSource implements Serializable {
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/RiskCheckDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/RiskCheckDTO.java
new file mode 100644
index 0000000..75fdfdd
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/RiskCheckDTO.java
@@ -0,0 +1,24 @@
+package com.hnac.hzims.safeproduct.risk.dto;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName RiskCheckDTO
+ * @description: 风险检查项DTO
+ * @author: hx
+ * @create: 2023-09-19 09:27
+ * @Version 4.0
+ **/
+@Data
+@EqualsAndHashCode
+@ApiModel("风险检查项DTO")
+public class RiskCheckDTO extends RiskCheckEntity implements Serializable {
+
+
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/Correlation.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/Correlation.java
new file mode 100644
index 0000000..caf04ae
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/Correlation.java
@@ -0,0 +1,26 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_work_source_correlation")
+public class Correlation extends BaseEntity {
+
+ @ApiModelProperty(value = "作业区域ID")
+ private Long workId;
+
+ @ApiModelProperty(value = "风险点Id")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "危险源ID")
+ private Long sourceId;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardCategory.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardCategory.java
new file mode 100644
index 0000000..0c7bb96
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardCategory.java
@@ -0,0 +1,26 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_category")
+public class HazardCategory extends BaseEntity {
+
+ @ApiModelProperty(value = "站点类别")
+ private Integer stationType;
+
+ @ApiModelProperty(value = "类别 :构筑物类、金属结构类、设备设施类")
+ private Integer category;
+
+ @ApiModelProperty(value = "危险点")
+ private String perilPoint;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardEstimate.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardEstimate.java
new file mode 100644
index 0000000..9bb9208
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardEstimate.java
@@ -0,0 +1,71 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_estimate")
+public class HazardEstimate extends BaseEntity {
+
+ @ApiModelProperty(value = "风险任务排查Id")
+ private Long taskId;
+
+ @ApiModelProperty(value = "风险点Id")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "风险等级ID")
+ private Long levelId;
+
+ @ApiModelProperty(value = "风险等级")
+ private Integer level;
+
+ @ApiModelProperty(value = "风险等级名称")
+ private String levelDesc;
+
+ @ApiModelProperty(value = "危险源Id")
+ private Long sourceId;
+
+ @ApiModelProperty(value = "危险源名称")
+ private String hazardName;
+
+ @ApiModelProperty(value = "事故诱因")
+ private String accidentIncentive;
+
+ @ApiModelProperty(value = "导致后果")
+ private String causeConsequence;
+
+ @ApiModelProperty(value = "评价方法 :LS、LEC")
+ private Integer evaluationMethod;
+
+ @ApiModelProperty(value = "L值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double lValue;
+
+ @ApiModelProperty(value = "E值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double eValue;
+
+ @ApiModelProperty(value = "cs值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double cSValue;
+
+ @ApiModelProperty(value = "R/D计算值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double rDValue;
+
+ @ApiModelProperty(value = "整改描述")
+ private String rectificationDesc;
+
+ @ApiModelProperty(value = "整改附件")
+ private String rectificationAttachment;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardLevel.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardLevel.java
new file mode 100644
index 0000000..0b2478b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardLevel.java
@@ -0,0 +1,41 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_level")
+public class HazardLevel extends BaseEntity {
+
+ @ApiModelProperty(value = "风险点Id")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "危险源Id")
+ private Long sourceId;
+
+ @ApiModelProperty(value = "危险源名称")
+ private String hazardName;
+
+ @ApiModelProperty(value = "R值上限值")
+ private Double rMaxValue;
+
+ @ApiModelProperty(value = "R值下限值")
+ private Double rMinValue;
+
+ @ApiModelProperty(value = "危险程度 : 极其危险、高度危险、中度危险、轻度危险")
+ private Integer risk;
+
+ @ApiModelProperty(value = "风险等级 : 重大风险、较大风险、一般风险、低风险")
+ private Integer riskLevel;
+
+ @ApiModelProperty(value = "颜色标识 : 红、橙、黄、蓝")
+ private Integer colour;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardSource.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardSource.java
new file mode 100644
index 0000000..b6e808b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardSource.java
@@ -0,0 +1,56 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.mp.support.SqlCondition;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_source")
+public class HazardSource extends BaseEntity {
+
+ @ApiModelProperty(value = "风险点主键ID")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "危险源")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String hazardName;
+
+ @ApiModelProperty(value = "事故诱因")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String accidentIncentive;
+
+ @ApiModelProperty(value = "导致后果")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String causeConsequence;
+
+ @ApiModelProperty(value = "评价方法 :LS、LEC")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private Integer evaluationMethod;
+
+ @ApiModelProperty(value = "L上限值")
+ private Double lUpLimit;
+
+ @ApiModelProperty(value = "L下限值")
+ private Double lDownLimit;
+
+ @ApiModelProperty(value = "E上限值")
+ private Double eUpLimit;
+
+ @ApiModelProperty(value = "E下限值")
+ private Double eDownLimit;
+
+ @ApiModelProperty(value = "C/S上限值")
+ private Double cSUpLimit;
+
+ @ApiModelProperty(value = "C/S下限值")
+ private Double cSDownLimit;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardTask.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardTask.java
new file mode 100644
index 0000000..bbeee20
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardTask.java
@@ -0,0 +1,55 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_task")
+public class HazardTask extends BaseEntity {
+
+ @ApiModelProperty(value = "工作流实例Id")
+ private String processInstanceId;
+
+ @ApiModelProperty(value = "站点编码")
+ private String stationCode;
+
+ @ApiModelProperty(value = "站点名称")
+ private String stationName;
+
+ @ApiModelProperty(value = "排查任务名称")
+ private String taskName;
+
+ @ApiModelProperty(value = "作业区域Id")
+ private Long workId;
+
+ @ApiModelProperty(value = "负责人")
+ private Long head;
+
+ @ApiModelProperty(value = "排查任务计划开始时间")
+ private Date planStartTime;
+
+ @ApiModelProperty(value = "排查任务计划完成时间")
+ private Date planEndTime;
+
+ @ApiModelProperty(value = "任务实际开始时间")
+ private Date actStartTime;
+
+ @ApiModelProperty(value = "任务实际完成时间")
+ private Date actEndTime;
+
+ @ApiModelProperty(value = "流程步骤名称")
+ private String processSteps;
+
+ @ApiModelProperty(value = "流程步骤人员名称")
+ private String nextStepOperator;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardWork.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardWork.java
new file mode 100644
index 0000000..5aeecc0
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardWork.java
@@ -0,0 +1,48 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.core.mp.support.QueryField;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_hazard_work")
+public class HazardWork extends BaseEntity {
+
+ @ApiModelProperty(value = "站点编码")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private String stationCode;
+
+ @ApiModelProperty(value = "站点名称")
+ private String stationName;
+
+ @ApiModelProperty(value = "作业区域名称")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String regionName;
+
+ @ApiModelProperty(value = "经度")
+ private Double longitude;
+
+ @ApiModelProperty(value = "经度")
+ private Double latitude;
+
+ @ApiModelProperty(value = "负责人")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private Long head;
+
+ @ApiModelProperty(value = "监管部门")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String regulator;
+
+ @ApiModelProperty(value = "分管领导")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private Long manage;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskCheckEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskCheckEntity.java
new file mode 100644
index 0000000..c43265d
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskCheckEntity.java
@@ -0,0 +1,46 @@
+package com.hnac.hzims.safeproduct.risk.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 javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @ClassName RiskCheckEntity
+ * @description:
+ * @author: hx
+ * @create: 2023-09-19 09:21
+ * @Version 4.0
+ **/
+@Data
+@ApiModel("风险点检查项")
+@EqualsAndHashCode
+@TableName("hzims_risk_check")
+public class RiskCheckEntity extends TenantEntity implements Serializable {
+
+ @ApiModelProperty(value = "风险点Id",required = true)
+ @QueryField(condition = SqlCondition.EQUAL)
+ @NotNull
+ private Long categoryId;
+
+ @ApiModelProperty("风险点名称")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String categoryName;
+
+ @ApiModelProperty("类型")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private String type;
+
+ @ApiModelProperty(value = "检查项",required = true)
+ @QueryField(condition = SqlCondition.LIKE)
+ @NotNull
+ private String checkItem;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimate.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimate.java
new file mode 100644
index 0000000..3a04c2d
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimate.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_estimate")
+public class RiskEstimate extends BaseEntity {
+
+ @ApiModelProperty(value = "站点编码")
+ private String stationCode;
+
+ @ApiModelProperty(value = "站点名称")
+ private String stationName;
+
+ @ApiModelProperty(value = "站点类别 :闸门、水库")
+ private Integer stationType;
+
+ @ApiModelProperty(value = "风险评估年度")
+ private String estimateYear;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimatePoint.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimatePoint.java
new file mode 100644
index 0000000..0588941
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimatePoint.java
@@ -0,0 +1,89 @@
+package com.hnac.hzims.safeproduct.risk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("hzims_risk_estimate_point")
+public class RiskEstimatePoint extends BaseEntity {
+
+ @ApiModelProperty(value = "风险评估Id")
+ private Long estimateId;
+
+ @ApiModelProperty(value = "风险点Id")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "风险点类别")
+ private Integer category;
+
+ @ApiModelProperty(value = "危险点")
+ private String perilPoint;
+
+ @ApiModelProperty(value = "危险源Id")
+ private Long sourceId;
+
+ @ApiModelProperty(value = "危险源")
+ private String hazardName;
+
+ @ApiModelProperty(value = "事故诱因")
+ private String accidentIncentive;
+
+ @ApiModelProperty(value = "导致后果")
+ private String causeConsequence;
+
+ @ApiModelProperty(value = "评价方法 :LS、LEC")
+ private Integer evaluationMethod;
+
+ @ApiModelProperty(value = "L上限值")
+ private Double lUpLimit;
+
+ @ApiModelProperty(value = "L下限值")
+ private Double lDownLimit;
+
+ @ApiModelProperty(value = "E上限值")
+ private Double eUpLimit;
+
+ @ApiModelProperty(value = "E下限值")
+ private Double eDownLimit;
+
+ @ApiModelProperty(value = "C/S上限值")
+ private Double cSUpLimit;
+
+ @ApiModelProperty(value = "C/S下限值")
+ private Double cSDownLimit;
+
+ @ApiModelProperty(value = "L值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double lValue;
+
+ @ApiModelProperty(value = "E值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double eValue;
+
+ @ApiModelProperty(value = "cs值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double cSValue;
+
+ @ApiModelProperty(value = "R/D计算值")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Double rDValue;
+
+ @ApiModelProperty(value = "风险等级Id")
+ private Long levelId;
+
+ @ApiModelProperty(value = "风险等级")
+ private Integer level;
+
+ @ApiModelProperty(value = "等级描述")
+ private String levelDesc;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClientFallBack.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClientFallBack.java
new file mode 100644
index 0000000..32c7da2
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClientFallBack.java
@@ -0,0 +1,19 @@
+package com.hnac.hzims.safeproduct.risk.feign;
+
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author ysj
+ */
+@Slf4j
+@Component
+public class HazardRiskClientFallBack implements IHazardRiskClient {
+
+ @Override
+ public R listener(ProcessWorkFlowResponse processWorkFlowResponse) {
+ return R.fail("执行失败!");
+ }
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/IHazardRiskClient.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/IHazardRiskClient.java
new file mode 100644
index 0000000..28e4caf
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/IHazardRiskClient.java
@@ -0,0 +1,25 @@
+package com.hnac.hzims.safeproduct.risk.feign;
+
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.safeproduct.Constants;
+import org.springblade.core.tool.api.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @author ysj
+ */
+@FeignClient(
+ value = Constants.APP_NAME,
+ fallback = HazardRiskClientFallBack.class
+)
+public interface IHazardRiskClient {
+
+ String API_PREFIX = "/feign/hazardRisk";
+
+ String PLAN_PROCESS_LISTENER = API_PREFIX + "/listener";
+
+ @PostMapping(PLAN_PROCESS_LISTENER)
+ R listener(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse);
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CategorySourceVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CategorySourceVo.java
new file mode 100644
index 0000000..1076908
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CategorySourceVo.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class CategorySourceVo extends HazardSource {
+
+
+ @ApiModelProperty(value = "站点类型")
+ private Integer stationType;
+
+ @ApiModelProperty(value = "类别 :构筑物类、金属结构类、设备设施类")
+ private Integer category;
+
+ @ApiModelProperty(value = "危险点")
+ private String perilPoint;
+
+ @ApiModelProperty(value = "创建时间")
+ private Date time;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CorrelationDetailsVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CorrelationDetailsVo.java
new file mode 100644
index 0000000..2aaf4ba
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CorrelationDetailsVo.java
@@ -0,0 +1,22 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = false)
+@Data
+public class CorrelationDetailsVo {
+
+ @ApiModelProperty(value = "作业区域Id")
+ private Long workId;
+
+ @ApiModelProperty(value = "风险点主键ID")
+ private List sources;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/ExportEstimateVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/ExportEstimateVo.java
new file mode 100644
index 0000000..126b7a0
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/ExportEstimateVo.java
@@ -0,0 +1,78 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = false)
+@Data
+public class ExportEstimateVo implements Serializable {
+
+ @ApiModelProperty(value = "序号")
+ private Integer index;
+
+ @ApiModelProperty(value = "站点编码")
+ private String stationCode;
+
+ @ApiModelProperty(value = "站点名称")
+ private String stationName;
+
+ @ApiModelProperty(value = "类别")
+ private Integer category;
+
+ @ApiModelProperty(value = "类别名称")
+ private String categoryName;
+
+ @ApiModelProperty(value = "风险点Id")
+ private Long perilPointId;
+
+ @ApiModelProperty(value = "风险点名称")
+ private String perilPoint;
+
+ @ApiModelProperty(value = "危险源Id")
+ private Long sourceId;
+
+ @ApiModelProperty(value = "危险源名称")
+ private String hazardName;
+
+ @ApiModelProperty(value = "事故诱因")
+ private String accidentIncentive;
+
+ @ApiModelProperty(value = "导致后果")
+ private String causeConsequence;
+
+ @ApiModelProperty(value = "评价方法")
+ private Integer evaluationMethod;
+
+ @ApiModelProperty(value = "评价方法描述")
+ private String methodName;
+
+ @ApiModelProperty(value = "L值")
+ private Double l;
+
+ @ApiModelProperty(value = "E值")
+ private Double e;
+
+ @ApiModelProperty(value = "C/S值")
+ private Double s;
+
+ @ApiModelProperty(value = "R/D值")
+ private Double r;
+
+ @ApiModelProperty(value = "风险等级")
+ private Integer level;
+
+ @ApiModelProperty(value = "风险等级名称")
+ private String levelName;
+
+ @ApiModelProperty(value = "创建时间")
+ private Date createTime;
+
+
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardDetailsVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardDetailsVo.java
new file mode 100644
index 0000000..89095bf
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardDetailsVo.java
@@ -0,0 +1,20 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class HazardDetailsVo extends HazardCategory {
+
+ @ApiModelProperty(value = "风险点主键ID")
+ private List sources;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardEstimateVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardEstimateVo.java
new file mode 100644
index 0000000..c11af94
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardEstimateVo.java
@@ -0,0 +1,32 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardEstimate;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class HazardEstimateVo extends HazardEstimate {
+
+ @ApiModelProperty(value = "L上限值")
+ private Double lUpLimit;
+
+ @ApiModelProperty(value = "L下限值")
+ private Double lDownLimit;
+
+ @ApiModelProperty(value = "E上限值")
+ private Double eUpLimit;
+
+ @ApiModelProperty(value = "E下限值")
+ private Double eDownLimit;
+
+ @ApiModelProperty(value = "C/S上限值")
+ private Double cSUpLimit;
+
+ @ApiModelProperty(value = "C/S下限值")
+ private Double cSDownLimit;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardTaskVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardTaskVo.java
new file mode 100644
index 0000000..f3bfc3e
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardTaskVo.java
@@ -0,0 +1,27 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardEstimate;
+import com.hnac.hzims.safeproduct.risk.entity.HazardTask;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class HazardTaskVo extends HazardTask {
+
+ @ApiModelProperty("开始时间")
+ private Date startTime;
+
+ @ApiModelProperty("结束时间")
+ private Date endTime;
+
+ @ApiModelProperty("风险评估对象")
+ private List estimates;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/PersonalCheckItemVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/PersonalCheckItemVO.java
new file mode 100644
index 0000000..2950de6
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/PersonalCheckItemVO.java
@@ -0,0 +1,48 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode
+@ApiModel("个人排查项")
+public class PersonalCheckItemVO implements Serializable {
+
+ @ApiModelProperty(value = "负责人ID")
+ private Long userId;
+
+ @ApiModelProperty(value = "负责人名称")
+ private String userName;
+
+ @ApiModelProperty(value = "区域ID")
+ private Long areaId;
+
+ @ApiModelProperty(value = "区域")
+ private String areaName;
+
+ @ApiModelProperty(value = "风险点主键ID")
+ private Long categoryId;
+
+ @ApiModelProperty(value = "风险点")
+ private String categoryName;
+
+ @ApiModelProperty(value = "危险源ID")
+ private Long hazardId;
+
+ @ApiModelProperty(value = "危险源")
+ private String hazardName;
+
+ @ApiModelProperty(value = "事故诱因")
+ private String accidentIncentive;
+
+ @ApiModelProperty(value = "导致后果")
+ private String causeConsequence;
+
+ @ApiModelProperty(value = "评价方法 :LS、LEC")
+ private Integer evaluationMethod;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/SourceVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/SourceVo.java
new file mode 100644
index 0000000..ad3ae7b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/SourceVo.java
@@ -0,0 +1,42 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class SourceVo extends HazardSource {
+
+ @ApiModelProperty
+ private Long workId;
+
+ @ApiModelProperty
+ private List sourceIds;
+
+ @ApiModelProperty(value = "站点类别")
+ private Integer stationType;
+
+ @ApiModelProperty(value = "类别 :构筑物类、金属结构类、设备设施类")
+ private Integer category;
+
+ @ApiModelProperty(value = "危险点")
+ private String perilPoint;
+
+ @ApiModelProperty(value = "风险评价方法")
+ private String estimateMethod;
+
+ @ApiModelProperty(value = "类别名称")
+ private String categoryName;
+
+ @ApiModelProperty(value = "风险评价方法名称")
+ private String estimateMethodName;
+
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationEstimateVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationEstimateVo.java
new file mode 100644
index 0000000..dfb0d1b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationEstimateVo.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = false)
+@Data
+public class StationEstimateVo implements Serializable {
+
+ @ApiModelProperty(value = "年份")
+ private String year;
+
+ @ApiModelProperty(value = "站点编码")
+ private String stationCode;
+
+ @ApiModelProperty(value = "站点名称")
+ private String stationName;
+
+ @ApiModelProperty(value = "评估记录列表")
+ private List exportEstimates;
+
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationRiskLevelVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationRiskLevelVo.java
new file mode 100644
index 0000000..b31b758
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationRiskLevelVo.java
@@ -0,0 +1,25 @@
+package com.hnac.hzims.safeproduct.risk.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author ysj
+ */
+@EqualsAndHashCode(callSuper = false)
+@Data
+public class StationRiskLevelVo {
+
+ @ApiModelProperty("站点编码")
+ private String stationCode;
+
+ @ApiModelProperty("站点名称")
+ private String stationName;
+
+ @ApiModelProperty("风险等级")
+ private Long level;
+
+ @ApiModelProperty("风险等级名称")
+ private Long levelName;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/HazardSourceWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/HazardSourceWrapper.java
new file mode 100644
index 0000000..908a4ec
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/HazardSourceWrapper.java
@@ -0,0 +1,26 @@
+package com.hnac.hzims.safeproduct.risk.wrapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.vo.SourceVo;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+/**
+ * @ClassName HazardSourceWrapper
+ * @description:
+ * @author: hx
+ * @create: 2023-09-18 14:21
+ * @Version 4.0
+ **/
+public class HazardSourceWrapper extends BaseEntityWrapper {
+
+ public static HazardSourceWrapper build() {
+ return new HazardSourceWrapper();
+ }
+
+ @Override
+ public SourceVo entityVO(HazardSource entity) {
+ SourceVo sourceVo = BeanUtil.copy(entity, SourceVo.class);
+ return sourceVo;
+ }
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/RiskCheckWrapper.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/RiskCheckWrapper.java
new file mode 100644
index 0000000..d3ab86c
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/RiskCheckWrapper.java
@@ -0,0 +1,33 @@
+package com.hnac.hzims.safeproduct.risk.wrapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+import com.hnac.hzims.safeproduct.vo.RiskCheckVO;
+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 RiskCheckWrapper
+ * @description:
+ * @author: hx
+ * @create: 2023-09-19 09:43
+ * @Version 4.0
+ **/
+public class RiskCheckWrapper extends BaseEntityWrapper {
+
+ public static RiskCheckWrapper build() {
+ return new RiskCheckWrapper();
+ }
+
+ @Override
+ public RiskCheckVO entityVO(RiskCheckEntity entity) {
+ RiskCheckVO checkVO = BeanUtil.copy(entity, RiskCheckVO.class);
+ checkVO.setCreatorName(Optional.ofNullable(entity.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null));
+ checkVO.setUpdateUserName(Optional.ofNullable(entity.getUpdateUser()).map(UserCache::getUser).map(User::getName).orElse(null));
+ return checkVO;
+ }
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/ControlLevel.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/ControlLevel.java
new file mode 100644
index 0000000..305f241
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/ControlLevel.java
@@ -0,0 +1,44 @@
+package com.hnac.hzims.safeproduct.riskhazards.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ *
+ * 管控级别定义表
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-13
+ */
+@Data
+@TableName("control_level")
+public class ControlLevel extends BaseEntity {
+
+ /**
+ * 管控级别
+ */
+ @TableField("level_desc")
+ private String levelDesc;
+
+ /**
+ * 风险等级
+ */
+ @TableField("risk_level_id")
+ private Long riskLevelId;
+
+ /**
+ * 到位人员
+ */
+ @TableField("in_place_op")
+ private String inPlaceOp;
+
+ /**
+ * 管理人员
+ */
+ @TableField("manage_op")
+ private String manageOp;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/DangerSourceInfo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/DangerSourceInfo.java
new file mode 100644
index 0000000..2670019
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/DangerSourceInfo.java
@@ -0,0 +1,52 @@
+package com.hnac.hzims.safeproduct.riskhazards.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ *
+ * 危险源信息
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("danger_source_info")
+public class DangerSourceInfo extends BaseEntity {
+ /**
+ * 危险源名称
+ */
+ @TableField("danger_source_name")
+ private String dangerSourceName;
+
+ /**
+ * 危险源分类
+ */
+ @TableField("danger_source_type")
+ private String dangerSourceType;
+
+ /**
+ * 风险点id
+ */
+ @TableField("risk_point_id")
+ private Long riskPointId;
+
+ /**
+ * 责任人
+ */
+ @TableField("direct_user")
+ private Long directUser;
+
+ /**
+ * 责任部门
+ */
+ @TableField("direct_dept")
+ private Long directDept;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/entity/HiddenDanger.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/HiddenDanger.java
similarity index 92%
rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/entity/HiddenDanger.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/HiddenDanger.java
index 1924629..b78faad 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/entity/HiddenDanger.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/HiddenDanger.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.hiddendanger.entity;
+package com.hnac.hzims.safeproduct.riskhazards.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskHazardsScreening.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskHazardsScreening.java
new file mode 100644
index 0000000..f5d806d
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskHazardsScreening.java
@@ -0,0 +1,59 @@
+package com.hnac.hzims.safeproduct.riskhazards.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+//风险隐患排查表
+@Data
+@TableName("risk_hazards_screening")
+public class RiskHazardsScreening extends BaseEntity{
+ @ApiModelProperty("项目编码")
+ private String project;//
+
+ @ApiModelProperty("电站编码")
+ private String stationCode;
+
+ @ApiModelProperty("电站名称")
+ private String stationName;
+
+ @ApiModelProperty("项目名称")
+ private String projectName;
+
+ //企业职工伤亡事故标准 casualty_accident 字典
+ @ApiModelProperty("隐患类型")
+ private String casualtyAccident;
+
+ @ApiModelProperty("隐患部位")
+ private String dangerArea;
+
+ @ApiModelProperty("隐患内容")
+ private String dangerContent;
+
+ @ApiModelProperty("隐患等级")
+ private String dangerLevel;
+
+ @ApiModelProperty("责任人")
+ private String dutyPerson;
+
+ @ApiModelProperty("责任人电话")
+ private String dutyPhone;
+
+ @ApiModelProperty("整改措施")
+ private String correctiveMeasure;
+
+ @ApiModelProperty("整改时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date correctiveDate;
+
+ @ApiModelProperty("是否整改")
+ private Integer corrective;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskInfo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskInfo.java
new file mode 100644
index 0000000..77f9115
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskInfo.java
@@ -0,0 +1,69 @@
+package com.hnac.hzims.safeproduct.riskhazards.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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 风险信息表
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("risk_info")
+public class RiskInfo implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 矩阵ID
+ */
+ @TableField("matrix_id")
+ private Long matrixId;
+
+ /**
+ * 最小值
+ */
+ @TableField("risk_value_min")
+ private Integer riskValueMin;
+
+ /**
+ * 最大值
+ */
+ @TableField("risk_value_max")
+ private Integer riskValueMax;
+
+ /**
+ * 可能性
+ */
+ @TableField("risk_level")
+ private String riskLevel;
+
+ /**
+ * 颜色
+ */
+ @TableField("color")
+ private String color;
+
+ /**
+ * 备注
+ */
+ @TableField("remark")
+ private String remark;
+
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixX.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixX.java
new file mode 100644
index 0000000..771104b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixX.java
@@ -0,0 +1,55 @@
+package com.hnac.hzims.safeproduct.riskhazards.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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 风险矩阵X表
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("risk_matrix_x")
+public class RiskMatrixX implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 矩阵ID
+ */
+ @TableField("matrix_id")
+ private Long matrixId;
+
+ /**
+ * 值
+ */
+ @TableField("risk_value_x")
+ private Integer riskValueX;
+
+ /**
+ * 可能性
+ */
+ @TableField("happen_possible")
+ private String happenPossible;
+
+ /**
+ * 发生频率
+ */
+ @TableField("happen_rate")
+ private String happenRate;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixY.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixY.java
new file mode 100644
index 0000000..356d265
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixY.java
@@ -0,0 +1,51 @@
+package com.hnac.hzims.safeproduct.riskhazards.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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 风险矩阵Y表
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("risk_matrix_y")
+public class RiskMatrixY implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 矩阵ID
+ */
+ @TableField("matrix_id")
+ private Long matrixId;
+
+ /**
+ * 值
+ */
+ @TableField("risk_value_y")
+ private Integer riskValueY;
+
+ /**
+ * 可能损失
+ */
+ @TableField("possible_loss")
+ private String possibleLoss;
+
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskPointInfo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskPointInfo.java
new file mode 100644
index 0000000..10eee26
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskPointInfo.java
@@ -0,0 +1,54 @@
+package com.hnac.hzims.safeproduct.riskhazards.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ *
+ * 风险点信息表
+ *
+ *
+ * @author zhaiqm
+ * @since 2023-09-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("risk_point_info")
+public class RiskPointInfo extends BaseEntity {
+
+ /**
+ * 管控级别
+ */
+ @TableField("risk_point_name")
+ private String riskPointName;
+
+ /**
+ * 电站编码
+ */
+ @TableField("station_code")
+ private String stationCode;
+
+ /**
+ * 风险等级
+ */
+ @TableField("risk_level_id")
+ private Long riskLevelId;
+
+ /**
+ * 作业区域
+ */
+ @TableField("work_area_id")
+ private Long workAreaId;
+
+ /**
+ * 事故分类
+ */
+ @TableField("casualty_accident")
+ private String casualtyAccident;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/entity/WorkArea.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/WorkArea.java
similarity index 83%
rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/entity/WorkArea.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/WorkArea.java
index 0f1ae1a..6f0b96e 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/entity/WorkArea.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/WorkArea.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.workarea.entity;
+package com.hnac.hzims.safeproduct.riskhazards.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
@@ -13,7 +13,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
@TableName("work_area")
public class WorkArea {
- @TableId(value = "id", type = IdType.AUTO)
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
@@ -46,9 +46,12 @@ public class WorkArea {
@TableField("area_range")
private String areaRange;
+ @TableField(exist = false)
private String directOpName;
+ @TableField(exist = false)
private String departName;
+ @TableField(exist = false)
private String leadOpName;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/ControlLevelQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/ControlLevelQueryVo.java
new file mode 100644
index 0000000..e782495
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/ControlLevelQueryVo.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import com.hnac.hzims.safeproduct.riskhazards.entity.ControlLevel;
+import lombok.Data;
+
+@Data
+public class ControlLevelQueryVo extends ControlLevel {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/DangerSourceInfoQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/DangerSourceInfoQueryVo.java
new file mode 100644
index 0000000..177b15e
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/DangerSourceInfoQueryVo.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import com.hnac.hzims.safeproduct.riskhazards.entity.DangerSourceInfo;
+import lombok.Data;
+
+@Data
+public class DangerSourceInfoQueryVo extends DangerSourceInfo {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/vo/HiddenDangerQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/HiddenDangerQueryVo.java
similarity index 81%
rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/vo/HiddenDangerQueryVo.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/HiddenDangerQueryVo.java
index 384bab9..06f9303 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/vo/HiddenDangerQueryVo.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/HiddenDangerQueryVo.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.hiddendanger.vo;
+package com.hnac.hzims.safeproduct.riskhazards.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskHazardsScreeningVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskHazardsScreeningVo.java
new file mode 100644
index 0000000..e309362
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskHazardsScreeningVo.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import com.hnac.hzims.safeproduct.riskhazards.entity.RiskHazardsScreening;
+import lombok.Data;
+
+@Data
+public class RiskHazardsScreeningVo extends RiskHazardsScreening {
+ String createUserName;
+ String casualtyAccidentName;//类型名
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskInfoQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskInfoQueryVo.java
new file mode 100644
index 0000000..97d96c0
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskInfoQueryVo.java
@@ -0,0 +1,7 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import lombok.Data;
+
+@Data
+public class RiskInfoQueryVo {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixXQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixXQueryVo.java
new file mode 100644
index 0000000..af432f8
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixXQueryVo.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import lombok.Data;
+
+@Data
+public class RiskMatrixXQueryVo {
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixYQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixYQueryVo.java
new file mode 100644
index 0000000..3401b69
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixYQueryVo.java
@@ -0,0 +1,7 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import lombok.Data;
+
+@Data
+public class RiskMatrixYQueryVo {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskPointInfoQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskPointInfoQueryVo.java
new file mode 100644
index 0000000..eae991f
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskPointInfoQueryVo.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.safeproduct.riskhazards.vo;
+
+import com.hnac.hzims.safeproduct.riskhazards.entity.RiskPointInfo;
+import lombok.Data;
+
+@Data
+public class RiskPointInfoQueryVo extends RiskPointInfo {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/vo/WorkAreaQueryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/WorkAreaQueryVo.java
similarity index 90%
rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/vo/WorkAreaQueryVo.java
rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/WorkAreaQueryVo.java
index 61c2160..072bd82 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/vo/WorkAreaQueryVo.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/WorkAreaQueryVo.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.workarea.vo;
+package com.hnac.hzims.safeproduct.riskhazards.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/Constants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/Constants.java
new file mode 100644
index 0000000..d0f7bac
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/Constants.java
@@ -0,0 +1,4 @@
+package com.hnac.hzims.safeproduct.statistic;
+
+public interface Constants {
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/DangerRiskScatterVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/DangerRiskScatterVO.java
new file mode 100644
index 0000000..63d0d3d
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/DangerRiskScatterVO.java
@@ -0,0 +1,31 @@
+package com.hnac.hzims.safeproduct.statistic.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName DangerRiskScatterVO
+ * @description:
+ * @author: hx
+ * @create: 2023-09-20 10:20
+ * @Version 4.0
+ **/
+@Data
+@EqualsAndHashCode
+@ApiModel("隐患分布统计")
+public class DangerRiskScatterVO implements Serializable {
+
+ @ApiModelProperty("统计年月")
+ private String yearAndMonth;
+
+ @ApiModelProperty("隐患等级")
+ private String hiddenDangerLevel;
+
+ @ApiModelProperty("隐患个数")
+ private Integer hiddenDangerCount;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerAccidentMonthCountVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerAccidentMonthCountVO.java
new file mode 100644
index 0000000..0316fab
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerAccidentMonthCountVO.java
@@ -0,0 +1,34 @@
+package com.hnac.hzims.safeproduct.statistic.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName RiskDangerAccidentMonthCount
+ * @description:
+ * @author: hx
+ * @create: 2023-09-20 10:31
+ * @Version 4.0
+ **/
+@ApiModel("风险/隐患/事故月份统计")
+@Data
+@EqualsAndHashCode
+public class RiskDangerAccidentMonthCountVO implements Serializable {
+
+ @ApiModelProperty("年月")
+ private String yearAndMonth;
+
+ @ApiModelProperty("风险个数")
+ private Integer riskCount;
+
+ @ApiModelProperty("隐患个数")
+ private Integer dangerCount;
+
+ @ApiModelProperty("事故个数")
+ private Integer accidentCount;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerStatisticVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerStatisticVO.java
new file mode 100644
index 0000000..ecd161a
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerStatisticVO.java
@@ -0,0 +1,38 @@
+package com.hnac.hzims.safeproduct.statistic.vo;
+
+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 RiskDangerStatisticVO
+ * @description: 首页-风险隐患模块返回数据
+ * @author: hx
+ * @create: 2023-09-20 09:43
+ * @Version 4.0
+ **/
+@Data
+@ApiModel("风险隐患模块返回数据")
+@EqualsAndHashCode
+public class RiskDangerStatisticVO implements Serializable {
+
+ @ApiModelProperty("风险等级站点统计")
+ private List stationRiskStatistics;
+
+ @ApiModelProperty("本月风险辨识评价数")
+ private Integer riskCheckMonthCount;
+
+ @ApiModelProperty("本月隐患排查数")
+ private Integer dangerCheckMonthCount;
+
+ @ApiModelProperty("今日新增隐患数")
+ private Integer dangerAddDailyCount;
+
+ @ApiModelProperty("本月各级隐患分布统计")
+ private List riskScatterCurrentMonth;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskInnerVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskInnerVO.java
new file mode 100644
index 0000000..1284a0b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskInnerVO.java
@@ -0,0 +1,26 @@
+package com.hnac.hzims.safeproduct.statistic.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @author ysj
+ */
+@Data
+@ApiModel("电站风险/隐患统计")
+@EqualsAndHashCode
+public class RiskInnerVO implements Serializable {
+
+ @ApiModelProperty("风险等级:1-低风险 2-一般风险 3-较大风险 4-重大风险")
+ private Integer riskLevel;
+
+ @ApiModelProperty("风险个数")
+ private Integer riskCount;
+
+ @ApiModelProperty("隐患个数")
+ private Integer innerCount;
+}
\ No newline at end of file
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/StationRiskStatisticVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/StationRiskStatisticVO.java
new file mode 100644
index 0000000..3f1be67
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/StationRiskStatisticVO.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.statistic.vo;
+
+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 StationRiskStatisticVO
+ * @description:
+ * @author: hx
+ * @create: 2023-09-20 09:50
+ * @Version 4.0
+ **/
+@Data
+@EqualsAndHashCode
+@ApiModel("站点风险统计一览")
+public class StationRiskStatisticVO implements Serializable {
+
+ @ApiModelProperty("风险等级")
+ private Long riskLevel;
+
+ @ApiModelProperty("站点名称集合")
+ private List stations;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java
index 278e6b7..dbeec77 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java
@@ -58,4 +58,7 @@ public class CarMaintenanceDetailVO {
@ApiModelProperty("车牌号")
private String plateNumber;
+
+ @ApiModelProperty("维保类型")
+ private String maintenanceType;
}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java
index 87880ad..515a252 100644
--- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java
@@ -14,6 +14,9 @@ import java.util.Date;
@ApiModel(value = "会议记录表VO类")
public class ConferenceRecordDetailVO {
+ @ApiModelProperty("编码")
+ private String code;
+
@ApiModelProperty("会议实际开始时间")
private Date actualStartTime;
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerBaseVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerBaseVo.java
new file mode 100644
index 0000000..35f2608
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerBaseVo.java
@@ -0,0 +1,170 @@
+package com.hnac.hzims.safeproduct.vo;
+
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+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.tenant.mp.TenantEntity;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "隐患基础信息", description = "隐患基础信息")
+public class HiddenDangerBaseVo extends TenantEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 隐患编码
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "隐患编码")
+ private String code;
+ /**
+ * 平台taskId
+ */
+ @ApiModelProperty(value = "平台任务Id")
+ private String taskId;
+ /**
+ * 流程实例
+ */
+ @ApiModelProperty(value = "流程实例")
+ private String processInstanceId;
+
+ //===================风险点基础信息========================
+ /**
+ * 站点编码
+ */
+ @ApiModelProperty(value = "站点编码")
+ private String stationCode;
+ /**
+ * 风险点Id
+ */
+ @ApiModelProperty(value = "风险点Id")
+ private String riskPointId;
+ /**
+ * 风险点名称
+ */
+ @ApiModelProperty(value = "风险点名称")
+ private String riskPointName;
+ /**
+ * 排查项目
+ */
+ @ApiModelProperty(value = "排查项目")
+ private String investigation;
+ /**
+ * 风险点类型
+ */
+ @ApiModelProperty(value = "风险点类型")
+ private String riskPointType;
+ /**
+ * 隐患责任部门
+ */
+ @ApiModelProperty(value = "隐患责任部门")
+ private String hiddenDangerDept;
+ /**
+ * 隐患责任部门
+ */
+ @ApiModelProperty(value = "隐患责任部门")
+ private String hiddenDangerDeptName;
+ /**
+ * 隐患地点
+ */
+ @ApiModelProperty(value = "隐患地点")
+ private String hiddenDangerAddr;
+
+ //===================隐患基础信息========================
+ /**
+ * 隐患名称
+ */
+ @ApiModelProperty(value = "隐患名称")
+ private String hiddenDangerName;
+ /**
+ * 隐患类别
+ */
+ @ApiModelProperty(value = "隐患类别")
+ private String hiddenDangerType;
+ /**
+ * 隐患照片地址
+ */
+ @ApiModelProperty(value = "隐患照片地址")
+ private String hiddenDangerPic;
+ /**
+ * 登记人
+ */
+ @ApiModelProperty(value = "登记人")
+ private String registrant;
+ /**
+ * 登记人姓名
+ */
+ @ApiModelProperty(value = "登记人姓名")
+ private String registrantName;
+ /**
+ * 登记时间
+ */
+ @ApiModelProperty(value = "登记时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date registrantTime;
+ /**
+ * 登记时间
+ */
+ @ApiModelProperty(value = "登记时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date registrantStartTime;
+ /**
+ * 登记时间
+ */
+ @ApiModelProperty(value = "登记时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date registrantEndTime;
+ /**
+ * 当前处理环节
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前处理环节")
+ private String currentOperator;
+ /**
+ * 当前环节处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前环节处理人")
+ private String currentLinkHandler;
+
+ //===================判定信息========================
+ /**
+ * 判定人
+ */
+ @ApiModelProperty(value = "判定人")
+ private String judge;
+ /**
+ * 判定人姓名
+ */
+ @ApiModelProperty(value = "判定人姓名")
+ private String judgeName;
+ /**
+ * 判定结果
+ */
+ @ApiModelProperty(value = "判定结果")
+ private String judgeRes;
+ /**
+ * 判定结果
+ */
+ @ApiModelProperty(value = "判定结果")
+ private String judgeContext;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerCheckVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerCheckVo.java
new file mode 100644
index 0000000..bf6c32b
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerCheckVo.java
@@ -0,0 +1,69 @@
+package com.hnac.hzims.safeproduct.vo;
+
+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.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "隐患核查信息", description = "隐患核查信息")
+public class HiddenDangerCheckVo extends HiddenDangerBaseVo {
+
+//===================核查信息========================
+ /**
+ * 隐患等级(核查结果)1.低风险;2一般风险;3较大风险;4重大风险
+ */
+ @ApiModelProperty(value = "隐患等级(核查结果)")
+ private Integer hiddenDangerLevel;
+ /**
+ * 核查意见
+ */
+ @ApiModelProperty(value = "核查意见")
+ private String checkView;
+ /**
+ * 核查治理措施
+ */
+ @ApiModelProperty(value = "核查治理措施")
+ private String measures;
+
+ /**
+ * 核查人
+ */
+ @ApiModelProperty(value = "核查人")
+ private Integer checkPeople;
+ /**
+ * 核查人姓名
+ */
+ @ApiModelProperty(value = "核查人姓名")
+ private String checkPeopleName;
+ /**
+ * 核查时间
+ */
+ @ApiModelProperty(value = "核查时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date checkTime;
+ /**
+ * 核查时间
+ */
+ @ApiModelProperty(value = "核查开始时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date checkStartTime;
+ /**
+ * 核查时间
+ */
+ @ApiModelProperty(value = "核查结束时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date checkEndTime;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerConclusionVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerConclusionVo.java
new file mode 100644
index 0000000..00728b2
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerConclusionVo.java
@@ -0,0 +1,62 @@
+package com.hnac.hzims.safeproduct.vo;
+
+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.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "隐患验收信息", description = "隐患验收信息")
+public class HiddenDangerConclusionVo extends HiddenDangerBaseVo {
+ /**
+ * 验收结果(完成,未完成)
+ */
+ @ApiModelProperty(value = "验收结果(完成,未完成)")
+ private Integer conclusionRes;
+
+ /**
+ * 验收人
+ */
+ @ApiModelProperty(value = "验收人")
+ private String conclusionPeople;
+ /**
+ * 验收验收人姓名
+ */
+ @ApiModelProperty(value = "验收验收人姓名")
+ private String conclusionPeopleName;
+ /**
+ * 验收意见
+ */
+ @ApiModelProperty(value = "验收意见")
+ private String conclusionView;
+ /**
+ * 验收时间
+ */
+ @ApiModelProperty(value = "验收时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date conclusionTime;
+ /**
+ * 验收时间
+ */
+ @ApiModelProperty(value = "验收时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date conclusionStartTime;
+ /**
+ * 验收时间
+ */
+ @ApiModelProperty(value = "验收时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date conclusionEndTime;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerRectifierVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerRectifierVo.java
new file mode 100644
index 0000000..436a179
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerRectifierVo.java
@@ -0,0 +1,104 @@
+package com.hnac.hzims.safeproduct.vo;
+
+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.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "隐患整改信息", description = "隐患整改信息")
+public class HiddenDangerRectifierVo extends HiddenDangerBaseVo {
+ /**
+ * 整改责任人
+ */
+ @ApiModelProperty(value = "整改责任人")
+ private Integer rectifier;
+ /**
+ * 整改责任人姓名
+ */
+ @ApiModelProperty(value = "整改责任人姓名")
+ private String rectifierName;
+ /**
+ * 整改责任部门ID
+ */
+ @ApiModelProperty(value = "整改责任部门ID")
+ private Integer rectifierDept;
+ /**
+ * 整改责任部门名称
+ */
+ @ApiModelProperty(value = "整改责任部门名称")
+ private String rectifierDeptName;
+ /**
+ * 整改类型(立即整改)
+ */
+ @ApiModelProperty(value = "整改类型(立即整改)1立即整改、2停产停业整改、3限期整改")
+ private Integer rectifierType;
+ /**
+ * 完成期限
+ */
+ @ApiModelProperty(value = "完成期限")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date deadLine;
+ /**
+ * 反馈时间
+ */
+ @ApiModelProperty(value = "期限开始时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date deadLineStartTime;
+ /**
+ * 反馈时间
+ */
+ @ApiModelProperty(value = "期限结束时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date deadLineEndTime;
+ /**
+ * 整改通知单号
+ */
+ @ApiModelProperty(value = "整改通知单号")
+ private Long rectifierId;
+ //===================隐患整改反馈表========================
+ /**
+ * 隐患存在原因
+ */
+ @ApiModelProperty(value = "隐患存在原因")
+ private String rectifierReason;
+ /**
+ * 治理后的效果图
+ */
+ @ApiModelProperty(value = "治理后的效果图")
+ private String rectifierPic;
+ /**
+ * 反馈时间
+ */
+ @ApiModelProperty(value = "反馈时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date rectifierTime;
+ /**
+ * 反馈时间
+ */
+ @ApiModelProperty(value = "反馈开始时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date rectifierStartTime;
+ /**
+ * 反馈时间
+ */
+ @ApiModelProperty(value = "反馈结束时间")
+ @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
+ @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
+ private Date rectifierEndTime;
+
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/InnerDangerVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/InnerDangerVo.java
new file mode 100644
index 0000000..ad4557f
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/InnerDangerVo.java
@@ -0,0 +1,38 @@
+package com.hnac.hzims.safeproduct.vo;
+
+import com.hnac.hzims.safeproduct.entity.InnerDangerEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "隐患信息表", description = "隐患信息表")
+public class InnerDangerVo extends InnerDangerEntity implements Serializable {
+ /**
+ * 判定人
+ */
+ @ApiModelProperty(value = "判定人")
+ private String judgeFlow;
+ /**
+ * 核查人
+ */
+ @ApiModelProperty(value = "核查人")
+ private String checkPeopleFlow;
+ /**
+ * 整改责任人
+ */
+ @ApiModelProperty(value = "整改责任人")
+ private String rectifierFlow;
+ /**
+ * 验收人
+ */
+ @ApiModelProperty(value = "验收人")
+ private String conclusionPeopleFlow;
+}
diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RiskCheckVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RiskCheckVO.java
new file mode 100644
index 0000000..566f2bf
--- /dev/null
+++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RiskCheckVO.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.vo;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName RiskCheckVO
+ * @description: 风险点检查项VO
+ * @author: hx
+ * @create: 2023-09-19 09:28
+ * @Version 4.0
+ **/
+@Data
+@EqualsAndHashCode
+@ApiModel("风险点检查项VO")
+public class RiskCheckVO extends RiskCheckEntity implements Serializable {
+
+ @ApiModelProperty("创建人名称")
+ private String creatorName;
+
+ @ApiModelProperty("更新人名称")
+ private String updateUserName;
+
+}
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java
index adf341f..3713c48 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java
@@ -1,12 +1,19 @@
package com.hnac.hzims.ticket.repair.entity;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
+import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -95,4 +102,5 @@ public class WorkTaskEntity extends TenantEntity {
@ApiModelProperty(value = "创建机构名称")
private String deptName;
+
}
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java
index e2cd03d..e530937 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java
@@ -13,6 +13,9 @@ public class WorkTaskContentVO {
private String location;
@ApiModelProperty(value = "工作内容")
- private Integer content;
+ private String content;
+
+ @ApiModelProperty(value = "下标")
+ private Integer $index;
}
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java
index 090f28e..88110e8 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java
@@ -1,9 +1,13 @@
package com.hnac.hzims.ticket.repair.vo;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
/**
* @author ysj
@@ -12,8 +16,23 @@ import lombok.EqualsAndHashCode;
@Data
public class WorkTaskPreviewVO extends WorkTaskEntity {
- @ApiModelProperty(value = "机构名称")
- private String deptName;
+ @ApiModelProperty("创建人")
+ private Long userId;
+
+ @ApiModelProperty("创建部门")
+ private Long deptId;
+
+ @ApiModelProperty("创建时间")
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ private Date time;
+
+ @ApiModelProperty(value = "单位")
+ private String company;
@ApiModelProperty(value = "班组成员数量")
private Integer groupCount;
@@ -45,7 +64,6 @@ public class WorkTaskPreviewVO extends WorkTaskEntity {
@ApiModelProperty(value = "签发时间: 分")
private Integer createMin;
-
@ApiModelProperty(value = "开票处理时间: 年")
private Integer headYear;
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java
index fcf8d24..7d95c29 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java
@@ -138,17 +138,19 @@ public class MessagePushSchedule {
request.setSmsParam(request.getContent());
}
request.setMessageId(IdWorker.getId());
- Boolean flag = service.send(request);
- if(!flag) {
- return;
+ try {
+ Boolean flag = service.send(request);
+ List ids = records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList());
+ // 更新消息推送状态
+ LambdaUpdateWrapper lwq = Wrappers.lambdaUpdate()
+ .set(MessagePushRecordEntity::getStatus, flag ? MessageConstants.PUSH_SUCCESS : MessageConstants.PUSH_FAILED)
+ .set(MessagePushRecordEntity::getPushTime,LocalDateTime.now())
+ .in(MessagePushRecordEntity::getId, ids);
+ recordService.update(lwq);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
}
- List ids = records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList());
- // 更新消息推送状态
- LambdaUpdateWrapper lwq = Wrappers.lambdaUpdate()
- .set(MessagePushRecordEntity::getStatus, flag ? MessageConstants.PUSH_SUCCESS : MessageConstants.PUSH_FAILED)
- .set(MessagePushRecordEntity::getPushTime,LocalDateTime.now())
- .in(MessagePushRecordEntity::getId, ids);
- recordService.update(lwq);
});
});
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/FlowKeyConstants.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/FlowKeyConstants.java
new file mode 100644
index 0000000..f58b7fb
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/FlowKeyConstants.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.operational.constants;
+
+public interface FlowKeyConstants {
+
+ /**日常维护任务流程key**/
+ String MAINTENANCE_TASK_FLOW_KEY = "maintenance_test";
+
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java
index 219397f..c0f0cad 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java
@@ -11,6 +11,9 @@ import org.springframework.stereotype.Component;
@Data
public class RedisKeyConstants {
+ public static String MAINTENANCE_TASK_DELAY_LIST = "hzims:operation:maintenance:end:delay:tasks";
+ public static String REMIND_TASK_END_LIST = "hzims:operation:maintenance:end:delay:tasks";
+
/**根据realId获取实时数据**/
@Value("${hzims.operation.realIdKey}")
private String realDataByRealId;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java
index 4a56847..abe2ff8 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java
@@ -45,6 +45,7 @@ public class GenerateController extends BladeController {
public R saveOrUpdate(@RequestBody GenerateEntity entity) {
return R.status(service.saveUpdate(entity));
}
+
/**
* 新增
*/
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java
index 689076e..f46dac8 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java
@@ -21,6 +21,7 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
+import java.util.List;
/**
* @author ysj
@@ -40,16 +41,28 @@ public class RainfallController extends BladeController {
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
- @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
+ @ApiOperation(value = "新增", notes = "传入RainfallEntity对象")
public R saveOrUpdate(@RequestBody RainfallEntity entity) {
return R.status(service.saveUpdate(entity));
}
+
+ /**
+ * 批量新增
+ */
+ @PostMapping("/batchSave")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "新增", notes = "传入RainfallEntity对象集合")
+ public R batchSave(@RequestBody List rains) {
+ return R.status(service.batchSave(rains));
+ }
+
+
/**
* 删除
*/
@PostMapping("/remove")
- @ApiOperationSupport(order = 2)
+ @ApiOperationSupport(order = 3)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java
index 49c3d84..5a99470 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java
@@ -20,6 +20,8 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
/**
* @author ysj
* @date 2023/04/10 11:16:07
@@ -38,16 +40,26 @@ public class UseController extends BladeController {
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
- @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
+ @ApiOperation(value = "新增", notes = "传入UseEntity对象")
public R saveOrUpdate(@RequestBody UseEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
+ * 批量新增
+ */
+ @PostMapping("/batchSave")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "批量新增", notes = "传入UseEntity对象集合")
+ public R batchSave(@RequestBody List uses) {
+ return R.status(service.batchSave(uses));
+ }
+
+ /**
* 删除
*/
@PostMapping("/remove")
- @ApiOperationSupport(order = 2)
+ @ApiOperationSupport(order = 3)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java
index 42bab3f..007ef5e 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java
@@ -8,14 +8,12 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
-/**
- * @author ysj
- * @date 2023/03/09 16:12:22
- * @version 4.0.0
- */
+import java.util.List;
+
/**
* 接入电站历史发电量填报
+ * @author ysj
*/
public interface RainfallService extends BaseService {
@@ -24,4 +22,7 @@ public interface RainfallService extends BaseService {
// 新增/修改水利降雨量填报数据
boolean saveUpdate(RainfallEntity entity);
+
+ // 批量保存降雨量填补数据
+ boolean batchSave(List rains);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java
index e80d319..91632f6 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java
@@ -22,6 +22,9 @@ public interface UseService extends BaseService {
// 分页查询用电量填报数据
R> pageCondition(QueryVo filter, Query query);
+ // 批量报错用电量填报数据
+ boolean batchSave(List uses);
+
// 新增/修改用电量填报数据
boolean saveUpdate(UseEntity entity);
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
index cd315be..3463168 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
@@ -102,8 +102,8 @@ public class GenerateServiceImpl extends BaseServiceImpl ids = entityList.stream().
filter(s -> ObjectUtil.isEmpty(s.getGenerate()))
- .filter(s -> ObjectUtil.isNotEmpty(s.getId()))
- .map(GenerateEntity::getId).collect(Collectors.toList());
+ .map(GenerateEntity::getId)
+ .filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
boolean deleteFlag =true;
if (CollectionUtil.isNotEmpty(ids)){
deleteFlag= this.deleteLogic(ids);
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java
index 2db7b57..e50c1e9 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java
@@ -3,15 +3,13 @@ package com.hnac.hzims.operational.fill.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.operational.fill.entity.RainfallEntity;
-import com.hnac.hzims.operational.fill.entity.StorageEntity;
import com.hnac.hzims.operational.fill.mapper.RainfallMapper;
import com.hnac.hzims.operational.fill.service.RainfallService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.RainfallVo;
-import com.hnac.hzims.operational.fill.wrapper.OverWrapper;
import com.hnac.hzims.operational.fill.wrapper.RainfallWrapper;
-import com.hnac.hzims.operational.fill.wrapper.StorageWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
@@ -19,11 +17,14 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
+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.transaction.annotation.Transactional;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @author ysj
@@ -51,7 +52,7 @@ public class RainFallServiceImpl extends BaseServiceImpl rains) {
+ // 查询填报数据中存在的填报数据
+ List filleds = this.list(Wrappers.lambdaQuery()
+ .eq(RainfallEntity::getStationCode,rains.get(0).getStationCode())
+ .in(RainfallEntity::getFillDate,rains.stream().map(RainfallEntity::getFillDate).collect(Collectors.toList()))
+ );
+
+ // 如果存在就进行删除原来的填报数据
+ if(CollectionUtil.isNotEmpty(filleds)){
+ this.deleteLogic(filleds.stream().map(RainfallEntity::getId).collect(Collectors.toList()));
+ }
+
+ // 批量保存填报数据
+ return this.saveBatch(rains);
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
index 2b03da4..fc00b17 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
@@ -4,15 +4,12 @@ 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.operational.fill.entity.GenerateEntity;
-import com.hnac.hzims.operational.fill.entity.PowerEntity;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.mapper.UseMapper;
import com.hnac.hzims.operational.fill.service.UseService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import com.hnac.hzims.operational.fill.wrapper.UseWrapper;
-import com.hnac.hzims.operational.main.vo.PowerMonthVo;
import com.hnac.hzims.operational.main.vo.UsrPowerVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -26,6 +23,7 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@@ -66,6 +64,29 @@ public class UseServiceImpl extends BaseServiceImpl implem
}
/**
+ * 批量报错用电量填报数据
+ * @param uses
+ * @return
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public boolean batchSave(List uses) {
+ // 查询填报数据中存在的填报数据
+ List filleds = this.list(Wrappers.lambdaQuery()
+ .eq(UseEntity::getStationCode,uses.get(0).getStationCode())
+ .in(UseEntity::getFillDate,uses.stream().map(UseEntity::getFillDate).collect(Collectors.toList()))
+ );
+
+ // 如果存在就进行删除原来的填报数据
+ if(CollectionUtil.isNotEmpty(filleds)){
+ this.deleteLogic(filleds.stream().map(UseEntity::getId).collect(Collectors.toList()));
+ }
+
+ // 批量保存填报数据
+ return this.saveBatch(uses);
+ }
+
+ /**
* 新增/修改用电量填报数据
* @param entity
* @return
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java
new file mode 100644
index 0000000..917c51c
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java
@@ -0,0 +1,103 @@
+package com.hnac.hzims.operational.maintenance.scheduled;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.google.common.collect.Lists;
+import com.hnac.hzims.common.constant.CommonConstant;
+import com.hnac.hzims.message.MessageConstants;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
+import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.operational.constants.RedisKeyConstants;
+import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
+import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.feign.ISysClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.REMIND_MAINTENANCE_BECOME_TASK;
+@Component
+@Slf4j
+@AllArgsConstructor
+public class MaintenanceTaskRemindHandler {
+
+ private final RedisTemplate redisTemplate;
+ private final IOperMaintenanceTaskService taskService;
+ private final IUserClient userClient;
+ private final IMessageClient messageClient;
+
+ @XxlJob(REMIND_MAINTENANCE_BECOME_TASK)
+ public ReturnT execute(String param) {
+ //获取当前时间段 redis内缓存的任务列表
+ Set taskEntitySet = redisTemplate.opsForZSet().rangeByScore(RedisKeyConstants.REMIND_TASK_END_LIST,0, LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
+ XxlJobLogger.log("从redis内取出{}条数据",taskEntitySet.size());
+ if(CollectionUtil.isNotEmpty(taskEntitySet)) {
+ taskEntitySet.forEach(operMaintenanceTaskEntity -> {
+ OperMaintenanceTaskEntity taskEntity = taskService.getById(operMaintenanceTaskEntity.getId());
+ if(StringUtil.isBlank(taskEntity.getFlowTaskName())) {
+ redisTemplate.opsForZSet().remove(RedisKeyConstants.REMIND_TASK_END_LIST,operMaintenanceTaskEntity);
+ }
+ //如果任务仍在待执行则自动结束
+ else if(Lists.newArrayList("待领用","待执行").contains(taskEntity.getFlowTaskName())) {
+ XxlJobLogger.log("开始执行id为{}的任务", Optional.ofNullable(operMaintenanceTaskEntity.getId()).orElse(0L));
+ //日常维护任务到期消息提醒,提醒对象:执行人、项目经理角色 取出
+ this.sendMessage(taskEntity);
+ redisTemplate.opsForZSet().remove(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,operMaintenanceTaskEntity);
+ }
+ });
+ }
+ else {
+ XxlJobLogger.log("无提醒任务!");
+ }
+ return new ReturnT<>("SUCCESS");
+ }
+
+ /**
+ * 推送消息
+ * @param taskEntity 日常维护任务
+ */
+ private void sendMessage(OperMaintenanceTaskEntity taskEntity) {
+ String disposer = taskEntity.getDisposer();
+ BusinessMessageDTO request = new BusinessMessageDTO();
+ request.setDeptId(taskEntity.getCreateDept());
+ request.setBusinessClassify(MessageConstants.BusinessClassifyEnum.OPERATIONAL.getKey());
+ request.setBusinessKey("maintenance_task_remind");
+ request.setTaskId(taskEntity.getId());
+ request.setContent("您有一条待执行的日常维护任务【"+taskEntity.getTitle()+"】即将于"+ DateUtil.format(taskEntity.getPlanEndTime(),DateUtil.PATTERN_DATETIME) +"过期,请即时处理。");
+ request.setSubject("日常维护任务到期提醒");
+ request.setUserIds(disposer);
+ request.setCreateUser(taskEntity.getCreateUser());
+ request.setTenantId(CommonConstant.TENANT_ID);
+ R sendFlag = messageClient.sendAppAndWsMsgByUsers(request);
+ if(!(sendFlag.isSuccess() && sendFlag.getData())) {
+ XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
+ }
+ // 任务执行人发送短信
+ R> listR = userClient.userByDeptId(CommonConstant.TENANT_ID, taskEntity.getCreateDept());
+ if(listR.isSuccess()) {
+ request.setUserIds(listR.getData().stream().map(User::getId).map(String::valueOf).collect(Collectors.joining(",")));
+ request.setContent("有一条待执行的日常维护任务【"+taskEntity.getTitle()+"】即将于"+ DateUtil.format(taskEntity.getPlanEndTime(),DateUtil.PATTERN_DATETIME) +"过期,请确认。");
+ R result = messageClient.sendAppAndWsMsgByUsers(request);
+ if(!(result.isSuccess() && result.getData())) {
+ XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
+ }
+ }
+ }
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
index ac69b88..cbe29fc 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
@@ -4,6 +4,8 @@ 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.equipment.feign.IEmInfoClient;
+import com.hnac.hzims.operational.constants.FlowKeyConstants;
+import com.hnac.hzims.operational.constants.RedisKeyConstants;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceLibraryEntity;
@@ -39,9 +41,7 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.TASK_VALUE_MAINTENANCE_TASK_CREATE;
-import static com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskCreateTask.REMIND_TASK_END_LIST;
-import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE;
+import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.GENERATE_MAINTENANCE_TASK_SCHEDULE;
/**
* 日常维护任务生成
@@ -58,12 +58,12 @@ public class MaintenanceTaskSchedule {
private final IImsDutyMainService dutyMainService;
private final RedisTemplate redisTemplate;
- //@XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE)
+ @XxlJob(GENERATE_MAINTENANCE_TASK_SCHEDULE)
public ReturnT execute(String param) throws Exception {
Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE);
Date endDate = DateUtil.parse(DateUtil.formatDate(DateUtil.plusDays(startDate, 1)), DateUtil.PATTERN_DATE);
LambdaQueryWrapper planQW = Wrappers.lambdaQuery().isNull(OperMaintenancePlanEntity::getCreateTaskTime)
- .gt(OperMaintenancePlanEntity::getDisposeTime, startDate).le(OperMaintenancePlanEntity::getDisposeTime, endDate);
+ .ge(OperMaintenancePlanEntity::getDisposeTime, startDate).lt(OperMaintenancePlanEntity::getDisposeTime, endDate);
List planList = planService.list(planQW);
XxlJobLogger.log("日常维护任务生成开始!计划ID为:"+planList.stream().map(OperMaintenancePlanEntity::getId).map(String::valueOf).collect(Collectors.joining(",")));
//分页插入日常维护计划
@@ -94,6 +94,7 @@ public class MaintenanceTaskSchedule {
else {
this.createTask(taskEntity,plan);
}
+ planService.update(Wrappers.lambdaUpdate().set(OperMaintenancePlanEntity::getCreateTaskTime,new Date()).eq(OperMaintenancePlanEntity::getId,plan.getId()));
}
catch(Exception e) {
logger.error("MaintenanceTaskSchedule:generateTaskByPlan",e.getLocalizedMessage());
@@ -142,7 +143,10 @@ public class MaintenanceTaskSchedule {
}
// 保存日常维护任务
if(taskService.save(task)) {
- redisTemplate.opsForZSet().add(REMIND_TASK_END_LIST,task,task.getPlanEndTime().toEpochSecond(ZoneOffset.of("+8")));
+ // redis存入待逾期状态处理任务
+ redisTemplate.opsForZSet().add(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,task,task.getPlanEndTime().toEpochSecond(ZoneOffset.of("+8")));
+ // 到期时间提醒
+ redisTemplate.opsForZSet().add(RedisKeyConstants.REMIND_TASK_END_LIST,task,task.getPlanEndTime().toEpochSecond(ZoneOffset.of("+8")));
this.startProcessInstance(task);
}
}
@@ -167,7 +171,7 @@ public class MaintenanceTaskSchedule {
});
put("operMaintenanceTaskEntityVo",vo);
}};
- R flowResult = flowClient.startProcessInstanceContainNameByKey("", String.valueOf(task.getId()), task.getTitle(), params);
+ R flowResult = flowClient.startProcessInstanceContainNameByKey(FlowKeyConstants.MAINTENANCE_TASK_FLOW_KEY, String.valueOf(task.getId()), task.getTitle(), params);
return Optional.ofNullable(flowResult).filter(r -> r.isSuccess()).map(R::getData).map(BladeFlow::getProcessInstanceId).orElse(null);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/TaskOverdueHandler.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/TaskOverdueHandler.java
index d581bd3..18628ff 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/TaskOverdueHandler.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/TaskOverdueHandler.java
@@ -1,6 +1,8 @@
package com.hnac.hzims.operational.maintenance.scheduled;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.google.common.collect.Lists;
+import com.hnac.hzims.operational.constants.RedisKeyConstants;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
@@ -14,6 +16,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
import org.springblade.flow.core.feign.IFlowClient;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
@@ -27,7 +30,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.TASK_MAINTENANCE_OVERDUE_HANDLER;
-import static com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskCreateTask.REMIND_TASK_END_LIST;
/**
* @author hx
@@ -39,75 +41,27 @@ public class TaskOverdueHandler {
private final RedisTemplate redisTemplate;
private final IOperMaintenanceTaskService taskService;
- private final IFlowClient flowClient;
- private final ITicketInfoClient ticketInfoClient;
-
-// @XxlJob(TASK_MAINTENANCE_OVERDUE_HANDLER)
-// public ReturnT execute(String param) throws Exception {
-// //获取当前时间段 redis内缓存的任务列表
-// Set taskEntitySet = redisTemplate.opsForZSet().rangeByScore(REMIND_TASK_END_LIST,0, LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
-// //XxlJobLogger.log("从redis内取出{}条数据",taskEntitySet.size());
-// if(CollectionUtil.isNotEmpty(taskEntitySet)) {
-// ExecutorService executorService = Executors.newSingleThreadExecutor();
-// executorService.execute(()-> {
-// taskEntitySet.forEach(operMaintenanceTaskEntity -> {
-// OperMaintenanceTaskEntity taskEntity = taskService.getById(operMaintenanceTaskEntity.getId());
-// //如果任务仍在待执行则自动结束
-// if(MaintenanceConstant.TASK_STATUS_5 != taskEntity.getStatus()) {
-// XxlJobLogger.log("开始执行id为{}的任务", Optional.ofNullable(operMaintenanceTaskEntity.getId()).orElse(0L));
-// //将任务置为未完成状态
-// LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper();
-// updateWrapper.set(OperMaintenanceTaskEntity::getStatus,MaintenanceConstant.TASK_STATUS_6);
-// updateWrapper.set(OperMaintenanceTaskEntity::getDelayStatus,true);
-// updateWrapper.eq(OperMaintenanceTaskEntity::getId,operMaintenanceTaskEntity.getId());
-// taskService.update(updateWrapper);
-// //若该任务已领用 则终止工作流
-// if(Func.isNotEmpty(taskEntity.getProcessInstanceId())){
-// R delFlowResult = flowClient.delProcessInstanceById(taskEntity.getProcessInstanceId(),"该日常维护任务已逾期,删除工作流");
-// if(!delFlowResult.isSuccess()){
-// XxlJobLogger.log(delFlowResult.getMsg());
-// throw new ServiceException(delFlowResult.getMsg());
-// }
-// }
-// //若该任务开了工作票,则更新工作票状态;终止工作流
-// if(Func.isNotEmpty(taskEntity.getTicketId())){
-// XxlJobLogger.log("开始处理逾期工作票");
-// R ticketSaveResult = ticketInfoClient.updateUndoneStatus(taskEntity.getTicketId());
-// if(!ticketSaveResult.isSuccess()){
-// XxlJobLogger.log("处理逾期工作票失败");
-// throw new ServiceException(ticketSaveResult.getMsg());
-// }
-// }
-// redisTemplate.opsForZSet().remove(REMIND_TASK_END_LIST,operMaintenanceTaskEntity);
-// }
-// });
-// });
-// executorService.shutdown();
-// }
-// else {
-// XxlJobLogger.log("无提醒任务!");
-// }
-//
-// return new ReturnT<>("SUCCESS");
-// }
@XxlJob(TASK_MAINTENANCE_OVERDUE_HANDLER)
public ReturnT execute(String param) throws Exception {
//获取当前时间段 redis内缓存的任务列表
- Set taskEntitySet = redisTemplate.opsForZSet().rangeByScore(REMIND_TASK_END_LIST,0, LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
+ Set taskEntitySet = redisTemplate.opsForZSet().rangeByScore(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,0, LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
XxlJobLogger.log("从redis内取出{}条数据",taskEntitySet.size());
if(CollectionUtil.isNotEmpty(taskEntitySet)) {
taskEntitySet.forEach(operMaintenanceTaskEntity -> {
OperMaintenanceTaskEntity taskEntity = taskService.getById(operMaintenanceTaskEntity.getId());
+ if(StringUtil.isBlank(taskEntity.getFlowTaskName())) {
+ redisTemplate.opsForZSet().remove(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,operMaintenanceTaskEntity);
+ }
//如果任务仍在待执行则自动结束
- if(!"结束".equals(taskEntity.getFlowTaskName())) {
+ else if(Lists.newArrayList("待领用","待执行").contains(taskEntity.getFlowTaskName())) {
XxlJobLogger.log("开始执行id为{}的任务", Optional.ofNullable(operMaintenanceTaskEntity.getId()).orElse(0L));
//将任务置为未完成状态
LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper();
- updateWrapper.set(OperMaintenanceTaskEntity::getDelayStatus,true);
+ updateWrapper.set(OperMaintenanceTaskEntity::getIsDelay,true);
updateWrapper.eq(OperMaintenanceTaskEntity::getId,operMaintenanceTaskEntity.getId());
taskService.update(updateWrapper);
- redisTemplate.opsForZSet().remove(REMIND_TASK_END_LIST,operMaintenanceTaskEntity);
+ redisTemplate.opsForZSet().remove(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,operMaintenanceTaskEntity);
}
});
}
diff --git a/hzims-service/safeproduct/pom.xml b/hzims-service/safeproduct/pom.xml
index cfede4f..ac33427 100644
--- a/hzims-service/safeproduct/pom.xml
+++ b/hzims-service/safeproduct/pom.xml
@@ -36,6 +36,12 @@
com.hnac.hzims
hzims-operational-api
+
+
+ poi-ooxml-schemas
+ org.apache.poi
+
+
com.hnac.hzims
@@ -64,6 +70,11 @@
blade-starter-excel
+ org.apache.poi
+ ooxml-schemas
+ 1.1
+
+
org.springblade
blade-core-test
test
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java
new file mode 100644
index 0000000..768b523
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java
@@ -0,0 +1,76 @@
+package com.hnac.hzims.safeproduct.controller;
+
+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.entity.DeviceEntity;
+import com.hnac.hzims.safeproduct.service.IDeviceService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+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.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 特种设备管理接口类
+ *
+ * @author liwen
+ * @date 2024-01-12
+ */
+@RequestMapping("/device")
+@AllArgsConstructor
+@RestController
+@Api(value = "特种设备", tags = "特种设备接口")
+public class DeviceController extends BladeController {
+
+ private final IDeviceService deviceService;
+
+ @PostMapping("/save")
+ @ApiOperation(value = "新增")
+ @ApiOperationSupport(order = 1)
+ public R save(@Valid @RequestBody DeviceEntity deviceEntity) {
+ return R.status(deviceService.save(deviceEntity));
+ }
+
+ @PostMapping("/update")
+ @ApiOperation(value = "修改")
+ @ApiOperationSupport(order = 2)
+ public R update(DeviceEntity deviceEntity) {
+ return R.status(deviceService.updateById(deviceEntity));
+ }
+
+ @PostMapping("/remove")
+ @ApiOperation(value = "删除")
+ @ApiOperationSupport(order = 3)
+ public R remove(@RequestParam Long id) {
+ return R.status(deviceService.removeById(id));
+ }
+
+ @GetMapping("/detail")
+ @ApiOperation(value = "详情")
+ @ApiOperationSupport(order = 4)
+ public R detail(@RequestParam Long id) {
+ return R.data(deviceService.getById(id));
+ }
+
+ @GetMapping("/page")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
+ @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string")
+ })
+ @ApiOperation(value = "分页")
+ @ApiOperationSupport(order = 5)
+ public R> page(@ApiIgnore @RequestParam Map param, Query query) {
+ IPage page = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, DeviceEntity.class)
+ .lambda().orderByDesc(DeviceEntity::getCreateTime));
+ return R.data(page);
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeReportController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeReportController.java
index 960783b..ad8e43f 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeReportController.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeReportController.java
@@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.hnac.hzims.safeproduct.service.IDangerSourceService;
+import com.hnac.hzims.safeproduct.hazard.service.IDangerSourceService;
import com.hnac.hzims.safeproduct.vo.DangerSourceReportVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
index 0cd49d3..28b8043 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
@@ -194,8 +194,8 @@ public class TrainController extends BladeController {
@GetMapping("/testScoreList")
@ApiOperation(value = "考试成绩列表")
@ApiOperationSupport(order = 18)
- public R> testScoreList(@RequestParam Long testId) {
- List list = testScoreService.testScoreList(testId);
+ public R> testScoreList(@RequestParam Long testId, String name) {
+ List list = testScoreService.testScoreList(testId, name);
return R.data(list);
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/DangerSourceImporter.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/DangerSourceImporter.java
index 514e216..e7c4f0d 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/DangerSourceImporter.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/DangerSourceImporter.java
@@ -1,8 +1,8 @@
package com.hnac.hzims.safeproduct.excel;
-import com.hnac.hzims.safeproduct.dto.DangerSourceDTO;
-import com.hnac.hzims.safeproduct.enums.DangerSourceLevelEnum;
-import com.hnac.hzims.safeproduct.service.IDangerSourceService;
+import com.hnac.hzims.safeproduct.hazard.dto.DangerSourceDTO;
+import com.hnac.hzims.safeproduct.hazard.enums.DangerSourceLevelEnum;
+import com.hnac.hzims.safeproduct.hazard.service.IDangerSourceService;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
index ceebb1a..76f1389 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
@@ -1,7 +1,7 @@
package com.hnac.hzims.safeproduct.feign;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
-import com.hnac.hzims.safeproduct.service.IDangerSourceService;
+import com.hnac.hzims.safeproduct.hazard.service.IDangerSourceService;
import com.hnac.hzims.safeproduct.vo.SourceVO;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.ArrayUtils;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/controller/InnerDangerStartController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/controller/InnerDangerStartController.java
new file mode 100644
index 0000000..574768c
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/controller/InnerDangerStartController.java
@@ -0,0 +1,126 @@
+package com.hnac.hzims.safeproduct.flow.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
+import com.hnac.hzims.common.logs.enums.BusinessType;
+import com.hnac.hzims.common.logs.enums.OperatorType;
+import com.hnac.hzims.safeproduct.entity.InnerDangerEntity;
+import com.hnac.hzims.safeproduct.flow.service.IInnerDangerFlowService;
+import com.hnac.hzims.safeproduct.vo.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.log.annotation.ApiLog;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * @author xiashandong
+ * @created 2020/9/1 15:15
+ **/
+@RestController
+@AllArgsConstructor
+@RequestMapping("/hiddenDangerStart")
+@Api(tags = "隐患")
+public class InnerDangerStartController extends BladeController {
+
+ private final IInnerDangerFlowService hiddenDangerFlowService;
+
+
+ /**
+ * 隐患管理
+ */
+ @ApiLog
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入hiddenDangerEntity")
+ @OperationAnnotation(moduleName = "隐患管理",title = "隐患管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患管理")
+ public R> list(InnerDangerEntity innerDangerEntity, Query query) {
+ IPage pages = hiddenDangerFlowService.selectPage(innerDangerEntity, query);
+ return R.data(pages);
+ }
+ /**
+ * 隐患管理
+ */
+ @ApiLog
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入hiddenDangerEntity")
+ @OperationAnnotation(moduleName = "隐患管理",title = "隐患管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患管理")
+ public R detail(InnerDangerEntity innerDangerEntity) {
+ InnerDangerEntity one = hiddenDangerFlowService.getOne(Condition.getQueryWrapper(innerDangerEntity));
+ return R.data(one);
+ }
+ /**
+ * 隐患排查流程开启
+ */
+ @ApiLog
+ @PostMapping("/startHiddenDanger")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "开启隐患流程排查", notes = "传入hiddenDangerEntity")
+ @OperationAnnotation(moduleName = "隐患排查流程开启",title = "隐患排查流程开启",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患排查流程开启")
+ public R startHiddenDanger(@RequestBody InnerDangerVo hiddenDangerVo) {
+ return hiddenDangerFlowService.startHiddenDanger(hiddenDangerVo);
+ }
+ /**
+ * 隐患基础页面
+ */
+ @ApiLog
+ @GetMapping("/getHiddenDangerBase")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入hiddenDangerEntity")
+ @OperationAnnotation(moduleName = "隐患基础页面",title = "隐患基础页面",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患基础页面")
+ public R> getHiddenDangerBase(HiddenDangerBaseVo hiddenDangerEntity, Query query) {
+ IPage pages = hiddenDangerFlowService.getHiddenDangerBase(hiddenDangerEntity, query);
+ return R.data(pages);
+ }
+ /**
+ * 隐患排查页面
+ */
+ @ApiLog
+ @GetMapping("/getHiddenDangerCheck")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入hiddenDangerEntity")
+ @OperationAnnotation(moduleName = "隐患排查页面",title = "隐患排查页面",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患排查页面")
+ public R> getHiddenDangerCheck(HiddenDangerCheckVo hiddenDangerEntity, Query query) {
+ IPage pages = hiddenDangerFlowService.getHiddenDangerCheck(hiddenDangerEntity, query);
+ return R.data(pages);
+ }
+ /**
+ * 隐患整改管理
+ */
+ @ApiLog
+ @GetMapping("/getHiddenDangerRectifier")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入HiddenDangerRectifierVo")
+ @OperationAnnotation(moduleName = "隐患整改管理",title = "隐患整改管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患整改管理")
+ public R> getHiddenDangerRectifier(HiddenDangerRectifierVo hiddenDangerEntity, Query query) {
+ IPage pages = hiddenDangerFlowService.getHiddenDangerRectifier(hiddenDangerEntity, query);
+ return R.data(pages);
+ }
+ /**
+ * 隐患验收管理
+ */
+ @ApiLog
+ @GetMapping("/getHiddenDangerConclusion")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入HiddenDangerConclusionVo")
+ @OperationAnnotation(moduleName = "隐患验收管理",title = "隐患验收管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
+ action = "隐患验收管理")
+ public R> getHiddenDangerConclusion(HiddenDangerConclusionVo hiddenDangerEntity, Query query) {
+ IPage pages = hiddenDangerFlowService.getHiddenDangerConclusion(hiddenDangerEntity, query);
+ return R.data(pages);
+ }
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.java
new file mode 100644
index 0000000..767120f
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.java
@@ -0,0 +1,12 @@
+package com.hnac.hzims.safeproduct.flow.mapper;
+
+import com.hnac.hzims.safeproduct.entity.InnerDangerEntity;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * Created by Sam Huang 2022/5/6 8:23
+ */
+public interface InnerDangerMapper extends UserDataScopeBaseMapper {
+
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.xml
new file mode 100644
index 0000000..a119c44
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/IInnerDangerFlowService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/IInnerDangerFlowService.java
new file mode 100644
index 0000000..1c6c749
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/IInnerDangerFlowService.java
@@ -0,0 +1,42 @@
+package com.hnac.hzims.safeproduct.flow.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.safeproduct.dto.InnerDangerDTO;
+import com.hnac.hzims.safeproduct.entity.InnerDangerEntity;
+import com.hnac.hzims.safeproduct.vo.*;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+
+import java.util.List;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ */
+public interface IInnerDangerFlowService extends BaseService {
+
+
+ IPage selectPage(InnerDangerEntity innerDangerEntity, Query query);
+
+ R startHiddenDanger(InnerDangerVo hiddenDangerVo);
+ /**
+ * 监听回调消息
+ * @param processWorkFlowResponse
+ * @return
+ */
+ R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse);
+
+ IPage getHiddenDangerBase(HiddenDangerBaseVo hiddenDangerEntity, Query query);
+
+ IPage getHiddenDangerCheck(HiddenDangerCheckVo hiddenDangerEntity, Query query);
+
+ IPage getHiddenDangerRectifier(HiddenDangerRectifierVo hiddenDangerEntity, Query query);
+
+ IPage getHiddenDangerConclusion(HiddenDangerConclusionVo hiddenDangerEntity, Query query);
+
+ List getListByDate(String mon);
+
+ List getList(InnerDangerDTO req);
+ List getListByDeptAndDate(String startTime,String endTime,String stationCode);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java
new file mode 100644
index 0000000..25e5a85
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java
@@ -0,0 +1,395 @@
+package com.hnac.hzims.safeproduct.flow.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.hnac.hzims.common.logs.utils.StringUtils;
+import com.hnac.hzims.message.MessageConstants;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
+import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.safeproduct.dto.InnerDangerDTO;
+import com.hnac.hzims.safeproduct.entity.InnerDangerEntity;
+import com.hnac.hzims.safeproduct.flow.mapper.InnerDangerMapper;
+import com.hnac.hzims.safeproduct.flow.service.IInnerDangerFlowService;
+import com.hnac.hzims.safeproduct.vo.*;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.flow.core.entity.BladeFlow;
+import org.springblade.flow.core.feign.IFlowClient;
+import org.springblade.system.feign.ISysClient;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.hnac.hzims.safeproduct.Constants.HIDDEN_DANGER_CHECK;
+
+/**
+ * Created by ty 2023/9/18 10:16
+ **/
+@Service
+public class InnerDangerFlowServiceImpl extends BaseServiceImpl implements IInnerDangerFlowService {
+
+ @Autowired
+ private ISysClient sysClient;
+ @Autowired
+ private IUserClient userClient;
+
+ @Autowired
+ private IFlowClient processClient;
+
+ @Autowired
+ private IMessageClient messageClient;
+
+
+
+ @Override
+ public IPage selectPage(InnerDangerEntity innerDangerEntity, Query query) {
+ return this.baseMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(innerDangerEntity));
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public R startHiddenDanger(InnerDangerVo hiddenDangerVo) {
+ InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
+ BeanUtil.copy(hiddenDangerVo, innerDangerEntity);
+ if (!saveHiddenDanger(innerDangerEntity)) {
+ throw new ServiceException("隐患保存失败,请稍后重试!");
+ }
+ InnerDangerEntity saveEntity = this.getOne(new LambdaQueryWrapper() {{
+ eq(InnerDangerEntity::getCode, innerDangerEntity.getCode());
+ last("limit 1");
+ }});
+ InnerDangerEntity res = this.startHiddenDangerFlow(saveEntity, hiddenDangerVo);
+ return R.data(res);
+ }
+
+ private boolean saveHiddenDanger(InnerDangerEntity entity) {
+ if (Func.isEmpty(entity.getCode())) {
+ entity.setCode(UUID.randomUUID().toString());
+ }
+ // 隐患发起人 : 当前用户Id
+ if (Func.isEmpty(entity.getRegistrant())) {
+ entity.setRegistrant(AuthUtil.getUserId());
+ entity.setRegistrantName(AuthUtil.getUserName());
+ }
+ // 隐患发起时间
+ entity.setRegistrantTime(new Date());
+ // 隐患发起时间
+ entity.setUpdateTime(new Date());
+ entity.setCreateUser(AuthUtil.getUserId());
+ entity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+ if (Func.isEmpty(entity.getHiddenDangerDept())) {
+ return false;
+ }
+ if (Func.isEmpty(entity.getHiddenDangerDeptName())) {
+ R deptNameR = sysClient.getDeptName(entity.getHiddenDangerDept());
+ if (deptNameR.isSuccess() && StringUtils.isNotEmpty(deptNameR.getData())) {
+ entity.setHiddenDangerDeptName(deptNameR.getData());
+ }
+ }
+ return this.save(entity);
+ }
+
+ private InnerDangerEntity startHiddenDangerFlow(InnerDangerEntity entity,InnerDangerVo hiddenDangerVo) {
+ BeanUtil.copy(entity,hiddenDangerVo);
+ // 隐患处理名字
+ String userName = Optional.ofNullable(AuthUtil.getUserName()).orElse("");
+ // 流程名称
+ String processName = "[" + userName + "] 发起 " + "【风险点:" + entity.getRiskPointName() + "】隐患处理流程" + "——>" + entity.getHiddenDangerName();
+ // 开启新的隐患处理流程
+ Map variable = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(hiddenDangerVo, DateUtil.PATTERN_DATETIME), Map.class);
+ R result = processClient.startProcessInstanceContainNameByKey(HIDDEN_DANGER_CHECK, entity.getId().toString(), processName, variable);
+ // 流程开启失败
+ if (!result.isSuccess()) {
+ throw new ServiceException("隐患处理流程开启失败,错误描述 : " + result.getMsg());
+ }
+ // 关联流程唯一键
+ entity.setProcessInstanceId(result.getData().getProcessInstanceId());
+ entity.setTaskId(result.getData().getTaskId());
+ this.baseMapper.updateById(entity);
+ return entity;
+ }
+
+
+ /**
+ * @param processWorkFlowResponse
+ */
+ @Override
+ public R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
+
+ InnerDangerVo hiddenDangerVo;
+ log.warn("隐患处理流程消息开始转换");
+ try {
+ Map variables = (Map) processWorkFlowResponse.getVariables();
+ //现象缺陷全表更新
+ hiddenDangerVo = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference() {
+ });
+ } catch (Exception e) {
+ log.error("隐患处理流程消息转换失败:" + e.getMessage());
+ return R.fail("隐患处理流程消息转换失败");
+ }
+ InnerDangerEntity saveEntity = this.getOne(new LambdaQueryWrapper() {{
+ eq(InnerDangerEntity::getCode, hiddenDangerVo.getCode());
+ last("limit 1");
+ }});
+ Long taskId = saveEntity.getId();
+ //设置当前环节+当前环节处理人
+ if (StringUtils.isEmpty(processWorkFlowResponse.getNextStepOperator())) {
+ hiddenDangerVo.setCurrentOperator("流程结束");
+ hiddenDangerVo.setCurrentLinkHandler(null);
+ }else {
+ hiddenDangerVo.setCurrentOperator(processWorkFlowResponse.getTaskName());
+ hiddenDangerVo.setCurrentLinkHandler(processWorkFlowResponse.getNextStepOperator());
+ hiddenDangerVo.setTaskId(processWorkFlowResponse.getTaskId());
+ }
+ this.baseMapper.update(hiddenDangerVo, new LambdaUpdateWrapper() {{
+ eq(InnerDangerEntity::getCode, hiddenDangerVo.getCode());
+ }});
+ //推送消息中心相关消息
+ sendMessage(processWorkFlowResponse, saveEntity, taskId);
+ log.warn("隐患处理流程消息转换结束");
+ return R.success("消息保存成功");
+ }
+
+ @Override
+ public IPage getHiddenDangerBase(HiddenDangerBaseVo hiddenDangerBaseVo, Query query) {
+ InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
+ BeanUtil.copy(hiddenDangerBaseVo, innerDangerEntity);
+ QueryWrapper queryWrapper = getQueryWrapper(innerDangerEntity);
+ if (ObjectUtils.isNotEmpty(hiddenDangerBaseVo.getRegistrantStartTime())) {
+ queryWrapper.lambda().gt(InnerDangerEntity::getCheckTime, hiddenDangerBaseVo.getRegistrantStartTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerBaseVo.getRegistrantEndTime())) {
+ queryWrapper.lambda().lt(InnerDangerEntity::getRegistrantTime, hiddenDangerBaseVo.getRegistrantEndTime());
+ }
+ queryWrapper.orderByDesc("create_time");
+ IPage hiddenDangerEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), queryWrapper);
+ IPage iPage = getIPage(hiddenDangerEntityIPage);
+ if (CollectionUtils.isNotEmpty(hiddenDangerEntityIPage.getRecords())) {
+ List voList = hiddenDangerEntityIPage.getRecords().stream().map(s -> {
+ HiddenDangerBaseVo hiddenDangerBaseVo1 = new HiddenDangerBaseVo();
+ BeanUtil.copy(s, hiddenDangerBaseVo1);
+ return hiddenDangerBaseVo1;
+ }).collect(Collectors.toList());
+ iPage.setRecords(voList);
+ }else {
+ iPage.setRecords(new ArrayList<>());
+ }
+ return iPage;
+ }
+
+ private static IPage getIPage(IPage hiddenDangerEntityIPage) {
+ IPage res = new Page<>();
+ res.setTotal(hiddenDangerEntityIPage.getTotal());
+ res.setCurrent(hiddenDangerEntityIPage.getCurrent());
+ res.setPages(hiddenDangerEntityIPage.getPages());
+ res.setSize(hiddenDangerEntityIPage.getSize());
+ return res;
+ }
+
+ //排查
+ @Override
+ public IPage getHiddenDangerCheck(HiddenDangerCheckVo hiddenDangerCheckVo, Query query) {
+ InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
+ BeanUtil.copy(hiddenDangerCheckVo, innerDangerEntity);
+ QueryWrapper queryWrapper = getQueryWrapper(innerDangerEntity);
+ //隐患等级字段不为空,则代表已经结束排查阶段
+ queryWrapper.lambda().isNotNull(InnerDangerEntity::getHiddenDangerLevel);
+ if (ObjectUtils.isNotEmpty(hiddenDangerCheckVo.getCheckStartTime())) {
+ queryWrapper.lambda().gt(InnerDangerEntity::getCheckTime, hiddenDangerCheckVo.getCheckStartTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerCheckVo.getCheckEndTime())) {
+ queryWrapper.lambda().lt(InnerDangerEntity::getCheckTime, hiddenDangerCheckVo.getCheckEndTime());
+ }
+ queryWrapper.orderByDesc("create_time");
+ IPage hiddenDangerEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), queryWrapper);
+ IPage iPage = getIPage(hiddenDangerEntityIPage);
+ if (CollectionUtils.isNotEmpty(hiddenDangerEntityIPage.getRecords())) {
+ List voList = hiddenDangerEntityIPage.getRecords().stream().map(s -> {
+ HiddenDangerCheckVo hiddenDangerCheckVo1 = new HiddenDangerCheckVo();
+ BeanUtil.copy(s, hiddenDangerCheckVo1);
+ return hiddenDangerCheckVo1;
+ }).collect(Collectors.toList());
+ iPage.setRecords(voList);
+ }else {
+ iPage.setRecords(new ArrayList<>());
+ }
+ return iPage;
+ }
+
+ //整改
+ @Override
+ public IPage getHiddenDangerRectifier(HiddenDangerRectifierVo hiddenDangerRectifierVo, Query query) {
+ InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
+ BeanUtil.copy(hiddenDangerRectifierVo, innerDangerEntity);
+ QueryWrapper queryWrapper = getQueryWrapper(innerDangerEntity);
+ //验收人不为空,则代表已经结束整改
+ queryWrapper.lambda().isNotNull(InnerDangerEntity::getRectifierType);
+ if (ObjectUtils.isNotEmpty(hiddenDangerRectifierVo.getRectifierStartTime())) {
+ queryWrapper.lambda().gt(InnerDangerEntity::getRectifierTime, hiddenDangerRectifierVo.getRectifierStartTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerRectifierVo.getRectifierEndTime())) {
+ queryWrapper.lambda().lt(InnerDangerEntity::getRectifierTime, hiddenDangerRectifierVo.getRectifierEndTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerRectifierVo.getDeadLineStartTime())) {
+ queryWrapper.lambda().gt(InnerDangerEntity::getDeadLine, hiddenDangerRectifierVo.getDeadLineStartTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerRectifierVo.getDeadLineEndTime())) {
+ queryWrapper.lambda().lt(InnerDangerEntity::getDeadLine, hiddenDangerRectifierVo.getDeadLineEndTime());
+ }
+ queryWrapper.orderByDesc("create_time");
+ IPage hiddenDangerEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), queryWrapper);
+ IPage iPage = getIPage(hiddenDangerEntityIPage);
+ if (CollectionUtils.isNotEmpty(hiddenDangerEntityIPage.getRecords())) {
+ List voList = hiddenDangerEntityIPage.getRecords().stream().map(s -> {
+ HiddenDangerRectifierVo hiddenDangerRectifierVo1 = new HiddenDangerRectifierVo();
+ BeanUtil.copy(s, hiddenDangerRectifierVo1);
+ return hiddenDangerRectifierVo1;
+ }).collect(Collectors.toList());
+ iPage.setRecords(voList);
+ }else {
+ iPage.setRecords(new ArrayList<>());
+ }
+ return iPage;
+ }
+
+ @Override
+ public IPage getHiddenDangerConclusion(HiddenDangerConclusionVo hiddenDangerConclusionVo, Query query) {
+ InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
+ BeanUtil.copy(hiddenDangerConclusionVo, innerDangerEntity);
+ QueryWrapper queryWrapper = Condition.getQueryWrapper(innerDangerEntity);
+ queryWrapper.lambda().eq(InnerDangerEntity::getConclusionRes,"1");
+ if (ObjectUtils.isNotEmpty(hiddenDangerConclusionVo.getConclusionStartTime())) {
+ queryWrapper.lambda().gt(InnerDangerEntity::getConclusionTime, hiddenDangerConclusionVo.getConclusionStartTime());
+ }
+ if (ObjectUtils.isNotEmpty(hiddenDangerConclusionVo.getConclusionEndTime())) {
+ queryWrapper.lambda().lt(InnerDangerEntity::getConclusionTime, hiddenDangerConclusionVo.getConclusionEndTime());
+ }
+ queryWrapper.orderByDesc("create_time");
+ IPage hiddenDangerEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), queryWrapper);
+ IPage iPage = getIPage(hiddenDangerEntityIPage);
+ if (CollectionUtils.isNotEmpty(hiddenDangerEntityIPage.getRecords())) {
+ List voList = hiddenDangerEntityIPage.getRecords().stream().map(s -> {
+ HiddenDangerConclusionVo hiddenDangerConclusionVo1 = new HiddenDangerConclusionVo();
+ BeanUtil.copy(s, hiddenDangerConclusionVo1);
+ return hiddenDangerConclusionVo1;
+ }).collect(Collectors.toList());
+ iPage.setRecords(voList);
+ }else {
+ iPage.setRecords(new ArrayList<>());
+ }
+ return iPage;
+ }
+ private QueryWrapper getQueryWrapper( InnerDangerEntity innerDangerEntity){
+ QueryWrapper qw = new QueryWrapper<>();
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getHiddenDangerLevel())){
+ qw.lambda().eq(InnerDangerEntity::getHiddenDangerLevel,innerDangerEntity.getHiddenDangerLevel());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getHiddenDangerName())){
+ qw.lambda().like(InnerDangerEntity::getHiddenDangerName,innerDangerEntity.getHiddenDangerName());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getConclusionRes())){
+ qw.lambda().eq(InnerDangerEntity::getConclusionRes,innerDangerEntity.getConclusionRes());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getJudgeRes())){
+ qw.lambda().eq(InnerDangerEntity::getJudgeRes,innerDangerEntity.getJudgeRes());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getJudgeContext())){
+ qw.lambda().like(InnerDangerEntity::getJudgeContext,innerDangerEntity.getJudgeContext());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getRiskPointType())){
+ qw.lambda().like(InnerDangerEntity::getRiskPointType,innerDangerEntity.getRiskPointType());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getHiddenDangerDept())){
+ qw.lambda().eq(InnerDangerEntity::getHiddenDangerDept,innerDangerEntity.getHiddenDangerDept());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getInvestigation())){
+ qw.lambda().like(InnerDangerEntity::getInvestigation,innerDangerEntity.getInvestigation());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getRiskPointName())){
+ qw.lambda().like(InnerDangerEntity::getRiskPointName,innerDangerEntity.getRiskPointName());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getHiddenDangerAddr())){
+ qw.lambda().like(InnerDangerEntity::getHiddenDangerAddr,innerDangerEntity.getHiddenDangerAddr());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getHiddenDangerDeptName())){
+ qw.lambda().like(InnerDangerEntity::getHiddenDangerDeptName,innerDangerEntity.getHiddenDangerDeptName());
+ }
+ if (ObjectUtils.isNotEmpty(innerDangerEntity.getRectifierType())){
+ qw.lambda().eq(InnerDangerEntity::getRectifierType,innerDangerEntity.getRectifierType());
+ }
+ return qw;
+ }
+ private void sendMessage(ProcessWorkFlowResponse processWorkFlowResponse, InnerDangerEntity innerDangerEntity, Long taskId) {
+ //推送消息
+ if (processWorkFlowResponse.getTaskId() != null) {
+ BusinessMessageDTO message = new BusinessMessageDTO();
+ message.setBusinessClassify("business");
+ message.setBusinessKey(MessageConstants.BusinessClassifyEnum.SAFEPRODUCT_HIDDENDANGER.getKey());
+ message.setSubject(MessageConstants.BusinessClassifyEnum.SAFEPRODUCT_HIDDENDANGER.getDescription());
+ message.setTaskId(Optional.ofNullable(taskId).orElse(System.currentTimeMillis()));
+ message.setTenantId("200000");
+ String countent =
+ "您的隐患处理流程待审批!隐患名称:".concat(Optional.ofNullable(innerDangerEntity.getHiddenDangerName()).orElse(""))
+ .concat(",审批环节:")
+ .concat(processWorkFlowResponse.getTaskName());
+ message.setContent(countent);
+ message.setDeptId(innerDangerEntity.getCreateDept());
+ R deptName = sysClient.getDeptName(innerDangerEntity.getCreateDept());
+ if (deptName.isSuccess()) {
+ message.setDeptName(deptName.getData());
+ }
+ String userIds = processWorkFlowResponse.getUserId();
+ if (StringUtils.isBlank(userIds)) {
+ log.error("推送的消息不能为空哦");
+ return;
+ }
+ message.setUserIds(userIds);
+ message.setCreateUser(innerDangerEntity.getCreateUser());
+ messageClient.sendAppAndWsMsgByUsers(message);
+ }
+ }
+
+ @Override
+ public List getList(InnerDangerDTO req) {
+ QueryWrapper queryWrapper =getQueryWrapper(BeanUtil.copy(req, InnerDangerEntity.class));
+ if(Func.isNotEmpty(req.getDate())) {
+ queryWrapper.eq("DATE_FORMAT(CREATE_TIME,'%Y-%m-%d')",req.getDate());
+ }
+ return this.list(queryWrapper).stream().map(e -> BeanUtil.copy(e,InnerDangerVo.class)).collect(Collectors.toList());
+ }
+
+ @Override
+ public List getListByDate(String mon) {
+ List innerDangerEntities = this.baseMapper.selectList(Wrappers.query().lambda().like(InnerDangerEntity::getCreateTime, mon));
+ return innerDangerEntities;
+ }
+ @Override
+ public List getListByDeptAndDate(String startTime,String endTime,String stationCode) {
+ List innerDangerEntities = this.baseMapper.selectList(Wrappers.query().lambda()
+ .gt(InnerDangerEntity::getCreateTime, startTime)
+ .lt(InnerDangerEntity::getCreateTime, endTime)
+ .eq(InnerDangerEntity::getStationCode, stationCode));
+ return innerDangerEntities;
+ }
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java
similarity index 85%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java
index db6a7b9..268a02b 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java
@@ -1,14 +1,15 @@
-package com.hnac.hzims.safeproduct.controller;
+package com.hnac.hzims.safeproduct.hazard.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
-import com.hnac.hzims.safeproduct.dto.DangerSourceDTO;
+import com.hnac.hzims.safeproduct.hazard.dto.DangerSourceDTO;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
-import com.hnac.hzims.safeproduct.service.IDangerSourceService;
-import com.hnac.hzims.safeproduct.vo.DangerSourceVO;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardInstanceDTO;
+import com.hnac.hzims.safeproduct.hazard.service.IDangerSourceService;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -110,4 +111,12 @@ public class DangerSourceController extends BladeController {
dangerSourceService.importExcel(file);
return R.data(true);
}
+
+
+ @PostMapping("/importDangerSource")
+ @ApiOperation("批量导入危险源")
+ @ApiOperationSupport(order = 80)
+ public R importDangerSource(@RequestBody HazardInstanceDTO req) {
+ return R.status(dangerSourceService.importDangerSource(req));
+ }
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java
new file mode 100644
index 0000000..c7cf1d9
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java
@@ -0,0 +1,77 @@
+package com.hnac.hzims.safeproduct.hazard.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO;
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import com.hnac.hzims.safeproduct.hazard.service.IHazardLibraryService;
+import com.hnac.hzims.safeproduct.hazard.vo.HazardLibraryVO;
+import com.hnac.hzims.safeproduct.hazard.wrapper.HazardLibraryWrapper;
+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 javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@Api(value = "危险源库管理",tags = "危险源库管理")
+@AllArgsConstructor
+@RequestMapping("/hazard/library")
+public class HazardLibraryController extends BladeController {
+ private final IHazardLibraryService hazardLibraryService;
+
+ @GetMapping("/listPage")
+ @ApiOperation("列表分页查询")
+ @ApiOperationSupport(order = 1)
+ public R listPage(HazardLibraryDTO req, Query query) {
+ return R.data(hazardLibraryService.listPage(req,query));
+ }
+
+ @GetMapping("/list")
+ @ApiOperation("列表查询")
+ @ApiOperationSupport(order = 2)
+ public R> list(HazardLibraryDTO req) {
+ HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class);
+ List list = hazardLibraryService.list(hazardLibraryService.getQueryWrapper(library));
+ return R.data(HazardLibraryWrapper.build().listVO(list));
+ }
+
+ @GetMapping("/detail")
+ @ApiOperation("查看详情")
+ @ApiOperationSupport(order = 3)
+ public R detail(@ApiParam("主键ID") @RequestParam Long id) {
+ HazardLibraryEntity library = hazardLibraryService.getById(id);
+ return R.data(HazardLibraryWrapper.build().entityVO(library));
+ }
+
+ @PostMapping("/save")
+ @ApiOperation("保存")
+ @ApiOperationSupport(order = 4)
+ public R save(@RequestBody @Valid HazardLibraryDTO req) {
+ HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class);
+ return R.status(hazardLibraryService.save(library));
+ }
+
+ @PutMapping("/modify")
+ @ApiOperation("编辑")
+ @ApiOperationSupport(order = 5)
+ public R modify(@RequestBody HazardLibraryDTO req) {
+ HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class);
+ return R.status(hazardLibraryService.updateById(library));
+ }
+
+ @DeleteMapping("/remove")
+ @ApiOperation("删除危险源库")
+ @ApiOperationSupport(order = 6)
+ public R remove(@ApiParam("主键ID") @RequestParam Long id) {
+ return R.status(hazardLibraryService.removeById(id));
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/RiskHazardController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/RiskHazardController.java
new file mode 100644
index 0000000..c913848
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/RiskHazardController.java
@@ -0,0 +1,63 @@
+package com.hnac.hzims.safeproduct.hazard.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.hazard.service.IRiskHazardService;
+import com.hnac.hzims.safeproduct.risk.dto.HazardSourceDTO;
+import com.itextpdf.text.DocumentException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Query;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @ClassName RiskHazardController
+ * @description:
+ * @author: hx
+ * @create: 2023-09-17 12:04
+ * @Version 4.0
+ **/
+@RestController
+@RequestMapping("/riskHazard")
+@AllArgsConstructor
+@Slf4j
+@Api("风险点管理")
+public class RiskHazardController extends BladeController {
+
+ private final IRiskHazardService riskHazardService;
+
+ @GetMapping("/exportRiskHazardExcel")
+ @ApiOperation("导出风险点")
+ @ApiOperationSupport(order = 1)
+ public void exportRiskHazardExcel(HazardSourceDTO req, Query query, HttpServletResponse response) {
+ riskHazardService.exportRiskHazardExcel(req,query,response);
+ }
+
+ @GetMapping("/exportEstimateExcel")
+ @ApiOperation("导出风险评价赋分表")
+ @ApiOperationSupport(order = 2)
+ public void exportEstimateExcel(@ApiParam(value = "风险评估ID",required = false) Long estimateId,
+ @ApiParam(value = "站点编号",required = false) String stationCode,
+ @ApiParam(value = "风险排查任务ID",required = false) Long taskId,
+ HttpServletResponse response) throws DocumentException, IOException {
+ riskHazardService.exportEstimateExcel(estimateId,stationCode,taskId,response);
+ }
+
+ @GetMapping("/exportEstimateWord")
+ @ApiOperation("导出风险评价赋分表")
+ @ApiOperationSupport(order = 2)
+ public void exportEstimateWord(@ApiParam(value = "风险评估ID",required = false) Long estimateId,
+ @ApiParam(value = "站点编号",required = false) String stationCode,
+ @ApiParam(value = "风险排查任务ID",required = false) Long taskId,
+ HttpServletResponse response) throws Exception {
+ riskHazardService.exportEstimateWord(estimateId,stationCode,taskId,response);
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DangerSourceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/DangerSourceMapper.java
similarity index 92%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DangerSourceMapper.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/DangerSourceMapper.java
index 9b435a8..9a8d09c 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DangerSourceMapper.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/DangerSourceMapper.java
@@ -1,4 +1,4 @@
-package com.hnac.hzims.safeproduct.mapper;
+package com.hnac.hzims.safeproduct.hazard.mapper;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
import com.hnac.hzims.safeproduct.vo.DangerSourceReportVO;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/HazardLibraryMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/HazardLibraryMapper.java
new file mode 100644
index 0000000..c07c8be
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/mapper/HazardLibraryMapper.java
@@ -0,0 +1,8 @@
+package com.hnac.hzims.safeproduct.hazard.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+
+public interface HazardLibraryMapper extends BaseMapper {
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDangerSourceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IDangerSourceService.java
similarity index 79%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDangerSourceService.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IDangerSourceService.java
index 1676f9a..44d2889 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDangerSourceService.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IDangerSourceService.java
@@ -1,9 +1,10 @@
-package com.hnac.hzims.safeproduct.service;
+package com.hnac.hzims.safeproduct.hazard.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.hnac.hzims.safeproduct.dto.DangerSourceDTO;
+import com.hnac.hzims.safeproduct.hazard.dto.DangerSourceDTO;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
-import com.hnac.hzims.safeproduct.vo.DangerSourceVO;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardInstanceDTO;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourceVO;
import com.hnac.hzims.safeproduct.vo.DangerSourceReportVO;
import com.hnac.hzims.safeproduct.vo.SourceVO;
import org.springblade.core.mp.base.BaseService;
@@ -41,4 +42,6 @@ public interface IDangerSourceService extends BaseService {
List getSafeCreateTable(List tableNames);
List safes(String safeInfos);
+
+ Boolean importDangerSource(HazardInstanceDTO req);
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IHazardLibraryService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IHazardLibraryService.java
new file mode 100644
index 0000000..fcea334
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IHazardLibraryService.java
@@ -0,0 +1,31 @@
+package com.hnac.hzims.safeproduct.hazard.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.common.utils.Condition;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO;
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import com.hnac.hzims.safeproduct.hazard.vo.HazardLibraryVO;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.mp.support.Query;
+
+public interface IHazardLibraryService extends BaseService {
+
+ /**
+ * 分页查询
+ * @param req 查询条件
+ * @param query 分页条件
+ * @return 查询结果
+ */
+ IPage listPage(HazardLibraryDTO req, Query query);
+
+ /**
+ * 获取危险源库查询wrapper
+ * @param request 查询条件
+ * @return wrapper
+ */
+ default LambdaQueryWrapper getQueryWrapper(HazardLibraryEntity request) {
+ return Condition.getQueryWrapper(HazardLibraryEntity.class,request);
+ }
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IRiskHazardService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IRiskHazardService.java
new file mode 100644
index 0000000..b2af119
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IRiskHazardService.java
@@ -0,0 +1,23 @@
+package com.hnac.hzims.safeproduct.hazard.service;
+
+import com.hnac.hzims.safeproduct.risk.dto.HazardSourceDTO;
+import com.itextpdf.text.DocumentException;
+import org.springblade.core.mp.support.Query;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @ClassName IRiskHazardService
+ * @description: 风险点服务类
+ * @author: hx
+ * @create: 2023-09-17 12:02
+ * @Version 4.0
+ **/
+public interface IRiskHazardService {
+ void exportRiskHazardExcel(HazardSourceDTO req, Query query, HttpServletResponse response);
+
+ void exportEstimateExcel(Long estimateId,String stationCode,Long taskId, HttpServletResponse response) throws IOException, DocumentException;
+
+ void exportEstimateWord(Long estimateId,String stationCode,Long taskId, HttpServletResponse response) throws Exception;
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/DangerSourceServiceImpl.java
similarity index 90%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/DangerSourceServiceImpl.java
index ce55832..6c666fe 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/DangerSourceServiceImpl.java
@@ -1,6 +1,7 @@
-package com.hnac.hzims.safeproduct.service.impl;
+package com.hnac.hzims.safeproduct.hazard.service.impl;
import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -9,29 +10,29 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.safeproduct.constants.DictConstants;
-import com.hnac.hzims.safeproduct.dto.DangerSourceDTO;
-import com.hnac.hzims.safeproduct.dto.DangerSourcePositionDTO;
+import com.hnac.hzims.safeproduct.hazard.dto.DangerSourceDTO;
+import com.hnac.hzims.safeproduct.hazard.dto.DangerSourcePositionDTO;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
import com.hnac.hzims.safeproduct.entity.DangerSourceLevelRecordEntity;
import com.hnac.hzims.safeproduct.entity.DangerSourcePositionEntity;
-import com.hnac.hzims.safeproduct.enums.DangerSourceLevelEnum;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardInstanceDTO;
+import com.hnac.hzims.safeproduct.hazard.enums.DangerSourceLevelEnum;
import com.hnac.hzims.safeproduct.excel.DangerSourceSaveExcel;
import com.hnac.hzims.safeproduct.mapper.DangerSourceLevelRecordMapper;
-import com.hnac.hzims.safeproduct.mapper.DangerSourceMapper;
+import com.hnac.hzims.safeproduct.hazard.mapper.DangerSourceMapper;
import com.hnac.hzims.safeproduct.mapper.DangerSourcePositionMapper;
-import com.hnac.hzims.safeproduct.service.IDangerSourceService;
+import com.hnac.hzims.safeproduct.hazard.service.IDangerSourceService;
import com.hnac.hzims.safeproduct.utils.ExcelToolListener;
import com.hnac.hzims.safeproduct.utils.TableJsonUtils;
-import com.hnac.hzims.safeproduct.vo.DangerSourcePositionVO;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourcePositionVO;
import com.hnac.hzims.safeproduct.vo.DangerSourceReportVO;
-import com.hnac.hzims.safeproduct.vo.DangerSourceVO;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourceVO;
import com.hnac.hzims.safeproduct.vo.SourceVO;
-import com.hnac.hzims.safeproduct.wrapper.DangerSourcePostionWrapper;
-import com.hnac.hzims.safeproduct.wrapper.DangerSourceWrapper;
+import com.hnac.hzims.safeproduct.hazard.wrapper.DangerSourcePostionWrapper;
+import com.hnac.hzims.safeproduct.hazard.wrapper.DangerSourceWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
-import org.apache.commons.lang.ArrayUtils;
import org.springblade.core.excel.support.ExcelException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@@ -322,6 +323,18 @@ public class DangerSourceServiceImpl extends BaseServiceImpl sourceList = req.getHazardList().stream().map(h -> {
+ DangerSourceEntity result = JSONObject.parseObject(JSON.toJSONString(h), DangerSourceEntity.class);
+ result.setLibraryId(h.getId());
+ result.setRefDept(req.getDeptId());
+ result.setRefDeptName(req.getDeptName());
+ return result;
+ }).collect(Collectors.toList());
+ return this.saveBatch(sourceList);
+ }
+
+ @Override
public List listByTenantId(String tenantId) {
return this.baseMapper.listByTenantId(tenantId);
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/HazardLibraryServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/HazardLibraryServiceImpl.java
new file mode 100644
index 0000000..7c404bd
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/HazardLibraryServiceImpl.java
@@ -0,0 +1,30 @@
+package com.hnac.hzims.safeproduct.hazard.service.impl;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.common.utils.Condition;
+import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO;
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import com.hnac.hzims.safeproduct.hazard.mapper.HazardLibraryMapper;
+import com.hnac.hzims.safeproduct.hazard.service.IHazardLibraryService;
+import com.hnac.hzims.safeproduct.hazard.vo.HazardLibraryVO;
+import com.hnac.hzims.safeproduct.hazard.wrapper.HazardLibraryWrapper;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+@AllArgsConstructor
+public class HazardLibraryServiceImpl extends BaseServiceImpl implements IHazardLibraryService {
+
+ @Override
+ public IPage listPage(HazardLibraryDTO req, Query query) {
+ IPage page = this.page(Condition.getPage(query), this.getQueryWrapper(BeanUtil.copy(req, HazardLibraryEntity.class)));
+ page.setRecords(HazardLibraryWrapper.build().listVO(page.getRecords()));
+ return page;
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/RiskHazardServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/RiskHazardServiceImpl.java
new file mode 100644
index 0000000..c68eb51
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/impl/RiskHazardServiceImpl.java
@@ -0,0 +1,249 @@
+package com.hnac.hzims.safeproduct.hazard.service.impl;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
+import cn.afterturn.easypoi.word.WordExportUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.google.common.collect.Lists;
+import com.hnac.hzims.safeproduct.hazard.service.IRiskHazardService;
+import com.hnac.hzims.safeproduct.hazard.util.ExcelConvertPdf;
+import com.hnac.hzims.safeproduct.hazard.vo.RiskHazardExcelVO;
+import com.hnac.hzims.safeproduct.risk.dto.HazardSourceDTO;
+import com.hnac.hzims.safeproduct.risk.service.HazardSourceService;
+import com.hnac.hzims.safeproduct.risk.service.HazardTaskService;
+import com.hnac.hzims.safeproduct.risk.vo.ExportEstimateVo;
+import com.hnac.hzims.safeproduct.risk.vo.SourceVo;
+import com.hnac.hzims.safeproduct.risk.vo.StationEstimateVo;
+import com.hnac.hzims.safeproduct.utils.AsposeUtil;
+import com.itextpdf.text.DocumentException;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.IntStream;
+
+/**
+ * @ClassName RiskHazardServiceImpl
+ * @description: 风险危险源服务类
+ * @author: hx
+ * @create: 2023-09-17 12:03
+ * @Version 4.0
+ **/
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class RiskHazardServiceImpl implements IRiskHazardService {
+
+ private final HazardSourceService hazardSourceService;
+ private final HazardTaskService hazardTaskService;
+
+ @Value("${hzims.risk.save-path}")
+ private String riskEvaluateSavePath;
+
+
+ @Override
+ public void exportEstimateWord(Long estimateId,String stationCode,Long taskId, HttpServletResponse response) throws Exception {
+ // 根据搜索条件查询风险点
+ StationEstimateVo stationEstimate = hazardTaskService.exportEstimate(estimateId,stationCode,taskId);
+ if(ObjectUtil.isEmpty(stationEstimate) || CollectionUtil.isEmpty(stationEstimate.getExportEstimates())){
+ if(StringUtil.isEmpty(stationCode)){
+ throw new ServiceException("未查询到任务风险评估数据!");
+ }else{
+ throw new ServiceException("未查询到站点风险评估数据!");
+ }
+ }
+ List estimate = stationEstimate.getExportEstimates();
+ IntStream.iterate(0,n->n+1).limit(estimate.size()).forEachOrdered(index -> estimate.get(index).setIndex(index+1));
+ Map data = new HashMap(3){{
+ put("stationName",stationEstimate.getStationName());
+ put("year",stationEstimate.getYear());
+ put("exportEstimates",estimate);
+ }};
+ XWPFDocument word = WordExportUtil.exportWord07("template/"+"风险评估.docx",data);
+ String stationName = Optional.ofNullable(stationEstimate).map(StationEstimateVo::getStationName).orElse("");
+ String wordPath = riskEvaluateSavePath+ "/" + stationName +"风险评价表.docx";
+ String pdfPath = riskEvaluateSavePath+ "/" + stationName +"风险评价表.pdf";
+ FileOutputStream outputStream = new FileOutputStream(wordPath);
+ try {
+ word.write(outputStream);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ finally {
+ outputStream.close();
+ }
+ AsposeUtil.wordToPdf(wordPath,pdfPath);
+ readPdf(response,pdfPath);
+ }
+
+ /**
+ * 导出风险点
+ * @param response
+ */
+ @Override
+ public void exportRiskHazardExcel(HazardSourceDTO req, Query query, HttpServletResponse response) {
+ // 根据搜索条件查询风险点
+ IPage page = hazardSourceService.page(req, query);
+ List riskHazardExcelVOList = JSONArray.parseArray(JSON.toJSONString(page.getRecords()), RiskHazardExcelVO.class);
+ IntStream.iterate(0,n->n+1).limit(riskHazardExcelVOList.size()).forEachOrdered(index -> riskHazardExcelVOList.get(index).setIndex(index+1));
+ Map data = new HashMap(1){{
+ put("riskList",riskHazardExcelVOList);
+ }};
+ TemplateExportParams params = new TemplateExportParams("template/风险点导出模板.xlsx",true);
+ try {
+ String fileName = URLEncoder.encode("风险点.xlsx","UTF-8");
+ response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+ response.setContentType("application/vnd.ms-excel;charset=utf-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ Workbook workbook = ExcelExportUtil.exportExcel(params, data);
+ Sheet sheet = workbook.getSheetAt(0);
+ this.mergeCell(2,1,JSONArray.parseArray(JSON.toJSONString(riskHazardExcelVOList)),"categoryName")
+ .forEach(cellRangeAddress -> sheet.addMergedRegion(cellRangeAddress));
+ try {
+ ServletOutputStream outputStream = response.getOutputStream();
+ try{
+ workbook.write(outputStream);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ finally {
+ outputStream.close();
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void exportEstimateExcel(Long estimateId,String stationCode,Long taskId, HttpServletResponse response) throws IOException, DocumentException {
+ StationEstimateVo stationEstimate = hazardTaskService.exportEstimate(estimateId,stationCode,taskId);
+ if(ObjectUtil.isEmpty(stationEstimate) || CollectionUtil.isEmpty(stationEstimate.getExportEstimates())){
+ if(StringUtil.isEmpty(stationCode)){
+ throw new ServiceException("未查询到任务风险评估数据!");
+ }else{
+ throw new ServiceException("未查询到站点风险评估数据!");
+ }
+ }
+ List estimate = stationEstimate.getExportEstimates();
+ IntStream.iterate(0,n->n+1).limit(estimate.size()).forEachOrdered(index -> estimate.get(index).setIndex(index+1));
+ Map data = new HashMap(3){{
+ put("stationName",stationEstimate.getStationName());
+ put("year",stationEstimate.getYear());
+ put("exportEstimates",estimate);
+ }};
+ TemplateExportParams params = new TemplateExportParams("template/风险评价赋分表.xlsx",true);
+ try {
+ String fileName = URLEncoder.encode("风险评价赋分表.xlsx","UTF-8");
+ response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+ response.setContentType("application/vnd.ms-excel;charset=utf-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ Workbook workbook = ExcelExportUtil.exportExcel(params, data);
+ Sheet sheet = workbook.getSheetAt(0);
+ this.mergeCell(2,1,JSONArray.parseArray(JSON.toJSONString(estimate)),"categoryName")
+ .forEach(sheet::addMergedRegion);
+ String pdfPath = "D:\\pdf" + stationEstimate.getStationName()+ "["+ stationEstimate.getYear() +"]" + "年度_风险评价赋分表.pdf";
+ OutputStream outputStream = Files.newOutputStream(Paths.get(pdfPath));
+ ExcelConvertPdf.excelConvertPdf(workbook, outputStream);
+ // pdf流放入response
+ readPdf(response,pdfPath);
+ }
+
+
+ /**
+ *
+ * @param initRow 起始行数
+ * @param initColumn 起始列数
+ * @param data 数据
+ * @param attribute 合并属性
+ * @return
+ */
+ private List mergeCell(int initRow, int initColumn, JSONArray data, String attribute) {
+ List result = Lists.newArrayList();
+ String initAttribute = JSONObject.parseObject(JSON.toJSONString(data.get(0))).getString(attribute);
+ int mergeCount = 1;
+ for (int index = 0; index < data.size(); index++ ) {
+ if(index == 0) {
+ continue;
+ }
+ JSONObject object = JSONObject.parseObject(JSON.toJSONString(data.get(index)));
+ if(object.getString(attribute).equals(initAttribute)) {
+ mergeCount ++ ;
+ }
+ else {
+ if(mergeCount > 1) {
+ result.add(new CellRangeAddress(initRow,initRow+mergeCount-1,initColumn,initColumn));
+ }
+ initRow = initRow+mergeCount;
+ initAttribute = object.getString(attribute);
+ mergeCount = 1;
+ }
+ if(index == data.size() -1) {
+ if(mergeCount > 1) {
+ result.add(new CellRangeAddress(initRow,initRow+mergeCount-1,initColumn,initColumn));
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 读取本地pdf,这里设置的是预览
+ */
+ public static void readPdf(HttpServletResponse response, String filePath) {
+ response.reset();
+ response.setContentType("application/pdf");
+ FileInputStream fileInputStream = null;
+ OutputStream outputStream = null;
+ try {
+ File file = new File(filePath);
+ fileInputStream = new FileInputStream(file);
+ outputStream = response.getOutputStream();
+ IOUtils.write(IOUtils.toByteArray(fileInputStream), outputStream);
+ response.setHeader("Content-Disposition",
+ "inline; filename= " + URLEncoder.encode(file.getName(), "UTF-8"));
+ outputStream.flush();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ fileInputStream.close();
+ outputStream.close();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java
new file mode 100644
index 0000000..c68fa1f
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java
@@ -0,0 +1,182 @@
+package com.hnac.hzims.safeproduct.hazard.util;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.BaseFont;
+import com.itextpdf.text.pdf.PdfPCell;
+import com.itextpdf.text.pdf.PdfPTable;
+import com.itextpdf.text.pdf.PdfWriter;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author yangshj
+ * @Date 2021/12/31 17:31
+ */
+public class ExcelConvertPdf {
+ public static void excelConvertPdf(Workbook workbook, OutputStream osOut) throws DocumentException, IOException {
+ //设置页面大小
+ Rectangle rectPageSize = new Rectangle(PageSize.A3);// 定义A3页面大小
+ rectPageSize = rectPageSize.rotate(); //横版
+ Document document = new Document(rectPageSize, -80, -80, 50, 0); //边距
+
+ //字体设置
+ /*
+ * 由于itext不支持中文,所以需要进行字体的设置,可以调用项目资源文件或者调用windows系统的中文字体,
+ * 找到文件后,打开属性,将文件名及所在路径作为字体名即可。
+ */
+ //创建BaseFont对象,指明字体,编码方式,是否嵌入
+ BaseFont bf=BaseFont.createFont("D:\\fonts\\SIMSUN.TTC,0", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+ //创建Font对象,将基础字体对象,字体大小,字体风格
+ Font font = new Font(bf, 13, Font.NORMAL);
+ int rowNum = 0;
+ int colNum = 0;
+
+ Sheet sheet = workbook.getSheetAt(0);
+ int column = sheet.getRow(1).getLastCellNum();
+ int row = sheet.getPhysicalNumberOfRows();
+ System.out.println(row);
+ //下面是找出表格中的空行和空列
+ List nullCol = new ArrayList<>();
+ List nullRow = new ArrayList<>();
+ for (int j = 0; j < column; j++) {
+ int nullColNum = 0;
+ for (int i = 0; i < row; i++) {
+ Cell cell = sheet.getRow(i).getCell(j);
+ if (cell == null || (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) && "".equals(cell.getStringCellValue())) {
+ nullColNum++;
+ }
+ }
+ if (nullColNum == row) {
+ nullCol.add(j);
+ }
+ }
+ for (int i = 0; i < row; i++) {
+ int nullRowNum = 0;
+ for (int j = 0; j < column; j++) {
+ Cell cell = sheet.getRow(i).getCell(j);
+ if (cell == null || (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) && "".equals(cell.getStringCellValue())) {
+ nullRowNum++;
+ }
+ }
+ if (nullRowNum == column) {
+ nullRow.add(i);
+ }
+ }
+ PdfWriter writer = PdfWriter.getInstance(document,osOut);
+ document.open();
+ PdfPTable table = new PdfPTable(column-sheet.getRow(1).getFirstCellNum());
+ List ranges = new ArrayList();
+ int sheetMergeCount = sheet.getNumMergedRegions();
+ System.out.println("sheetMergeCount"+sheetMergeCount);
+ for (int i = 0; i < sheetMergeCount; i++) {
+ CellRangeAddress range = sheet.getMergedRegion(i);
+ ranges.add(range);
+ }
+
+ PdfPCell cell1 = null;
+ String str = null;
+ boolean mergeFlag = true;
+
+ for (int i = sheet.getFirstRowNum(); i < row; i++) {
+ /*if (nullRow.contains(i)) { //如果这一行是空行,这跳过这一行
+ continue;
+ }*/
+
+ for (int j = sheet.getRow(1).getFirstCellNum(); j < column; j++) {
+ /*if (nullCol.contains(j)) { //如果这一列是空列,则跳过这一列
+ continue;
+ }*/
+
+ boolean flag = true;
+ Cell cell = sheet.getRow(i).getCell(j);
+ if(null != cell) {
+ if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
+ str = (int) cell.getNumericCellValue() + "";
+ } else {
+ str = cell.getStringCellValue();
+ }
+
+ System.out.println("i ::"+i + "j::"+j);
+ System.out.println(str);
+
+ for (CellRangeAddress range : ranges) { //合并的单元格判断和处理
+
+ if (j >= range.getFirstColumn() && j <= range.getLastColumn() && i >= range.getFirstRow()
+ && i <= range.getLastRow()) {
+ /*if (str == null || "".equals(str)) {
+ flag = false;
+ if (ranges.size()>1){
+ mergeFlag = true;
+ }else {
+ mergeFlag = false;
+ }
+ break;
+ }*/
+ if(mergeFlag){
+ rowNum = range.getLastRow() - range.getFirstRow() + 1;
+ colNum = range.getLastColumn() - range.getFirstColumn() + 1;
+ cell1 = mergeCell(str, font, rowNum, colNum);
+ System.out.println("合并"+rowNum+"、"+colNum);
+ table.addCell(cell1);
+ flag = false;
+ if (ranges.size()>1){
+ mergeFlag = true;
+ }else {
+ mergeFlag = false;
+ }
+ break;
+ }
+ flag = false;
+ if (ranges.size()>1){
+ mergeFlag = true;
+ }else {
+ mergeFlag = false;
+ }
+ }
+ }
+
+ if (flag) {
+ table.addCell(getPDFCell(str, font));
+ }
+ }
+
+ }
+ }
+ document.add(table);
+ document.close();
+ writer.close();
+ }
+
+ //合并
+ public static PdfPCell mergeCell(String str, Font font, int i, int j) {
+
+ PdfPCell cell = new PdfPCell(new Paragraph(str, font));
+ cell.setMinimumHeight(25);
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+ cell.setRowspan(i);
+ cell.setColspan(j);
+
+ return cell;
+ }
+ //获取指定内容与字体的单元格
+ public static PdfPCell getPDFCell(String string, Font font) {
+ //创建单元格对象,将内容与字体放入段落中作为单元格内容
+ PdfPCell cell = new PdfPCell(new Paragraph(string, font));
+
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+
+ //设置最小单元格高度
+ cell.setMinimumHeight(25);
+ return cell;
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/FILE_TYPE.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/FILE_TYPE.java
new file mode 100644
index 0000000..dd1c410
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/FILE_TYPE.java
@@ -0,0 +1,29 @@
+package com.hnac.hzims.safeproduct.hazard.util;
+
+/**
+ * @author ysj
+ * @version 4.0.0
+ * @create 2023-10-12-22:08
+ */
+public enum FILE_TYPE{
+ /**
+ * 统计报表形式
+ */
+ PDF("pdf"),
+ EXCLE("excle");
+
+ String desc;
+
+ FILE_TYPE(String desc){
+ this.desc = desc;
+ }
+ public static FILE_TYPE getFileTypeEnum(String desc){
+ for(FILE_TYPE fileType:FILE_TYPE.values()){
+ if(fileType.desc.equals(desc)){
+ return fileType;
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/RiskHazardExcelVO.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/RiskHazardExcelVO.java
new file mode 100644
index 0000000..9005021
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/RiskHazardExcelVO.java
@@ -0,0 +1,57 @@
+package com.hnac.hzims.safeproduct.hazard.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName HazardExcelVO
+ * @description:
+ * @author: hx
+ * @create: 2023-09-17 11:48
+ * @Version 4.0
+ **/
+@ApiModel("风险点Excel导出对象")
+@Data
+@AllArgsConstructor
+@EqualsAndHashCode
+public class RiskHazardExcelVO implements Serializable {
+
+ @Excel(name = "序号")
+ private Integer index;
+
+ @Excel(name = "类别")
+ private String categoryName;
+
+ @Excel(name = "风险点")
+ private String perilPoint;
+
+ @Excel(name = "危险源")
+ private String hazardName;
+
+ @Excel(name = "事故诱因")
+ private String accidentIncentive;
+
+ @Excel(name = "可能导致的后果")
+ private String causeConsequence;
+
+ @Excel(name = "风险评价方法")
+ private String estimateMethodName;
+
+ private Integer lUpLimit;
+
+ private Integer lLowerLimit;
+
+ private Integer eUpLimit;
+
+ private Integer eLowerLimit;
+
+ private Integer sUpLimit;
+
+ private Integer sLowerLimit;
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourcePostionWrapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourcePostionWrapper.java
similarity index 84%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourcePostionWrapper.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourcePostionWrapper.java
index 1056471..1304d4f 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourcePostionWrapper.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourcePostionWrapper.java
@@ -1,7 +1,7 @@
-package com.hnac.hzims.safeproduct.wrapper;
+package com.hnac.hzims.safeproduct.hazard.wrapper;
import com.hnac.hzims.safeproduct.entity.DangerSourcePositionEntity;
-import com.hnac.hzims.safeproduct.vo.DangerSourcePositionVO;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourcePositionVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourceWrapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourceWrapper.java
similarity index 91%
rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourceWrapper.java
rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourceWrapper.java
index 6b5c776..e71adde 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/DangerSourceWrapper.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/DangerSourceWrapper.java
@@ -1,8 +1,8 @@
-package com.hnac.hzims.safeproduct.wrapper;
+package com.hnac.hzims.safeproduct.hazard.wrapper;
import com.hnac.hzims.safeproduct.constants.DictConstants;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
-import com.hnac.hzims.safeproduct.vo.DangerSourceVO;
+import com.hnac.hzims.safeproduct.hazard.vo.DangerSourceVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.DictCache;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java
new file mode 100644
index 0000000..55799b4
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java
@@ -0,0 +1,19 @@
+package com.hnac.hzims.safeproduct.hazard.wrapper;
+
+import com.hnac.hzims.safeproduct.hazard.entity.HazardLibraryEntity;
+import com.hnac.hzims.safeproduct.hazard.vo.HazardLibraryVO;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+public class HazardLibraryWrapper extends BaseEntityWrapper {
+
+ public static HazardLibraryWrapper build() {
+ return new HazardLibraryWrapper();
+ }
+
+ @Override
+ public HazardLibraryVO entityVO(HazardLibraryEntity entity) {
+ HazardLibraryVO hazardLibraryVO = BeanUtil.copy(entity, HazardLibraryVO.class);
+ return hazardLibraryVO;
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java
index 93132b0..e386ef5 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java
@@ -1,6 +1,9 @@
package com.hnac.hzims.safeproduct.jobs;
-import com.alibaba.excel.util.CollectionUtils;
+import com.hnac.hzims.common.constant.CommonConstant;
+import com.hnac.hzims.common.logs.utils.StringUtils;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
+import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.enums.CarInsuranceStatusEnum;
@@ -9,10 +12,13 @@ import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.system.feign.ISysClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@@ -32,6 +38,12 @@ public class CarJob {
@Autowired
ICarMaintenanceService carMaintenanceService;
+ @Autowired
+ IMessageClient messageClient;
+
+ @Autowired
+ ISysClient sysClient;
+
/**
* 车辆台账自动变更
*/
@@ -41,28 +53,83 @@ public class CarJob {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
- String today = DateUtil.format(current, "yyyy-mm-dd");
- String yesterday = DateUtil.format(before, "yyyy-mm-dd");
- // 车包状态变更
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
+ // 车保状态变更
List uninsuredCarList = carService.getCarListByInsuranceTime(today, yesterday);
- uninsuredCarList.forEach(car -> car.setInsuranceStatus(CarInsuranceStatusEnum.UNINSURED.getValue()));
- boolean insuranceUpdate = carService.updateBatchById(uninsuredCarList);
- if (!insuranceUpdate) {
- return ReturnT.FAIL;
+ if (!CollectionUtils.isEmpty(uninsuredCarList)) {
+ uninsuredCarList.forEach(car -> {
+ car.setInsuranceStatus(CarInsuranceStatusEnum.UNINSURED.getValue());
+ sendUninsuredMessage(car);
+ });
+ boolean insuranceUpdate = carService.updateBatchById(uninsuredCarList);
+ if (!insuranceUpdate) {
+ return ReturnT.FAIL;
+ }
}
// 维保状态变更
List unMaintainedCarList = carService.getCarListByMaintenanceTime(today, yesterday);
+ if (CollectionUtils.isEmpty(unMaintainedCarList)) {
+ return ReturnT.SUCCESS;
+ }
unMaintainedCarList.forEach(car -> {
// 查询车辆在两次维保时间内是否有确认过的维保记录
- String lastMaintenanceTime = DateUtil.format(car.getMaintenanceLastTime(), "yyyy-mm-dd");
- String nextMaintenanceTime = DateUtil.format(car.getMaintenanceNextTime(), "yyyy-mm-dd");
+ String lastMaintenanceTime = DateUtil.format(car.getMaintenanceLastTime(), DateUtil.PATTERN_DATE);
+ String nextMaintenanceTime = DateUtil.format(car.getMaintenanceNextTime(), DateUtil.PATTERN_DATE);
List carMaintenanceList = carMaintenanceService.getCarMaintenanceByCarIdAndTime(car.getId(),
lastMaintenanceTime, nextMaintenanceTime);
// 若无维保记录,说明在规定范围内未进行有效维保
if (CollectionUtils.isEmpty(carMaintenanceList)) {
car.setMaintenanceStatus(CarMaintenanceStatusEnum.UNMAINTAINED.getValue());
+ sendUnMaintainedMessage(car);
}
});
return carService.updateBatchById(unMaintainedCarList) ? ReturnT.SUCCESS : ReturnT.FAIL;
}
+
+ /**
+ * 推送车保过期消息
+ * @param carEntity 车辆实体类
+ */
+ private void sendUninsuredMessage(CarEntity carEntity) {
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ String deptId = AuthUtil.getDeptId();
+ if (StringUtils.isNotEmpty(deptId)) {
+ Long id = Long.valueOf(deptId);
+ businessMessageDTO.setDeptId(id);
+ businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData());
+ businessMessageDTO.setBusinessKey("车保到期");
+ businessMessageDTO.setBusinessClassify("system");
+ businessMessageDTO.setTaskId(carEntity.getId());
+ businessMessageDTO.setSubject("车保到期通知");
+ businessMessageDTO.setContent("您所管理的车辆" + carEntity.getPlateNumber() + "车保已过期,请及时续保。");
+ businessMessageDTO.setUserIds(String.valueOf(carEntity.getManagerId()));
+ businessMessageDTO.setCreateUser(carEntity.getCreateUser());
+ businessMessageDTO.setTenantId(CommonConstant.TENANT_ID);
+ }
+ messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ }
+
+ /**
+ * 推送维保过期消息
+ * @param carEntity 车辆实体类
+ */
+ private void sendUnMaintainedMessage(CarEntity carEntity) {
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ String deptId = AuthUtil.getDeptId();
+ if (StringUtils.isNotEmpty(deptId)) {
+ Long id = Long.valueOf(deptId);
+ businessMessageDTO.setDeptId(id);
+ businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData());
+ businessMessageDTO.setBusinessKey("维保到期");
+ businessMessageDTO.setBusinessClassify("system");
+ businessMessageDTO.setTaskId(carEntity.getId());
+ businessMessageDTO.setSubject("维保到期通知");
+ businessMessageDTO.setContent("您所管理的车辆" + carEntity.getPlateNumber() + "维保已过期,请及时进行维保。");
+ businessMessageDTO.setUserIds(String.valueOf(carEntity.getManagerId()));
+ businessMessageDTO.setCreateUser(carEntity.getCreateUser());
+ businessMessageDTO.setTenantId(CommonConstant.TENANT_ID);
+ }
+ messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ }
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java
index 26e40c5..45a7b7f 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java
@@ -8,6 +8,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@@ -29,13 +30,14 @@ public class ConferenceJob {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
- String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
- String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
// 查询前一天的超时未完成会议计划
List list = conferencePlanService.getWaitingConferencePlanInTimeRange(yesterday, today);
- list.forEach(x -> {
- x.setConferenceStatus(ConferenceStatusEnum.UNFINISHED.getValue());
- });
+ if (CollectionUtils.isEmpty(list)) {
+ return ReturnT.SUCCESS;
+ }
+ list.forEach(x -> x.setConferenceStatus(ConferenceStatusEnum.UNFINISHED.getValue()));
// 将状态置为未完成
boolean flag = conferencePlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java
new file mode 100644
index 0000000..2e5c414
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java
@@ -0,0 +1,45 @@
+package com.hnac.hzims.safeproduct.jobs;
+
+import com.hnac.hzims.safeproduct.entity.DeviceEntity;
+import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
+import com.hnac.hzims.safeproduct.service.IDeviceService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 特种设备模块定时任务
+ *
+ * @author liwen
+ * @date 2024-01-16
+ */
+@Component
+public class DeviceJob {
+
+ @Autowired
+ IDeviceService deviceService;
+
+ @XxlJob("autoChangeDeviceStatus")
+ public ReturnT autoChangeDeviceStatus(String param) {
+ // 获取时间范围
+ Date current = DateUtil.now();
+ Date before = DateUtil.minusDays(current, 1);
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
+ // 查询昨天的过期设备
+ List list = deviceService.getExpiredDeviceByTime(yesterday, today);
+ if (CollectionUtils.isEmpty(list)) {
+ return ReturnT.SUCCESS;
+ }
+ list.forEach(e -> e.setDeviceStatus(DeviceStatusEnum.EXPIRED.getValue()));
+ // 更新状态
+ boolean update = deviceService.updateBatchById(list);
+ return update ? ReturnT.SUCCESS : ReturnT.FAIL;
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java
index 4a8aabf..399aa1d 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java
@@ -8,6 +8,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@@ -29,13 +30,14 @@ public class HygieneJob {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
- String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
- String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
// 查询前一天的超时未完成卫生自查计划
List list = hygienePlanService.getWaitingHygienePlanInTimeRange(yesterday, today);
- list.forEach(x -> {
- x.setHygienePlanStatus(TrainStatusEnum.UNFINISHED.getValue());
- });
+ if (CollectionUtils.isEmpty(list)) {
+ return ReturnT.SUCCESS;
+ }
+ list.forEach(x -> x.setHygienePlanStatus(TrainStatusEnum.UNFINISHED.getValue()));
// 将状态置为未完成
boolean flag = hygienePlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java
index d6eda46..2cb8450 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java
@@ -8,6 +8,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@@ -29,13 +30,14 @@ public class RehearsalJob {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
- String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
- String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
// 查询前一天的超时未完成演练计划
List list = rehearsalPlanService.getWaitingRehearsalInTimeRange(yesterday, today);
- list.forEach(x -> {
- x.setRehearsalStatus(RehearsalStatusEnum.UNFINISHED.getValue());
- });
+ if (CollectionUtils.isEmpty(list)) {
+ return ReturnT.SUCCESS;
+ }
+ list.forEach(x -> x.setRehearsalStatus(RehearsalStatusEnum.UNFINISHED.getValue()));
// 将状态置为未完成
boolean flag = rehearsalPlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java
index 6ed0f71..415fd72 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java
@@ -8,6 +8,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@@ -29,13 +30,14 @@ public class TrainJob {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
- String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
- String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
+ String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
+ String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
// 查询前一天的超时未完成培训计划
List list = trainPlanService.getWaitingTrainPlanInTimeRange(yesterday, today);
- list.forEach(x -> {
- x.setTrainStatus(TrainStatusEnum.UNFINISHED.getValue());
- });
+ if (CollectionUtils.isEmpty(list)) {
+ return ReturnT.SUCCESS;
+ }
+ list.forEach(x -> x.setTrainStatus(TrainStatusEnum.UNFINISHED.getValue()));
// 将状态置为未完成
boolean flag = trainPlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.java
index b76f9ca..df347f9 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.java
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.java
@@ -1,12 +1,17 @@
package com.hnac.hzims.safeproduct.mapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnac.hzims.safeproduct.entity.AccidentEntity;
+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;
+
/**
* @author hx
*/
public interface AccidentMapper extends UserDataScopeBaseMapper {
-
+ List getAccidentMonthTrend(@Param("ew") QueryWrapper ew);
}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.xml
new file mode 100644
index 0000000..f6b90db
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/AccidentMapper.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
index b77ecf2..e9f9afc 100644
--- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
@@ -5,7 +5,7 @@
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/CorrelationController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/CorrelationController.java
new file mode 100644
index 0000000..500f331
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/CorrelationController.java
@@ -0,0 +1,67 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.dto.CorrelationDTO;
+import com.hnac.hzims.safeproduct.risk.entity.Correlation;
+import com.hnac.hzims.safeproduct.risk.service.CorrelationService;
+import com.hnac.hzims.safeproduct.risk.vo.CorrelationDetailsVo;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/work/correlation")
+public class CorrelationController {
+
+ private final CorrelationService service;
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "关联危险源", notes = "传入Correlation")
+ public R correlation(@RequestBody CorrelationDTO correlation) {
+ return R.status(service.correlation(correlation));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "重新关联危险源", notes = "传入Correlation")
+ public R re_correlation(@RequestBody CorrelationDTO correlation) {
+ return R.status(service.re_correlation(correlation));
+ }
+
+ /**
+ * 详情
+ */
+ @GetMapping("/details")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R details(@RequestParam("workId") Long workId) {
+ return R.data(service.details(workId));
+ }
+
+
+ /**
+ * 分页
+ */
+ @GetMapping("/pageList")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R> page(Correlation entity, Query query) {
+ return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimateController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimateController.java
new file mode 100644
index 0000000..d4d31f5
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimateController.java
@@ -0,0 +1,48 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimate;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import com.hnac.hzims.safeproduct.risk.service.EstimateService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/estimate")
+public class EstimateController {
+
+ private final EstimateService estimateService;
+
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "风险评估新增", notes = "传入Estimate")
+ public R save(@RequestBody RiskEstimate entity) {
+ return R.status(estimateService.saveEstimate(entity));
+ }
+
+ @PostMapping("/pageList")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "风险评估任务列表", notes = "传入HazardWork")
+ public R save(RiskEstimate entity, Query query) {
+ return R.data(estimateService.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+
+ @PostMapping("/execute")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "危险源评估", notes = "传入RiskEstimatePoint")
+ public R execute(@RequestBody RiskEstimatePoint point) {
+ return R.status(estimateService.execute(point));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimatePointController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimatePointController.java
new file mode 100644
index 0000000..09ee3b4
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/EstimatePointController.java
@@ -0,0 +1,44 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import com.hnac.hzims.safeproduct.risk.service.EstimatePointService;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/estimate/point")
+public class EstimatePointController {
+
+ private final EstimatePointService pointService;
+
+ @PostMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "风险评估任务列表", notes = "传入HazardWork")
+ public R save(@RequestParam Long estimateId, Query query) {
+ IPage page = pointService.page(Condition.getPage(query),Wrappers.lambdaQuery()
+ .eq(RiskEstimatePoint::getEstimateId,estimateId));
+ if(CollectionUtil.isEmpty(page.getRecords())){
+ throw new ServiceException("风险评估清单获取失败,请联系系统管理员!");
+ }
+ page.setRecords(page.getRecords().stream().sorted(Comparator.comparing(RiskEstimatePoint::getCategory).thenComparing(RiskEstimatePoint::getPerilPoint).thenComparing(RiskEstimatePoint::getHazardName)).collect(Collectors.toList()));
+ return R.data(page);
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardCategoryController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardCategoryController.java
new file mode 100644
index 0000000..a9d8a9a
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardCategoryController.java
@@ -0,0 +1,93 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
+import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService;
+import com.hnac.hzims.safeproduct.risk.vo.HazardDetailsVo;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/hazard/category")
+public class HazardCategoryController {
+
+ private final HazardCategoryService service;
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "新增", notes = "传入HazardDetailsVo")
+ public R save(@RequestBody HazardDetailsVo entity) {
+ return R.status(service.saveDetail(entity));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "新增", notes = "传入HazardDetailsVo")
+ public R update(@RequestBody HazardDetailsVo entity) {
+ return R.status(service.updateDetail(entity));
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/details")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R details(@RequestParam("categoryId") Long categoryId) {
+ return R.data(service.details(categoryId));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "删除", notes = "ids")
+ public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+ return R.status(service.removeDetail(Func.toLongList(ids)));
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/pages")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "分页", notes = "查询条件:entity")
+ public R> page(HazardCategory entity, Query query) {
+ return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+
+
+ /**
+ * 是否存在危险源
+ */
+ @GetMapping("/isExist")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "是否存在危险源", notes = "传入风险源名称")
+ public R isExist(@RequestParam("stationType") Long stationType,
+ @RequestParam("category") Long category,
+ @RequestParam("perilPoint") String perilPoint,
+ @RequestParam("hazardName") String hazardName) {
+ return R.data(service.isExist(stationType,category,perilPoint,hazardName));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardLevelController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardLevelController.java
new file mode 100644
index 0000000..0167d66
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardLevelController.java
@@ -0,0 +1,77 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.entity.HazardLevel;
+import com.hnac.hzims.safeproduct.risk.service.HazardLevelService;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/hazard/level")
+public class HazardLevelController {
+
+ private final HazardLevelService service;
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "新增", notes = "传入HazardLevel")
+ public R save(@RequestBody HazardLevel entity) {
+ return R.status(service.save(entity));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "修改", notes = "传入HazardLevel")
+ public R update(@RequestBody HazardLevel entity) {
+ return R.status(service.updateById(entity));
+ }
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(service.deleteLogic(Func.toLongList(ids)));
+ }
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "详情", notes = "传入id")
+ public R detail(@RequestParam Long id) {
+ return R.data(service.getById(id));
+ }
+
+
+ /**
+ * 分页
+ */
+ @GetMapping("/pageList")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R> page(HazardLevel entity, Query query) {
+ return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardSourceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardSourceController.java
new file mode 100644
index 0000000..3acc4a1
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardSourceController.java
@@ -0,0 +1,55 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.dto.HazardSourceDTO;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.service.HazardSourceService;
+import com.hnac.hzims.safeproduct.risk.vo.SourceVo;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/hazard/source")
+public class HazardSourceController {
+
+ private final HazardSourceService service;
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R> list(HazardSource entity, Query query) {
+ return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/pages")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "查询条件:entity")
+ public R> pages(SourceVo entity, Query query) {
+ return R.data(service.pageCondition(entity,Condition.getPage(query)));
+ }
+
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页查询", notes = "查询条件:HazardSourceDTO")
+ public R> page(HazardSourceDTO req,Query query) {
+ return R.data(service.page(req,query));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardTaskController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardTaskController.java
new file mode 100644
index 0000000..c95ea34
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardTaskController.java
@@ -0,0 +1,55 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.dto.HazardRiskProcessDTO;
+import com.hnac.hzims.safeproduct.risk.service.HazardTaskService;
+import com.hnac.hzims.safeproduct.risk.vo.HazardTaskVo;
+import com.hnac.hzims.safeproduct.risk.vo.StationEstimateVo;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/hazard/process")
+public class HazardTaskController {
+
+ private final HazardTaskService service;
+
+ @PostMapping("/startProcess")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "开启流程", notes = "传入Correlation")
+ public R startProcess(@RequestBody HazardRiskProcessDTO process) {
+ return R.status(service.startProcess(process));
+ }
+
+ @PostMapping("/pages")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "用户任务列表", notes = "查询条件:entity")
+ public R> page(HazardTaskVo entity, Query query) {
+ return R.data(service.pageCondition(entity,Condition.getPage(query)));
+ }
+
+ @GetMapping("/details")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "任务风险评估详情", notes = "查询条件:entity")
+ public R details(@RequestParam("taskId") Long taskId) {
+ return R.data(service.details(taskId));
+ }
+
+ @GetMapping("/exportEstimate")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "任务风险导出", notes = "查询条件:entity")
+ public R exportEstimate(@RequestParam(value = "stationCode",required = false) String stationCode,
+ @RequestParam(value = "stationCode",required = false) Long taskId) {
+ return R.data(service.exportEstimate(null,stationCode,taskId));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardWorkController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardWorkController.java
new file mode 100644
index 0000000..cad2485
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/HazardWorkController.java
@@ -0,0 +1,89 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.safeproduct.risk.dto.CorrelationDTO;
+import com.hnac.hzims.safeproduct.risk.entity.HazardWork;
+import com.hnac.hzims.safeproduct.risk.service.HazardWorkService;
+import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/risk/hazard/work")
+public class HazardWorkController {
+
+ private final HazardWorkService service;
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 20)
+ @ApiOperation(value = "新增", notes = "传入HazardWork")
+ public R save(@RequestBody HazardWork entity) {
+ return R.status(service.save(entity));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 30)
+ @ApiOperation(value = "修改", notes = "传入HazardWork")
+ public R update(@RequestBody HazardWork entity) {
+ return R.status(service.updateById(entity));
+ }
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+ return R.status(service.deleteBacth(Func.toLongList(ids)));
+ }
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 40)
+ @ApiOperation(value = "详情", notes = "传入id")
+ public R detail(@RequestParam Long id) {
+ return R.data(service.getById(id));
+ }
+
+
+ /**
+ * 分页
+ */
+ @GetMapping("/pageList")
+ @ApiOperationSupport(order = 60)
+ @ApiOperation(value = "分页", notes = "查询条件:item")
+ public R> page(HazardWork entity, Query query) {
+ return R.data(service.page(Condition.getPage(query),Condition.getQueryWrapper(entity)));
+ }
+
+ @GetMapping("/getCheckItemByDutyPerson")
+ @ApiOperationSupport(order = 70)
+ @ApiOperation(value = "根据负责人ID获取对应区域下的风险排查项")
+ public R> getCheckItemByDutyPerson(@RequestParam @ApiParam("区域负责人ID") Long userId,@RequestParam @ApiParam("风险点ID")Long categoryId) {
+ return R.data(service.getCheckItemByDutyPerson(userId,categoryId));
+ }
+
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/RiskCheckController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/RiskCheckController.java
new file mode 100644
index 0000000..9a1686e
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/controller/RiskCheckController.java
@@ -0,0 +1,71 @@
+package com.hnac.hzims.safeproduct.risk.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.common.utils.Condition;
+import com.hnac.hzims.safeproduct.risk.dto.RiskCheckDTO;
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+import com.hnac.hzims.safeproduct.risk.service.IRiskCheckService;
+import com.hnac.hzims.safeproduct.risk.wrapper.RiskCheckWrapper;
+import com.hnac.hzims.safeproduct.vo.RiskCheckVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+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.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @ClassName RiskCheckController
+ * @description:
+ * @author: hx
+ * @create: 2023-09-19 09:32
+ * @Version 4.0
+ **/
+@RestController
+@AllArgsConstructor
+@Slf4j
+@RequestMapping("/risk/check")
+@Api(value = "风险检查项管理",tags = "风险检查项管理")
+public class RiskCheckController extends BladeController {
+
+ private final IRiskCheckService riskCheckService;
+
+ @GetMapping("/page")
+ @ApiOperation("分页查询")
+ @ApiOperationSupport(order = 1)
+ public R> page(RiskCheckDTO req, Query query) {
+ LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(RiskCheckEntity.class, BeanUtil.copy(req, RiskCheckEntity.class));
+ IPage page = riskCheckService.page(Condition.getPage(query), queryWrapper);
+ page.setRecords(RiskCheckWrapper.build().listVO(page.getRecords()));
+ return R.data(page);
+ }
+
+ @PostMapping("/saveOrUpdateBatch")
+ @ApiOperation("批量新增/修改")
+ @ApiOperationSupport(order = 2)
+ public R saveOrUpdateBatch(@RequestBody @Valid List req) {
+ List riskCheckList = JSONArray.parseArray(JSON.toJSONString(req), RiskCheckEntity.class);
+ return R.status(riskCheckService.saveBatch(riskCheckList));
+ }
+
+ @DeleteMapping("/delete/{ids}")
+ @ApiOperation("批量删除")
+ @ApiOperationSupport(order = 3)
+ public R delete(@PathVariable @ApiParam("id,按逗号分隔") String ids) {
+ return R.status(riskCheckService.removeByIds(Func.toLongList(",",ids)));
+ }
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClient.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClient.java
new file mode 100644
index 0000000..980c22f
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClient.java
@@ -0,0 +1,34 @@
+package com.hnac.hzims.safeproduct.risk.feign;
+
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.safeproduct.risk.service.HazardTaskService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author ysj
+ */
+@RestController
+@RequestMapping("/feign/hazardRisk")
+@Slf4j
+@RequiredArgsConstructor
+public class HazardRiskClient implements IHazardRiskClient {
+
+ private final HazardTaskService service;
+
+ /**
+ * 检修任务流程监听
+ * @param processWorkFlowResponse
+ * @return
+ */
+ @Override
+ @PostMapping("/listener")
+ public R listener(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) {
+ return R.status(service.listener(processWorkFlowResponse));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.java
new file mode 100644
index 0000000..662bf6c
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.Correlation;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @author ysj
+ */
+public interface CorrelationMapper extends UserDataScopeBaseMapper {
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.xml
new file mode 100644
index 0000000..64f6c76
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/CorrelationMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.java
new file mode 100644
index 0000000..07a33b7
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimate;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @author ysj
+ */
+public interface EstimateMapper extends UserDataScopeBaseMapper {
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.xml
new file mode 100644
index 0000000..9a5341e
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimateMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.java
new file mode 100644
index 0000000..b0845a9
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @author ysj
+ */
+public interface EstimatePointMapper extends UserDataScopeBaseMapper {
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.xml
new file mode 100644
index 0000000..8885015
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/EstimatePointMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.java
new file mode 100644
index 0000000..0b7bb27
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.java
@@ -0,0 +1,15 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
+import com.hnac.hzims.safeproduct.risk.vo.CategorySourceVo;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardCategoryMapper extends UserDataScopeBaseMapper {
+ List sourcesByCategory(@Param("stationType") Integer stationType);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.xml
new file mode 100644
index 0000000..bd35c38
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardCategoryMapper.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select category.STATION_TYPE,category.CATEGORY,category.PERIL_POINT,category.CREATE_TIME time,
+ source.*
+ from hzims_risk_hazard_source source
+ INNER JOIN hzims_risk_hazard_category category
+ on source.CATEGORY_ID = category.ID
+ where STATION_TYPE = #{stationType};
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.java
new file mode 100644
index 0000000..9c198cf
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardEstimate;
+import com.hnac.hzims.safeproduct.risk.vo.ExportEstimateVo;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardEstimateMapper extends UserDataScopeBaseMapper {
+
+ List exprotEstimate(@Param("taskId") Long taskId);
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.xml
new file mode 100644
index 0000000..a039a46
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardEstimateMapper.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ SELECT es.SOURCE_ID,task.STATION_CODE,task.STATION_NAME,task.CREATE_TIME,es.HAZARD_NAME,es.EVALUATION_METHOD,es.CAUSE_CONSEQUENCE,es.ACCIDENT_INCENTIVE,
+ es.L_VALUE as l,es.E_VALUE as e,es.C_S_VALUE as s,es.R_D_VALUE as r,es.LEVEL_ID,es.LEVEL_DESC as levelDesc,es.`LEVEL`,category.CATEGORY,es.CATEGORY_ID,category.PERIL_POINT
+ FROM HZIMS_RISK_HAZARD_ESTIMATE es
+ INNER JOIN HZIMS_RISK_HAZARD_TASK task
+ ON es.TASK_ID = task.ID
+ INNER JOIN hzims_risk_hazard_category category
+ ON es.CATEGORY_ID = category.ID
+ WHERE task.id = #{taskId};
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.java
new file mode 100644
index 0000000..66e76b1
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardLevel;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @author ysj
+ */
+public interface HazardLevelMapper extends UserDataScopeBaseMapper {
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.xml
new file mode 100644
index 0000000..a960623
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardLevelMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.java
new file mode 100644
index 0000000..c8ac1c0
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.java
@@ -0,0 +1,23 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.vo.SourceVo;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.annotation.UserDataAuth;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @author ysj
+ */
+public interface HazardSourceMapper extends BaseMapper {
+
+ @UserDataAuth
+ IPage pageCondition(IPage page,@Param("source") SourceVo entity);
+
+ @UserDataAuth
+ IPage selectPageOverride(IPage page, @Param("ew") Wrapper ew);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.xml
new file mode 100644
index 0000000..e659237
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardSourceMapper.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+ SELECT source.*,category.STATION_TYPE,category.CATEGORY,category.PERIL_POINT FROM
+ HZIMS_RISK_HAZARD_SOURCE source
+ INNER JOIN HZIMS_RISK_HAZARD_CATEGORY category ON source.CATEGORY_ID = CATEGORY.ID
+ WHERE source.IS_DELETED = 0
+ AND category.IS_DELETED = 0
+
+ AND SOURCE.HAZARD_NAME like concat('%',#{source.hazardName},'%')
+
+
+ AND category.PERIL_POINT like concat('%',#{source.perilPoint},'%')
+
+
+ AND SOURCE.STATION_TYPE = #{source.stationType}
+
+
+ AND SOURCE.CATEGORY = #{source.category}
+
+
+ AND source.ID NOT IN
+
+ #{sourceId}
+
+
+
+
+
+ SELECT source.*,category.STATION_TYPE,category.CATEGORY,category.PERIL_POINT
+ FROM
+ HZIMS_RISK_HAZARD_SOURCE source
+ INNER JOIN HZIMS_RISK_HAZARD_CATEGORY category
+ ON source.CATEGORY_ID = CATEGORY.ID and category.IS_DELETED = 0
+
+ ${ew.sqlSegment}
+
+
+
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.java
new file mode 100644
index 0000000..d9b6e02
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.java
@@ -0,0 +1,22 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.safeproduct.risk.entity.HazardTask;
+import com.hnac.hzims.safeproduct.risk.vo.ExportEstimateVo;
+import com.hnac.hzims.safeproduct.risk.vo.HazardTaskVo;
+import com.hnac.hzims.safeproduct.risk.vo.StationRiskLevelVo;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardTaskMapper extends UserDataScopeBaseMapper {
+
+ IPage pageCondition(IPage page, @Param("task") HazardTaskVo entity);
+
+ List stationRiskLevel();
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.xml
new file mode 100644
index 0000000..6e6b45b
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardTaskMapper.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+ SELECT * FROM HZIMS_RISK_HAZARD_TASK
+ WHERE IS_DELETED = 0
+
+ AND TASK_NAME LIKE concat('%',#{task.taskName},'%')
+
+
+ AND HEAD = #{task.head}
+
+
+ AND ACT_START_TIME >= #{task.startTime}
+
+
+ AND ACT_START_TIME <= #{task.endTime}
+
+ order by create_time desc
+
+
+
+ SELECT
+ distinct task.STATION_CODE,
+ task.STATION_NAME,
+ estimate.LEV AS `LEVEL`
+ FROM
+ (SELECT * FROM HZIMS_RISK_HAZARD_TASK WHERE CREATE_TIME IN ( SELECT MAX( CREATE_TIME ) FROM hzims_risk_hazard_task GROUP BY STATION_CODE ) ) task
+
+ INNER JOIN
+ ( SELECT TASK_ID, MAX( LEVEL ) AS LEV FROM HZIMS_RISK_HAZARD_ESTIMATE WHERE NOT LEVEL IS NULL GROUP BY TASK_ID ) estimate ON task.ID = estimate.TASK_ID
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.java
new file mode 100644
index 0000000..18712b9
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.java
@@ -0,0 +1,14 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardWork;
+import com.hnac.hzims.safeproduct.risk.vo.StationRiskLevelVo;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardWorkMapper extends UserDataScopeBaseMapper {
+
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.xml
new file mode 100644
index 0000000..e6ab349
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/HazardWorkMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/RiskCheckMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/RiskCheckMapper.java
new file mode 100644
index 0000000..7fa3c81
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/mapper/RiskCheckMapper.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.safeproduct.risk.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+
+public interface RiskCheckMapper extends BaseMapper {
+
+
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/CorrelationService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/CorrelationService.java
new file mode 100644
index 0000000..0baadce
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/CorrelationService.java
@@ -0,0 +1,19 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.dto.CorrelationDTO;
+import com.hnac.hzims.safeproduct.risk.entity.Correlation;
+import com.hnac.hzims.safeproduct.risk.vo.CorrelationDetailsVo;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @author ysj
+ */
+public interface CorrelationService extends BaseService {
+
+ boolean correlation(CorrelationDTO correlation);
+
+ boolean re_correlation(CorrelationDTO correlation);
+
+ CorrelationDetailsVo details(Long workId);
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimatePointService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimatePointService.java
new file mode 100644
index 0000000..f2f7923
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimatePointService.java
@@ -0,0 +1,11 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @author ysj
+ */
+public interface EstimatePointService extends BaseService {
+
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimateService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimateService.java
new file mode 100644
index 0000000..2971a47
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/EstimateService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimate;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @author ysj
+ */
+public interface EstimateService extends BaseService {
+
+
+ boolean saveEstimate(RiskEstimate entity);
+
+ boolean execute(RiskEstimatePoint point);
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardCategoryService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardCategoryService.java
new file mode 100644
index 0000000..9bd5203
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardCategoryService.java
@@ -0,0 +1,27 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.vo.CategorySourceVo;
+import com.hnac.hzims.safeproduct.risk.vo.HazardDetailsVo;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardCategoryService extends BaseService {
+
+ boolean saveDetail(HazardDetailsVo entity);
+
+ boolean updateDetail(HazardDetailsVo entity);
+
+ HazardDetailsVo details(Long categoryId);
+
+ boolean removeDetail(List ids);
+
+ boolean isExist(Long stationType,Long category,String perilPoint,String hazardName);
+
+ List sourcesByCategory(Integer stationType);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardEstimateService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardEstimateService.java
new file mode 100644
index 0000000..db31bf9
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardEstimateService.java
@@ -0,0 +1,17 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardEstimate;
+import com.hnac.hzims.safeproduct.risk.vo.ExportEstimateVo;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardEstimateService extends BaseService {
+
+ List evaluationLevel(List estimates);
+
+ List exportEstimate(Long taskId);
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardLevelService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardLevelService.java
new file mode 100644
index 0000000..01ce5bb
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardLevelService.java
@@ -0,0 +1,11 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardLevel;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @author ysj
+ */
+public interface HazardLevelService extends BaseService {
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardSourceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardSourceService.java
new file mode 100644
index 0000000..bf9b5e4
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardSourceService.java
@@ -0,0 +1,26 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO;
+import com.hnac.hzims.safeproduct.risk.dto.HazardSourceDTO;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.vo.HazardDetailsVo;
+import com.hnac.hzims.safeproduct.risk.vo.SourceVo;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.annotation.UserDataAuth;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.mp.support.Query;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardSourceService extends BaseService {
+
+ IPage pageCondition(SourceVo entity, IPage page);
+
+ List list(HazardSourceDTO sourceDTO);
+
+ IPage page(HazardSourceDTO req, Query query);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardTaskService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardTaskService.java
new file mode 100644
index 0000000..0db7110
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardTaskService.java
@@ -0,0 +1,34 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.safeproduct.risk.dto.HazardRiskProcessDTO;
+import com.hnac.hzims.safeproduct.risk.entity.HazardTask;
+import com.hnac.hzims.safeproduct.risk.vo.ExportEstimateVo;
+import com.hnac.hzims.safeproduct.risk.vo.HazardTaskVo;
+import com.hnac.hzims.safeproduct.risk.vo.StationEstimateVo;
+import com.hnac.hzims.safeproduct.risk.vo.StationRiskLevelVo;
+import com.hnac.hzims.safeproduct.statistic.vo.RiskInnerVO;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardTaskService extends BaseService {
+
+ boolean startProcess(HazardRiskProcessDTO process);
+
+ boolean listener(ProcessWorkFlowResponse processWorkFlowResponse);
+
+ IPage pageCondition(HazardTaskVo entity, IPage page);
+
+ HazardTaskVo details(Long taskId);
+
+ List stationRiskLevel();
+
+ StationEstimateVo exportEstimate(Long estimateId,String stationCode,Long taskId);
+
+ RiskInnerVO stationRiskInner(String stationCode);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardWorkService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardWorkService.java
new file mode 100644
index 0000000..35cfefa
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/HazardWorkService.java
@@ -0,0 +1,18 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.HazardWork;
+import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO;
+import com.hnac.hzims.safeproduct.risk.vo.StationRiskLevelVo;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @author ysj
+ */
+public interface HazardWorkService extends BaseService {
+
+ boolean deleteBacth(List workIds);
+
+ List getCheckItemByDutyPerson(Long userId,Long categoryId);
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/IRiskCheckService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/IRiskCheckService.java
new file mode 100644
index 0000000..d3c8996
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/IRiskCheckService.java
@@ -0,0 +1,15 @@
+package com.hnac.hzims.safeproduct.risk.service;
+
+import com.hnac.hzims.safeproduct.risk.entity.RiskCheckEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @ClassName IRiskCheckService
+ * @description:
+ * @author: hx
+ * @create: 2023-09-19 09:34
+ * @Version 4.0
+ **/
+public interface IRiskCheckService extends BaseService {
+
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/CorrelationServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/CorrelationServiceImpl.java
new file mode 100644
index 0000000..5eb37f1
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/CorrelationServiceImpl.java
@@ -0,0 +1,94 @@
+package com.hnac.hzims.safeproduct.risk.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.safeproduct.risk.dto.CorrelationDTO;
+import com.hnac.hzims.safeproduct.risk.entity.Correlation;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.mapper.CorrelationMapper;
+import com.hnac.hzims.safeproduct.risk.service.CorrelationService;
+import com.hnac.hzims.safeproduct.risk.service.HazardSourceService;
+import com.hnac.hzims.safeproduct.risk.vo.CorrelationDetailsVo;
+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.ObjectUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author ysj
+ */
+@Service
+@AllArgsConstructor
+@Slf4j
+public class CorrelationServiceImpl extends BaseServiceImpl implements CorrelationService {
+
+ private final HazardSourceService sourceService;
+
+ /**
+ * 危险源关联
+ * @param correlation : 危险源关联数据
+ * @return
+ */
+ @Override
+ public boolean correlation(CorrelationDTO correlation) {
+ if(ObjectUtil.isEmpty(correlation) || CollectionUtil.isEmpty(correlation.getSources())){
+ throw new ServiceException("请选择危险源关联数据,再进行保存!");
+ }
+ return super.saveBatch(correlation.getSources().stream().map(source->{
+ Correlation entity = new Correlation();
+ entity.setWorkId(correlation.getWorkId());
+ entity.setCategoryId(source.getCategoryId());
+ entity.setSourceId(source.getId());
+ return entity;
+ }).collect(Collectors.toList()));
+ }
+
+ /**
+ * 重新关联危险源
+ * @param correlation
+ * @return
+ */
+ @Override
+ public boolean re_correlation(CorrelationDTO correlation) {
+ if(ObjectUtil.isEmpty(correlation)){
+ throw new ServiceException("请选择危险源关联数据,再进行保存!");
+ }
+ if(CollectionUtil.isEmpty(correlation.getSources())) {
+ return super.remove(Wrappers.lambdaQuery().eq(Correlation::getWorkId, correlation.getWorkId()));
+ }
+ // 删除已关联危险源数据 && 保存新关联危险源数据
+ return super.remove(Wrappers.lambdaQuery().eq(Correlation::getWorkId, correlation.getWorkId())) && super.saveBatch(correlation.getSources().stream().map(source->{
+ Correlation entity = new Correlation();
+ entity.setWorkId(correlation.getWorkId());
+ entity.setCategoryId(source.getCategoryId());
+ entity.setSourceId(source.getId());
+ return entity;
+ }).collect(Collectors.toList()));
+ }
+
+ /**
+ * 查看关联危险源详情
+ * @param workId
+ * @return
+ */
+ @Override
+ public CorrelationDetailsVo details(Long workId) {
+ if(ObjectUtil.isEmpty(workId)){
+ throw new ServiceException("请选择需要查看的作业区域!");
+ }
+ List sources = this.list(Wrappers.lambdaQuery()
+ .eq(Correlation::getWorkId,workId));
+ if(CollectionUtil.isEmpty(sources)){
+ return new CorrelationDetailsVo();
+ }
+ CorrelationDetailsVo correlation = new CorrelationDetailsVo();
+ correlation.setWorkId(workId);
+ correlation.setSources(sourceService.listByIds(sources.stream().map(Correlation::getSourceId).collect(Collectors.toList())));
+ return correlation;
+ }
+}
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimatePointServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimatePointServiceImpl.java
new file mode 100644
index 0000000..cc958a1
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimatePointServiceImpl.java
@@ -0,0 +1,30 @@
+package com.hnac.hzims.safeproduct.risk.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.safeproduct.risk.constants.HazardRiskConstants;
+import com.hnac.hzims.safeproduct.risk.entity.HazardLevel;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import com.hnac.hzims.safeproduct.risk.mapper.EstimatePointMapper;
+import com.hnac.hzims.safeproduct.risk.service.EstimatePointService;
+import com.hnac.hzims.safeproduct.risk.service.HazardLevelService;
+import com.hnac.hzims.vo.SafeCheckStatisticVO;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.system.cache.DictCache;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * @author ysj
+ */
+@Service
+@AllArgsConstructor
+@Slf4j
+public class EstimatePointServiceImpl extends BaseServiceImpl implements EstimatePointService {
+
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java
new file mode 100644
index 0000000..5494200
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java
@@ -0,0 +1,166 @@
+package com.hnac.hzims.safeproduct.risk.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.safeproduct.risk.constants.HazardRiskConstants;
+import com.hnac.hzims.safeproduct.risk.entity.HazardLevel;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimate;
+import com.hnac.hzims.safeproduct.risk.entity.RiskEstimatePoint;
+import com.hnac.hzims.safeproduct.risk.mapper.EstimateMapper;
+import com.hnac.hzims.safeproduct.risk.service.EstimatePointService;
+import com.hnac.hzims.safeproduct.risk.service.EstimateService;
+import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService;
+import com.hnac.hzims.safeproduct.risk.service.HazardLevelService;
+import com.hnac.hzims.safeproduct.risk.vo.CategorySourceVo;
+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.ObjectUtil;
+import org.springblade.system.cache.DictCache;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+
+/**
+ * @author ysj
+ */
+@Service
+@AllArgsConstructor
+@Slf4j
+public class EstimateServiceImpl extends BaseServiceImpl implements EstimateService {
+
+ private final HazardLevelService levelService;
+
+ private final EstimatePointService pointService;
+
+ private final HazardCategoryService categoryService;
+
+ /**
+ * 风险评估
+ * @param entity
+ * @return
+ */
+ @Override
+ public boolean saveEstimate(RiskEstimate entity) {
+ // 检查站点年度评估任务是否存在
+ int count = this.count(Wrappers.lambdaQuery()
+ .eq(RiskEstimate::getStationCode,entity.getStationCode())
+ .eq(RiskEstimate::getEstimateYear,entity.getEstimateYear()));
+ if(count > 0){
+ throw new ServiceException("[" + entity.getStationName() + "],在" + entity.getEstimateYear() + "年度已经存在风险评估记录!");
+ }
+
+ // 站点年度评估保存
+ this.save(entity);
+
+ // 站点类型评估危险源绑定
+ List sources = categoryService.sourcesByCategory(entity.getStationType());
+
+ // 批量评估危险源
+ return pointService.saveBatch(sources.stream().map(source->{
+ RiskEstimatePoint point = new RiskEstimatePoint();
+ point.setEstimateId(entity.getId());
+ point.setCategory(source.getCategory());
+ point.setPerilPoint(source.getPerilPoint());
+ point.setCategoryId(source.getCategoryId());
+ point.setSourceId(source.getId());
+ point.setHazardName(source.getHazardName());
+ point.setAccidentIncentive(source.getAccidentIncentive());
+ point.setCauseConsequence(source.getCauseConsequence());
+ point.setEvaluationMethod(source.getEvaluationMethod());
+ point.setLUpLimit(source.getLUpLimit());
+ point.setLDownLimit(source.getLDownLimit());
+ point.setEUpLimit(source.getEUpLimit());
+ point.setEDownLimit(source.getLDownLimit());
+ point.setCSUpLimit(source.getCSUpLimit());
+ point.setCSDownLimit(source.getCSDownLimit());
+ return point;
+ }).collect(Collectors.toList()));
+ }
+
+ /**
+ * 危险源评估
+ * @param point
+ * @return
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public boolean execute(RiskEstimatePoint point) {
+ // 计算R/D值
+ double rdValue = this.rdValue(point);
+ point.setRDValue(rdValue);
+ // 评估等级
+ HazardLevel level = this.evaluation(point.getSourceId(),rdValue);
+ if(!ObjectUtil.isEmpty(level) && !ObjectUtil.isEmpty(level.getId())){
+ point.setLevel(level.getRiskLevel());
+ point.setLevelId(level.getId());
+ point.setLevelDesc(Optional.ofNullable(level.getRisk()).map(dict-> DictCache.getValue("hazard_level", Math.toIntExact(dict))).orElse("R/D值评级范围未制定"));
+ }else{
+ if(rdValue < 70){
+ point.setLevel(1);
+ }else if(rdValue > 70 && rdValue < 160){
+ point.setLevel(2);
+ }else if(rdValue > 160 && rdValue < 320){
+ point.setLevel(3);
+ }else{
+ point.setLevel(4);
+ }
+ point.setLevelDesc(Optional.ofNullable(point.getLevel()).map(dict-> DictCache.getValue("hazard_level", Math.toIntExact(dict))).orElse("R/D值评级范围未制定"));
+ }
+ // 同步评估数据
+ point.setStatus(2);
+ pointService.saveOrUpdate(point);
+
+ // 异步修改任务评估状态
+ CompletableFuture.supplyAsync(() -> this.syncEstimteStatus(point.getEstimateId()));
+ return true;
+ }
+
+ /**
+ * R/D 值计算
+ * @param point
+ */
+ private double rdValue(RiskEstimatePoint point) {
+ if(HazardRiskConstants.LS.equals(point.getEvaluationMethod())){
+ return point.getLValue() * point.getCSValue();
+ }
+ return point.getLValue() * point.getEValue() * point.getCSValue();
+ }
+
+ /**
+ * 风险等级评估
+ * @param sourceId
+ * @param rDValue
+ * @return
+ */
+ private HazardLevel evaluation(Long sourceId, double rDValue) {
+ HazardLevel confirm = levelService.getOne(Wrappers.lambdaQuery()
+ .eq(HazardLevel::getSourceId,sourceId)
+ .gt(HazardLevel::getRMaxValue,rDValue)
+ .lt(HazardLevel::getRMinValue,rDValue)
+ );
+ if(ObjectUtil.isNotEmpty(confirm)){
+ return confirm;
+ }
+ return new HazardLevel();
+ }
+
+ private Boolean syncEstimteStatus(Long estimateId) {
+ List points = pointService.list(Wrappers.lambdaQuery()
+ .eq(RiskEstimatePoint::getEstimateId,estimateId)
+ .eq(RiskEstimatePoint::getStatus,1));
+ if(CollectionUtil.isEmpty(points)){
+ return this.update(Wrappers.lambdaUpdate()
+ .set(RiskEstimate::getStatus, 3)
+ .eq(RiskEstimate::getId,estimateId));
+ }
+ return this.update(Wrappers.lambdaUpdate()
+ .set(RiskEstimate::getStatus, 2)
+ .eq(RiskEstimate::getId,estimateId));
+ }
+}
\ No newline at end of file
diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java
new file mode 100644
index 0000000..d2d271c
--- /dev/null
+++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java
@@ -0,0 +1,153 @@
+package com.hnac.hzims.safeproduct.risk.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.safeproduct.risk.entity.HazardCategory;
+import com.hnac.hzims.safeproduct.risk.entity.HazardSource;
+import com.hnac.hzims.safeproduct.risk.mapper.HazardCategoryMapper;
+import com.hnac.hzims.safeproduct.risk.service.HazardCategoryService;
+import com.hnac.hzims.safeproduct.risk.service.HazardSourceService;
+import com.hnac.hzims.safeproduct.risk.vo.CategorySourceVo;
+import com.hnac.hzims.safeproduct.risk.vo.HazardDetailsVo;
+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.BeanUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author ysj
+ */
+@Service
+@AllArgsConstructor
+@Slf4j
+public class HazardCategoryServiceImpl extends BaseServiceImpl implements HazardCategoryService {
+
+ private final HazardSourceService sourceService;
+
+ /**
+ * 保存类别及详情
+ * @param entity
+ * @return
+ */
+ @Override
+ public boolean saveDetail(HazardDetailsVo entity) {
+ // 危险源检查
+ if(CollectionUtil.isEmpty(entity.getSources())){
+ throw new ServiceException("请添加危险点对应危险源信息!");
+ }
+ // 查询项目是否存在
+ HazardCategory category = this.getOne(Wrappers.lambdaQuery()
+ .eq(HazardCategory::getStationType,entity.getStationType())
+ .eq(HazardCategory::getCategory,entity.getCategory())
+ .eq(HazardCategory::getPerilPoint,entity.getPerilPoint())
+ );
+ if(ObjectUtil.isEmpty(category)){
+ // 保存风险点记录
+ this.save(entity);
+ // 保存危险源
+ return sourceService.saveBatch(entity.getSources().stream().peek(source-> source.setCategoryId(entity.getId())).collect(Collectors.toList()));
+ }
+ // 保存危险源
+ return sourceService.saveBatch(entity.getSources().stream().peek(source-> source.setCategoryId(category.getId())).collect(Collectors.toList()));
+ }
+
+ /**
+ * 修改
+ * @param entity
+ * @return
+ */
+ @Override
+ public boolean updateDetail(HazardDetailsVo entity) {
+ // 危险源检查
+ if(CollectionUtil.isEmpty(entity.getSources())){
+ throw new ServiceException("请添加危险点对应危险源信息!");
+ }
+ // 查询项目是否存在
+ HazardCategory category = this.getOne(Wrappers.lambdaQuery()
+ .eq(HazardCategory::getStationType,entity.getStationType())
+ .eq(HazardCategory::getCategory,entity.getCategory())
+ .eq(HazardCategory::getPerilPoint,entity.getPerilPoint())
+ .ne(HazardCategory::getId,entity.getId())
+ );
+ if(ObjectUtil.isNotEmpty(category)){
+ throw new ServiceException("站点类型的对应类别已经存在该危险点,请重新填写危险点!");
+ }
+ // 保存危险类别记录
+ this.updateById(entity);
+ // 保存详情
+ return sourceService.updateBatchById(entity.getSources().stream().peek(source-> source.setCategoryId(entity.getId())).collect(Collectors.toList()));
+ }
+
+ /**
+ * 根据风险点ID查询危险源列表
+ * @param categoryId
+ * @return
+ */
+ @Override
+ public HazardDetailsVo details(Long categoryId) {
+ HazardCategory category = this.getById(categoryId);
+ if(ObjectUtil.isEmpty(category)){
+ throw new ServiceException("未查询风险点详情数据!");
+ }
+ HazardDetailsVo details = new HazardDetailsVo();
+ BeanUtil.copyProperties(category,details);
+ List sources = sourceService.list(Wrappers.lambdaQuery()
+ .eq(HazardSource::getCategoryId,categoryId));
+ if(CollectionUtil.isEmpty(sources)){
+ throw new ServiceException("未查询危险源详情数据!");
+ }
+ details.setSources(sources);
+ return details;
+ }
+
+ /**
+ * 删除
+ * @param ids
+ * @return
+ */
+ @Override
+ public boolean removeDetail(List ids) {
+ if(CollectionUtil.isEmpty(ids)){
+ throw new ServiceException("请选择需要删除的危险点记录,再进行删除!");
+ }
+ // 删除风险点 && 危险源记录
+ return super.deleteLogic(ids) && sourceService.remove(Wrappers.