Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 11 months ago
parent
commit
3ad46ae280
  1. 13
      hzims-service-api/basic-api/pom.xml
  2. 11
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/constants/BasicConstants.java
  3. 65
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetEntity.java
  4. 44
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetNoticeEntity.java
  5. 68
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java
  6. 82
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/vo/PersonManagemetVo.java
  7. 3
      hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java
  8. 1
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  9. 1
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  10. 5
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
  11. 1
      hzims-service-api/pom.xml
  12. 18
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java
  13. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/AnalysisYearDTO.java
  14. 59
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java
  15. 21
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneExportDTO.java
  16. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java
  17. 20
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TestDTO.java
  18. 23
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TestScoreDTO.java
  19. 20
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TrainRecordDTO.java
  20. 60
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java
  21. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java
  22. 59
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  23. 51
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  24. 47
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java
  25. 54
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java
  26. 77
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java
  27. 37
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestScoreEntity.java
  28. 80
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java
  29. 69
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java
  30. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java
  31. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java
  32. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java
  33. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java
  34. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java
  35. 46
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java
  36. 23
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TestScoreVO.java
  37. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainMonthVO.java
  38. 53
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java
  39. 24
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/IOfflineTicketProcessClient.java
  40. 15
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OfflineTicketProcessClientFallback.java
  41. 173
      hzims-service/hzims-basic/pom.xml
  42. 32
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/BasicApplication.java
  43. 63
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/CertificatetNoticeController.java
  44. 87
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
  45. 15
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.java
  46. 6
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.xml
  47. 15
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetNoticeMapper.java
  48. 6
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetNoticeMapper.xml
  49. 30
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  50. 99
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
  51. 13
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetNoticeService.java
  52. 13
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetService.java
  53. 21
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
  54. 20
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetNoticeServiceImpl.java
  55. 21
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetServiceImpl.java
  56. 124
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
  57. 41
      hzims-service/hzims-basic/src/main/resources/application.yml
  58. 7
      hzims-service/hzims-basic/src/main/resources/bootstrap.yml
  59. 15
      hzims-service/hzims-basic/src/test/java/com/hnac/hzims/basic/BasicApplicationTests.java
  60. 41
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineTicketProcessImpl.java
  61. 1
      hzims-service/hzims-middle/src/main/resources/db/1.0.2.sql
  62. 4
      hzims-service/hzims-scheduled/pom.xml
  63. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.java
  64. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.xml
  65. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.java
  66. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.xml
  67. 29
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.java
  68. 97
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.xml
  69. 141
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/basicScheduledTask.java
  70. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsCertificatetNoticeService.java
  71. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsCertificatetService.java
  72. 21
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java
  73. 21
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java
  74. 5
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java
  75. 9
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
  76. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java
  77. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java
  78. 56
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml
  79. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java
  80. 172
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  81. 1
      hzims-service/pom.xml
  82. 56
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/BaseController.java
  83. 133
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java
  84. 142
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  85. 81
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalRecordController.java
  86. 243
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  87. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java
  88. 43
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java
  89. 27
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java
  90. 23
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml
  91. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java
  92. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml
  93. 45
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java
  94. 52
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml
  95. 23
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java
  96. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml
  97. 64
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java
  98. 84
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml
  99. 38
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  100. 60
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  101. Some files were not shown because too many files have changed in this diff Show More

13
hzims-service-api/basic-api/pom.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hzims-service-api</artifactId>
<groupId>com.hnac.hzims</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>basic-api</artifactId>
<packaging>jar</packaging>
</project>

11
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/constants/BasicConstants.java

@ -0,0 +1,11 @@
package com.hnac.hzims.basic.constants;
/**
* @author ysj
*/
public interface BasicConstants {
String APP_NAME = "hzims-basic";
}

65
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetEntity.java

@ -0,0 +1,65 @@
package com.hnac.hzims.basic.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
* @author Chill
*/
@Data
@TableName("hzims_certificatet")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "证书管理表", description = "证书管理表")
public class CertificatetEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String personId;
/**
* 档案类型
*/
@ApiModelProperty(value = "证书类型")
@QueryField(condition = SqlCondition.LIKE)
private String type;
/**
* 到期时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期时间")
private Date deadTime;
/**
* 图片地址
*/
@ApiModelProperty(value = "图片地址")
private String pic;
/**
* 是否过期
*/
@TableField(exist = false)
@ApiModelProperty(value = "是否过期")
private String isDead;
}

44
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetNoticeEntity.java

@ -0,0 +1,44 @@
package com.hnac.hzims.basic.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
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.tenant.mp.TenantEntity;
/**
* 实体类
* @author Chill
*/
@Data
@TableName("hzims_certificatet_notice")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "证书通知配置表", description = "证书通知配置表")
public class CertificatetNoticeEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 通知类型
*/
@ApiModelProperty(value = "通知类型")
@QueryField(condition = SqlCondition.EQUAL)
private String sendType;
/**
* 距离过期前几天通知
*/
@ApiModelProperty(value = "距离过期前几天通知")
@QueryField(condition = SqlCondition.EQUAL)
private Integer safeTime;
/**
* 通知用户
*/
@ApiModelProperty(value = "通知用户")
@QueryField(condition = SqlCondition.LIKE)
private String noticeUsers;
}

68
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java

@ -0,0 +1,68 @@
package com.hnac.hzims.basic.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
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.tenant.mp.TenantEntity;
/**
* 实体类
* @author Chill
*/
@Data
@TableName("hzims_person_managemet")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "人员管理表", description = "人员管理表")
public class PersonManagemetEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String userId;
/**
* 用户名称
*/
@ApiModelProperty(value = "用户名称")
@QueryField(condition = SqlCondition.LIKE)
private String name;
/**
* 单位名称
*/
@ApiModelProperty(value = "单位名称")
@QueryField(condition = SqlCondition.LIKE)
private String unitName;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
@QueryField(condition = SqlCondition.EQUAL)
private String sex;
/**
* 性别
*/
@ApiModelProperty(value = "职位")
@QueryField(condition = SqlCondition.EQUAL)
private String job;
/**
* 职称
*/
@ApiModelProperty(value = "职称")
@QueryField(condition = SqlCondition.EQUAL)
private String academicTitle;
/**
* 电话号码
*/
@ApiModelProperty(value = "电话号码")
@QueryField(condition = SqlCondition.EQUAL)
private String phone;
}

82
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/vo/PersonManagemetVo.java

@ -0,0 +1,82 @@
package com.hnac.hzims.basic.vo;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
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.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* 实体类
* @author Chill
*/
@Data
@ApiModel(value = "档案管理实体类",description = "档案管理实体类")
public class PersonManagemetVo extends PersonManagemetEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String personId;
/**
* 档案类型
*/
@ApiModelProperty(value = "档案类型")
@QueryField(condition = SqlCondition.LIKE)
private String type;
/**
* 到期开始时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期开始时间")
private Date deadStartTime;
/**
* 到期时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期时间")
private Date deadTime;
/**
* 档案编号
*/
@ApiModelProperty(value = "档案编号")
private List<String> certificatetIds;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户IDs")
private List<String> personIds;
/**
* 档案
*/
@ApiModelProperty(value = "档案")
private List<CertificatetEntity> certificatetEntityList;
}

3
hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java

@ -36,4 +36,7 @@ public class VoteChartVo {
@ApiModelProperty(value = "完成id")
@ExcelIgnore
private List<Long> finishIds;
@ApiModelProperty(value = "完成率")
@ExcelProperty(value = "完成率", index = 3)
private Double finishRate;
}

1
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -87,6 +87,7 @@ public interface MainConstants {
String LOAD_PHOTOVOLTAIC_REAL = "loadPhotovoltaicReal";
String DUTY_NOTICE = "dutyNotice";
String CERTIFICATET_DEAD_LINE_NOTICE = "certificatetDeadLineNotice";
String PROJECT_MANAGER = "projectManager";

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

@ -60,6 +60,7 @@ public class MessageConstants {
OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"),
ROUTINEMAINTENANCE("operation-maintenance-message","日常维护消息"),
OPERATIONDEFECTMESSAGE("operation-defect-message","消缺消息"),
CERTIFICATETNOTICE("certificatet-notice-message","证书消息"),
OVERHAUL_PLAN("overhaul-plan","检修计划"),

5
hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java

@ -52,4 +52,9 @@ public class TicketProcessConstant {
* 值班计划
*/
public static final String DUTY_REC = "duty_rec";
/**
* 线下工作票
*/
public static final String OFFLINE_WORK_TICKET = "offlineWorkTicket";
}

1
hzims-service-api/pom.xml

@ -19,6 +19,7 @@
<!-- <module>spare-api</module>-->
<module>topvision-api</module>
<module>equipment-api</module>
<module>basic-api</module>
<module>safeproduct-api</module>
<module>hzims-operational-api</module>
<module>inspect-api</module>

18
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java

@ -0,0 +1,18 @@
package com.hnac.hzims.safeproduct.constants;
/**
* safeproduct 常量类
*
* @author liwen
* @date 2023-12-25
*/
public interface SafeProductConstant {
String TENANT_ID = "200000";
int SUCCESS = 1;
int FAILURE = 0;
int TRAIN_PLAN_HAS_TEST = 1;
int TRAIN_PLAN_HAS_NO_TEST = 0;
}

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalYearDTO.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/AnalysisYearDTO.java

@ -9,8 +9,8 @@ import lombok.Data;
* @date 2023-12-14
*/
@Data
@ApiModel(value = "演练年度统计DTO类")
public class RehearsalYearDTO {
@ApiModel(value = "年度数据统计DTO类")
public class AnalysisYearDTO {
@ApiModelProperty("单位")
private String unit;

59
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java

@ -0,0 +1,59 @@
package com.hnac.hzims.safeproduct.dto;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@ExcelIgnoreUnannotated
@ApiModel(value = "会议数据导出DTO类")
public class ConferenceExportDTO {
@ApiModelProperty("单位")
@ExcelProperty(value = "单位", index = 0)
private String unit;
@ApiModelProperty("会议计划开始时间")
@ExcelProperty(value = "会议计划开始时间", index = 1)
private Date scheduledStartTime;
@ApiModelProperty("会议计划结束时间")
@ExcelProperty(value = "会议计划结束时间", index = 2)
private Date scheduledEndTime;
@ApiModelProperty("会议主题")
@ExcelProperty(value = "会议主题", index = 3)
private String theme;
@ApiModelProperty("会议地点")
@ExcelProperty(value = "会议地点", index = 4)
private String location;
@ApiModelProperty("会议方式")
@ExcelProperty(value = "会议方式", index = 5)
private String conferenceMethod;
@ApiModelProperty("主持人")
@ExcelProperty(value = "主持人", index = 6)
private String host;
@ApiModelProperty("会议实际开始时间")
@ExcelProperty(value = "会议实际开始时间", index = 7)
private Date actualStartTime;
@ApiModelProperty("会议实际结束时间")
@ExcelProperty(value = "会议实际结束时间", index = 8)
private Date actualEndTime;
@ApiModelProperty("会议状态")
@ExcelProperty(value = "会议状态", index = 9)
private String conferenceStatus;
}

21
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneExportDTO.java

@ -0,0 +1,21 @@
package com.hnac.hzims.safeproduct.dto;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@ExcelIgnoreUnannotated
@ApiModel(value = "卫生自查数据导出DTO类")
public class HygieneExportDTO {
@ApiModelProperty("卫生自查状态")
@ExcelProperty(value = "卫生自查状态", index = 8)
private String hygieneStatus;
}

55
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java

@ -0,0 +1,55 @@
package com.hnac.hzims.safeproduct.dto;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@ExcelIgnoreUnannotated
@ApiModel(value = "演练数据导出DTO类")
public class RehearsalExportDTO {
@ApiModelProperty("单位")
@ExcelProperty(value = "单位", index = 0)
private String unit;
@ApiModelProperty("演练科目")
@ExcelProperty(value = "演练科目", index = 1)
private String subject;
@ApiModelProperty("演练计划开始时间")
@ExcelProperty(value = "演练计划开始时间", index = 2)
private Date scheduledStartTime;
@ApiModelProperty("演练计划结束时间")
@ExcelProperty(value = "演练计划结束时间", index = 3)
private Date scheduledEndTime;
@ApiModelProperty("演练地点")
@ExcelProperty(value = "演练地点", index = 4)
private String location;
@ApiModelProperty("参演人数")
@ExcelProperty(value = "参演人数", index = 5)
private Integer peopleNum;
@ApiModelProperty("演练实际开始时间")
@ExcelProperty(value = "演练实际开始时间", index = 6)
private Date actualStartTime;
@ApiModelProperty("演练实际结束时间")
@ExcelProperty(value = "演练实际结束时间", index = 7)
private Date actualEndTime;
@ApiModelProperty("演练状态")
@ExcelProperty(value = "演练状态", index = 8)
private String rehearsalStatus;
}

20
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TestDTO.java

@ -0,0 +1,20 @@
package com.hnac.hzims.safeproduct.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "考试记录DTO类")
public class TestDTO {
@ApiModelProperty("考试记录id")
private Long id;
@ApiModelProperty("考试记录名称")
private String testName;
}

23
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TestScoreDTO.java

@ -0,0 +1,23 @@
package com.hnac.hzims.safeproduct.dto;
import com.hnac.hzims.safeproduct.vo.TestScoreVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "考试成绩DTO类")
public class TestScoreDTO {
@ApiModelProperty("考试记录id")
private Long testId;
@ApiModelProperty("考试成绩列表")
private List<TestScoreVO> scoreList;
}

20
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/TrainRecordDTO.java

@ -0,0 +1,20 @@
package com.hnac.hzims.safeproduct.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "培训记录DTO类")
public class TrainRecordDTO {
@ApiModelProperty("培训记录id")
private Long id;
@ApiModelProperty("培训记录名称")
private String trainRecordName;
}

60
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java

@ -0,0 +1,60 @@
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_conference_plan")
@ApiModel(value = "会议计划实体类")
public class ConferencePlanEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
private String unit;
@NotNull
@Size(max = 50, message = "会议主题字段长度不能超过50")
@ApiModelProperty("会议主题")
private String theme;
@NotNull
@ApiModelProperty("会议计划开始时间")
private Date scheduledStartTime;
@NotNull
@ApiModelProperty("会议计划结束时间")
private Date scheduledEndTime;
@NotNull
@Size(max = 255, message = "演练地点字段长度不能超过255")
@ApiModelProperty("会议地点")
private String location;
@NotNull
@Size(max = 10, message = "总指挥字段长度不能超过10")
@ApiModelProperty("主持人")
private String host;
@Size(max = 20, message = "会议方式字段长度不能超过20")
@ApiModelProperty("会议方式")
private String conferenceMethod;
@NotNull
@Size(max = 20, message = "会议状态字段长度不能超过20")
@ApiModelProperty("会议状态")
private String conferenceStatus;
}

