Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
ea59601785
  1. 16
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java
  2. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java
  3. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java
  4. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java
  5. 12
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java
  6. 13
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java
  7. 2
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java
  8. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java
  9. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java
  10. 13
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  11. 5
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java
  12. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java
  13. 43
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java
  14. 12
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java
  15. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java
  16. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java
  17. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java
  18. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java
  19. 6
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java
  20. 41
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java
  21. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  22. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  23. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  24. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java
  25. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskDetailServiceImpl.java
  26. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  27. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java
  28. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java
  29. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java
  30. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java
  31. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskDetailWrapper.java
  32. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskWrapper.java
  33. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  34. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  35. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java
  36. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java
  37. 24
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenanceTaskWrapper.java
  38. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java
  39. 76
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java
  40. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  41. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  42. 121
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java
  43. 26
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java
  44. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml
  45. 26
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java
  46. 24
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml
  47. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java
  48. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml
  49. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java
  50. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  51. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java
  52. 39
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java
  53. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java
  54. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java
  55. 60
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java
  56. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java
  57. 110
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  58. 17
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java
  59. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java
  60. 46
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  61. 79
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java
  62. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java
  63. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  64. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java
  65. 21
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java
  66. 120
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  67. BIN
      hzims-service/safeproduct/src/main/resources/template/会议记录表.docx
  68. BIN
      hzims-service/safeproduct/src/main/resources/template/培训记录表.docx
  69. BIN
      hzims-service/safeproduct/src/main/resources/template/演练记录表.docx
  70. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  71. 48
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java
  72. 6
      hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

16
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java

@ -149,7 +149,23 @@ public class OperAccessPlanEntity extends TenantEntity {
@ApiModelProperty("当前步骤任务名称")
private String taskName;
/**
* 技术负责人
*/
@ApiModelProperty(value = "技术负责人")
private String techLeadName;
/**
* 管理负责人
*/
@ApiModelProperty(value = "管理负责人")
private String managerName;
@ApiModelProperty("当前环节处理人")
private String nextStepOperator;
@ApiModelProperty(value = "创建用户名称")
private String createUserName;
@ApiModelProperty(value = "创建用户名称")
private String updateUserName;
}

8
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java

@ -111,4 +111,12 @@ public class OperAccessStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "描述")
private String descripiton;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称")
private String updateUserName;
@ApiModelProperty("负责人名称")
private String managerName;
}

4
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java

