Browse Source

# 危险源库功能

zhongwei
haungxing 10 months ago
parent
commit
22476de82e
  1. 11
      hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/DateUtil.java
  2. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/constants/ScheduledConstant.java
  3. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java
  4. 1
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  5. 12
      hzims-service-api/safeproduct-api/pom.xml
  6. 5
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java
  7. 9
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/AccidentDTO.java
  8. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/InnerDangerDTO.java
  9. 15
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java
  10. 299
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/InnerDangerEntity.java
  11. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/DangerSourceDTO.java
  12. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/DangerSourcePositionDTO.java
  13. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardInstanceDTO.java
  14. 15
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardLibraryDTO.java
  15. 59
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/entity/HazardLibraryEntity.java
  16. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java
  17. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourcePositionVO.java
  18. 5
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java
  19. 15
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/HazardLibraryVO.java
  20. 53
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/DocumentManagement.java
  21. 14
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/RatingScale.java
  22. 33
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardNecessary.java
  23. 44
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/SafeStandardResult.java
  24. 18
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetManagement.java
  25. 57
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/entity/TargetTemplate.java
  26. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/DocumentManagementQueryVo.java
  27. 5
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/RatingScaleVo.java
  28. 19
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/management/vo/TargetTemplateQueryVo.java
  29. 58
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/constants/HazardRiskConstants.java
  30. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/CorrelationDTO.java
  31. 22
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardRiskProcessDTO.java
  32. 22
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/HazardSourceDTO.java
  33. 24
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/dto/RiskCheckDTO.java
  34. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/Correlation.java
  35. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardCategory.java
  36. 71
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardEstimate.java
  37. 41
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardLevel.java
  38. 56
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardSource.java
  39. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardTask.java
  40. 48
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/HazardWork.java
  41. 46
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskCheckEntity.java
  42. 29
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimate.java
  43. 89
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/entity/RiskEstimatePoint.java
  44. 19
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/HazardRiskClientFallBack.java
  45. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/feign/IHazardRiskClient.java
  46. 29
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CategorySourceVo.java
  47. 22
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/CorrelationDetailsVo.java
  48. 78
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/ExportEstimateVo.java
  49. 20
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardDetailsVo.java
  50. 32
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardEstimateVo.java
  51. 27
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/HazardTaskVo.java
  52. 48
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/PersonalCheckItemVO.java
  53. 42
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/SourceVo.java
  54. 29
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationEstimateVo.java
  55. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/vo/StationRiskLevelVo.java
  56. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/HazardSourceWrapper.java
  57. 33
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/risk/wrapper/RiskCheckWrapper.java
  58. 44
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/ControlLevel.java
  59. 52
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/DangerSourceInfo.java
  60. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/HiddenDanger.java
  61. 59
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskHazardsScreening.java
  62. 69
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskInfo.java
  63. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixX.java
  64. 51
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskMatrixY.java
  65. 54
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/RiskPointInfo.java
  66. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/entity/WorkArea.java
  67. 8
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/ControlLevelQueryVo.java
  68. 8
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/DangerSourceInfoQueryVo.java
  69. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/HiddenDangerQueryVo.java
  70. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskHazardsScreeningVo.java
  71. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskInfoQueryVo.java
  72. 8
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixXQueryVo.java
  73. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskMatrixYQueryVo.java
  74. 8
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/RiskPointInfoQueryVo.java
  75. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/riskhazards/vo/WorkAreaQueryVo.java
  76. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/Constants.java
  77. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/DangerRiskScatterVO.java
  78. 34
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerAccidentMonthCountVO.java
  79. 38
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskDangerStatisticVO.java
  80. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/RiskInnerVO.java
  81. 29
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/statistic/vo/StationRiskStatisticVO.java
  82. 170
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerBaseVo.java
  83. 69
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerCheckVo.java
  84. 62
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerConclusionVo.java
  85. 104
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HiddenDangerRectifierVo.java
  86. 38
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/InnerDangerVo.java
  87. 29
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RiskCheckVO.java
  88. 22
      hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java
  89. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/FlowKeyConstants.java
  90. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java
  91. 103
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java
  92. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
  93. 66
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/TaskOverdueHandler.java
  94. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeReportController.java
  95. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/DangerSourceImporter.java
  96. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
  97. 126
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/controller/InnerDangerStartController.java
  98. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.java
  99. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.xml
  100. 42
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/IInnerDangerFlowService.java
  101. Some files were not shown because too many files have changed in this diff Show More