55
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java

@ -0,0 +1,55 @@
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_conference_record")
@ApiModel(value = "会议记录实体类")
public class ConferenceRecordEntity extends BaseEntity {
@ApiModelProperty("会议计划id")
private Long conferencePlanId;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
private String code;
@Size(max = 5000, message = "参会人员字段长度超出限制范围")
@ApiModelProperty("参会人员")
private String peopleName;
@ApiModelProperty("会议实际开始时间")
private Date actualStartTime;
@ApiModelProperty("会议实际结束时间")
private Date actualEndTime;
@Size(max = 20, message = "记录人字段长度不能超过20")
@ApiModelProperty("记录人")
private String recorder;
@Size(max = 250, message = "会议内容字段长度不能超过250")
@ApiModelProperty("会议内容")
private String content;
@Size(max = 1000, message = "会议图片字段长度不能超过1000")
@ApiModelProperty("会议图片")
private String imgPath;
@Size(max = 1000, message = "会议附件字段长度不能超过1000")
@ApiModelProperty("会议附件")
private String filePath;
}

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

@ -0,0 +1,59 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_hygiene_plan")
@ApiModel(value = "卫生自查计划实体类")
public class HygienePlanEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("责任区")
private String zone;
@ApiModelProperty("责任人")
private String principal;
@ApiModelProperty("检查项")
private String checkItem;
@ApiModelProperty("检查项分值")
private String checkItemScore;
@ApiModelProperty("标准总分值")
private Integer standardScore;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("计划开始时间")
private Date scheduledStartTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("计划结束时间")
private Date scheduledEndTime;
@NotNull
@Size(max = 20, message = "卫生自查状态字段长度不能超过20")
@ApiModelProperty("卫生自查状态")
private String hygieneStatus;
}

51
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java

@ -0,0 +1,51 @@
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_hygiene_record")
@ApiModel(value = "卫生自查记录实体类")
public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("卫生自查计划id")
private Long hygienePlanId;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("实际开始时间")
private Date actualStartTime;
@ApiModelProperty("实际结束时间")
private Date actualEndTime;
@ApiModelProperty("检查人")
private String checkUser;
@ApiModelProperty("检查结果")
private String checkResult;
@ApiModelProperty("综合评分")
private Integer comprehensiveScore;
@ApiModelProperty("周数")
private Integer weekNum;
@Size(max = 1000, message = "检查图片字段长度不能超过1000")
@ApiModelProperty("检查图片")
private String imgPath;
}

47
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalRecordDTO.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java