@ -49,7 +49,11 @@ public class OperAccessTaskDetailEntity extends TenantEntity {
@ApiModelProperty(value = "任务内容")
private String content;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称")
private String updateUserName;
public void setValue(OperAccessContentDetailEntity contentDetailEntity){
contentDetailId = contentDetailEntity.getId();
content = contentDetailEntity.getContent();

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java

@ -132,5 +132,11 @@ public class OperAccessTaskEntity extends TenantEntity {
@ApiModelProperty("当前环节处理人")
private String nextStepOperator;
@ApiModelProperty(value = "任务执行人")
private String handlerName;
@ApiModelProperty(value = "创建用户名称")
private String createUserName;
@ApiModelProperty(value = "创建用户名称")
private String updateUserName;
}

12
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.maintenance.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
@ -72,6 +73,12 @@ public class OperMaintenancePlanEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long disposer;
/**
* 执行人
*/
@ApiModelProperty(value = "执行人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String disposerName;
/**
* 执行日期
*/
@ApiModelProperty(value = "执行日期")
@ -114,4 +121,9 @@ public class OperMaintenancePlanEntity extends TenantEntity {
*/
private String stationCode;
@ApiModelProperty(value = "创建用户名称")
private String createUserName;
@ApiModelProperty(value = "创建用户名称")
private String updateUserName;
}

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

@ -71,6 +71,13 @@ public class OperMaintenanceTaskEntity extends TenantEntity {
@ApiModelProperty(value = "执行人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String disposer;
/**
* 执行人
*/
@ApiModelProperty(value = "执行人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String disposerName;
/**
* 执行日期
*/
@ -198,4 +205,10 @@ public class OperMaintenanceTaskEntity extends TenantEntity {
@ApiModelProperty("是否延期")
private Boolean isDelay;
@ApiModelProperty(value = "创建用户名称")
private String createUserName;
@ApiModelProperty(value = "创建用户名称")
private String updateUserName;
}

2
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java

@ -50,4 +50,6 @@ public class TaskUserEntity extends TenantEntity {
*/
@ApiModelProperty(value = "领用时间")
private LocalDateTime claimTime;
@ApiModelProperty(value = "用户ID")
private String userName;
}

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

@ -22,11 +22,9 @@ public class ConferenceExportDTO {
private String unit;
@ApiModelProperty("会议计划开始时间")
@ExcelProperty(value = "会议计划开始时间", index = 1)
private Date scheduledStartTime;
@ApiModelProperty("会议计划结束时间")
@ExcelProperty(value = "会议计划结束时间", index = 2)
private Date scheduledEndTime;
@ApiModelProperty("会议主题")
@ -48,4 +46,12 @@ public class ConferenceExportDTO {
@ApiModelProperty("会议状态")
@ExcelProperty(value = "会议状态", index = 7)
private String conferenceStatus;
@ApiModelProperty("计划开始时间")
@ExcelProperty(value = "计划开始时间", index = 1)
private String startTime;
@ApiModelProperty("计划结束时间")
@ExcelProperty(value = "计划结束时间", index = 2)
private String endTime;
}

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

@ -26,11 +26,9 @@ public class RehearsalExportDTO {
private String subject;
@ApiModelProperty("演练计划开始时间")
@ExcelProperty(value = "计划开始时间", index = 2)
private Date scheduledStartTime;
@ApiModelProperty("演练计划结束时间")
@ExcelProperty(value = "计划结束时间", index = 3)
private Date scheduledEndTime;
@ApiModelProperty("演练地点")
@ -40,4 +38,12 @@ public class RehearsalExportDTO {
@ApiModelProperty("演练状态")
@ExcelProperty(value = "演练状态", index = 5)
private String rehearsalStatus;
@ApiModelProperty("计划开始时间")
@ExcelProperty(value = "计划开始时间", index = 2)
private String startTime;
@ApiModelProperty("计划结束时间")
@ExcelProperty(value = "计划结束时间", index = 3)
private String endTime;
}

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

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@ -23,13 +24,16 @@ import java.util.Date;
public class HygienePlanEntity extends BaseEntity {
@Size(max = 50, message = "计划名称字段长度不能超过50")
@ExcelProperty(value = "计划名称", index = 0)
@ApiModelProperty("计划名称")
private String name;
@Size(max = 50, message = "单位字段长度不能超过50")
@ExcelProperty(value = "单位", index = 1)
@ApiModelProperty("单位")
private String unit;
@ExcelProperty(value = "标准总分值", index = 2)
@ApiModelProperty("标准总分值")
private Integer standardScore;
@ -43,6 +47,15 @@ public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("计划结束时间")
private Date scheduledEndTime;
@ExcelProperty(value = "自查计划状态", index = 5)
@ApiModelProperty("自查计划状态")
private String hygienePlanStatus;
@ExcelProperty(value = "计划开始时间", index = 3)
@ApiModelProperty("计划开始时间")
private String startTime;
@ExcelProperty(value = "计划结束时间", index = 4)
@ApiModelProperty("计划结束时间")
private String endTime;
}

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

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tool.utils.DateUtil;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@ -33,12 +34,12 @@ public class RehearsalPlanEntity extends BaseEntity {
private String subject;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@ApiModelProperty("演练计划开始时间")
private Date scheduledStartTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@ApiModelProperty("演练计划结束时间")
private Date scheduledEndTime;

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java → hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java

@ -18,7 +18,7 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_device")
@ApiModel(value = "特种设备实体类")
public class DeviceEntity extends BaseEntity {
public class SpecialDeviceEntity extends BaseEntity {
@Size(max = 50, message = "设备名称长度不能超过50")
@ApiModelProperty("设备名称")

43
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java

@ -0,0 +1,43 @@
package com.hnac.hzims.safeproduct.entity;
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.base.BaseEntity;
import javax.validation.constraints.Size;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_device_inspection")
@ApiModel(value = "特种设备检验记录实体类")
public class SpecialDeviceInspectionEntity extends BaseEntity {
@ApiModelProperty("设备id")
private Long deviceId;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("检验时间")
private Date inspectionTime;
@Size(max = 255, message = "检验地点长度不能超过255")
@ApiModelProperty("检验地点")
private String location;
@Size(max = 1000, message = "检验照片长度不能超过1000")
@ApiModelProperty("检验照片")
private String imgPath;
@TableField(exist = false)
@ApiModelProperty("下次检验时间")
private Date nextInspectionTime;
@TableField(exist = false)
@ApiModelProperty("上次检验时间")
private Date lastInspectionTime;
}

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

@ -35,13 +35,11 @@ public class TrainPlanEntity extends BaseEntity {
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("计划开始时间")
@ExcelProperty(value = "计划开始时间", index = 6)
private Date scheduledStartTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("计划结束时间")
@ExcelProperty(value = "计划结束时间", index = 7)
private Date scheduledEndTime;
@NotNull
@ -80,4 +78,14 @@ public class TrainPlanEntity extends BaseEntity {
@ApiModelProperty("是否考试")
@ExcelProperty(value = "是否考试", index = 5)
private String hasTest;
@TableField(exist = false)
@ApiModelProperty("计划开始时间")
@ExcelProperty(value = "计划开始时间", index = 6)
private String startTime;
@TableField(exist = false)
@ApiModelProperty("计划结束时间")
@ExcelProperty(value = "计划结束时间", index = 7)
private String endTime;
}

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java

@ -1,10 +1,12 @@
package com.hnac.hzims.safeproduct.vo;
import cn.afterturn.easypoi.entity.ImageEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author liwen
@ -52,4 +54,13 @@ public class ConferenceRecordDetailVO {
@ApiModelProperty("会议附件")
private String filePath;
@ApiModelProperty("图片列表")
private List<ImageEntity> images;
@ApiModelProperty("年份")
private String year;
@ApiModelProperty("月份")
private String month;
}

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java

@ -17,6 +17,9 @@ public class HygieneRecordPageVO {
@ApiModelProperty("卫生自查记录id")
private Long id;
@ApiModelProperty("卫生自查计划id")
private Long hygienePlanId;
@ApiModelProperty("单位")
private String unit;

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java

@ -1,10 +1,12 @@
package com.hnac.hzims.safeproduct.vo;
import cn.afterturn.easypoi.entity.ImageEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author liwen
@ -52,4 +54,13 @@ public class RehearsalRecordDetailVO {
@ApiModelProperty("演练科目")
private String subject;
@ApiModelProperty("图片列表")
private List<ImageEntity> images;
@ApiModelProperty("年份")
private String year;
@ApiModelProperty("月份")
private String month;
}

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java

@ -1,10 +1,12 @@
package com.hnac.hzims.safeproduct.vo;
import cn.afterturn.easypoi.entity.ImageEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author liwen
@ -52,4 +54,13 @@ public class TrainRecordDetailVO {
@ApiModelProperty("培训附件")
private String filePath;
@ApiModelProperty("图片列表")
private List<ImageEntity> images;
@ApiModelProperty("年份")
private String year;
@ApiModelProperty("月份")
private String month;
}

6
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java

@ -25,6 +25,12 @@ public interface TicketConstants {
String LICENSOR_ROLE = "licensor";
/**
* 操作票监护人确认结果
*/
String OPERATION_TICKET_APPROVED = "approved";
String OPERATION_TICKET_REJECTED = "rejected";
/**
* 工作票安措新增类型
**/
String DUTY_PATTERN = "1";

41
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.standardTicket.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@ -106,7 +107,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("是否评价")
private Integer isEvaluate;
/**
* AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性
* 站点标识-两票编码
@ -114,65 +114,30 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("站点标识-两票编码")
private String signage;
/**
* 编号原站点ID
*/
@ApiModelProperty("编号(原站点ID)")
private String signageCode;
/**
* 流程状态'
*/
@ApiModelProperty("流程状态")
private Integer flowStatus;
/**
* 流程描述
*/
@ApiModelProperty("流程描述")
private String flowDescription;
/**
* 下一个审批人
*/
@ApiModelProperty("下一个审批人")
private String nextStepOperator;
/**
* 用户Id
*/
@ApiModelProperty("用户Id")
private String flowUserId;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskName;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskId;
/**
* 项目
*/
@ApiModelProperty("项目")
private String projectName;
/**
*
*/
@ApiModelProperty("分组")
private String classGroupName;
@ -182,7 +147,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("更新人名称")
private String updateUserName;
@ApiModelProperty("发令人名称")
private String issueOrderPersonName;
@ -195,4 +159,7 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("许可人名称")
private String guardianName;
@TableField(exist = false)
@ApiModelProperty("监护人确认结果:approved-确认,rejected-作废")
private String verifyResult;
}

11
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

@ -94,11 +94,14 @@ public class TaskController extends BladeController {
TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus()));
if(taskUserEntity!=null){
detail.setUserId(taskUserEntity.getUserId());
User user = UserCache.getUser(taskUserEntity.getUserId());
if(user!=null){
String userName = user.getRealName();
detail.setUserName(userName);
if(taskUserEntity.getUserId()!=null) {
detail.setUserName(taskUserEntity.getUserName());
}
// User user = UserCache.getUser(taskUserEntity.getUserId());
// if(user!=null){
// String userName = user.getRealName();
// detail.setUserName(userName);
// }
}
//巡检记录

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
@ -28,6 +29,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -39,6 +41,7 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.utils.TaskUtil;
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.stereotype.Service;
@ -120,6 +123,23 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
entity.setCode("PLAN_" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999)));
entity.setProcDefId("overhaul_plan");
entity.setActStartTime(new Date());
if (ObjectUtil.isNotEmpty(entity.getTechLead())){
User user = UserCache.getUser(entity.getTechLead());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setTechLeadName(user.getName());
}
}
if (ObjectUtil.isNotEmpty(entity.getManager())){
User user = UserCache.getUser(entity.getManager());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setManagerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
entity.setCreateUserName(user.getUserName());
entity.setUpdateUserName(user.getUserName());
}
planService.save(entity);
}

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
@ -31,6 +32,7 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.utils.TaskUtil;
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.stereotype.Service;
@ -113,6 +115,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
private void save(AccessTaskV4DTO entity) {
entity.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999)));
List<OperAccessMaterialEntity> materialEntityList = JSONObject.parseArray(JSON.toJSONString(entity.getAccessMaterials()), OperAccessMaterialEntity.class);
if (ObjectUtil.isNotEmpty(entity.getHandler())){
User user = UserCache.getUser(entity.getHandler());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setHandlerName(user.getName());
entity.setCreateUserName(user.getName());
entity.setUpdateUserName(user.getName());
}
}
taskService.save(entity);
}
@ -254,6 +264,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
statisticsDTO.setEmCode(entity.getEmCode());
statisticsDTO.setPlanHours(entity.getPlanHours());
statisticsDTO.setManager(entity.getHandler());
statisticsDTO.setManagerName(entity.getHandlerName());
OperAccessContentEntity content = contentService.getById(entity.getId());
if (ObjectUtil.isNotEmpty(content)) {
statisticsDTO.setPid(content.getLibraryId());

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java

@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import com.hnac.hzims.operational.access.excel.OperAccessStatisticsExport;
@ -16,8 +17,13 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
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.ObjectUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -38,7 +44,19 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl<OperAccessS
@Override
public R doSave(OperAccessStatisticsDTO req) {
return R.status(super.save(req));
if (ObjectUtil.isNotEmpty(req.getManager())){
User user = UserCache.getUser(req.getManager());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setManagerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
boolean save = super.save(req);
return R.status(save);
}
@Override

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskDetailServiceImpl.java

@ -1,8 +1,10 @@
package com.hnac.hzims.operational.access.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDetailDTO;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import com.hnac.hzims.operational.access.mapper.OperAccessTaskDetailMapper;
@ -12,7 +14,11 @@ import com.hnac.hzims.operational.access.wrapper.OperAccessTaskDetailWrapper;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -27,6 +33,11 @@ public class OperAccessTaskDetailServiceImpl extends BaseServiceImpl<OperAccessT
@Override
public R doSave(OperAccessTaskDetailDTO req) {
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
return R.status(super.save(req));
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -50,6 +50,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
@ -103,6 +104,17 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
@Override
public R doSave(OperAccessTaskDTO req) {
req.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999)));
if (ObjectUtil.isNotEmpty(req.getHandler())){
User user = UserCache.getUser(req.getHandler());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setHandlerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
List<OperAccessMaterialEntity> materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class);
if (super.save(req)) {
if (CollectionUtil.isNotEmpty(materialEntityList)) {

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java

@ -20,14 +20,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称")
private String updateUserName;
@ApiModelProperty("负责人名称")
private String managerName;
@ApiModelProperty(value = "任务名称")
private String taskName;

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java

@ -17,9 +17,5 @@ public class OperAccessTaskDetailVO extends OperAccessTaskDetailEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称")
private String updateUserName;
}

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java

@ -20,14 +20,14 @@ public class OperAccessTaskVO extends OperAccessTaskEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称")
private String updateUserName;
@ApiModelProperty("执行人名称")
private String handlerName;
// @ApiModelProperty("创建人名称")
// private String createUserName;
//
// @ApiModelProperty("修改人名称")
// private String updateUserName;
//
// @ApiModelProperty("执行人名称")
// private String handlerName;
@ApiModelProperty("状态名称")
private String statusName;

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java

@ -24,12 +24,12 @@ public class OperAccessStatisticsWrapper extends BaseEntityWrapper<OperAccessSta
@Override
public OperAccessStatisticsVO entityVO(OperAccessStatisticsEntity entity) {
OperAccessStatisticsVO vo = BeanUtil.copy(entity, OperAccessStatisticsVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
User manager = UserCache.getUser(entity.getManager());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
vo.setManagerName(Optional.ofNullable(manager).map(User :: getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// User manager = UserCache.getUser(entity.getManager());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
// vo.setManagerName(Optional.ofNullable(manager).map(User :: getName).orElse(null));
return vo;
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskDetailWrapper.java

@ -25,10 +25,10 @@ public class OperAccessTaskDetailWrapper extends BaseEntityWrapper<OperAccessTas
@Override
public OperAccessTaskDetailVO entityVO(OperAccessTaskDetailEntity entity) {
OperAccessTaskDetailVO vo = BeanUtil.copy(entity, OperAccessTaskDetailVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
return vo;
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskWrapper.java

@ -32,12 +32,12 @@ public class OperAccessTaskWrapper extends BaseEntityWrapper<OperAccessTaskEntit
public <T extends OperAccessTaskEntity> OperAccessTaskVO entityVOExtras(T entity) {
OperAccessTaskVO vo = BeanUtil.copy(entity, OperAccessTaskVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
User handlerName = UserCache.getUser(entity.getHandler());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// User handlerName = UserCache.getUser(entity.getHandler());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
// vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null));
vo.setStatusName(DictCache.getValue(DictConstant.ACCESS_TASK_STATUS, entity.getStatus()));
return vo;
}

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -177,20 +177,23 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
@Override
public ImsSchedulingVo getByIdOneV2(Long id, Long preDutyId) {
ImsSchedulingVo imsSchedulingVo = this.baseMapper.selectByIdOneV2(id, preDutyId);
if (null == imsSchedulingVo.getGroupId()) {
imsSchedulingVo.setGroupName("临时班组");
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId());
last("limit 1");
}});
imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson());
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId());
imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName());
imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId());
imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId());
if(ObjectUtil.isNotEmpty(imsSchedulingVo)) {
if (null == imsSchedulingVo.getGroupId()) {
imsSchedulingVo.setGroupName("临时班组");
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId());
last("limit 1");
}});
imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson());
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId());
imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName());
imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId());
imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId());
}
return imsSchedulingVo;
}
return imsSchedulingVo;
return new ImsSchedulingVo();
}
@Override
@ -1257,6 +1260,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
return R.success("您当前未值班");
}
ImsSchedulingVo imsSchedulingVo = getByIdOneV2(entity.getId(), null);
if (ObjectUtil.isEmpty(imsSchedulingVo)){
return R.success("暂无接班计划,请排班后重试");
}
R<User> userR = userClient.userInfoById(imsSchedulingVo.getManagerId());
imsSchedulingVo.setManagerName(userR.getData().getName());
imsSchedulingVo.setCreateDept(userR.getData().getCreateDept());

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
@ -63,6 +64,7 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import javax.xml.ws.WebServiceException;
import java.math.BigDecimal;
import java.sql.Time;
import java.text.SimpleDateFormat;
@ -455,6 +457,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
}
for (ImsDutyRecVO imsDutyRecVO : records) {
ImsSchedulingVo imsSchedulingVo = imsDutyMainService.getByIdOneV2(imsDutyRecVO.getDutyId(), null);
if (ObjectUtil.isEmpty(imsSchedulingVo)){
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,尽快进行排班!");
}
ImsSchedulingVo carryDutyMainVo = imsDutyMainMapper.selectByPreDutyIdOne(Optional.ofNullable(imsSchedulingVo).map(ImsSchedulingVo::getId).orElse(null));
if (ObjectUtil.isNotEmpty(carryDutyMainVo)){
if (StringUtil.isBlank(carryDutyMainVo.getGroupName())){
@ -545,7 +550,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
if (ObjectUtil.isNotEmpty(imsSchedulingVo1)&&null != imsSchedulingVo1.getManagerId()) {
imsSchedulingVo1.setUserName(userClient.userInfoById(imsSchedulingVo1.getManagerId()).getData().getName());
}else {
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,进行尽快进行排班!!!!");
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,尽快进行排班!!!!");
}
vo.setHeadDutyMainVo(imsSchedulingVo);
vo.setCarryDutyMainVo(imsSchedulingVo1);
@ -1416,10 +1421,15 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
recDTO.setStatus(DutyRecStatus.ACCEPT.getVal());
recDTO.setAcceptTime(new Date());
ImsDutyLogEntity imsDutyLogEntity = recDTO.getImsDutyLogEntity();
imsDutyLogService.update(Wrappers.<ImsDutyLogEntity>lambdaUpdate()
.set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME))
.eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId())
);
ImsDutyLogEntity update = imsDutyLogService.getOne(Wrappers.<ImsDutyLogEntity>lambdaQuery()
.eq(ImsDutyLogEntity::getDutyId, imsDutyLogEntity.getDutyId())
.last("limit 1"));
update.setCarryTime(DateUtil.format(new Date(), PATTERN_DATETIME));
imsDutyLogService.updateById(update);
// imsDutyLogService.update(Wrappers.<ImsDutyLogEntity>lambdaUpdate()
// .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME))
// .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId())
// );
log.info("更新值班日志");
}
ImsDutyRecEntity dutyRec = BeanUtil.copy(recDTO, ImsDutyRecEntity.class);

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java