11
hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/DateUtil.java

@ -18,6 +18,17 @@ import java.util.stream.IntStream;
*/
public class DateUtil {
public static final String yyyy_MM_dd_HH_MM_SS= "yyyy-MM-dd HH:mm:ss";
public static final String yyyy_MM_dd= "yyyy-MM-dd";
public static final String yyyy_MM= "yyyy-MM";
public static final String yyyy= "yyyy";
public static final String YEAR = "year";
public static final String QUARTER = "quarter";
public static final String MONTH = "month";
public static final String WEEK = "week";
public static final String DAY = "day";
/***
* Date 转换为 LocalDateTime
* @param convertDate 需转换的时间

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/constants/ScheduledConstant.java

@ -19,4 +19,8 @@ public interface ScheduledConstant {
String STATION_MONTH_REPORT = "stationMonthReport";
//自动生成个人运维月报
String PERSONAL_MONTH_REPORT = "personalMonthReport";
//生成日常维护任务
String GENERATE_MAINTENANCE_TASK_SCHEDULE = "generateMaintenanceTask";
//日常维护任务到期提醒
String REMIND_MAINTENANCE_BECOME_TASK = "remindMaintenanceBecomeTask";
}

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java

@ -75,9 +75,13 @@ public class OperMaintenanceTaskEntity extends TenantEntity {
* 执行日期
*/
@ApiModelProperty(value = "任务按周期生成计划时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date disposeTime;
@ApiModelProperty(value = "执行时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private LocalDateTime executeTime;
/**
* 标准工时

1
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java

@ -50,6 +50,7 @@ public class MessageConstants {
OPERATIONAL("dailyRemind","运维管理"),
EQUIPMENT("equipment","设备管理"),
SAFE_PRODUCT("safeProduct","安全管理"),
SAFEPRODUCT_HIDDENDANGER("safeProduct-hiddenDanger","隐患处理消息"),
ASSETS("assets","资产管理"),
WARNING("warning","告警消息"),
DUTY("duty","值班消息"),

12
hzims-service-api/safeproduct-api/pom.xml

@ -20,6 +20,18 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-dict-api</artifactId>
</dependency>
</dependencies>
<packaging>jar</packaging>

5
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java

@ -55,4 +55,9 @@ public class Constants {
this.describe = describe;
}
}
/**
* 隐患流程标识
*/
public static final String HIDDEN_DANGER_CHECK = "hiddenDangerCheck";
}

9
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/AccidentDTO.java

@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author hx
@ -15,5 +16,13 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode
public class AccidentDTO extends AccidentEntity implements Serializable {
private String yearMonth;
private String stationCode;
private LocalDateTime startTime;
private LocalDateTime endTime;
private Long deptId;
}

26
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/InnerDangerDTO.java

@ -0,0 +1,26 @@
package com.hnac.hzims.safeproduct.dto;
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;
/**
* @ClassName InnerDangerDTO
* @description:
* @author: hx
* @create: 2023-09-20 14:50
* @Version 4.0
**/
@Data
@ApiModel("隐患信息DTO")
@EqualsAndHashCode
public class InnerDangerDTO extends InnerDangerEntity implements Serializable {
@ApiModelProperty("隐患发起日期")
private String date;
}

15
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java

@ -22,6 +22,15 @@ public class DangerSourceEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("所属机构")
private Long refDept;
@ApiModelProperty("所属机构名称")
private String refDeptName;
@ApiModelProperty(value = "危险源库ID")
private Long libraryId;
/**
* 危险源类型 1=作业活动 2=设备
*/
@ -34,6 +43,12 @@ public class DangerSourceEntity extends TenantEntity {
@ApiModelProperty(value = "设备ID")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long eqId;
@ApiModelProperty("设备编号")
private String emCode;
@ApiModelProperty("设备名称")
private String emName;
/**
* 危险源名称
*/

299
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/InnerDangerEntity.java

@ -0,0 +1,299 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
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
@TableName("hzims_inner_danger_info")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "隐患信息", description = "隐患信息")
public class InnerDangerEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 隐患编码
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "隐患编码")
private String code;
/**
* 流程实例
*/
@ApiModelProperty(value = "流程实例")
private String processInstanceId;
/**
* 平台taskId
*/
@ApiModelProperty(value = "平台任务Id")
private String taskId;
//===================风险点基础信息========================
/**
* 站点编码
*/
@ApiModelProperty(value = "站点编码")
private String stationCode;
/**
* 风险点Id
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "风险点Id")
private String riskPointId;
/**
* 风险点名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "风险点名称")
private String riskPointName;
/**
* 排查项目
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "排查项目")
private String investigation;
/**
* 风险点类型
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "风险点类型")
private String riskPointType;
/**
* 隐患责任部门
*/
@ApiModelProperty(value = "隐患责任部门")
private Long hiddenDangerDept;
/**
* 隐患责任部门
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "隐患责任部门")
private String hiddenDangerDeptName;
/**
* 隐患地点
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "隐患地点")
private String hiddenDangerAddr;
//===================隐患基础信息========================
/**
* 隐患名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "隐患名称")
private String hiddenDangerName;
/**
* 隐患类别
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "隐患类别")
private String hiddenDangerType;
/**
* 隐患照片地址
*/
@ApiModelProperty(value = "隐患照片地址")
private String hiddenDangerPic;
/**
* 登记人
*/
@ApiModelProperty(value = "登记人")
private Long registrant;
/**
* 登记人姓名
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "登记人姓名")
private String registrantName;
/**
* 登记时间
*/
@ApiModelProperty(value = "登记时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date registrantTime;
/**
* 当前处理环节
*/
@QueryField(condition = SqlCondition.LIKE)
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前处理环节")
private String currentOperator;
/**
* 当前环节处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "当前环节处理人")
private String currentLinkHandler;
//===================判定信息========================
/**
* 判定人
*/
@ApiModelProperty(value = "判定人")
private Long judge;
/**
* 判定人姓名
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "判定人姓名")
private String judgeName;
/**
* 是否是隐患
*/
@ApiModelProperty(value = "是否是隐患")
@QueryField(condition = SqlCondition.EQUAL)
private Integer judgeRes;
/**
* 判定内容
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "判定内容")
private String judgeContext;
//===================核查信息========================
/**
* 隐患等级核查结果
*/
@ApiModelProperty(value = "隐患等级(核查结果)")
private Integer hiddenDangerLevel;
/**
* 核查意见
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "核查意见")
private String checkView;
/**
* 核查治理措施
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "核查治理措施")
private String measures;
/**
* 核查人
*/
@ApiModelProperty(value = "核查人")
private Long checkPeople;
/**
* 核查人姓名
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "核查人姓名")
private String checkPeopleName;
/**
* 核查时间
*/
@ApiModelProperty(value = "核查时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date checkTime;
//===================整改信息========================
/**
* 整改责任人
*/
@ApiModelProperty(value = "整改责任人")
private Long rectifier;
/**
* 整改责任人姓名
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "整改责任人姓名")
private String rectifierName;
/**
* 整改责任部门ID
*/
@ApiModelProperty(value = "整改责任部门ID")
private Long rectifierDept;
/**
* 整改责任部门名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "整改责任部门名称")
private String rectifierDeptName;
/**
* 整改类型立即整改)
*/
@ApiModelProperty(value = "整改类型(立即整改)")
private Integer rectifierType;
/**
* 完成期限
*/
@ApiModelProperty(value = "完成期限")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date deadLine;
/**
* 整改通知单号
*/
@ApiModelProperty(value = "整改通知单号")
private Long rectifierId;
//===================隐患整改反馈表========================
/**
* 隐患存在原因
*/
@QueryField(condition = SqlCondition.LIKE)
@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;
//===================验收信息========================
/**
* 验收结果1完成0未完成
*/
@ApiModelProperty(value = "验收结果(完成,未完成)")
private Integer conclusionRes;
/**
* 验收人
*/
@ApiModelProperty(value = "验收人")
private Long conclusionPeople;
/**
* 验收验收人姓名
*/
@ApiModelProperty(value = "验收验收人姓名")
private String conclusionPeopleName;
/**
* 验收意见
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "验收意见")
private String conclusionView;
/**
* 验收时间
*/
@ApiModelProperty(value = "验收时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date conclusionTime;
}

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/dto/DangerSourceDTO.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/DangerSourceDTO.java

@ -1,4 +1,4 @@
package com.hnac.hzims.safeproduct.dto;
package com.hnac.hzims.safeproduct.hazard.dto;
import com.hnac.hzims.safeproduct.entity.DangerSourceEntity;
import lombok.Data;

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/dto/DangerSourcePositionDTO.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/DangerSourcePositionDTO.java

@ -1,4 +1,4 @@
package com.hnac.hzims.safeproduct.dto;
package com.hnac.hzims.safeproduct.hazard.dto;
import com.hnac.hzims.safeproduct.entity.DangerSourcePositionEntity;
import lombok.Data;

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/dto/HazardInstanceDTO.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.hazard.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel("危险源库实例化")
@EqualsAndHashCode
public class HazardInstanceDTO implements Serializable {
@ApiModelProperty("所属站点")
private Long deptId;
@ApiModelProperty("所属站点名称")
private String deptName;
@ApiModelProperty("设备编号")
private String emCode;
@ApiModelProperty("设备名称")
private String emName;
@ApiModelProperty("危险源列表")
private List<HazardLibraryDTO> hazardList;
}

15
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 {
}

59
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/entity/HazardLibraryEntity.java

@ -0,0 +1,59 @@
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
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)
private Integer level;
}

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/DangerSourceLevelEnum.java → 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;

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourcePositionVO.java → 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;

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/DangerSourceVO.java → 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;

15
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 {
}

53
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;
/**
* <p>
* 文档管理
* 电站安全标准化文档管理
* </p>
*
* @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;
}

14
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")

33
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;
/**
* <p>
* 安全标准必要条件
* </p>
*
* @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;
}

44
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;
/**
* <p>
* 安全标准必要条件结果
* </p>
*
* @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;
}

18
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<TargetManagement> children;
@TableField(exist = false)
private List<IndicatorManagement> childrens;
}

57
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> targetManagement;
}

6
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;
}

5
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;
}

19
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;
}

58
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<Long> 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";
}

25
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<HazardSource> sources;
}

22
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<HazardEstimate> estimates;
}

22
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 {
}

24
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 {
}

26
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;
}

26
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;
}

71
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;
}

41
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;
}

56
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;
}

55
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;
}

48
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;
}

46
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;
}

29
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;
}

89
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;
}

19
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<Boolean> listener(ProcessWorkFlowResponse processWorkFlowResponse) {
return R.fail("执行失败!");
}
}

25
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<Boolean> listener(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse);
}

29
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;
}

22
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<HazardSource> sources;
}

78
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;
}

20
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<HazardSource> sources;
}

32
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;
}

27
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<HazardEstimate> estimates;
}

48
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;
}

42
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<Long> 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;
}

29
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<ExportEstimateVo> exportEstimates;
}

25
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;
}

26
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<HazardSource, SourceVo> {
public static HazardSourceWrapper build() {
return new HazardSourceWrapper();
}
@Override
public SourceVo entityVO(HazardSource entity) {
SourceVo sourceVo = BeanUtil.copy(entity, SourceVo.class);
return sourceVo;
}
}

33
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<RiskCheckEntity, RiskCheckVO> {
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;
}
}

44
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;
/**
* <p>
* 管控级别定义表
* </p>
*
* @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;
}

52
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;
/**
* <p>
* 危险源信息
* </p>
*
* @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;
}

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/entity/HiddenDanger.java → 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;

59
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;
}

69
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;
/**
* <p>
* 风险信息表
* </p>
*
* @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;
}

55
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;
/**
* <p>
* 风险矩阵X表
* </p>
*
* @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;
}

51
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;
/**
* <p>
* 风险矩阵Y表
* </p>
*
* @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;
}

54
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;
/**
* <p>
* 风险点信息表
* </p>
*
* @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;
}

7
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/entity/WorkArea.java → 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;
}

8
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 {
}

8
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 {
}

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddendanger/vo/HiddenDangerQueryVo.java → 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;

10
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;//类型名
}

7
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 {
}

8
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 {
}

7
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 {
}

8
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 {
}

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/workarea/vo/WorkAreaQueryVo.java → 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;

4
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 {
}

31
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;
}

34
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;
}

38
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<StationRiskStatisticVO> stationRiskStatistics;
@ApiModelProperty("本月风险辨识评价数")
private Integer riskCheckMonthCount;
@ApiModelProperty("本月隐患排查数")
private Integer dangerCheckMonthCount;
@ApiModelProperty("今日新增隐患数")
private Integer dangerAddDailyCount;
@ApiModelProperty("本月各级隐患分布统计")
private List<DangerRiskScatterVO> riskScatterCurrentMonth;
}

26
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;
}

29
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<String> stations;
}

170
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;
}

69
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;
}

62
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;
}

104
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;
}

38
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;
}

29
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;
}

22
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<Long> ids = records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList());
// 更新消息推送状态
LambdaUpdateWrapper<MessagePushRecordEntity> lwq = Wrappers.<MessagePushRecordEntity>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<Long> ids = records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList());
// 更新消息推送状态
LambdaUpdateWrapper<MessagePushRecordEntity> lwq = Wrappers.<MessagePushRecordEntity>lambdaUpdate()
.set(MessagePushRecordEntity::getStatus, flag ? MessageConstants.PUSH_SUCCESS : MessageConstants.PUSH_FAILED)
.set(MessagePushRecordEntity::getPushTime,LocalDateTime.now())
.in(MessagePushRecordEntity::getId, ids);
recordService.update(lwq);
});
});
}

8
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";
}

3
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;

103
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<OperMaintenanceTaskEntity> 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<Boolean> sendFlag = messageClient.sendAppAndWsMsgByUsers(request);
if(!(sendFlag.isSuccess() && sendFlag.getData())) {
XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
}
// 任务执行人发送短信
R<List<User>> 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<Boolean> result = messageClient.sendAppAndWsMsgByUsers(request);
if(!(result.isSuccess() && result.getData())) {
XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
}
}
}
}

18
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<String> 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<OperMaintenancePlanEntity> planQW = Wrappers.<OperMaintenancePlanEntity>lambdaQuery().isNull(OperMaintenancePlanEntity::getCreateTaskTime)
.gt(OperMaintenancePlanEntity::getDisposeTime, startDate).le(OperMaintenancePlanEntity::getDisposeTime, endDate);
.ge(OperMaintenancePlanEntity::getDisposeTime, startDate).lt(OperMaintenancePlanEntity::getDisposeTime, endDate);
List<OperMaintenancePlanEntity> 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.<OperMaintenancePlanEntity>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<BladeFlow> flowResult = flowClient.startProcessInstanceContainNameByKey("", String.valueOf(task.getId()), task.getTitle(), params);
R<BladeFlow> 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);
}

66
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<String> execute(String param) throws Exception {
// //获取当前时间段 redis内缓存的任务列表
// Set<OperMaintenanceTaskEntity> 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<OperMaintenanceTaskEntity> 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<Boolean> 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<String> execute(String param) throws Exception {
//获取当前时间段 redis内缓存的任务列表
Set<OperMaintenanceTaskEntity> taskEntitySet = redisTemplate.opsForZSet().rangeByScore(REMIND_TASK_END_LIST,0, LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
Set<OperMaintenanceTaskEntity> 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<OperMaintenanceTaskEntity> 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);
}
});
}

2
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;

6
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;

2
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;

126
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<IPage<InnerDangerEntity>> list(InnerDangerEntity innerDangerEntity, Query query) {
IPage<InnerDangerEntity> 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<InnerDangerEntity> 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<IPage<HiddenDangerBaseVo>> getHiddenDangerBase(HiddenDangerBaseVo hiddenDangerEntity, Query query) {
IPage<HiddenDangerBaseVo> 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<IPage<HiddenDangerCheckVo>> getHiddenDangerCheck(HiddenDangerCheckVo hiddenDangerEntity, Query query) {
IPage<HiddenDangerCheckVo> 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<IPage<HiddenDangerRectifierVo>> getHiddenDangerRectifier(HiddenDangerRectifierVo hiddenDangerEntity, Query query) {
IPage<HiddenDangerRectifierVo> 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<IPage<HiddenDangerConclusionVo>> getHiddenDangerConclusion(HiddenDangerConclusionVo hiddenDangerEntity, Query query) {
IPage<HiddenDangerConclusionVo> pages = hiddenDangerFlowService.getHiddenDangerConclusion(hiddenDangerEntity, query);
return R.data(pages);
}
}

12
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<InnerDangerEntity> {
}

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/mapper/InnerDangerMapper.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.flow.mapper.InnerDangerMapper">
<!-- 通用查询映射结果 -->
<resultMap id="emergencyPlanTypeResultMap" type="com.hnac.hzims.safeproduct.entity.InnerDangerEntity">
<result column="ID" property="id"/>
<result column="TENANT_ID" property="tenantId"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="IS_DELETED" property="isDeleted"/>
<result column="STATUS" property="status"/>
<result column="CREATE_DEPT" property="createDept"/>
</resultMap>
<select id="pageCondition" resultMap="emergencyPlanTypeResultMap">
SELECT
t1.*
FROM
HZIMS_SAFE_emergency_plan_type t1
WHERE
t1.IS_DELETED = 0
AND t1.TENANT_ID = #{page.tenantId}
<if test="page.idOrParentId!=null">
AND ( t1.ID = #{page.idOrParentId} OR t1.PARENT_ID = #{page.idOrParentId} )
</if>
<if test="page.name!=null and page.name!=''">
AND t1.`NAME` LIKE CONCAT( '%', #{page.name}, '%' )
</if>
</select>
</mapper>

42
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<InnerDangerEntity> {
IPage<InnerDangerEntity> selectPage(InnerDangerEntity innerDangerEntity, Query query);
R startHiddenDanger(InnerDangerVo hiddenDangerVo);
/**
* 监听回调消息
* @param processWorkFlowResponse
* @return
*/
R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse);
IPage<HiddenDangerBaseVo> getHiddenDangerBase(HiddenDangerBaseVo hiddenDangerEntity, Query query);
IPage<HiddenDangerCheckVo> getHiddenDangerCheck(HiddenDangerCheckVo hiddenDangerEntity, Query query);
IPage<HiddenDangerRectifierVo> getHiddenDangerRectifier(HiddenDangerRectifierVo hiddenDangerEntity, Query query);
IPage<HiddenDangerConclusionVo> getHiddenDangerConclusion(HiddenDangerConclusionVo hiddenDangerEntity, Query query);
List<InnerDangerEntity> getListByDate(String mon);
List<InnerDangerVo> getList(InnerDangerDTO req);
List<InnerDangerEntity> getListByDeptAndDate(String startTime,String endTime,String stationCode);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save