@ -1,29 +1,25 @@
package com.hnac.hzims.safeproduct.dto;
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-15
* @date 2023-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "演练记录DTO类")
public class RehearsalRecordDTO extends BaseEntity {
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
private String code;
@TableName("hzims_rehearsal_plan")
@ApiModel(value = "演练计划实体类")
public class RehearsalPlanEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ -48,34 +44,11 @@ public class RehearsalRecordDTO extends BaseEntity {
@ApiModelProperty("演练地点")
private String location;
@Min(value = 0, message = "参演人数不能小于0")
@Max(value = 1000, message = "参演人数字段长度超出限制范围")
@ApiModelProperty("参演人数")
private Integer peopleNum;
@Size(max = 5000, message = "参演人员字段长度超出限制范围")
@ApiModelProperty("参演人员")
private String[] people;
@NotNull
@Size(max = 10, message = "总指挥字段长度不能超过10")
@ApiModelProperty("总指挥")
private String commander;
@ApiModelProperty("演练实际开始时间")
private Date actualStartTime;
@ApiModelProperty("演练实际结束时间")
private Date actualEndTime;
@Size(max = 250, message = "演练记录字段长度不能超过250")
@ApiModelProperty("演练记录")
private String record;
@Size(max = 250, message = "演练评价字段长度不能超过250")
@ApiModelProperty("演练评价")
private String comment;
@Size(max = 20, message = "演练方式字段长度不能超过20")
@ApiModelProperty("演练方式")
private String rehearsalMethod;
@ -84,12 +57,4 @@ public class RehearsalRecordDTO extends BaseEntity {
@Size(max = 20, message = "演练状态字段长度不能超过20")
@ApiModelProperty("演练状态")
private String rehearsalStatus;
@Size(max = 1000, message = "演练图片字段长度不能超过1000")
@ApiModelProperty("演练图片")
private String[] images;
@Size(max = 1000, message = "演练附件字段长度不能超过1000")
@ApiModelProperty("演练附件")
private String[] files;
}

54
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java

@ -1,7 +1,5 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,7 +9,6 @@ import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@ -21,65 +18,30 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ExcelIgnoreUnannotated
@TableName("hzims_rehearsal_record")
@ApiModel(value = "演练记录实体类")
public class RehearsalRecordEntity extends BaseEntity {
@ApiModelProperty("演练计划id")
private Long rehearsalPlanId;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
@ExcelProperty(value = "编码", index = 0)
private String code;
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
@ExcelProperty(value = "单位", index = 1)
private String unit;
@NotNull
@Size(max = 50, message = "演练科目字段长度不能超过50")
@ApiModelProperty("演练科目")
@ExcelProperty(value = "演练科目", index = 2)
private String subject;
@NotNull
@ApiModelProperty("演练计划开始时间")
@ExcelProperty(value = "演练计划开始时间", index = 3)
private Date scheduledStartTime;
@NotNull
@ApiModelProperty("演练计划结束时间")
@ExcelProperty(value = "演练计划结束时间", index = 4)
private Date scheduledEndTime;
@NotNull
@Size(max = 255, message = "演练地点字段长度不能超过255")
@ApiModelProperty("演练地点")
@ExcelProperty(value = "演练地点", index = 5)
private String location;
@Min(value = 0, message = "参演人数不能小于0")
@Max(value = 1000, message = "参演人数字段长度超出限制范围")
@ApiModelProperty("参演人数")
@ExcelProperty(value = "参演人数", index = 6)
private Integer peopleNum;
@Size(max = 5000, message = "参演人员字段长度超出限制范围")
@ApiModelProperty("参演人员")
private String peopleName;
@NotNull
@Size(max = 10, message = "总指挥字段长度不能超过10")
@ApiModelProperty("总指挥")
private String commander;
@ApiModelProperty("演练实际开始时间")
@ExcelProperty(value = "演练实际开始时间", index = 7)
private Date actualStartTime;
@ApiModelProperty("演练实际结束时间")
@ExcelProperty(value = "演练实际结束时间", index = 8)
private Date actualEndTime;
@Size(max = 250, message = "演练记录字段长度不能超过250")
@ -90,16 +52,6 @@ public class RehearsalRecordEntity extends BaseEntity {
@ApiModelProperty("演练评价")
private String comment;
@Size(max = 20, message = "演练方式字段长度不能超过20")
@ApiModelProperty("演练方式")
private String rehearsalMethod;
@NotNull
@Size(max = 20, message = "演练状态字段长度不能超过20")
@ApiModelProperty("演练状态")
@ExcelProperty(value = "演练状态", index = 9)
private String rehearsalStatus;
@Size(max = 1000, message = "演练图片字段长度不能超过1000")
@ApiModelProperty("演练图片")
private String imgPath;

77
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java

@ -0,0 +1,77 @@
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_test")
@ApiModel(value = "考试记录实体类")
public class TestEntity extends BaseEntity {
@ApiModelProperty("培训计划id")
private Long trainPlanId;
@ApiModelProperty("培训记录id")
private Long trainRecordId;
@Size(max = 50, message = "名称字段长度不能超过50")
@ApiModelProperty("考试记录名称")
private String testName;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
private String code;
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
private String unit;
@NotNull
@ApiModelProperty("考试开始时间")
private Date testStartTime;
@NotNull
@ApiModelProperty("考试结束时间")
private Date testEndTime;
@NotNull
@Size(max = 255, message = "考试地点字段长度不能超过255")
@ApiModelProperty("考试地点")
private String location;
@NotNull
@Size(max = 50, message = "考试科目字段长度不能超过50")
@ApiModelProperty("考试科目")
private String subject;
@NotNull
@Size(max = 20, message = "监考人字段长度不能超过20")
@ApiModelProperty("监考人")
private String proctor;
@Size(max = 1000, message = "参考人员字段长度超出限制范围")
@ApiModelProperty("参考人员")
private String peopleName;
@Size(max = 1000, message = "考试图片字段长度不能超过1000")
@ApiModelProperty("考试图片")
private String imgPath;
@Size(max = 1000, message = "考试附件字段长度不能超过1000")
@ApiModelProperty("考试附件")
private String filePath;
}

37
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestScoreEntity.java

@ -0,0 +1,37 @@
package com.hnac.hzims.safeproduct.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.base.BaseEntity;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_test_score")
@ApiModel(value = "考试记录实体类")
public class TestScoreEntity extends BaseEntity {
@ApiModelProperty("考试记录id")
private Long testId;
@Size(max = 50, message = "姓名字段长度不能超过50")
@ApiModelProperty("姓名")
private String name;
@NotNull
@Min(value = 0, message = "成绩必须大于等于0")
@Max(value = 100, message = "成绩必须小于等于100")
@ApiModelProperty("成绩")
private Integer score;
}

80
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java

@ -0,0 +1,80 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
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.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ExcelIgnoreUnannotated
@TableName("hzims_train_plan")
@ApiModel(value = "培训计划实体类")
public class TrainPlanEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
@ExcelProperty(value = "单位", index = 0)
private String unit;
@NotNull
@ApiModelProperty("计划培训开始时间")
@ExcelProperty(value = "计划开始时间", index = 6)
private Date scheduledStartTime;
@NotNull
@ApiModelProperty("计划培训结束时间")
@ExcelProperty(value = "计划结束时间", index = 7)
private Date scheduledEndTime;
@NotNull
@Size(max = 255, message = "单位字段长度不能超过255")
@ApiModelProperty("培训课程")
@ExcelProperty(value = "培训课程", index = 1)
private String lesson;
@NotNull
@Size(max = 255, message = "培训地点字段长度不能超过255")
@ApiModelProperty("培训地点")
@ExcelProperty(value = "培训地点", index = 2)
private String location;
@Size(max = 20, message = "培训方式字段长度不能超过20")
@ApiModelProperty("培训方式")
private String trainMethod;
@NotNull
@Size(max = 20, message = "培训讲师字段长度不能超过20")
@ApiModelProperty("培训讲师")
@ExcelProperty(value = "培训讲师", index = 4)
private String teacher;
@NotNull
@Size(max = 20, message = "培训状态字段长度不能超过20")
@ApiModelProperty("培训状态")
@ExcelProperty(value = "培训状态", index = 3)
private String trainStatus;
@NotNull
@ApiModelProperty("关联考试:0-否,1-是")
private Integer isTest;
@TableField(exist = false)
@ApiModelProperty("是否考试")
@ExcelProperty(value = "是否考试", index = 5)
private String hasTest;
}

69
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java

@ -0,0 +1,69 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
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.base.BaseEntity;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ExcelIgnoreUnannotated
@TableName("hzims_train_record")
@ApiModel(value = "培训记录实体类")
public class TrainRecordEntity extends BaseEntity {
@ApiModelProperty("培训计划id")
private Long trainPlanId;
@Size(max = 50, message = "名称字段长度不能超过50")
@ApiModelProperty("培训记录名称")
@ExcelProperty(value = "培训记录名称", index = 1)
private String trainRecordName;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
@ExcelProperty(value = "编码", index = 0)
private String code;
@Size(max = 5000, message = "培训学员字段长度超出限制范围")
@ApiModelProperty("培训学员")
@ExcelProperty(value = "培训学员", index = 3)
private String peopleName;
@Size(max = 5000, message = "培训内容字段长度超出限制范围")
@ApiModelProperty("培训内容")
@ExcelProperty(value = "培训内容", index = 2)
private String content;
@ApiModelProperty("实际培训开始时间")
@ExcelProperty(value = "实际开始时间", index = 5)
private Date actualStartTime;
@ApiModelProperty("实际培训结束时间")
@ExcelProperty(value = "实际结束时间", index = 6)
private Date actualEndTime;
@Size(max = 250, message = "培训评价字段长度不能超过250")
@ApiModelProperty("培训评价")
@ExcelProperty(value = "培训评价", index = 4)
private String command;
@Size(max = 1000, message = "培训图片字段长度不能超过1000")
@ApiModelProperty("培训图片")
private String imgPath;
@Size(max = 1000, message = "培训附件字段长度不能超过1000")
@ApiModelProperty("培训附件")
private String filePath;
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 会议方式枚举类
*
* @author liwen
* @date 2023-12-27
*/
public enum ConferenceMethodEnum {
ONLINE("ONLINE", "线上"),
OFFLINE("OFFLINE", "线下"),
MIXED("MIXED", "线上+线下");
private final String value;
private final String desc;
ConferenceMethodEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 会议状态枚举类
*
* @author liwen
* @date 2023-12-27
*/
public enum ConferenceStatusEnum {
WAITING("WAITING", "未开始"),
UNFINISHED("UNFINISHED", "未完成"),
FINISHED("FINISHED", "已完成");
private final String value;
private final String desc;
ConferenceStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 卫生自查状态枚举类
*
* @author liwen
* @date 2023-12-29
*/
public enum HygieneStatusEnum {
WAITING("WAITING", "未开始"),
UNFINISHED("UNFINISHED", "未完成"),
FINISHED("FINISHED", "已完成");
private final String value;
private final String desc;
HygieneStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 培训计划状态枚举类
*
* @author liwen
* @date 2023-12-27
*/
public enum TrainStatusEnum {
WAITING("WAITING", "未开始"),
UNFINISHED("UNFINISHED", "未完成"),
FINISHED("FINISHED", "已完成");
private final String value;
private final String desc;
TrainStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author liwen
* @date 2023-12-27
*/
@Data
@ApiModel(value = "卫生自查月度统计VO类")
public class HygieneMonthVO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("应检查次数")
private Long scheduledCheckNum;
@ApiModelProperty("已检查次数")
private Long finishedCheckNum;
@ApiModelProperty("未检查次数")
private Long unfinishedCheckNum;
@ApiModelProperty("完成率")
private BigDecimal completionRate;
}

46
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java

@ -0,0 +1,46 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2023-12-29
*/
@Data
@ApiModel(value = "卫生自查记录详情VO类")
public class HygieneRecordDetailVO {
@ApiModelProperty("责任区")
private String zone;
@ApiModelProperty("责任人")
private String principal;
@ApiModelProperty("检查项")
private String checkItem;
@ApiModelProperty("检查项分值")
private String checkItemScore;
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("检查人")
private String checkUser;
@ApiModelProperty("检查结果")
private String checkResult;
@ApiModelProperty("综合评分")
private Integer comprehensiveScore;
@ApiModelProperty("周数")
private Integer weekNum;
}

23
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TestScoreVO.java

@ -0,0 +1,23 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "考试成绩VO类")
public class TestScoreVO {
@ApiModelProperty("考试成绩id")
private Long id;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("成绩")
private Integer score;
}

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainMonthVO.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "培训月度统计VO类")
public class TrainMonthVO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("应完成次数")
private Long scheduledTrainNum;
@ApiModelProperty("已完成次数")
private Long finishedTrainNum;
@ApiModelProperty("未完成次数")
private Long unfinishedTrainNum;
@ApiModelProperty("完成率")
private BigDecimal completionRate;
}

53
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java

@ -0,0 +1,53 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2023-12-25
*/
@Data
@ApiModel(value = "培训年度统计VO类")
public class TrainYearVO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("1月完成数")
private Long januaryNum;
@ApiModelProperty("2月完成数")
private Long februaryNum;
@ApiModelProperty("3月完成数")
private Long marchNum;
@ApiModelProperty("4月完成数")
private Long aprilNum;
@ApiModelProperty("5月完成数")
private Long mayNum;
@ApiModelProperty("6月完成数")
private Long juneNum;
@ApiModelProperty("7月完成数")
private Long julyNum;
@ApiModelProperty("8月完成数")
private Long augustNum;
@ApiModelProperty("9月完成数")
private Long septemberNum;
@ApiModelProperty("10月完成数")
private Long octoberNum;
@ApiModelProperty("11月完成数")
private Long novemberNum;
@ApiModelProperty("12月完成数")
private Long decemberNum;
}

24
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/IOfflineTicketProcessClient.java

@ -0,0 +1,24 @@
package com.hnac.hzims.ticket.ticketprocess.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants;
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;
@FeignClient(value = TicketConstants.APP_NAME,fallback = OfflineTicketProcessClientFallback.class)
public interface IOfflineTicketProcessClient {
String API = "/offlineTicket";
String FIND_PENDING = API + "/findPending";
/**
* 线下工作票处理
* @param response 流程信息
* @return 处理结果
*/
@PostMapping(FIND_PENDING)
R findPending(@RequestBody ProcessWorkFlowResponse response);
}

15
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OfflineTicketProcessClientFallback.java

@ -0,0 +1,15 @@
package com.hnac.hzims.ticket.ticketprocess.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Component;
@Component
public class OfflineTicketProcessClientFallback implements IOfflineTicketProcessClient {
@Override
public R findPending(ProcessWorkFlowResponse response) {
return R.fail("工作票处理流程失败!");
}
}

173
hzims-service/hzims-basic/pom.xml

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-service</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hzims-basic</artifactId>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.6.13</spring-boot.version>
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>
<exclusions>
<exclusion>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-redis</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-auto</artifactId>
<scope>provided</scope>
</dependency>
<!-- spring-boot-websocket start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--WebSocket核心依赖包-->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
</dependency>
<!--生成代码-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</dependency>
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要-->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.2</version>
</dependency>
<!--swagger-bootstrap-ui-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>alarm-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>basic-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>equipment-api</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-operational-api</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>message-api</artifactId>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

32
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/BasicApplication.java

@ -0,0 +1,32 @@
package com.hnac.hzims.basic;
import com.hnac.hzims.basic.constants.BasicConstants;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.cloud.feign.EnableBladeFeign;
import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.ComponentScan;
import javax.annotation.Resource;
/**
* @author ty
*/
@EnableBladeFeign
@SpringCloudApplication
@MapperScan("com.hnac.hzims.**.mapper.**")
@ComponentScan(basePackages = {"com.hnac.hzims.basic.*"})
@Resource
public class BasicApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
BladeApplication.run(BasicConstants.APP_NAME, BasicApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return BladeApplication.createSpringApplicationBuilder(builder, BasicConstants.APP_NAME, BasicApplication.class);
}
}

63
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/CertificatetNoticeController.java

@ -0,0 +1,63 @@
package com.hnac.hzims.basic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import com.hnac.hzims.basic.service.IImsCertificatetNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.web.bind.annotation.*;
/**
* 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@RequestMapping("/certificatetNotice")
@Api(value = "档案通知配置页面", tags = "档案通知配置页面")
public class CertificatetNoticeController extends BladeController {
private final IImsCertificatetNoticeService iImsCertificatetNoticeService;
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加", notes = "传入imsDutyClass")
public R submit(@RequestBody CertificatetNoticeEntity certificatetNoticeEntity) {
Boolean submit = iImsCertificatetNoticeService.saveOrUpdate(certificatetNoticeEntity);
if (submit) {
return R.success("保存成功");
}
return R.fail("保存失败");
}
/**
* 新增或修改
*/
@PostMapping("/getCertificatetNotice")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加", notes = "传入imsDutyClass")
public R getCertificatetNotice() {
CertificatetNoticeEntity res = iImsCertificatetNoticeService.getOne(Wrappers.<CertificatetNoticeEntity>lambdaQuery()
.eq(CertificatetNoticeEntity::getIsDeleted, 0)
.last("limit 1;"));
if (ObjectUtil.isNotEmpty(res)) {
return R.data(res);
}
return R.data("");
}
}

87
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java

@ -0,0 +1,87 @@
package com.hnac.hzims.basic.controller;
import com.alibaba.spring.util.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.service.IImsPresonManagementService;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
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.operational.duty.entity.ImsDutyClassEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@RequestMapping("/presonManagement")
@Api(value = "人员档案", tags = "人员档案页面")
public class PresonManagementController extends BladeController {
private final IImsPresonManagementService iImsPresonManagementService;
/**
* 分页 代码自定义代号
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入imsDutyClass")
@OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "档案管理")
public R<IPage<PersonManagemetVo>> list(PersonManagemetVo personManagemetVo, Query query) {
IPage<PersonManagemetVo> page=iImsPresonManagementService.getPersonManagemetEntity(personManagemetVo,query);
return R.data(page);
}
/**
* 新增或修改
*/
@PostMapping ("/submit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加", notes = "传入imsDutyClass")
public R submit(@RequestBody PersonManagemetVo personManagemetVo) {
Boolean submit = iImsPresonManagementService.submit(personManagemetVo);
if (submit){
return R.success("保存成功");
}
return R.fail("保存失败");
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "删除", notes = "传入imsDutyClass")
public R remove(@RequestBody PersonManagemetVo personManagemetVo) {
Boolean flag = iImsPresonManagementService.removeByPersonManagemetVo(personManagemetVo);
if (flag){
return R.success("删除成功");
}
return R.fail("删除失败");
}
}

15
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.basic.mapper;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface CertificatetMapper extends UserDataScopeBaseMapper<CertificatetEntity> {
}

6
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.xml

@ -0,0 +1,6 @@
<?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.basic.mapper.CertificatetMapper">
</mapper>

15
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetNoticeMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.basic.mapper;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface CertificatetNoticeMapper extends UserDataScopeBaseMapper<CertificatetNoticeEntity> {
}

6
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetNoticeMapper.xml

@ -0,0 +1,6 @@
<?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.basic.mapper.CertificatetNoticeMapper">
</mapper>

30
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -0,0 +1,30 @@
package com.hnac.hzims.basic.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Date;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonManagemetEntity> {
List<PersonManagemetVo> getPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
Integer getCountByPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
}

99
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml

@ -0,0 +1,99 @@
<?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.basic.mapper.PersonManagemetMapper">
<!--嵌套结果的 resultMap-->
<resultMap id="PersonManagemetMap" type="com.hnac.hzims.basic.vo.PersonManagemetVo">
<id property="id" column="id" jdbcType="VARCHAR" />
<result property="name" column="name" jdbcType="VARCHAR" />
<result property="unitName" column="unit_name" jdbcType="VARCHAR" />
<result property="sex" column="sex" jdbcType="VARCHAR" />
<result property="job" column="job" jdbcType="VARCHAR" />
<result property="academicTitle" column="academic_title" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<collection property="certificatetEntityList" ofType="com.hnac.hzims.basic.entity.CertificatetEntity">
<id property="id" column="certificatetId" />
<result property="personId" column="person_id" />
<result property="type" column="type" />
<result property="deadTime" column="dead_time" />
<result property="pic" column="pic" />
<result property="status" column="status" />
<result property="createTime" column="CREATE_TIME" />
<result property="isDead" column="isDead" />
</collection>
</resultMap>
<!--嵌套查询-->
<select id="getPersonManagemetEntity" resultMap="PersonManagemetMap">
select a.id ,a.name,a.unit_name ,a.sex,a.job ,a.academic_title,a.phone ,a.CREATE_TIME,
b.id as certificatetId,b.person_id,b.type,b.dead_time,b.pic,b.CREATE_TIME,b.status,b.create_dept,
case when b.dead_time is null then ""
when b.dead_time &lt; NOW() then "过期" else "未过期" end as isDead
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id and b.is_deleted = 0
where a.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
LIMIT #{current}, #{size}
</select>
<!--嵌套查询-->
<select id="getCountByPersonManagemetEntity" resultType="Integer">
select count(*)
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id and b.is_deleted = 0
where a.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
<if test="status != null and status != ''">
and b.status =#{status}
</if>
</select>
</mapper>

13
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetNoticeService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
/**
* 服务类
*
* @author Chill
*/
public interface IImsCertificatetNoticeService extends IService<CertificatetNoticeEntity> {
}

13
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.CertificatetEntity;
/**
* 服务类
*
* @author Chill
*/
public interface IImsCertificatetService extends IService<CertificatetEntity> {
}

21
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java

@ -0,0 +1,21 @@
package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.springblade.core.mp.support.Query;
/**
* 服务类
*
* @author Chill
*/
public interface IImsPresonManagementService extends IService<PersonManagemetEntity> {
IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query);
Boolean submit(PersonManagemetVo personManagemetVo);
Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo);
}

20
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetNoticeServiceImpl.java

@ -0,0 +1,20 @@
package com.hnac.hzims.basic.service.impl;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import com.hnac.hzims.basic.mapper.CertificatetNoticeMapper;
import com.hnac.hzims.basic.service.IImsCertificatetNoticeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 证书实现类
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class CertificatetNoticeServiceImpl extends BaseServiceImpl<CertificatetNoticeMapper, CertificatetNoticeEntity> implements IImsCertificatetNoticeService {
}