@ -1,10 +1,12 @@
package com.hnac.hzims.operational.maintenance.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenancePlanDTO;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity;
import com.hnac.hzims.operational.maintenance.scheduled.MaintenancePlanCreateTask;
@ -18,8 +20,12 @@ import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -59,6 +65,17 @@ public class OperMaintenancePlanController extends BladeController {
public R save(@Valid @RequestBody OperMaintenancePlanEntity req) {
//设备为临时任务类型
req.setTaskType("1");
if (ObjectUtil.isNotEmpty(req.getDisposer())){
User user = UserCache.getUser(req.getDisposer());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setDisposerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
planService.save(req);
return R.data(req);
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java

@ -36,12 +36,12 @@ public class OperMaintenancePlanWrapper extends BaseEntityWrapper<OperMaintenanc
@Override
public OperMaintenancePlanVO entityVO(OperMaintenancePlanEntity entity) {
OperMaintenancePlanVO vo = BeanUtil.copy(entity, OperMaintenancePlanVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
User disposer = UserCache.getUser(entity.getDisposer());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
vo.setDisposerName(Optional.ofNullable(disposer).map(User::getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// User disposer = UserCache.getUser(entity.getDisposer());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
// vo.setDisposerName(Optional.ofNullable(disposer).map(User::getName).orElse(null));
vo.setTypeCodeValue(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, vo.getTypeCode()));
vo.setStatusValue(DictCache.getValue(DictConstant.MAINTENANCE_TASK_STATUS, vo.getStatus()));
//完善维护模式

24
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenanceTaskWrapper.java

@ -29,22 +29,22 @@ public class OperMaintenanceTaskWrapper extends BaseEntityWrapper<OperMaintenanc
@Override
public OperMaintenanceTaskVO entityVO(OperMaintenanceTaskEntity entity) {
OperMaintenanceTaskVO vo = BeanUtil.copy(entity, OperMaintenanceTaskVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
vo.setIsAnomalyValue(DictCache.getValue(DictConstant.YES_NO, vo.getIsAnomaly()));
vo.setTypeCodeValue(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, vo.getTypeCode()));
vo.setStatusValue(DictCache.getValue(DictConstant.MAINTENANCE_TASK_STATUS, vo.getStatus()));
String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{
List<String> disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList());
return disposerList.stream().map(d ->{
User user = UserCache.getUser(Long.parseLong(d));
return Optional.ofNullable(user).map(User::getName).orElse("");
}).collect(Collectors.joining(","));
}).orElse("");
vo.setDisposerName(disposerName);
// String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{
// List<String> disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList());
// return disposerList.stream().map(d ->{
// User user = UserCache.getUser(Long.parseLong(d));
// return Optional.ofNullable(user).map(User::getName).orElse("");
// }).collect(Collectors.joining(","));
// }).orElse("");
// vo.setDisposerName(disposerName);
return vo;
}

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

@ -2,7 +2,6 @@ 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;
@ -110,13 +109,14 @@ public class ConferenceController extends BladeController {
@GetMapping("/recordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", 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).lambda().orderByDesc(ConferenceRecordEntity::getCreateTime));
IPage<ConferenceRecordEntity> page = conferenceRecordService.recordPage(param, query);
return R.data(page);
}

76
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java

@ -1,76 +0,0 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.service.IDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.Map;
/**
* 特种设备管理接口类
*
* @author liwen
* @date 2024-01-12
*/
@RequestMapping("/device")
@AllArgsConstructor
@RestController
@Api(value = "特种设备", tags = "特种设备接口")
public class DeviceController extends BladeController {
private final IDeviceService deviceService;
@PostMapping("/save")
@ApiOperation(value = "新增")
@ApiOperationSupport(order = 1)
public R save(@Valid @RequestBody DeviceEntity deviceEntity) {
return R.status(deviceService.save(deviceEntity));
}
@PostMapping("/update")
@ApiOperation(value = "修改")
@ApiOperationSupport(order = 2)
public R update(@Valid @RequestBody DeviceEntity deviceEntity) {
return R.status(deviceService.updateById(deviceEntity));
}
@PostMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperationSupport(order = 3)
public R remove(@RequestParam Long id) {
return R.status(deviceService.removeById(id));
}
@GetMapping("/detail")
@ApiOperation(value = "详情")
@ApiOperationSupport(order = 4)
public R<DeviceEntity> detail(@RequestParam Long id) {
return R.data(deviceService.getById(id));
}
@GetMapping("/page")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string")
})
@ApiOperation(value = "分页")
@ApiOperationSupport(order = 5)
public R<IPage<DeviceEntity>> page(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<DeviceEntity> page = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, DeviceEntity.class)
.lambda().orderByDesc(DeviceEntity::getCreateTime));
return R.data(page);
}
}

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