21
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetServiceImpl.java

@ -0,0 +1,21 @@
package com.hnac.hzims.basic.service.impl;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.mapper.CertificatetMapper;
import com.hnac.hzims.basic.service.IImsCertificatetService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 证书实现类
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class CertificatetServiceImpl extends BaseServiceImpl<CertificatetMapper, CertificatetEntity> implements IImsCertificatetService {
}

124
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java

@ -0,0 +1,124 @@
package com.hnac.hzims.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.mapper.PersonManagemetMapper;
import com.hnac.hzims.basic.service.IImsCertificatetService;
import com.hnac.hzims.basic.service.IImsPresonManagementService;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import com.hnac.hzims.common.logs.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* 人员信息实现类
*
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class PresonManagementServiceImpl extends BaseServiceImpl<PersonManagemetMapper, PersonManagemetEntity> implements IImsPresonManagementService {
private ISysClient sysClient;
private final IImsCertificatetService certificatetService;
@Override
public IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query) {
List<PersonManagemetVo> personManagemetEntity = baseMapper.getPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(),
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(),
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), (query.getCurrent()-1)*query.getSize(), query.getSize());
Integer count = baseMapper.getCountByPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(),
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(),
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), (query.getCurrent()-1)*query.getSize(), query.getSize());
IPage<PersonManagemetVo> res = new Page<>();
res.setCurrent(query.getCurrent());
res.setSize(query.getSize());
res.setTotal(Long.valueOf(count));
res.setRecords(personManagemetEntity);
return res;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean submit(PersonManagemetVo personManagemetVo) {
try {
if (ObjectUtil.isNotEmpty(personManagemetVo)) {
PersonManagemetEntity personManagemetEntity = new PersonManagemetEntity();
BeanUtil.copy(personManagemetVo, personManagemetEntity);
if (StringUtils.isBlank(personManagemetEntity.getUnitName())){
String deptId = AuthUtil.getDeptId();
R<String> deptName = sysClient.getDeptName(Long.valueOf(deptId));
if (deptName.isSuccess()&&StringUtils.isBlank(deptName.getData())){
personManagemetEntity.setUnitName(deptName.getData());
}
}
if (ObjectUtil.isNotEmpty(personManagemetEntity)) {
this.saveOrUpdate(personManagemetEntity);
}
if (CollectionUtil.isNotEmpty(personManagemetVo.getCertificatetEntityList())) {
List<CertificatetEntity> certificatetList = personManagemetVo.getCertificatetEntityList().stream().map(
s -> {
s.setPersonId(personManagemetEntity.getId().toString());
if (System.currentTimeMillis() > s.getDeadTime().getTime()){
s.setStatus(2);
}else {
s.setStatus(1);
}
return s;
}
).collect(Collectors.toList());
certificatetService.saveOrUpdateBatch(certificatetList);
}
return true;
}
return false;
} catch (Exception e) {
log.error("入参 personManagemetVo" + personManagemetVo + ":" + e);
return false;
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo) {
try {
if (ObjectUtil.isNotEmpty(personManagemetVo)) {
if (ObjectUtil.isNotEmpty(personManagemetVo.getPersonIds())) {
this.removeByIds(personManagemetVo.getPersonIds());
certificatetService.remove(new LambdaQueryWrapper<CertificatetEntity>() {{
in(CertificatetEntity::getPersonId, personManagemetVo.getPersonIds());
}});
}
if (CollectionUtil.isNotEmpty(personManagemetVo.getCertificatetIds())) {
certificatetService.removeByIds(personManagemetVo.getCertificatetIds());
}
return true;
}
return false;
} catch (Exception e) {
log.error("removeByPersonManagemetVo 入参 personManagemetVo" + personManagemetVo + ":" + e);
return false;
}
}
}

41
hzims-service/hzims-basic/src/main/resources/application.yml

@ -0,0 +1,41 @@
#服务器端口
server:
port: 8430
#数据源配置
spring:
main:
allow-bean-definition-overriding: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
url: jdbc:mysql://192.168.60.34:3576/hzims_basic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: hzinfo
password: 1qaz2WSX!
#mybatis-plus配置
mybatis-plus:
mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置
swagger:
base-packages:
- org.springbalde
- com.hnac
blade:
data-scope:
enabled: false
lock:
enabled: true
address: redis://192.168.1.20:3577
password: 1qaz2WSX@redis
database: 0
ssl: false

7
hzims-service/hzims-basic/src/main/resources/bootstrap.yml

@ -0,0 +1,7 @@
spring:
cloud:
nacos:
discovery:
server-addr: 175.6.40.67:10042

15
hzims-service/hzims-basic/src/test/java/com/hnac/hzims/basic/BasicApplicationTests.java

@ -0,0 +1,15 @@
package com.hnac.hzims.basic;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes = BasicApplication.class)
class BasicApplicationTests {
@Test
void contextLoads() {
System.out.println("1");
}
}

41
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineTicketProcessImpl.java

@ -0,0 +1,41 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.IOfflineTicketProcessClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_WORK_TICKET;
@Slf4j
@Service
@AllArgsConstructor
public class OfflineTicketProcessImpl extends ProcessAbstractService {
private final ProcessDictService processDictService;
private final IOfflineTicketProcessClient offlineTicketProcessClient;
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
String dictValue = processDictService.selectDictValueByKey(OFFLINE_WORK_TICKET);
return dictValue.equals(flowQueue.getProcessDefinitionKey());
}
@Override
public void calculate(ProcessWorkFlowResponse response) {
log.info("线下工作票调用fein接口消费开始---param",response);
R result = offlineTicketProcessClient.findPending(response);
Assert.isTrue(result.isSuccess(),() -> {
throw new ServiceException("线下工作票处理失败!");
});
log.info("线下工作票调用fein接口消费结束---");
}
}

1
hzims-service/hzims-middle/src/main/resources/db/1.0.2.sql