@ -114,7 +114,10 @@ public class HygieneController extends BladeController {
@GetMapping("/recordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "卫生自查记录分页")
@ApiOperationSupport(order = 10)
@ -148,4 +151,17 @@ public class HygieneController extends BladeController {
public void exportMonthData(@ApiIgnore @RequestParam Map<String, Object> param, Query query, HttpServletResponse response) {
hygienePlanService.exportMonthData(param, query, response);
}
@GetMapping("/exportHygienePlanData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "name", 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 = 14)
public void exportHygienePlanData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
hygienePlanService.exportHygienePlanData(param, response);
}
}

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java

@ -112,13 +112,14 @@ public class RehearsalController extends BladeController {
@GetMapping("/rehearsalRecordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", 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).lambda().orderByDesc(RehearsalRecordEntity::getCreateTime));
IPage<RehearsalRecordEntity> page = rehearsalRecordService.rehearsalRecordPage(param, query);
return R.data(page);
}

121
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java

@ -0,0 +1,121 @@
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.SpecialDeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.Map;
/**
* 特种设备管理接口类
*
* @author liwen
* @date 2024-01-12
*/
@RequestMapping("/specialDevice")
@AllArgsConstructor
@RestController
@Api(value = "特种设备", tags = "特种设备接口")
public class SpecialDeviceController extends BladeController {
private final ISpecialDeviceService specialDeviceService;
private final ISpecialDeviceInspectionService specialDeviceInspectionService;
@PostMapping("/save")
@ApiOperation(value = "新增设备")
@ApiOperationSupport(order = 1)
public R save(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) {
return R.status(specialDeviceService.save(specialDeviceEntity));
}
@PostMapping("/update")
@ApiOperation(value = "修改设备")
@ApiOperationSupport(order = 2)
public R update(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) {
return R.status(specialDeviceService.updateById(specialDeviceEntity));
}
@PostMapping("/remove")
@ApiOperation(value = "删除设备")
@ApiOperationSupport(order = 3)
public R remove(@RequestParam Long id) {
return R.status(specialDeviceService.removeById(id));
}
@GetMapping("/detail")
@ApiOperation(value = "设备详情")
@ApiOperationSupport(order = 4)
public R<SpecialDeviceEntity> detail(@RequestParam Long id) {
return R.data(specialDeviceService.getById(id));
}
@GetMapping("/page")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string")
})
@ApiOperation(value = "设备分页")
@ApiOperationSupport(order = 5)
public R<IPage<SpecialDeviceEntity>> page(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<SpecialDeviceEntity> page = specialDeviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, SpecialDeviceEntity.class)
.lambda().orderByDesc(SpecialDeviceEntity::getCreateTime));
return R.data(page);
}
@PostMapping("/saveInspection")
@ApiOperation(value = "新增设备检验记录")
@ApiOperationSupport(order = 6)
public R saveInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) {
return R.status(specialDeviceInspectionService.saveInspection(specialDeviceInspectionEntity));
}
@PostMapping("/updateInspection")
@ApiOperation(value = "修改设备检验记录")
@ApiOperationSupport(order = 7)
public R updateInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) {
return R.status(specialDeviceInspectionService.updateInspection(specialDeviceInspectionEntity));
}
@PostMapping("/removeInspection")
@ApiOperation(value = "删除设备检验记录")
@ApiOperationSupport(order = 8)
public R removeInspection(@RequestParam Long id) {
return R.status(specialDeviceInspectionService.removeById(id));
}
@GetMapping("/inspectionDetail")
@ApiOperation(value = "设备检验记录详情")
@ApiOperationSupport(order = 9)
public R<SpecialDeviceInspectionEntity> inspectionDetail(@RequestParam Long id) {
return R.data(specialDeviceInspectionService.getById(id));
}
@GetMapping("/inspectionPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string")
})
@ApiOperation(value = "设备检验记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<SpecialDeviceInspectionEntity>> inspectionPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<SpecialDeviceInspectionEntity> page = specialDeviceInspectionService.getInspectionPage(param, query);
return R.data(page);
}
}

26
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java → hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java