@ -0,0 +1 @@
INSERT INTO `process_dict` (`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (9, 9, 'offlineWorkTicket', 'offlineWorkTicket', '线下工作票', '线下工作票', 'Y', 0, NULL, '2023-12-28 16:35:10', '2023-12-28 16:35:14', '线下工作票流程');

4
hzims-service/hzims-scheduled/pom.xml

@ -167,6 +167,10 @@
<artifactId>weather-api</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>basic-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.mapper.basic;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface CertificatetMapper extends UserDataScopeBaseMapper<CertificatetEntity> {
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.xml

@ -0,0 +1,6 @@
<?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.scheduled.mapper.basic.CertificatetMapper">
</mapper>

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.mapper.basic;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface CertificatetNoticeMapper extends UserDataScopeBaseMapper<CertificatetNoticeEntity> {
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.xml

@ -0,0 +1,6 @@
<?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.scheduled.mapper.basic.CertificatetNoticeMapper">
</mapper>

29
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.java

@ -0,0 +1,29 @@
package com.hnac.hzims.scheduled.mapper.basic;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Date;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonManagemetEntity> {
List<PersonManagemetVo> getPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
Integer getCountByPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
}

97
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.xml

@ -0,0 +1,97 @@
<?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.scheduled.mapper.basic.PersonManagemetMapper">
<!--嵌套结果的 resultMap-->
<resultMap id="PersonManagemetMap" type="com.hnac.hzims.basic.vo.PersonManagemetVo">
<id property="id" column="id" jdbcType="VARCHAR" />
<result property="name" column="name" jdbcType="VARCHAR" />
<result property="unitName" column="unitName" jdbcType="VARCHAR" />
<result property="sex" column="sex" jdbcType="VARCHAR" />
<result property="job" column="job" jdbcType="VARCHAR" />
<result property="academicTitle" column="academic_title" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<collection property="certificatetEntityList" ofType="com.hnac.hzims.basic.entity.CertificatetEntity">
<id property="id" column="certificatetId" />
<result property="personId" column="person_id" />
<result property="type" column="type" />
<result property="deadTime" column="dead_time" />
<result property="pic" column="pic" />
<result property="status" column="status" />
<result property="isDead" column="isDead" />
</collection>
</resultMap>
<!--嵌套查询-->
<select id="getPersonManagemetEntity" resultMap="PersonManagemetMap">
select a.id ,a.name,a.unit_name ,a.sex,a.job ,a.academic_title,a.phone ,a.CREATE_TIME,
b.id as certificatetId,b.person_id,b.type,b.dead_time,b.pic,b.CREATE_TIME,b.status,b.create_dept,
case when b.dead_time &lt; NOW() then "过期" else "未过期" end as isDead
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id
where a.is_deleted = 0 and b.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
LIMIT #{current}, #{size}
</select>
<!--嵌套查询-->
<select id="getCountByPersonManagemetEntity" resultType="Integer">
select count(*)
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id
where a.is_deleted = 0 and b.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
<if test="status != null and status != ''">
and b.status =#{status}
</if>
</select>
</mapper>

141
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/basicScheduledTask.java

@ -0,0 +1,141 @@
package com.hnac.hzims.scheduled.scheduled;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.entity.config.SmsConfigEntity;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.message.fegin.IMessageConfigClient;
import com.hnac.hzims.scheduled.mapper.basic.PersonManagemetMapper;
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService;
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**
* 排班到期定时任务通知
*
* @author ty
*/
@Slf4j
@Component
public class basicScheduledTask {
@Autowired
private IImsCertificatetService iImsCertificatetService;
@Autowired
private IImsCertificatetNoticeService iImsCertificatetNoticeService;
@Autowired
private ISysClient sysClient;
@Autowired
private IUserClient userClient;
@Autowired
private IMessageClient messageClient;
@Autowired
private PersonManagemetMapper personManagemetMapper;
@Autowired
private IMessageConfigClient messageConfigClient;
/**
* realId刷新
*/
@XxlJob(CERTIFICATET_DEAD_LINE_NOTICE)
// @Scheduled(cron = "0 */1 * * * ? ")
public ReturnT<String> certificatetDeadLineNotice(String param) throws ParseException {
Date endTime = new Date();
if (Func.isBlank(param)) {
endTime = new SimpleDateFormat("yyyy-MM-dd").parse(param);
}
CertificatetNoticeEntity noticeEntity = iImsCertificatetNoticeService.getOne(Wrappers.<CertificatetNoticeEntity>lambdaQuery()
.eq(CertificatetNoticeEntity::getIsDeleted, 0)
.last("limit 1;"));
//用户档案过期截止时间
Date date = DateUtil.plusDays(endTime, noticeEntity.getSafeTime());
List<CertificatetEntity> list = iImsCertificatetService.list(Wrappers.<CertificatetEntity>lambdaQuery()
.le(CertificatetEntity::getDeadTime, date));
String noticeUsers = noticeEntity.getNoticeUsers();
List<String> userList = Arrays.asList(noticeUsers.split(","));
if (CollectionUtil.isNotEmpty(userList) && CollectionUtil.isNotEmpty(list)) {
List<String> personIds = list.stream().map(CertificatetEntity::getPersonId).collect(Collectors.toList());
List<PersonManagemetEntity> personManagemetEntities = personManagemetMapper.selectList(Wrappers.<PersonManagemetEntity>query().lambda().in(PersonManagemetEntity::getId, personIds));
String personNotice="";
if (CollectionUtil.isNotEmpty(personManagemetEntities)) {
personNotice = personManagemetEntities.stream().map(PersonManagemetEntity::getName).collect(Collectors.joining(","));
}
if ("1".equals(noticeEntity.getSendType())) {
sendSmsByUserList(userList, date,personNotice);
}
sendMessage(list.get(0), noticeEntity.getSafeTime(), noticeEntity.getNoticeUsers(),personNotice);
}
return new ReturnT<>("SUCCESS");
}
private void sendSmsByUserList(List<String> userList, Date date,String personNotice) {
//区分用户
for (String s : userList) {
User user = UserCache.getUser(Long.valueOf(s));
String phone = "";
if (ObjectUtil.isNotEmpty(user)) {
phone = user.getPhone();
}
//短信推送
String code = "certificatetNotice";
SmsConfigEntity smsConfigEntity = messageConfigClient.getSmsConfigByBusinessKey(code);
Map<String, String> contentParams = new HashMap<>(2);
contentParams.put("one", personNotice);
String deadLine = DateUtil.format(date, "yyyy-MM-dd");
contentParams.put("two", deadLine);
smsConfigEntity.setTemplateParam(JSONObject.toJSONString(contentParams));
smsConfigEntity.setPhones(phone);
messageConfigClient.pushSmsMessageByConfig(smsConfigEntity);
}
}
private void sendMessage(CertificatetEntity certificatetEntity, Integer date, String users,String personNotice) {
// //注意:通知人是创建人所在机构
BusinessMessageDTO message = new BusinessMessageDTO();
message.setBusinessClassify("system");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.CERTIFICATETNOTICE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.CERTIFICATETNOTICE.getDescription());
message.setTaskId(System.currentTimeMillis());
message.setTenantId("200000");
String countent =
personNotice + "的证书即将到期,请提交新的证书资料";
message.setContent(countent);
message.setDeptId(certificatetEntity.getCreateDept());
R<String> deptName = sysClient.getDeptName(certificatetEntity.getCreateDept());
if (deptName.isSuccess()) {
message.setDeptName(deptName.getData());
}
message.setUserIds(users);
User admin = userClient.userByAccount("200000", "admin").getData();
message.setCreateUser(admin.getId());
messageClient.sendAppAndWsMsgByUsers(message);
}
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsCertificatetNoticeService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
/**
* 服务类
*
* @author Chill
*/
public interface IImsCertificatetNoticeService extends IService<CertificatetNoticeEntity> {
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsCertificatetService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.CertificatetEntity;
/**
* 服务类
*
* @author Chill
*/
public interface IImsCertificatetService extends IService<CertificatetEntity> {
}

21
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java

@ -0,0 +1,21 @@
package com.hnac.hzims.scheduled.service.basic.impl;
import com.hnac.hzims.basic.entity.CertificatetNoticeEntity;
import com.hnac.hzims.scheduled.mapper.basic.CertificatetNoticeMapper;
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 证书实现类
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class CertificatetNoticeServiceImpl extends BaseServiceImpl<CertificatetNoticeMapper, CertificatetNoticeEntity> implements IImsCertificatetNoticeService {
}

21
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java

@ -0,0 +1,21 @@
package com.hnac.hzims.scheduled.service.basic.impl;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.scheduled.mapper.basic.CertificatetMapper;
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 证书实现类
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class CertificatetServiceImpl extends BaseServiceImpl<CertificatetMapper, CertificatetEntity> implements IImsCertificatetService {
}

5
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java

@ -1,5 +1,6 @@
package com.hnac.hzinfo.inspect.task.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
@ -15,6 +16,7 @@ import com.hnac.hzinfo.inspect.task.mapper.TaskEventMapper;
import com.hnac.hzinfo.inspect.task.service.*;
import com.hnac.hzinfo.inspect.task.vo.EventAddVO;
import com.hnac.hzinfo.inspect.task.vo.EventRecordAddVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -43,6 +45,7 @@ import java.util.List;
* @author Chill
*/
@Service
@Slf4j
public class EventServiceImpl extends BaseServiceImpl<TaskEventMapper, EventEntity> implements IEventService {
@Autowired
@ -187,7 +190,9 @@ public class EventServiceImpl extends BaseServiceImpl<TaskEventMapper, EventEnti
if(!AuthUtil.isAdministrator()){
ITaskService taskService = SpringUtil.getBean(ITaskService.class);
TaskEntity taskEntity = taskService.getById(eventVO.getTaskId());
log.info("userId:"+ (user == null ? eventVO.getUserId() : user.getUserId()) + ";taskId:" + eventVO.getTaskId() );
TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId,eventVO.getTaskId()).eq(TaskUserEntity::getUserId,user == null ? eventVO.getUserId() : user.getUserId()));
log.info("taskUserEntity:"+JSON.toJSONString(taskUserEntity));
if(taskUserEntity==null){
throw new ServiceException("该任务已被别人领取");
}

9
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -54,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@ -282,7 +283,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
taskUserService.update(Wrappers.<TaskUserEntity>lambdaUpdate().set(TaskUserEntity::getClaimStatus, ClaimStatusEnum.COLLECT.getStatus()).set(TaskUserEntity::getClaimTime, LocalDateTime.now()).eq(TaskUserEntity::getTaskId, task.getId()).eq(TaskUserEntity::getUserId, userId));
//如果是抢占任务,删除能够抢占此任务的其他人
if (PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(task.getMethod())) {
taskUserService.remove(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId, task.getId()).ne(TaskUserEntity::getId, userId));
taskUserService.remove(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId, task.getId()).ne(TaskUserEntity::getUserId, userId));
}
task.setStatus(Integer.valueOf(TaskStatusEnum.UNDERWAY_STATUS.getStatus()));
task.setStartTime(LocalDateTime.now());
@ -1162,6 +1163,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
voteChartVo.setFinishIds(finishIds);
voteChartVo.setUndoneNum(undoneIds.size());
voteChartVo.setUndoneIds(undoneIds);
if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){
voteChartVo.setFinishRate(0.00d);
}else {
BigDecimal divide = new BigDecimal(list.size()).divide(new BigDecimal(list.size()),2,BigDecimal.ROUND_UP);
voteChartVo.setFinishRate( divide.doubleValue());
}
return voteChartVo;
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java

@ -143,17 +143,17 @@ public class OperDefectController extends BladeController {
@OperationAnnotation(moduleName = "生产月报", title = "缺陷月报表", operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE,
action = "获取缺陷的统计月报")
public R<Map<String, Object>> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month) {
Map<String, Object> defectStatistics = defectService.getDefectStatistics(month);
public R<Map<String, Object>> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month, @RequestParam String deptId) {
Map<String, Object> defectStatistics = defectService.getDefectStatistics(month,deptId);
return R.data(defectStatistics);
}
@ApiOperation(value = "缺陷月报表导出-Excel")
@RequestMapping(value = "/exportFualtMonthExcel", method = {RequestMethod.GET, RequestMethod.POST})
public void exportFualtMonthExcel(HttpServletResponse response, @ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month) {
public void exportFualtMonthExcel(HttpServletResponse response, @ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month,@ApiParam String deptId) {
Map<String, Object> result = new HashMap<>();
try {
defectService.exportFualtMonthExcel(response, month);
defectService.exportFualtMonthExcel(response, month, deptId);
result.put("success", "true");
} catch (IOException e) {
result.put("success", "false");

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java

@ -27,7 +27,7 @@ public interface OperDefectMapper extends UserDataScopeBaseMapper<OperDefectEnti
* @return
*/
List<OperDefectStatisticsStatusDTO> getStatisticByMonth(@Param("month") String month,
@Param("createDept") String createDept);
@Param("createDept") List<String> createDept);
/**
* 当年1月 - 当前月获取缺陷等级统计数据
@ -37,13 +37,13 @@ public interface OperDefectMapper extends UserDataScopeBaseMapper<OperDefectEnti
*/
List<OperDefectStatisticsStatusDTO> getStatisticBySeveralMonth(@Param("firstMonth") String firstMonth,
@Param("endMonth") String endMonth,
@Param("createDept") String createDept);
@Param("createDept") List<String> createDept);
/**
* 获取重复缺陷等级统计数据
* @return
*/
List<OperDefectStatisticsCodeDTO> getRepetStatistics(@Param("createDept") String createDept);
List<OperDefectStatisticsCodeDTO> getRepetStatistics(@Param("createDept") List<String> createDept);
/**
* 获取按月管理指标统计数据
@ -52,7 +52,7 @@ public interface OperDefectMapper extends UserDataScopeBaseMapper<OperDefectEnti
* @return
*/
List<Integer> getManageIndex(@Param("month") String month,
@Param("createDept") String createDept);
@Param("createDept") List<String> createDept);
List<OperDefectEntity> selectDefectList(String emCode,List<String> list);

56
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml

@ -8,8 +8,11 @@
hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY P.DEFECT_LEVEL,D.HANDLE_STATUS
ORDER BY P.DEFECT_LEVEL
@ -22,8 +25,11 @@
LEFT JOIN hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE D.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth}
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY P.DEFECT_LEVEL,D.HANDLE_STATUS
ORDER BY P.DEFECT_LEVEL
@ -34,8 +40,11 @@
hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE 1=1
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY P.DEFECT_LEVEL,P.FAULT_CODE
</select>
@ -47,8 +56,11 @@
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.HANDLE_STATUS = 1
AND D.ACT_END_TIME &lt;= P.PLAN_END_TIME
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
UNION ALL
@ -57,8 +69,11 @@
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.HANDLE_STATUS = 1
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
UNION ALL
@ -67,8 +82,11 @@
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.HANDLE_STATUS = 0
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
UNION ALL
@ -77,8 +95,11 @@
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') &lt; CONCAT(#{month}, '-01')
AND D.HANDLE_STATUS = 0
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
UNION ALL
@ -86,8 +107,11 @@
(
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
<if test="createDept != null and createDept != ''">
AND D.CREATE_DEPT = #{createDept}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
</select>

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java

@ -43,7 +43,7 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
* 获取缺陷的统计月报
* @param month 格式"2021-01"
*/
Map<String, Object> getDefectStatistics(String month);
Map<String, Object> getDefectStatistics(String month,String deptId);
/**
* 导出缺陷统计月报报表
@ -51,7 +51,7 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
* @param month 格式 "2021-01"
* @throws IOException
*/
void exportFualtMonthExcel(HttpServletResponse response, String month) throws IOException;
void exportFualtMonthExcel(HttpServletResponse response, String month,String deptId) throws IOException;
List<OperDefectEntity> getDefectList(String emCode,List<String> list);

172
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -50,6 +50,8 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
@ -57,6 +59,7 @@ import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.WebServiceException;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
@ -85,6 +88,8 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
private final IUserClient userClient;
private final ISysClient sysClient;
private final OperPhenomenonMapper operPhenomenonMapper;
/**
@ -118,6 +123,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
}
}
@Override
public LambdaQueryWrapper<OperDefectEntity> getQueryWrapper(OperDefectVO defectVO) {
LambdaQueryWrapper<OperDefectEntity> queryWrapper = Condition.getQueryWrapper(new OperDefectEntity(), defectVO);
@ -180,6 +186,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
queryWrapper.orderByDesc(OperDefectEntity::getCreateTime);
return queryWrapper;
}
/**
* 处理问题
*
@ -238,19 +245,19 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
* @param month 格式"2021-01"
*/
@Override
public Map<String, Object> getDefectStatistics(String month) {
public Map<String, Object> getDefectStatistics(String month, String deptId) {
Map<String, Object> re = new HashMap<>();
re.put("currentMonth", getCurrentMonthStatic(month));
re.put("severalMonths", getStatisticBySeveralMonth(month));
re.put("manageIndex", getManageIndexStatistic(month));
re.put("repeat", getRepeatStatistic(month));
re.put("currentMonth", getCurrentMonthStatic(month, deptId));
re.put("severalMonths", getStatisticBySeveralMonth(month, deptId));
re.put("manageIndex", getManageIndexStatistic(month, deptId));
re.put("repeat", getRepeatStatistic(deptId));
return re;
}
@Override
public void exportFualtMonthExcel(HttpServletResponse response, String month) throws IOException {
public void exportFualtMonthExcel(HttpServletResponse response, String month, String deptId) throws IOException {
Map<String, Object> re = new HashMap<>();
re = this.getDefectStatistics(month);
re = this.getDefectStatistics(month, deptId);
//获取数据
List<OperDefectRatioDTO> currentMonth = (List<OperDefectRatioDTO>) re.get("currentMonth");
List<OperDefectRatioDTO> severalMonths = (List<OperDefectRatioDTO>) re.get("severalMonths");
@ -785,8 +792,25 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
* @param month
* @return
*/
private List<OperDefectRatioDTO> getCurrentMonthStatic(String month) {
List<OperDefectStatisticsStatusDTO> statisticByMonth = this.baseMapper.getStatisticByMonth(month, AuthUtil.getDeptId());
private List<OperDefectRatioDTO> getCurrentMonthStatic(String month, String deptId) {
List<String> createDeptList = new ArrayList<>();
List<String> deptList = new ArrayList<>();
R<List<Dept>> res = sysClient.getDeptByCurrentUser();
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
} else {
log.error("getCurrentMonthStatic"+"用户权限问题");
throw new WebServiceException("该用户没有此权限");
}
if (StringUtil.isNotBlank(deptId)) {
if (deptList.contains(deptId)) {
createDeptList.add(deptId);
}
} else {
//拿到用户当前及其以下的机构
createDeptList.addAll(deptList);
}
List<OperDefectStatisticsStatusDTO> statisticByMonth = this.baseMapper.getStatisticByMonth(month, createDeptList);
return getRatioStatic(statisticByMonth);
}
@ -796,7 +820,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
* @param month "2021-01"
* @return
*/
private List<OperDefectRatioDTO> getStatisticBySeveralMonth(String month) {
private List<OperDefectRatioDTO> getStatisticBySeveralMonth(String month, String deptId) {
Integer intervalMonth = Integer.valueOf(month.split("-")[1]);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date;
@ -811,8 +835,23 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
throw new ServiceException("日期转换失败");
}
log.error("firstMonth:" + firstMonth + "; end=" + dateFormat.format(date));
List<OperDefectStatisticsStatusDTO> statisticBySeveralMonth = this.baseMapper.getStatisticBySeveralMonth(firstMonth, dateFormat.format(date), AuthUtil.getDeptId());
List<String> createDeptList = new ArrayList<>();
List<String> deptList = new ArrayList<>();
R<List<Dept>> res = sysClient.getDeptByCurrentUser();
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
} else {
throw new WebServiceException("该用户没有此权限");
}
if (StringUtil.isNotBlank(deptId)) {
if (deptList.contains(deptId)) {
createDeptList.add(deptId);
}
} else {
//拿到用户当前及其以下的机构
createDeptList.addAll(deptList);
}
List<OperDefectStatisticsStatusDTO> statisticBySeveralMonth = this.baseMapper.getStatisticBySeveralMonth(firstMonth, dateFormat.format(date), createDeptList);
return getRatioStatic(statisticBySeveralMonth);
}
@ -822,9 +861,25 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
* @param month
* @return
*/
private OperDefectManageIndexDTO getManageIndexStatistic(String month) {
private OperDefectManageIndexDTO getManageIndexStatistic(String month, String deptId) {
OperDefectManageIndexDTO manageIndex = new OperDefectManageIndexDTO();
List<Integer> list = this.baseMapper.getManageIndex(month, AuthUtil.getDeptId());
List<String> createDeptList = new ArrayList<>();
List<String> deptList = new ArrayList<>();
R<List<Dept>> res = sysClient.getDeptByCurrentUser();
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
} else {
throw new WebServiceException("该用户没有此权限");
}
if (StringUtil.isNotBlank(deptId)) {
if (deptList.contains(deptId)) {
createDeptList.add(deptId);
}
} else {
//拿到用户当前及其以下的机构
createDeptList.addAll(deptList);
}
List<Integer> list = this.baseMapper.getManageIndex(month, createDeptList);
manageIndex.setInTimeNum(list.get(0));
if (!list.get(1).equals(0)) {
manageIndex.setInTimeRatio(list.get(0).equals(0) ? 0.0 : Double.valueOf(list.get(0)) / list.get(1));
@ -840,50 +895,67 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取重复缺陷等级统计数据
*
* @param month
* @param deptId
* @return
*/
private List<OperDefectRepeatRatioDTO> getRepeatStatistic(String month) {
private List<OperDefectRepeatRatioDTO> getRepeatStatistic(String deptId) {
List<OperDefectRepeatRatioDTO> re = new ArrayList<>();
List<OperDefectStatisticsCodeDTO> repetStatistics = this.baseMapper.getRepetStatistics(AuthUtil.getDeptId());
//总缺陷数
int total = repetStatistics.stream().mapToInt(OperDefectStatisticsCodeDTO::getDefectNum).sum();
//总重复缺陷数
int totalRepeat = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.summingInt(OperDefectStatisticsCodeDTO::getDefectNum));
//等级重复统计
Map<String, IntSummaryStatistics> repeatList = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
OperDefectRepeatRatioDTO one = new OperDefectRepeatRatioDTO();
one.setDefectLevel(DefectConstant.DefectLevelEnum.ONE.getStatus());
if (repeatList.get(one.getDefectLevel()) != null) {
one.setHappenNum(repeatList.get(one.getDefectLevel()).getSum());
one.setHappenRatio(one.getHappenNum() / Double.valueOf(total));
one.setRepeatRatio(one.getHappenNum() / Double.valueOf(totalRepeat));
List<String> createDeptList = new ArrayList<>();
List<String> deptList ;
R<List<Dept>> res = sysClient.getDeptByCurrentUser();
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
} else {
throw new WebServiceException("该用户没有此权限");
}
OperDefectRepeatRatioDTO two = new OperDefectRepeatRatioDTO();
two.setDefectLevel(DefectConstant.DefectLevelEnum.TWO.getStatus());
if (repeatList.get(two.getDefectLevel()) != null) {
two.setHappenNum(repeatList.get(two.getDefectLevel()).getSum());
two.setHappenRatio(two.getHappenNum() / Double.valueOf(total));
two.setRepeatRatio(two.getHappenNum() / Double.valueOf(totalRepeat));
if (StringUtil.isNotBlank(deptId)) {
if (deptList.contains(deptId)) {
createDeptList.add(deptId);
}
} else {
//拿到用户当前及其以下的机构
createDeptList.addAll(deptList);
}
if (CollectionUtil.isNotEmpty(createDeptList)) {
List<OperDefectStatisticsCodeDTO> repetStatistics = this.baseMapper.getRepetStatistics(createDeptList);
//总缺陷数
int total = repetStatistics.stream().mapToInt(OperDefectStatisticsCodeDTO::getDefectNum).sum();
//总重复缺陷数
int totalRepeat = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.summingInt(OperDefectStatisticsCodeDTO::getDefectNum));
//等级重复统计
Map<String, IntSummaryStatistics> repeatList = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
OperDefectRepeatRatioDTO one = new OperDefectRepeatRatioDTO();
one.setDefectLevel(DefectConstant.DefectLevelEnum.ONE.getStatus());
if (repeatList.get(one.getDefectLevel()) != null) {
one.setHappenNum(repeatList.get(one.getDefectLevel()).getSum());
one.setHappenRatio(one.getHappenNum() / Double.valueOf(total));
one.setRepeatRatio(one.getHappenNum() / Double.valueOf(totalRepeat));
}
OperDefectRepeatRatioDTO three = new OperDefectRepeatRatioDTO();
three.setDefectLevel(DefectConstant.DefectLevelEnum.THREE.getStatus());
if (repeatList.get(three.getDefectLevel()) != null) {
three.setHappenNum(repeatList.get(three.getDefectLevel()).getSum());
three.setHappenRatio(three.getHappenNum() / Double.valueOf(total));
three.setRepeatRatio(three.getHappenNum() / Double.valueOf(totalRepeat));
}
OperDefectRepeatRatioDTO two = new OperDefectRepeatRatioDTO();
two.setDefectLevel(DefectConstant.DefectLevelEnum.TWO.getStatus());
if (repeatList.get(two.getDefectLevel()) != null) {
two.setHappenNum(repeatList.get(two.getDefectLevel()).getSum());
two.setHappenRatio(two.getHappenNum() / Double.valueOf(total));
two.setRepeatRatio(two.getHappenNum() / Double.valueOf(totalRepeat));
}
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder().defectLevel("合计").happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum()).happenRatio(one.getHappenRatio() + two.getHappenRatio() + three.getHappenRatio()).repeatRatio(1.00).build();
if (addUp.getHappenNum().equals(0L)) {
addUp.setRepeatRatio(0.0);
}
OperDefectRepeatRatioDTO three = new OperDefectRepeatRatioDTO();
three.setDefectLevel(DefectConstant.DefectLevelEnum.THREE.getStatus());
if (repeatList.get(three.getDefectLevel()) != null) {
three.setHappenNum(repeatList.get(three.getDefectLevel()).getSum());
three.setHappenRatio(three.getHappenNum() / Double.valueOf(total));
three.setRepeatRatio(three.getHappenNum() / Double.valueOf(totalRepeat));
}
re.addAll(Arrays.asList(one, two, three, addUp));
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder().defectLevel("合计").happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum()).happenRatio(one.getHappenRatio() + two.getHappenRatio() + three.getHappenRatio()).repeatRatio(1.00).build();
if (addUp.getHappenNum().equals(0L)) {
addUp.setRepeatRatio(0.0);
}
re.addAll(Arrays.asList(one, two, three, addUp));
}
return re;
}

1
hzims-service/pom.xml

@ -27,6 +27,7 @@
<module>hzims-middle</module>
<module>hzims-scheduled</module>
<module>hzims-alarm</module>
<module>hzims-basic</module>
</modules>
<dependencies>

56
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/BaseController.java

@ -0,0 +1,56 @@
package com.hnac.hzims.safeproduct.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 公用业务接口类
*
* @author liwen
* @date 2023-12-28
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base")
@Api(value = "公用业务", tags = "公用业务接口")
public class BaseController extends BladeController {
private final ISysClient sysClient;
private final IUserClient userClient;
@GetMapping("/getDeptName")
@ApiOperation(value = "获取所属机构名")
@ApiOperationSupport(order = 1)
public R<String> getDeptName() {
BladeUser bladeUser = getUser();
String deptId = bladeUser.getDeptId();
if (StringUtils.isNotBlank(deptId)) {
return sysClient.getDeptName(Long.valueOf(deptId));
}
return R.data(null, "所属机构为空");
}
@GetMapping("/getUserList")
@ApiOperation(value = "获取用户列表")
@ApiOperationSupport(order = 2)
public R<List<User>> getUserList(@RequestParam String name) {
return userClient.userListByCodeAndNameAndAccount(SafeProductConstant.TENANT_ID, null, name, null);
}
}

133
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java

@ -0,0 +1,133 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.service.IConferencePlanService;
import com.hnac.hzims.safeproduct.service.IConferenceRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Map;
/**
* 会议管理接口类
*
* @author liwen
* @date 2023-12-27
*/
@RestController
@AllArgsConstructor
@RequestMapping("/conference")
@Api(value = "会议管理", tags = "会议管理接口")
public class ConferenceController extends BladeController {
private final IConferencePlanService conferencePlanService;
private final IConferenceRecordService conferenceRecordService;
@PostMapping("/savePlan")
@ApiOperation(value = "新增会议计划")
@ApiOperationSupport(order = 1)
public R savePlan(@Valid @RequestBody ConferencePlanEntity conferencePlan) {
return R.status(conferencePlanService.save(conferencePlan));
}
@PostMapping("/updatePlan")
@ApiOperation(value = "修改会议计划")
@ApiOperationSupport(order = 2)
public R updatePlan(@Valid @RequestBody ConferencePlanEntity conferencePlan) {
return R.status(conferencePlanService.updateById(conferencePlan));
}
@PostMapping("/removePlan")
@ApiOperation(value = "删除会议计划")
@ApiOperationSupport(order = 3)
public R removePlan(@RequestParam Long id) {
return R.status(conferencePlanService.removePlan(id));
}
@GetMapping("/planDetail")
@ApiOperation(value = "会议计划详情")
@ApiOperationSupport(order = 4)
public R<ConferencePlanEntity> planDetail(@RequestParam Long id) {
return R.data(conferencePlanService.getById(id));
}
@GetMapping("/planPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "会议计划分页")
@ApiOperationSupport(order = 5)
public R<IPage<ConferencePlanEntity>> planPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<ConferencePlanEntity> page = conferencePlanService.planPage(param, query);
return R.data(page);
}
@PostMapping("/saveRecord")
@ApiOperation(value = "新增会议记录")
@ApiOperationSupport(order = 6)
public R saveRecord(@Valid @RequestBody ConferenceRecordEntity conferenceRecord) {
return R.status(conferenceRecordService.saveRecord(conferenceRecord));
}
@PostMapping("/updateRecord")
@ApiOperation(value = "修改会议记录")
@ApiOperationSupport(order = 7)
public R updateRecord(@Valid @RequestBody ConferenceRecordEntity conferenceRecord) {
return R.status(conferenceRecordService.updateById(conferenceRecord));
}
@PostMapping("/removeRecord")
@ApiOperation(value = "删除会议记录")
@ApiOperationSupport(order = 8)
public R removeRecord(@RequestParam Long id) {
return R.status(conferenceRecordService.removeById(id));
}
@GetMapping("/recordDetail")
@ApiOperation(value = "会议记录详情")
@ApiOperationSupport(order = 9)
public R<ConferenceRecordEntity> recordDetail(@RequestParam Long id) {
return R.data(conferenceRecordService.getById(id));
}
@GetMapping("/recordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "会议记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<ConferenceRecordEntity>> recordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<ConferenceRecordEntity> page = conferenceRecordService.page(Condition.getPage(query),
Condition.getQueryWrapper(param, ConferenceRecordEntity.class));
return R.data(page);
}
@GetMapping("/exportConferenceData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "会议数据导出")
@ApiOperationSupport(order = 11)
public void exportConferenceData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
conferencePlanService.exportConferenceData(param, response);
}
}

142
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java

@ -0,0 +1,142 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.service.IHygienePlanService;
import com.hnac.hzims.safeproduct.service.IHygieneRecordService;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Map;
/**
* 卫生自查接口类
*
* @author liwen
* @date 2023-12-27
*/
@RestController
@AllArgsConstructor
@RequestMapping("/hygiene")
@Api(value = "卫生自查", tags = "卫生自查接口")
public class HygieneController extends BladeController {
private final IHygienePlanService hygienePlanService;
private final IHygieneRecordService hygieneRecordService;
@PostMapping("/savePlan")
@ApiOperation(value = "新增卫生自查计划")
@ApiOperationSupport(order = 1)
public R savePlan(@Valid @RequestBody HygienePlanEntity hygienePlanEntity) {
return hygienePlanService.savePlan(hygienePlanEntity);
}
@PostMapping("/updatePlan")
@ApiOperation(value = "修改卫生自查计划")
@ApiOperationSupport(order = 2)
public R updatePlan(@Valid @RequestBody HygienePlanEntity hygienePlanEntity) {
return hygienePlanService.updatePlan(hygienePlanEntity);
}
@PostMapping("/removePlan")
@ApiOperation(value = "删除卫生自查计划")
@ApiOperationSupport(order = 3)
public R removePlan(@RequestParam Long id) {
return R.status(hygienePlanService.removePlan(id));
}
@GetMapping("/planDetail")
@ApiOperation(value = "卫生自查计划详情")
@ApiOperationSupport(order = 4)
public R<HygienePlanEntity> planDetail(@RequestParam Long id) {
return R.data(hygienePlanService.getById(id));
}
@GetMapping("/planPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "zone", value = "责任区", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "principal", value = "责任人", dataType = "query", paramType = "string")
})
@ApiOperation(value = "卫生自查计划分页")
@ApiOperationSupport(order = 5)
public R<IPage<HygienePlanEntity>> planPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<HygienePlanEntity> page = hygienePlanService.planPage(param, query);
return R.data(page);
}
@PostMapping("/saveRecord")
@ApiOperation(value = "新增卫生自查记录")
@ApiOperationSupport(order = 6)
public R saveRecord(@Valid @RequestBody HygieneRecordEntity hygieneRecordEntity) {
return hygieneRecordService.saveRecord(hygieneRecordEntity);
}
@PostMapping("/updateRecord")
@ApiOperation(value = "修改卫生自查记录")
@ApiOperationSupport(order = 7)
public R updateRecord(@Valid @RequestBody HygieneRecordEntity hygieneRecordEntity) {
return hygieneRecordService.updateRecord(hygieneRecordEntity);
}
@PostMapping("/removeRecord")
@ApiOperation(value = "删除卫生自查记录")
@ApiOperationSupport(order = 8)
public R removeRecord(@RequestParam Long id) {
return R.status(hygieneRecordService.removeById(id));
}
@GetMapping("/recordDetail")
@ApiOperation(value = "卫生自查记录详情")
@ApiOperationSupport(order = 9)
public R<HygieneRecordDetailVO> recordDetail(@RequestParam Long id) {
return R.data(hygieneRecordService.getRecordDetail(id));
}
@GetMapping("/recordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "卫生自查记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<HygieneRecordEntity>> recordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<HygieneRecordEntity> page = hygieneRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(param,
HygieneRecordEntity.class));
return R.data(page);
}
@GetMapping("/dataByMonth")
@ApiOperation(value = "月度统计表")
@ApiOperationSupport(order = 11)
public R<IPage<HygieneMonthVO>> dataByMonth(@RequestParam String month, Query query) {
IPage<HygieneMonthVO> page = hygienePlanService.dataByMonth(month, query);
return R.data(page);
}
@GetMapping("/exportHygieneData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "卫生自查数据导出")
@ApiOperationSupport(order = 13)
public void exportHygieneData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
hygienePlanService.exportHygieneData(param, response);
}
}

81
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalRecordController.java

@ -3,7 +3,9 @@ package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.service.IRehearsalPlanService;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
@ -36,32 +38,34 @@ public class RehearsalRecordController extends BladeController {
private final IRehearsalRecordService rehearsalRecordService;
private final IRehearsalPlanService rehearsalPlanService;
@PostMapping("/save")
@ApiOperation(value = "新增")
@ApiOperation(value = "新增演练计划")
@ApiOperationSupport(order = 1)
public R save(@Valid @RequestBody RehearsalRecordEntity rehearsalRecord) {
return R.status(rehearsalRecordService.saveRehearsal(rehearsalRecord));
public R save(@Valid @RequestBody RehearsalPlanEntity rehearsalPlan) {
return R.status(rehearsalPlanService.save(rehearsalPlan));
}
@PostMapping("/update")
@ApiOperation(value = "修改")
@ApiOperation(value = "修改演练计划")
@ApiOperationSupport(order = 2)
public R update(@Valid @RequestBody RehearsalRecordEntity rehearsalRecord) {
return R.status(rehearsalRecordService.updateRehearsal(rehearsalRecord));
public R update(@Valid @RequestBody RehearsalPlanEntity rehearsalPlan) {
return R.status(rehearsalPlanService.updateById(rehearsalPlan));
}
@PostMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperation(value = "删除演练计划")
@ApiOperationSupport(order = 3)
public R remove(@RequestParam Long id) {
return R.status(rehearsalRecordService.removeById(id));
return R.status(rehearsalPlanService.removeRehearsalPlan(id));
}
@GetMapping("/detail")
@ApiOperation(value = "详情")
@ApiOperation(value = "演练计划详情")
@ApiOperationSupport(order = 4)
public R<RehearsalRecordEntity> detail(@RequestParam Long id) {
return R.data(rehearsalRecordService.getById(id));
public R<RehearsalPlanEntity> detail(@RequestParam Long id) {
return R.data(rehearsalPlanService.getById(id));
}
@GetMapping("/page")
@ -70,9 +74,48 @@ public class RehearsalRecordController extends BladeController {
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "分页")
@ApiOperation(value = "演练计划分页")
@ApiOperationSupport(order = 5)
public R<IPage<RehearsalRecordEntity>> page(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
public R<IPage<RehearsalPlanEntity>> page(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<RehearsalPlanEntity> page = rehearsalPlanService.rehearsalPlanPage(param, query);
return R.data(page);
}
@PostMapping("/saveRehearsalRecord")
@ApiOperation(value = "新增演练记录")
@ApiOperationSupport(order = 6)
public R saveRehearsalRecord(@Valid @RequestBody RehearsalRecordEntity rehearsalRecord) {
return R.status(rehearsalRecordService.saveRehearsalRecord(rehearsalRecord));
}
@PostMapping("/updateRehearsalRecord")
@ApiOperation(value = "修改演练记录")
@ApiOperationSupport(order = 7)
public R updateRehearsalRecord(@Valid @RequestBody RehearsalRecordEntity rehearsalRecord) {
return R.status(rehearsalRecordService.updateRehearsalRecord(rehearsalRecord));
}
@PostMapping("/removeRehearsalRecord")
@ApiOperation(value = "删除演练记录")
@ApiOperationSupport(order = 8)
public R removeRehearsalRecord(@RequestParam Long id) {
return R.status(rehearsalRecordService.removeById(id));
}
@GetMapping("/rehearsalRecordDetail")
@ApiOperation(value = "演练记录详情")
@ApiOperationSupport(order = 9)
public R<RehearsalRecordEntity> rehearsalRecordDetail(@RequestParam Long id) {
return R.data(rehearsalRecordService.getById(id));
}
@GetMapping("/rehearsalRecordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "演练记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<RehearsalRecordEntity>> rehearsalRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<RehearsalRecordEntity> page = rehearsalRecordService.page(Condition.getPage(query),
Condition.getQueryWrapper(param, RehearsalRecordEntity.class));
return R.data(page);
@ -80,17 +123,17 @@ public class RehearsalRecordController extends BladeController {
@GetMapping("/dataByMonth")
@ApiOperation(value = "月度统计表")
@ApiOperationSupport(order = 6)
@ApiOperationSupport(order = 11)
public R<IPage<RehearsalMonthVO>> dataByMonth(@RequestParam String month, Query query) {
IPage<RehearsalMonthVO> page = rehearsalRecordService.dataByMonth(month, query);
IPage<RehearsalMonthVO> page = rehearsalPlanService.dataByMonth(month, query);
return R.data(page);
}
@GetMapping("/dataByYear")
@ApiOperation(value = "年度统计表")
@ApiOperationSupport(order = 7)
@ApiOperationSupport(order = 12)
public R<IPage<RehearsalYearVO>> dataByYear(@RequestParam String year, Query query) {
IPage<RehearsalYearVO> page = rehearsalRecordService.dataByYear(year, query);
IPage<RehearsalYearVO> page = rehearsalPlanService.dataByYear(year, query);
return R.data(page);
}
@ -101,8 +144,8 @@ public class RehearsalRecordController extends BladeController {
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "演练数据导出")
@ApiOperationSupport(order = 8)
@ApiOperationSupport(order = 13)
public void exportRehearsalData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
rehearsalRecordService.exportRehearsalData(param, response);
rehearsalPlanService.exportRehearsalPlanData(param, response);
}
}

243
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java

@ -0,0 +1,243 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.TestDTO;
import com.hnac.hzims.safeproduct.dto.TestScoreDTO;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TestEntity;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.service.ITestScoreService;
import com.hnac.hzims.safeproduct.service.ITestService;
import com.hnac.hzims.safeproduct.service.ITrainPlanService;
import com.hnac.hzims.safeproduct.service.ITrainRecordService;
import com.hnac.hzims.safeproduct.vo.TestScoreVO;
import com.hnac.hzims.safeproduct.vo.TrainMonthVO;
import com.hnac.hzims.safeproduct.vo.TrainYearVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
* 培训管理接口类
*
* @author liwen
* @date 2023-12-25
*/
@RestController
@AllArgsConstructor
@RequestMapping("/train")
@Api(value = "培训管理", tags = "培训管理接口")
public class TrainController extends BladeController {
private final ITrainPlanService trainPlanService;
private final ITrainRecordService trainRecordService;
private final ITestService testService;
private final ITestScoreService testScoreService;
@PostMapping("/saveTrainPlan")
@ApiOperation(value = "新增培训计划")
@ApiOperationSupport(order = 1)
public R saveTrainPlan(@Valid @RequestBody TrainPlanEntity trainPlanEntity) {
return R.status(trainPlanService.save(trainPlanEntity));
}
@PostMapping("/updateTrainPlan")
@ApiOperation(value = "修改培训计划")
@ApiOperationSupport(order = 2)
public R updateTrainPlan(@Valid @RequestBody TrainPlanEntity trainPlanEntity) {
return R.status(trainPlanService.updateById(trainPlanEntity));
}
@PostMapping("/removeTrainPlan")
@ApiOperation(value = "删除培训计划")
@ApiOperationSupport(order = 3)
public R removeTrainPlan(@RequestParam Long id) {
return R.status(trainPlanService.removeTrainPlan(id));
}
@GetMapping("/trainPlanDetail")
@ApiOperation(value = "培训计划详情")
@ApiOperationSupport(order = 4)
public R<TrainPlanEntity> trainPlanDetail(@RequestParam Long id) {
return R.data(trainPlanService.getById(id));
}
@GetMapping("/trainPlanPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划培训开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划培训结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训计划分页")
@ApiOperationSupport(order = 5)
public R<IPage<TrainPlanEntity>> trainPlanPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TrainPlanEntity> page = trainPlanService.trainPlanPage(param, query);
return R.data(page);
}
@PostMapping("/saveTrainRecord")
@ApiOperation(value = "新增培训记录")
@ApiOperationSupport(order = 6)
public R saveTrainRecord(@Valid @RequestBody TrainRecordEntity trainRecordEntity) {
return R.status(trainRecordService.saveTrainRecord(trainRecordEntity));
}
@PostMapping("/updateTrainRecord")
@ApiOperation(value = "修改培训记录")
@ApiOperationSupport(order = 7)
public R updateTrainRecord(@Valid @RequestBody TrainRecordEntity trainRecordEntity) {
return R.status(trainRecordService.updateById(trainRecordEntity));
}
@PostMapping("/removeTrainRecord")
@ApiOperation(value = "删除培训记录")
@ApiOperationSupport(order = 8)
public R removeTrainRecord(@RequestParam Long id) {
return R.status(trainRecordService.removeTrainRecord(id));
}
@GetMapping("/trainRecordDetail")
@ApiOperation(value = "培训记录详情")
@ApiOperationSupport(order = 9)
public R<TrainRecordEntity> trainRecordDetail(@RequestParam Long id) {
return R.data(trainRecordService.getById(id));
}
@GetMapping("/trainRecordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<TrainRecordEntity>> trainRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TrainRecordEntity> page = trainRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TrainRecordEntity.class));
return R.data(page);
}
@GetMapping("/getTrainRecordNameList")
@ApiOperation(value = "培训记录名称列表")
@ApiOperationSupport(order = 11)
public R<List<TrainRecordDTO>> getTrainRecordNameList(@RequestParam String trainPlanId) {
List<TrainRecordDTO> list = trainRecordService.getTrainRecordNameList(trainPlanId);
return R.data(list);
}
@PostMapping("/saveTest")
@ApiOperation(value = "新增考试")
@ApiOperationSupport(order = 12)
public R saveTest(@Valid @RequestBody TestEntity testEntity) {
return testService.saveTest(testEntity);
}
@PostMapping("/updateTest")
@ApiOperation(value = "修改考试")
@ApiOperationSupport(order = 13)
public R updateTest(@Valid @RequestBody TestEntity testEntity) {
return R.status(testService.updateTest(testEntity));
}
@PostMapping("/removeTest")
@ApiOperation(value = "删除考试")
@ApiOperationSupport(order = 14)
public R removeTest(@RequestParam Long id) {
return R.status(testService.removeTest(id));
}
@GetMapping("/testDetail")
@ApiOperation(value = "考试详情")
@ApiOperationSupport(order = 15)
public R<TestEntity> testDetail(@RequestParam Long id) {
return R.data(testService.getById(id));
}
@GetMapping("/testPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "trainRecordId", value = "培训记录id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "考试记录分页")
@ApiOperationSupport(order = 16)
public R<IPage<TestEntity>> testPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TestEntity> page = testService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TestEntity.class));
return R.data(page);
}
@GetMapping("/getTestNameList")
@ApiOperation(value = "考试记录名称列表")
@ApiOperationSupport(order = 17)
public R<List<TestDTO>> getTestNameList(@RequestParam String trainPlanId) {
List<TestDTO> list = testService.getTestNameList(trainPlanId);
return R.data(list);
}
@GetMapping("/testScoreList")
@ApiOperation(value = "考试成绩列表")
@ApiOperationSupport(order = 18)
public R<List<TestScoreVO>> testScoreList(@RequestParam Long testId) {
List<TestScoreVO> list = testScoreService.testScoreList(testId);
return R.data(list);
}
@PostMapping("/updateBatchScore")
@ApiOperation(value = "批量填写分数")
@ApiOperationSupport(order = 19)
public R updateBatchScore(@RequestBody TestScoreDTO testScoreDTO) {
return R.status(testScoreService.updateBatchScore(testScoreDTO));
}
@GetMapping("/trainDataByMonth")
@ApiOperation(value = "培训月度统计表")
@ApiOperationSupport(order = 20)
public R<IPage<TrainMonthVO>> trainDataByMonth(@RequestParam String month, Query query) {
IPage<TrainMonthVO> page = trainPlanService.dataByMonth(month, query);
return R.data(page);
}
@GetMapping("/trainDataByYear")
@ApiOperation(value = "培训年度统计表")
@ApiOperationSupport(order = 21)
public R<IPage<TrainYearVO>> trainDataByYear(@RequestParam String year, Query query) {
IPage<TrainYearVO> page = trainPlanService.dataByYear(year, query);
return R.data(page);
}
@GetMapping("/exportTrainPlanData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训计划数据导出")
@ApiOperationSupport(order = 22)
public void exportTrainPlanData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
trainPlanService.exportTrainPlanData(param, response);
}
@GetMapping("/exportTrainRecordData")
@ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训记录数据导出")
@ApiOperationSupport(order = 23)
public void exportTrainRecordData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
trainRecordService.exportTrainRecordData(param, response);
}
}

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java

@ -1,8 +1,8 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.service.IRehearsalPlanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
@ -22,7 +22,7 @@ import java.util.List;
public class RehearsalJob {
@Autowired
IRehearsalRecordService rehearsalRecordService;
IRehearsalPlanService rehearsalPlanService;
@XxlJob("autoChangeRehearsalStatus")
public ReturnT<String> autoChangeRehearsalStatus(String param) {
@ -32,12 +32,12 @@ public class RehearsalJob {
String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
// 查询前一天的超时未完成演练记录
List<RehearsalRecordEntity> list = rehearsalRecordService.getWaitingRehearsalInTimeRange(yesterday, today);
List<RehearsalPlanEntity> list = rehearsalPlanService.getWaitingRehearsalInTimeRange(yesterday, today);
list.forEach(x -> {
x.setRehearsalStatus(RehearsalStatusEnum.UNFINISHED.getValue());
});
// 将状态置为未完成
boolean flag = rehearsalRecordService.updateBatchById(list);
boolean flag = rehearsalPlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
}
}

43
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/TrainJob.java

@ -0,0 +1,43 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
import com.hnac.hzims.safeproduct.enums.TrainStatusEnum;
import com.hnac.hzims.safeproduct.service.ITrainPlanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* 演练模块定时任务
*
* @author liwen
* @date 2023-12-27
*/
@Component
public class TrainJob {
@Autowired
ITrainPlanService trainPlanService;
@XxlJob("autoChangeTrainPlanStatus")
public ReturnT<String> autoChangeTrainPlanStatus(String param) {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
// 查询前一天的超时未完成培训计划
List<TrainPlanEntity> list = trainPlanService.getWaitingTrainPlanInTimeRange(yesterday, today);
list.forEach(x -> {
x.setTrainStatus(TrainStatusEnum.UNFINISHED.getValue());
});
// 将状态置为未完成
boolean flag = trainPlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
}
}

27
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java

@ -0,0 +1,27 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.dto.ConferenceExportDTO;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 会议计划Mapper类
*
* @author liwen
* @date 2023-12-27
*/
@Mapper
public interface ConferencePlanMapper extends BaseMapper<ConferencePlanEntity> {
/**
* 根据单位和计划时间查询会议记录
* @param unit 单位
* @param startTime 计划开始时间
* @param endTime 计划结束时间
* @return 会议记录列表
*/
List<ConferenceExportDTO> getConferenceByUnitAndDate(String unit, String startTime, String endTime);
}

23
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml

@ -0,0 +1,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper">
<select id="getConferenceByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.ConferenceExportDTO">
SELECT
t1.unit, t1.scheduled_start_time, t1.scheduled_end_time, t1.theme, t1.location, t1.conference_method,
t1.host, t2.actual_start_time, t2.actual_end_time, t1.conference_status
FROM
hzims_conference_plan t1
LEFT JOIN hzims_conference_record t2 ON t1.id = t2.conference_plan_id
WHERE
t1.is_deleted = 0
<if test="unit != 'null' and unit != ''">
AND t1.unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != 'null' and startTime != ''">
AND t1.scheduled_start_time >= #{startTime}
</if>
<if test="endTime != 'null' and endTime != ''">
AND t1.scheduled_end_time &lt; #{endTime}
</if>
</select>
</mapper>

16
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java

@ -0,0 +1,16 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 会议记录Mapper类
*
* @author liwen
* @date 2023-12-27
*/
@Mapper
public interface ConferenceRecordMapper extends BaseMapper<ConferenceRecordEntity> {
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml

@ -0,0 +1,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper">
</mapper>

45
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java

@ -0,0 +1,45 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.HygieneExportDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 卫生自查计划Mapper类
*
* @author liwen
* @date 2023-12-27
*/
@Mapper
public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
/**
* 查询当月各单位的卫生自查总数
* @param page 分页类
* @param month 月份
* @return 当月的卫生自查总数据
*/
IPage<HygieneMonthVO> selectByMonth(IPage<HygieneMonthVO> page, String month);
/**
* 查询当月各单位已完成的卫生自查数据
* @param page 分页类
* @param month 月份
* @return 当月的已完成数据
*/
IPage<HygieneMonthVO> selectFinishedDataByMonth(IPage<HygieneMonthVO> page, String month);
/**
* 根据单位和计划时间查询卫生自查记录
* @param unit 单位
* @param startTime 计划开始时间
* @param endTime 计划结束时间
* @return 卫生自查记录
*/
List<HygieneExportDTO> getHygieneByUnitAndDate(String unit, String startTime, String endTime);
}

52
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml

@ -0,0 +1,52 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.HygienePlanMapper">
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as scheduled_check_num
FROM
hzims_hygiene_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
GROUP BY
unit
ORDER BY
unit
</select>
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as finished_task_num
FROM
hzims_hygiene_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
AND hygiene_status = 'FINISHED'
GROUP BY
unit
ORDER BY
unit
</select>
<select id="getHygieneByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.HygieneExportDTO">
SELECT
t1.unit, t1.zone, t1.principal, t1.check_item, t1.check_item_score, t2.code, t2.check_result, t2.comprehensive_score,
t2.check_user, t2.actual_start_time, t2.actual_end_time, t1.hygiene_status
FROM
hzims_hygiene_plan t1
LEFT JOIN hzims_hygiene_record t2 ON t1.id = t2.hygiene_plan_id
WHERE
t1.is_deleted = 0
<if test="unit != 'null' and unit != ''">
AND t1.unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != 'null' and startTime != ''">
AND t1.scheduled_start_time >= #{startTime}
</if>
<if test="endTime != 'null' and endTime != ''">
AND t1.scheduled_end_time &lt; #{endTime}
</if>
</select>
</mapper>

23
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java

@ -0,0 +1,23 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 卫生自查记录Mapper类
*
* @author liwen
* @date 2023-12-27
*/
@Mapper
public interface HygieneRecordMapper extends BaseMapper<HygieneRecordEntity> {
/**
* 查询卫生自查记录详情
* @param id 卫生自查记录id
* @return 卫生自查记录详情VO类
*/
HygieneRecordDetailVO getRecordDetail(Long id);
}

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml

@ -0,0 +1,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper">
<select id="getRecordDetail" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO">
SELECT
t2.zone, t2.principal, t2.check_item, t2.check_item_score, t1.code, t1.check_time, t1.check_user,
t1.check_result, t1.comprehensive_score, t1.week_num
FROM
hzims_hygiene_record t1
LEFT JOIN hzims_hygiene_plan t2 ON t1.hygiene_plan_id = h2.id
WHERE
t1.is_deleted = 0
AND t1.id = #{id}
</select>
</mapper>

64
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java

@ -0,0 +1,64 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 演练计划Mapper类
*
* @author liwen
* @date 2023-12-27
*/
@Mapper
public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
/**
* 查询当月各单位的演练总数
* @param page 分页类
* @param month 月份
* @return 当月的演练总数据
*/
IPage<RehearsalMonthVO> selectByMonth(IPage<RehearsalMonthVO> page, String month);
/**
* 查询当月各单位已完成的演练数据
* @param page 分页类
* @param month 月份
* @return 当月的已完成数据
*/
IPage<RehearsalMonthVO> selectFinishedDataByMonth(IPage<RehearsalMonthVO> page, String month);
/**
* 查询当年的所有单位
* @param page 分页类
* @param year 年份
* @return 年度单位数据
*/
IPage<RehearsalYearVO> selectUnitByYear(IPage<RehearsalYearVO> page, @Param("year") String year);
/**
* 查询各单位全年已完成的演练数据
* @param unitList 单元列表
* @param year 年份
* @return 单位各月的数据列表
*/
List<AnalysisYearDTO> selectFinishedDataByUnit(@Param("unitList") List<String> unitList, @Param("year") String year);
/**
* 根据单位和计划时间查询演练数据
* @param unit 单位
* @param startTime 计划开始时间
* @param endTime 计划结束时间
* @return 演练数据列表
*/
List<RehearsalExportDTO> getRehearsalByUnitAndDate(String unit, String startTime, String endTime);
}

84
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml

@ -0,0 +1,84 @@
<?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.mapper.RehearsalPlanMapper">
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT
unit, count(1) as scheduled_task_num
FROM
hzims_rehearsal_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
GROUP BY
unit
ORDER BY
unit
</select>
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT
unit, count(1) as finished_task_num
FROM
hzims_rehearsal_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
AND rehearsal_status = 'FINISHED'
GROUP BY
unit
ORDER BY
unit
</select>
<select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.RehearsalYearVO">
SELECT
distinct unit
FROM
hzims_rehearsal_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{year}, '%')
ORDER BY
unit
</select>
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO">
SELECT
unit, DATE_FORMAT(scheduled_end_time, '%m') as dateTime, count(1) as finished_num
FROM
hzims_rehearsal_plan
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{year}, '%')
AND rehearsal_status = 'FINISHED'
AND unit in
<foreach collection="unitList" item="unit" open="(" close=")" separator=",">
#{unit}
</foreach>
GROUP BY
unit, DATE_FORMAT(scheduled_end_time, '%m')
ORDER BY
unit
</select>
<select id="getRehearsalByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.RehearsalExportDTO">
SELECT
t1.unit, t1.subject, t1.scheduled_start_time, t1.scheduled_end_time, t1.location,
t2.people_num, t2.actual_start_time, t2.actual_end_time, t1.rehearsal_status
FROM
hzims_rehearsal_plan t1
LEFT JOIN hzims_rehearsal_record t2 ON t1.id = t2.rehearsal_plan_id
WHERE
t1.is_deleted = 0
<if test="unit != 'null' and unit != ''">
AND t1.unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != 'null' and startTime != ''">
AND t1.scheduled_start_time >= #{startTime}
</if>
<if test="endTime != 'null' and endTime != ''">
AND t1.scheduled_end_time &lt; #{endTime}
</if>
</select>
</mapper>

38
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java

@ -1,15 +1,8 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.RehearsalYearDTO;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 演练记录Mapper类
@ -20,35 +13,4 @@ import java.util.List;
@Mapper
public interface RehearsalRecordMapper extends BaseMapper<RehearsalRecordEntity> {
/**
* 查询当月各单位的演练总数
* @param page 分页类
* @param month 月份
* @return 当月的演练总数据
*/
IPage<RehearsalMonthVO> selectByMonth(IPage<RehearsalMonthVO> page, @Param("month") String month);
/**
* 查询当月各单位已完成的演练数据
* @param page 分页类
* @param month 月份
* @return 当月的已完成数据
*/
IPage<RehearsalMonthVO> selectFinishedDataByMonth(IPage<RehearsalMonthVO> page, @Param("month") String month);
/**
* 查询当年的所有单位
* @param page 分页类
* @param year 年份
* @return 年度单位数据
*/
IPage<RehearsalYearVO> selectUnitByYear(IPage<RehearsalYearVO> page, @Param("year") String year);
/**
* 查询各单位全年已完成的演练数据
* @param unitList 单元列表
* @param year 年份
* @return 单位各月的数据列表
*/
List<RehearsalYearDTO> selectFinishedDataByUnit(@Param("unitList") List<String> unitList, @Param("year") String year);
}

60
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml

@ -2,64 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper">
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT
unit, count(1) as scheduled_task_num
FROM
hzims_rehearsal_record
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
GROUP BY
unit
ORDER BY
unit
</select>
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT
unit, count(1) as finished_task_num
FROM
hzims_rehearsal_record
WHERE
is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%')
AND rehearsal_status = 'FINISHED'
GROUP BY
unit
ORDER BY
unit
</select>
<select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.RehearsalYearVO">
SELECT
distinct unit
FROM
hzims_rehearsal_record
WHERE
is_deleted = 0
AND actual_end_time like concat('%', #{year}, '%')
ORDER BY
unit
</select>
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.RehearsalYearDTO">
SELECT
unit, DATE_FORMAT(actual_end_time, '%m') as dateTime, count(1) as finished_num
FROM
hzims_rehearsal_record
WHERE
is_deleted = 0
AND actual_end_time like concat('%', #{year}, '%')
AND rehearsal_status = 'FINISHED'
AND unit in
<foreach collection="unitList" item="unit" open="(" close=")" separator=",">
#{unit}
</foreach>
GROUP BY
unit, DATE_FORMAT(actual_end_time, '%m')
ORDER BY
unit
</select>
</mapper>

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

Loading…
Cancel
Save