@ -4,9 +4,9 @@ import com.hnac.hzims.common.constant.CommonConstant;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
import com.hnac.hzims.safeproduct.service.IDeviceService;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
@ -30,10 +30,10 @@ import java.util.List;
*/
@Slf4j
@Component
public class DeviceJob {
public class SpecialDeviceJob {
@Autowired
IDeviceService deviceService;
ISpecialDeviceService deviceService;
@Autowired
IUserClient userClient;
@ -52,7 +52,7 @@ public class DeviceJob {
String today = DateUtil.format(current, DateUtil.PATTERN_DATE);
String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE);
// 查询昨天的过期设备
List<DeviceEntity> list = deviceService.getExpiredDeviceByTime(yesterday, today);
List<SpecialDeviceEntity> list = deviceService.getExpiredDeviceByTime(yesterday, today);
if (CollectionUtils.isEmpty(list)) {
return ReturnT.SUCCESS;
}
@ -67,15 +67,15 @@ public class DeviceJob {
/**
* 推送设备过期消息
* @param deviceEntity 特种设备实体类
* @param specialDeviceEntity 特种设备实体类
*/
private void sendExpiredMessage(DeviceEntity deviceEntity) {
if (deviceEntity.getManagerId() == null) {
private void sendExpiredMessage(SpecialDeviceEntity specialDeviceEntity) {
if (specialDeviceEntity.getManagerId() == null) {
log.error("系统无该用户信息,推送设备过期消息失败");
return;
}
// 查询用户
R<User> userRes = userClient.userInfoById(deviceEntity.getManagerId());
R<User> userRes = userClient.userInfoById(specialDeviceEntity.getManagerId());
User user = userRes.getData();
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
if (StringUtils.isNotEmpty(user.getDeptId())) {
@ -84,11 +84,11 @@ public class DeviceJob {
businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData());
businessMessageDTO.setBusinessKey("设备到期");
businessMessageDTO.setBusinessClassify("system");
businessMessageDTO.setTaskId(deviceEntity.getId());
businessMessageDTO.setTaskId(specialDeviceEntity.getId());
businessMessageDTO.setSubject("设备到期通知");
businessMessageDTO.setContent("您所管理的特种设备" + deviceEntity.getName() + "已到期,请尽快进行检验。");
businessMessageDTO.setUserIds(String.valueOf(deviceEntity.getManagerId()));
businessMessageDTO.setCreateUser(deviceEntity.getCreateUser());
businessMessageDTO.setContent("您所管理的特种设备" + specialDeviceEntity.getName() + "已到期,请尽快进行检验。");
businessMessageDTO.setUserIds(String.valueOf(specialDeviceEntity.getManagerId()));
businessMessageDTO.setCreateUser(specialDeviceEntity.getCreateUser());
businessMessageDTO.setTenantId(CommonConstant.TENANT_ID);
}
messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);

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

@ -14,7 +14,7 @@
<select id="recordPage" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO">
SELECT
id, unit, actual_start_time, actual_end_time, check_user, week_num
id, unit, actual_start_time, actual_end_time, check_user, week_num, hygiene_plan_id
FROM
hzims_hygiene_record
WHERE
@ -22,6 +22,15 @@
<if test="param.hygienePlanId != null and param.hygienePlanId != ''">
AND hygiene_plan_id = #{param.hygienePlanId}
</if>
<if test="param.unit != null and param.unit != ''">
AND unit like concat('%', #{param.unit}, '%')
</if>
<if test="param.actualStartTime != null and param.actualStartTime != ''">
AND actual_start_time >= #{param.actualStartTime}
</if>
<if test="param.actualEndTime != null and param.actualEndTime != ''">
AND actual_end_time &lt;= #{param.actualEndTime}
</if>
ORDER BY
create_time DESC
</select>

26
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java

@ -0,0 +1,26 @@
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.entity.SpecialDeviceInspectionEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/**
* 特种设备检验记录Mapper类
*
* @author liwen
* @date 2024-01-22
*/
@Mapper
public interface SpecialDeviceInspectionMapper extends BaseMapper<SpecialDeviceInspectionEntity> {
/**
* 设备检验记录分页
* @param param 入参
* @param page 分页类
* @return 设备检验记录数据
*/
IPage<SpecialDeviceInspectionEntity> getInspectionPage(IPage<SpecialDeviceInspectionEntity> page, Map<String, Object> param);
}

24
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml

@ -0,0 +1,24 @@
<?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.SpecialDeviceInspectionMapper">
<select id="getInspectionPage" resultType="com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity">
SELECT
*
FROM
hzims_device_inspection
WHERE
is_deleted = 0
<if test="param.deviceId != null and param.deviceId != ''">
AND device_id = #{param.deviceId}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND inspectionTime >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND inspectionTime &lt;= #{param.endTime}
</if>
ORDER BY
create_time DESC
</select>
</mapper>

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java → hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java

@ -1,7 +1,7 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-12
*/
@Mapper
public interface DeviceMapper extends BaseMapper<DeviceEntity> {
public interface SpecialDeviceMapper extends BaseMapper<SpecialDeviceEntity> {
}

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml → hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml

@ -1,4 +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.DeviceMapper">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.SpecialDeviceMapper">
</mapper>

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java

@ -1,10 +1,13 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 会议记录服务类
@ -41,4 +44,12 @@ public interface IConferenceRecordService extends IService<ConferenceRecordEntit
* @return 会议记录表VO类
*/
ConferenceRecordDetailVO getConferenceRecordDetailById(Long id);
/**
* 会议记录分页
* @param param 入参
* @param query 分页类
* @return 会议记录数据
*/
IPage<ConferenceRecordEntity> recordPage(Map<String, Object> param, Query query);
}

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java

@ -85,4 +85,11 @@ public interface IHygienePlanService extends IService<HygienePlanEntity> {
* @return 卫生自查计划数据
*/
List<HygienePlanEntity> getWaitingHygienePlanInTimeRange(String startTime, String endTime);
/**
* 卫生自查计划数据导出
* @param param 入参
* @param response 响应类
*/
void exportHygienePlanData(Map<String, Object> param, HttpServletResponse response);
}

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java

@ -1,10 +1,13 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 演练记录服务类
@ -48,4 +51,12 @@ public interface IRehearsalRecordService extends IService<RehearsalRecordEntity>
* @return 演练记录表VO类
*/
RehearsalRecordDetailVO getRecordDetailVOById(Long id);
/**
* 演练记录分页
* @param param 入参
* @param query 分页类
* @return 演练记录数据
*/
IPage<RehearsalRecordEntity> rehearsalRecordPage(Map<String, Object> param, Query query);
}

39
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java

@ -0,0 +1,39 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import org.springblade.core.mp.support.Query;
import java.util.Map;
/**
* 特种设备检验记录服务类
*
* @author liwen
* @date 2024-01-22
*/
public interface ISpecialDeviceInspectionService extends IService<SpecialDeviceInspectionEntity> {
/**
* 新增设备检验记录
* @param specialDeviceInspectionEntity 特种设备检验记录实体类
* @return true-成功false-失败
*/
boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity);
/**
* 修改设备检验记录
* @param specialDeviceInspectionEntity 特种设备检验记录实体类
* @return true-成功false-失败
*/
boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity);
/**
* 设备检验记录分页
* @param param 入参
* @param query 分页类
* @return 设备检验记录数据
*/
IPage<SpecialDeviceInspectionEntity> getInspectionPage(Map<String, Object> param, Query query);
}

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java → hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java

@ -1,7 +1,7 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import java.util.List;
@ -11,12 +11,12 @@ import java.util.List;
* @author liwen
* @date 2024-01-12
*/
public interface IDeviceService extends IService<DeviceEntity> {
public interface ISpecialDeviceService extends IService<SpecialDeviceEntity> {
/**
* 查找时间范围内的过期设备
* @param startTime 开始时间
* @param endTime 结束时间
*/
List<DeviceEntity> getExpiredDeviceByTime(String startTime, String endTime);
List<SpecialDeviceEntity> getExpiredDeviceByTime(String startTime, String endTime);
}

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java

@ -18,6 +18,7 @@ import com.hnac.hzims.safeproduct.service.IConferencePlanService;
import com.hnac.hzims.safeproduct.service.IConferenceRecordService;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -89,7 +90,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl<ConferencePlanMapper,
String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime"));
List<ConferenceExportDTO> conferenceList = getConferenceByUnitAndDate(unit, startTime, endTime);
// 处理会议数据信息
// 数据处理
conferenceList.forEach(conference -> {
// 会议方式
String method;
@ -111,6 +112,9 @@ public class ConferencePlanServiceImpl extends ServiceImpl<ConferencePlanMapper,
status = ConferenceStatusEnum.FINISHED.getDesc();
}
conference.setConferenceStatus(status);
// 时间格式
conference.setStartTime(DateUtil.format(conference.getScheduledStartTime(), DateUtil.PATTERN_DATE));
conference.setEndTime(DateUtil.format(conference.getScheduledEndTime(), DateUtil.PATTERN_DATE));
});
// 设置响应头
// URLEncoder.encode防止中文乱码

60
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java

@ -1,9 +1,13 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
@ -14,11 +18,14 @@ import com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper;
import com.hnac.hzims.safeproduct.service.IConferenceRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO;
import org.springblade.core.mp.support.Query;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -60,14 +67,16 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
/**
* 新增会议记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveRecord(ConferenceRecordEntity conferenceRecord) {
// 获取当月时间(yyyymm)
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 获取当月时间
String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号
String lastCode = getLastCode(currentMonth);
String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号
String code = BaseUtil.getUniqueCode("HYJL", lastCode, currentMonth);
String code = BaseUtil.getUniqueCode("HYJL", lastCode, currentSimpleMonth);
conferenceRecord.setCode(code);
boolean save = this.save(conferenceRecord);
// 若会议记录新增成功,修改会议计划状态为已完成
@ -85,7 +94,8 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
@Override
public void exportConferenceRecordData(Long id, HttpServletResponse response) {
ConferenceRecordDetailVO conferenceRecordDetailVO = this.getConferenceRecordDetailById(id);
// 会议方式字段
// 数据处理
// 会议方式
String conferenceMethod = conferenceRecordDetailVO.getConferenceMethod();
if (conferenceMethod.equals(ConferenceMethodEnum.MIXED.getValue())) {
conferenceRecordDetailVO.setConferenceMethod(ConferenceMethodEnum.MIXED.getDesc());
@ -94,6 +104,21 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
} else {
conferenceRecordDetailVO.setConferenceMethod(ConferenceMethodEnum.OFFLINE.getDesc());
}
// 表头年月
String code = conferenceRecordDetailVO.getCode();
conferenceRecordDetailVO.setYear(code.substring(4, 8));
conferenceRecordDetailVO.setMonth(code.substring(8, 10));
// 图片
if (StringUtils.isNotEmpty(conferenceRecordDetailVO.getImgPath())) {
String[] imgArr = conferenceRecordDetailVO.getImgPath().split(",");
List<ImageEntity> list = new ArrayList<>();
for (String img : imgArr) {
ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath +
BaseUtil.downloadFileByUrl(img, savePath)), 180, 150);
list.add(imageEntity);
}
conferenceRecordDetailVO.setImages(list);
}
Map<String, Object> params = BaseUtil.obj2Map(conferenceRecordDetailVO);
String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX;
@ -110,13 +135,34 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
}
/**
* 会议记录分页
*/
@Override
public IPage<ConferenceRecordEntity> recordPage(Map<String, Object> param, Query query) {
QueryWrapper<ConferenceRecordEntity> queryWrapper = new QueryWrapper<>();
String conferencePlanId = String.valueOf(param.get("conferencePlanId"));
String startTime = String.valueOf(param.get("actualStartTime"));
String endTime = String.valueOf((param.get("actualEndTime")));
if (!conferencePlanId.equals("null") && !conferencePlanId.equals("")) {
queryWrapper.lambda().eq(ConferenceRecordEntity::getConferencePlanId, conferencePlanId);
}
if (!startTime.equals("null") && !startTime.equals("")) {
queryWrapper.lambda().ge(ConferenceRecordEntity::getActualStartTime, startTime);
}
if (!endTime.equals("null") && !endTime.equals("")) {
queryWrapper.lambda().le(ConferenceRecordEntity::getActualEndTime, endTime);
}
queryWrapper.lambda().orderByDesc(ConferenceRecordEntity::getCreateTime);
return this.page(Condition.getPage(query), queryWrapper);
}
/**
* 查询是否存在同月编号
* @param currentMonth 当月
* @return 存在则返回上一编号否则返回null
*/
private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2);
List<ConferenceRecordEntity> list = getConferenceByMonth(month);
List<ConferenceRecordEntity> list = getConferenceByMonth(currentMonth);
if (CollectionUtils.isEmpty(list)) {
return null;
}

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java

@ -1,33 +0,0 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.DeviceMapper;
import com.hnac.hzims.safeproduct.service.IDeviceService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 特种设备服务实现类
*
* @author liwen
* @date 2024-01-12
*/
@Service
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, DeviceEntity> implements IDeviceService {
/**
* 查找时间范围内的过期设备
*/
@Override
public List<DeviceEntity> getExpiredDeviceByTime(String startTime, String endTime) {
QueryWrapper<DeviceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(DeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue())
.ge(DeviceEntity::getInspectionNextTime, startTime)
.le(DeviceEntity::getInspectionNextTime, endTime);
return this.list(queryWrapper);
}
}

110
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java

@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -125,10 +126,7 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
}
String[] scores = zone.getCheckItemScore().split(",|,");
// 校验检查项总成绩是否为标准总成绩
R res = getSumScore(scores, hygienePlanDTO.getStandardScore());
if (!res.isSuccess()) {
return res;
}
getSumScore(scores, hygienePlanDTO.getStandardScore());
}
// 校验通过则批量新增责任区数据
return R.status(hygieneZoneService.saveBatch(zoneList));
@ -139,6 +137,7 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
/**
* 修改卫生自查计划
*/
@Transactional(rollbackFor = Exception.class)
@Override
public R updatePlan(HygienePlanDTO hygienePlanDTO) {
// 重名校验
@ -159,10 +158,7 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
for (HygieneZoneEntity zone : zoneList) {
String[] scores = zone.getCheckItemScore().split(",|,");
// 校验检查项总成绩是否为标准总成绩
R res = getSumScore(scores, hygienePlanDTO.getStandardScore());
if (!res.isSuccess()) {
return res;
}
getSumScore(scores, hygienePlanDTO.getStandardScore());
}
// 校验通过则批量修改责任区数据
return R.status(hygieneZoneService.updateBatchById(zoneList));
@ -217,17 +213,18 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
* 计算累计分值
* @param scores 各项分值
* @param standardScore 标准总分值
* @return 累计分值等于标准总分值时返回数据否则返回错误信息
*/
private R getSumScore(String[] scores, Integer standardScore) {
private void getSumScore(String[] scores, Integer standardScore) {
int sum = 0;
for (String score : scores) {
sum += Integer.parseInt(score);
if (sum > standardScore) {
return R.fail("累计分值超过标准总分值");
throw new ServiceException("累计分值超过标准总分值");
}
}
return sum < standardScore ? R.fail("标准总分值未全部分配") : R.data(sum);
if (sum < standardScore) {
throw new ServiceException("标准总分值未全部分配");
}
}
/**
@ -297,4 +294,93 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
.le(HygienePlanEntity::getScheduledEndTime, endTime);
return this.list(queryWrapper);
}
/**
* 卫生自查计划数据导出
*/
@Override
public void exportHygienePlanData(Map<String, Object> param, HttpServletResponse response) {
ServletOutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
String unit = String.valueOf(param.get("unit"));
String name = String.valueOf(param.get("name"));
String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime"));
List<HygienePlanEntity> hygienePlanList = getHygienePlanByUnitNameAndTime(unit, name, startTime, endTime);
// 数据处理
hygienePlanList.forEach(plan -> {
// 卫生自查状态
String status;
if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.WAITING.getValue())) {
status = HygieneStatusEnum.WAITING.getDesc();
} else if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.UNFINISHED.getValue())) {
status = HygieneStatusEnum.UNFINISHED.getDesc();
} else {
status = HygieneStatusEnum.FINISHED.getDesc();
}
plan.setHygienePlanStatus(status);
// 时间格式
plan.setStartTime(DateUtil.format(plan.getScheduledStartTime(), DateUtil.PATTERN_DATE));
plan.setEndTime(DateUtil.format(plan.getScheduledEndTime(), DateUtil.PATTERN_DATE));
});
// 设置响应头
// URLEncoder.encode防止中文乱码
String fileName = URLEncoder.encode("卫生自查计划表", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
// ExcelWriter初始化
ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream())
.autoCloseStream(Boolean.TRUE)
.registerConverter(new LongStringConverter())
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25))
.build();
WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查计划表").head(HygienePlanEntity.class)
.build();
excelWriter.write(hygienePlanList, writeSheet);
excelWriter.finish();
} catch (Exception e) {
// 重置response
response.reset();
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
throw new ServiceException("卫生自查计划表数据导出异常: " + e.getMessage());
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error("卫生自查计划表数据导出输出流关闭异常: " + e.getMessage());
}
}
}
}
/**
* 根据单位名称时间查询卫生自查计划
* @param unit 单位
* @param name 名称
* @param startTime 开始时间
* @param endTime 结束时间
* @return 卫生自查计划数据
*/
private List<HygienePlanEntity> getHygienePlanByUnitNameAndTime(String unit, String name, String startTime, String endTime) {
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
if (!unit.equals("null") && !unit.equals("")) {
queryWrapper.lambda().like(HygienePlanEntity::getUnit, unit);
}
if (!name.equals("null") && !name.equals("")) {
queryWrapper.lambda().like(HygienePlanEntity::getName, name);
}
if (!startTime.equals("null") && !startTime.equals("")) {
queryWrapper.lambda().ge(HygienePlanEntity::getScheduledStartTime, startTime);
}
if (!endTime.equals("null") && !endTime.equals("")) {
queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime);
}
queryWrapper.lambda().orderByDesc(HygienePlanEntity::getCreateTime);
return this.list(queryWrapper);
}
}

17
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

@ -20,12 +20,14 @@ import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO;
import com.hnac.hzims.safeproduct.vo.HygieneZoneDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@ -73,17 +75,19 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
/**
* 新增卫生自查记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public R saveRecord(HygieneRecordDTO hygieneRecordDTO) {
HygieneRecordEntity hygieneRecordEntity = new HygieneRecordEntity();
BeanUtils.copyProperties(hygieneRecordDTO, hygieneRecordEntity);
// 编码生成
// 获取当月时间(yyyymm)
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 获取当月时间
String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号
String lastCode = getLastCode(currentMonth);
String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号
String code = BaseUtil.getUniqueCode("WSZC", lastCode, currentMonth);
String code = BaseUtil.getUniqueCode("WSZC", lastCode, currentSimpleMonth);
hygieneRecordEntity.setCode(code);
// 周数计算
int weekNum = getWeekNum(hygieneRecordEntity.getActualEndTime());
@ -94,7 +98,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
for (String score : scores) {
int sc = Integer.parseInt(score);
if (sc > hygienePlanEntity.getStandardScore()) {
return R.fail("评分不能大于标准总分值");
throw new ServiceException("评分不能大于标准总分值");
}
}
boolean save = this.save(hygieneRecordEntity);
@ -178,8 +182,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
* @return 存在则返回上一编号否则返回null
*/
private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2);
List<HygieneRecordEntity> list = getHygieneByMonth(month);
List<HygieneRecordEntity> list = getHygieneByMonth(currentMonth);
if (CollectionUtils.isEmpty(list)) {
return null;
}

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

@ -21,6 +21,7 @@ import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -45,8 +46,7 @@ import java.util.stream.Collectors;
* @date 2023-12-27
*/
@Service
public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, RehearsalPlanEntity>
implements IRehearsalPlanService {
public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, RehearsalPlanEntity> implements IRehearsalPlanService {
@Autowired
IRehearsalRecordService rehearsalRecordService;
@ -190,8 +190,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime"));
List<RehearsalExportDTO> rehearsalList = getRehearsalByUnitAndDate(unit, startTime, endTime);
// 处理演练状态信息
// 数据处理
rehearsalList.forEach(record -> {
// 演练状态
String status;
if (record.getRehearsalStatus().equals(RehearsalStatusEnum.WAITING.getValue())) {
status = RehearsalStatusEnum.WAITING.getDesc();
@ -201,6 +202,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
status = RehearsalStatusEnum.FINISHED.getDesc();
}
record.setRehearsalStatus(status);
// 时间格式
record.setStartTime(DateUtil.format(record.getScheduledStartTime(), DateUtil.PATTERN_DATE));
record.setEndTime(DateUtil.format(record.getScheduledEndTime(), DateUtil.PATTERN_DATE));
});
// 设置响应头
// URLEncoder.encode防止中文乱码

46
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -1,10 +1,13 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
@ -16,8 +19,10 @@ import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Query;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@ -43,6 +48,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
/**
* 新增演练
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveRehearsalRecord(RehearsalRecordEntity rehearsalRecord) {
// 获取当月时间
@ -132,7 +138,23 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
@Override
public void exportRehearsalRecordData(Long id, HttpServletResponse response) {
RehearsalRecordDetailVO rehearsalRecordDetailVO = this.getRecordDetailVOById(id);
// 演练方式字段
// 数据处理
// 图片
if (StringUtils.isNotEmpty(rehearsalRecordDetailVO.getImgPath())) {
String[] imgArr = rehearsalRecordDetailVO.getImgPath().split(",");
List<ImageEntity> list = new ArrayList<>();
for (String img : imgArr) {
ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath +
BaseUtil.downloadFileByUrl(img, savePath)), 180, 150);
list.add(imageEntity);
}
rehearsalRecordDetailVO.setImages(list);
}
// 表头年月
String code = rehearsalRecordDetailVO.getCode();
rehearsalRecordDetailVO.setYear(code.substring(4, 8));
rehearsalRecordDetailVO.setMonth(code.substring(8, 10));
// 演练方式
String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod();
if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) {
rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc());
@ -155,4 +177,26 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
public RehearsalRecordDetailVO getRecordDetailVOById(Long id) {
return baseMapper.getRecordDetailVOById(id);
}
/**
* 演练记录分页
*/
@Override
public IPage<RehearsalRecordEntity> rehearsalRecordPage(Map<String, Object> param, Query query) {
QueryWrapper<RehearsalRecordEntity> queryWrapper = new QueryWrapper<>();
String rehearsalPlanId = String.valueOf(param.get("rehearsalPlanId"));
String actualStartTime = String.valueOf(param.get("actualStartTime"));
String actualEndTime = String.valueOf(param.get("actualEndTime"));
if (!rehearsalPlanId.equals("null") && !rehearsalPlanId.equals("")) {
queryWrapper.lambda().eq(RehearsalRecordEntity::getRehearsalPlanId, rehearsalPlanId);
}
if (!actualStartTime.equals("null") && !actualStartTime.equals("")) {
queryWrapper.lambda().ge(RehearsalRecordEntity::getActualStartTime, actualStartTime);
}
if (!actualEndTime.equals("null") && !actualEndTime.equals("")) {
queryWrapper.lambda().le(RehearsalRecordEntity::getActualEndTime, actualEndTime);
}
queryWrapper.lambda().orderByDesc(RehearsalRecordEntity::getCreateTime);
return this.page(Condition.getPage(query), queryWrapper);
}
}

79
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java

@ -0,0 +1,79 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.SpecialDeviceInspectionMapper;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceService;
import org.springblade.core.mp.support.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
/**
* 特种设备检验记录服务实现类
*
* @author liwen
* @date 2024-01-22
*/
@Service
public class SpecialDeviceInspectionServiceImpl extends ServiceImpl<SpecialDeviceInspectionMapper, SpecialDeviceInspectionEntity> implements ISpecialDeviceInspectionService {
@Autowired
ISpecialDeviceService deviceService;
/**
* 新增设备检验记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) {
boolean save = this.save(specialDeviceInspectionEntity);
if (save) {
SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId());
if (specialDeviceEntity != null) {
specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime());
specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime());
specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime());
specialDeviceEntity.setDeviceStatus(DeviceStatusEnum.NORMAL.getValue());
return deviceService.updateById(specialDeviceEntity);
}
}
return false;
}
/**
* 修改设备检验记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) {
boolean update = this.updateById(specialDeviceInspectionEntity);
if (update) {
SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId());
if (specialDeviceEntity != null) {
specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime());
specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime());
specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime());
return deviceService.updateById(specialDeviceEntity);
}
}
return false;
}
/**
* 设备检验记录分页
*/
@Override
public IPage<SpecialDeviceInspectionEntity> getInspectionPage(Map<String, Object> param, Query query) {
IPage<SpecialDeviceInspectionEntity> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getInspectionPage(page, param);
}
}

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java

@ -0,0 +1,33 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.SpecialDeviceMapper;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 特种设备服务实现类
*
* @author liwen
* @date 2024-01-12
*/
@Service
public class SpecialDeviceServiceImpl extends ServiceImpl<SpecialDeviceMapper, SpecialDeviceEntity> implements ISpecialDeviceService {
/**
* 查找时间范围内的过期设备
*/
@Override
public List<SpecialDeviceEntity> getExpiredDeviceByTime(String startTime, String endTime) {
QueryWrapper<SpecialDeviceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SpecialDeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue())
.ge(SpecialDeviceEntity::getInspectionNextTime, startTime)
.le(SpecialDeviceEntity::getInspectionNextTime, endTime);
return this.list(queryWrapper);
}
}

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java

@ -87,6 +87,7 @@ public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> impleme
/**
* 删除关联考试记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeRelativeTest(Long trainRecordId) {
// 查询关联考试记录

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java

@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO;
import com.hnac.hzims.safeproduct.vo.TrainYearVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -194,7 +195,7 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime"));
List<TrainPlanEntity> trainPlanList = getTrainPlanByUnitAndDate(unit, startTime, endTime);
// 处理字段信息
// 数据处理
trainPlanList.forEach(train -> {
// 培训状态
String status;
@ -209,6 +210,9 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
// 是否考试
String isTest = train.getIsTest().equals(SafeProductConstant.TRAIN_PLAN_HAS_TEST) ? "是" : "否";
train.setHasTest(isTest);
// 时间格式
train.setStartTime(DateUtil.format(train.getScheduledStartTime(), DateUtil.PATTERN_DATE));
train.setEndTime(DateUtil.format(train.getScheduledEndTime(), DateUtil.PATTERN_DATE));
});
// 设置响应头
// URLEncoder.encode防止中文乱码

21
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

@ -1,9 +1,11 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
@ -23,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -136,7 +139,8 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
@Override
public void exportTrainRecordData(Long id, HttpServletResponse response) {
TrainRecordDetailVO trainRecordDetailVO = this.getTrainRecordDetailById(id);
// 培训方式字段
// 数据处理
// 培训方式
String trainMethod = trainRecordDetailVO.getTrainMethod();
if (trainMethod.equals(TrainMethodEnum.MIXED.getValue())) {
trainRecordDetailVO.setTrainMethod(TrainMethodEnum.MIXED.getDesc());
@ -145,6 +149,21 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
} else {
trainRecordDetailVO.setTrainMethod(TrainMethodEnum.OFFLINE.getDesc());
}
// 图片
if (StringUtils.isNotEmpty(trainRecordDetailVO.getImgPath())) {
String[] imgArr = trainRecordDetailVO.getImgPath().split(",");
List<ImageEntity> list = new ArrayList<>();
for (String img : imgArr) {
ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath +
BaseUtil.downloadFileByUrl(img, savePath)), 180, 150);
list.add(imageEntity);
}
trainRecordDetailVO.setImages(list);
}
// 表头年月
String code = trainRecordDetailVO.getCode();
trainRecordDetailVO.setYear(code.substring(4, 8));
trainRecordDetailVO.setMonth(code.substring(8, 10));
Map<String, Object> params = BaseUtil.obj2Map(trainRecordDetailVO);
String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX;

120
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java

@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.utils;
import cn.afterturn.easypoi.word.WordExportUtil;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.ticket.annotation.DateTimeToMap;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
@ -13,10 +13,12 @@ import org.springblade.core.tool.utils.ObjectUtil;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 公用工具类
@ -156,8 +158,8 @@ public class BaseUtil {
* @return map参数
*/
public static Map<String, Object> obj2Map(Object obj) {
Map<String, Object> result = new HashMap<>();
if (ObjectUtil.isNotEmpty(obj) && null != obj.getClass()) {
Map<String, Object> result = new HashMap<>();
List<Field> fieldList = new ArrayList<>();
Class<?> clazz = obj.getClass();
while (clazz != null) {
@ -172,59 +174,81 @@ public class BaseUtil {
} catch (IllegalAccessException e) {
throw new ServiceException("获取属性性出错");
}
if (value instanceof List) {
List<Map<String, Object>> list = ((List<?>) value).stream().map(BaseUtil::obj2Map).collect(Collectors.toList());
result.put(field.getName(),list);
}
else if (value instanceof LocalDateTime) {
DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class);
LocalDateTime time = (LocalDateTime) value;
if(ObjectUtil.isEmpty(dateTimeToMap)) {
result.put(field.getName(),time.format(DateUtil.TIME_FORMATTER));
}
else {
result.putAll(LocalDateConvertMap(time,dateTimeToMap.prefix(),dateTimeToMap.split()));
}
if (value instanceof LocalDateTime) {
value = DateUtil.format((LocalDateTime) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE);
}
else if (value instanceof Date) {
DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class);
Date time = (Date) value;
if (ObjectUtil.isEmpty(dateTimeToMap)) {
result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME));
}
else {
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year", time.getYear());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month", time.getMonth());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day", time.getDay());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour", time.getHours());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minuter", time.getMinutes());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second", time.getSeconds());
}
}
else {
result.put(field.getName(),value);
value = DateUtil.format((Date) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE);
}
result.put(field.getName(),value);
});
return result;
}
return null;
return result;
}
/**
* 图片转字节
* @param tempImgPath 图片路径
* @return 图片字节
*/
public static byte[] imgToByte(String tempImgPath) {
File file = new File(tempImgPath);
byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
byte[] b = new byte[1000];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (IOException e) {
log.error(e.getMessage());
}
//删除临时文件
file.delete();
return buffer;
}
/**
* 将时间按格式转化为map对象
* @param dateTime 待转换时间
* @param prefix 转换格式Key前缀
* @param split 转换格式Key分隔符
* @return map对象
* 下载文件
* @param fileUrl 文件路径
* @param downloadFileDir 下载路径
* @return 下载文件路径
*/
public static Map<String, Object> LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) {
return new HashMap<String, Object>() {{
put(prefix + split + "year", dateTime.getYear());
put(prefix + split + "month", dateTime.getMonthValue());
put(prefix + split + "day", dateTime.getDayOfMonth());
put(prefix + split + "hour", dateTime.getHour());
put(prefix + split + "minuter", dateTime.getMinute());
put(prefix + split + "second", dateTime.getSecond());
}};
public static String downloadFileByUrl(String fileUrl, String downloadFileDir){
URL url;
String fileName = null;
try {
url = new URL(fileUrl);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.connect();
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
InputStream inputStream = connection.getInputStream();
int lastSlashIndex = fileUrl.lastIndexOf("/");
if (lastSlashIndex > 0) {
fileName = fileUrl.substring(lastSlashIndex+1);
String filePath = downloadFileDir + fileName;
File file = new File(filePath);
if (file.exists()){
file.delete();
}
OutputStream outputStream = Files.newOutputStream(file.toPath());
// 将文件流拷贝到本地处理
IOUtils.copy(inputStream, outputStream);
} else {
throw new ServiceException("下载文件路径异常:" + downloadFileDir);
}
}
} catch (Exception e) {
throw new ServiceException("文件图片下载失败!");
}
return fileName;
}
}

BIN
hzims-service/safeproduct/src/main/resources/template/会议记录表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/培训记录表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/演练记录表.docx

Binary file not shown.

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -303,11 +303,16 @@ public class OperationTicketServiceImpl implements OperationTicketService {
String taskId = response.getTaskId();
log.info("StringUtils.isBlank(taskId) = " + StringUtils.isBlank(taskId));
if (StringUtils.isBlank(taskId)) {
newStandardTicketInfoEntity.setFlowDescription("结束");
newStandardTicketInfoEntity.setFlowTaskId(" ");
newStandardTicketInfoEntity.setFlowTaskName("结束");
newStandardTicketInfoEntity.setNextStepOperator(" ");
newStandardTicketInfoEntity.setFlowStatus(999);
if (newStandardTicketInfoEntity.equals(TicketConstants.OPERATION_TICKET_APPROVED)) {
newStandardTicketInfoEntity.setFlowDescription("结束");
newStandardTicketInfoEntity.setFlowTaskId(" ");
newStandardTicketInfoEntity.setFlowTaskName("结束");
newStandardTicketInfoEntity.setNextStepOperator(" ");
newStandardTicketInfoEntity.setFlowStatus(999);
} else {
newStandardTicketInfoEntity.setFlowDescription("作废");
newStandardTicketInfoEntity.setFlowTaskName("作废");
}
} else {
//如果response.getHandleType() 是0使用户
newStandardTicketInfoEntity.setFlowUserId(response.getUserId());

48
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java

@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.twoTicket.vo.operation;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
@ -17,22 +18,19 @@ import java.util.List;
* @Date 2023/6/6 15:39
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("票据类型")
private String ticketType;
@ApiModelProperty("单位")
private String company;
@ApiModelProperty("工作流ID")
private String processInstanceId;
@ApiModelProperty("编号")
private String code;
@ -97,7 +95,6 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("是否评价")
private Integer isEvaluate;
/**
* AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性
* 站点标识-两票编码
@ -105,70 +102,33 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("站点标识-两票编码")
private String signage;
/**
* 项目
*/
@ApiModelProperty("项目")
private String projectName;
/**
*
*/
@ApiModelProperty("分组")
private String classGroupName;
/**
* 编号原站点ID
*/
@ApiModelProperty("编号(原站点ID)")
private String signageCode;
/**
* 流程状态'
*/
@ApiModelProperty("流程状态")
private Integer flowStatus;
/**
* 流程描述
*/
@ApiModelProperty("流程描述")
private String flowDescription;
/**
* 下一个审批人
*/
@ApiModelProperty("下一个审批人")
private String nextStepOperator;
/**
* 用户Id
*/
@ApiModelProperty("用户Id")
private String flowUserId;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskName;
/**
* 当前任务名
*/
@ApiModelProperty("当前任务名")
private String flowTaskId;
@ApiModelProperty("创建人名称")
private String createUserName;
@ -190,8 +150,6 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("许可人名称")
private String guardianName;
/**
* 安全措施
*/
@ApiModelProperty("安全措施")
private List<StandardTicketMeasureVo> standardTicketMeasureVos;
}

6
hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
<process id="offlineWorkTicket1" name="线下工作票审批流程" isExecutable="true">
<process id="offlineWorkTicket" name="线下工作票审批流程" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-194BD702-29AE-4DA6-A343-05464D12BB83" name="签发人签发" flowable:candidateGroups="signer">
<extensionElements>
@ -60,8 +60,8 @@
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${signFlag==true}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_offlineWorkTicket1">
<bpmndi:BPMNPlane bpmnElement="offlineWorkTicket1" id="BPMNPlane_offlineWorkTicket1">
<bpmndi:BPMNDiagram id="BPMNDiagram_offlineWorkTicket">
<bpmndi:BPMNPlane bpmnElement="offlineWorkTicket" id="BPMNPlane_offlineWorkTicket">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="74.99999888241292" y="359.999994635582"></omgdc:Bounds>
</bpmndi:BPMNShape>

Loading…
Cancel
Save