Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 11 months ago
parent
commit
e97e494681
  1. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java
  2. 9
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java
  3. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java
  4. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java
  5. 1
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java
  6. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java
  7. 68
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java
  8. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  9. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  10. 5
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java
  11. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java
  12. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java
  13. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java
  14. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java
  15. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java
  16. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java
  17. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java
  18. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java
  19. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java
  20. 55
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java
  21. 22
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java
  22. 21
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java
  23. 101
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java
  24. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  25. 12
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java
  26. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  27. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java
  28. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java
  29. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java
  30. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java
  31. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java
  32. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
  33. 30
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java
  34. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
  35. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java
  36. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java
  37. 76
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java
  38. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  39. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  40. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  41. 39
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java
  42. 41
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java
  43. 39
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java
  44. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java
  45. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  46. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml
  47. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java
  48. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml
  49. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java
  50. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml
  51. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  52. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  53. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java
  54. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.xml
  55. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  56. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  57. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarService.java
  58. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java
  59. 17
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java
  60. 22
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java
  61. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  62. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java
  63. 13
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java
  64. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITestScoreService.java
  65. 13
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java
  66. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  67. 19
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  68. 59
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  69. 26
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java
  70. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java
  71. 38
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java
  72. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java
  73. 13
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  74. 66
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java
  75. 44
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  76. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java
  77. 90
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java
  78. 57
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  79. 340
      hzims-service/safeproduct/src/main/resources/db/1.0.1.sql
  80. 364
      hzims-service/safeproduct/src/main/resources/db/1.0.2.sql
  81. BIN
      hzims-service/safeproduct/src/main/resources/template/会议记录表.docx
  82. BIN
      hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx
  83. BIN
      hzims-service/safeproduct/src/main/resources/template/培训记录表.docx
  84. BIN
      hzims-service/safeproduct/src/main/resources/template/演练记录表.docx
  85. BIN
      hzims-service/safeproduct/src/main/resources/template/用车记录单.docx
  86. BIN
      hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx
  87. BIN
      hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx
  88. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java
  89. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/WorkTaskMapper.java
  90. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/WorkTaskMapper.xml
  91. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java
  92. 267
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java
  93. BIN
      hzims-service/ticket/src/main/resources/template/excel/work_task_template.xlsx

8
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java

@ -2,18 +2,20 @@ package com.hnac.hzims.operational.fill.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("hzims_fill_rainfall")
@ApiModel(value="RainfallEntity", description="水利降雨量填报")

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

@ -13,6 +13,15 @@ public interface SafeProductConstant {
int SUCCESS = 1;
int FAILURE = 0;
/**
* 文件后缀
*/
String DOCX_SUFFIX = ".docx";
String PDF_SUFFIX = ".pdf";
/**
* 培训管理
*/
int TRAIN_PLAN_HAS_TEST = 1;
int TRAIN_PLAN_HAS_NO_TEST = 0;
}

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java

@ -1,10 +1,12 @@
package com.hnac.hzims.safeproduct.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
@ -21,10 +23,12 @@ public class CarMaintenanceConfirmationDTO {
private Long carMaintenanceId;
@NotNull
@Size(max = 500, message = "车辆管理人意见长度不能超过500")
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("下次维保时间")
private Date maintenanceNextTime;

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

@ -46,6 +46,6 @@ public class ConferenceExportDTO {
private String host;
@ApiModelProperty("会议状态")
@ExcelProperty(value = "会议状态", index = 9)
@ExcelProperty(value = "会议状态", index = 7)
private String conferenceStatus;
}

1
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java

@ -1,6 +1,5 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java

@ -55,10 +55,10 @@ public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("出车公里数")
private BigDecimal startMiles;
@NotNull
@ApiModelProperty("收车公里数")
private BigDecimal endMiles;
@NotNull
@ApiModelProperty("行驶公里数")
private BigDecimal miles;

68
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java

@ -0,0 +1,68 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_device")
@ApiModel(value = "特种设备实体类")
public class DeviceEntity extends BaseEntity {
@Size(max = 50, message = "设备名称长度不能超过50")
@ApiModelProperty("设备名称")
private String name;
@Size(max = 50, message = "规格型号长度不能超过50")
@ApiModelProperty("规格型号")
private String type;
@Size(max = 50, message = "设备编码长度不能超过50")
@ApiModelProperty("设备编码")
private String code;
@Size(max = 255, message = "产品合格证号长度不能超过255")
@ApiModelProperty("产品合格证号")
private String qualityCertificateNo;
@ApiModelProperty("生产日期")
private Date productionTime;
@ApiModelProperty("使用时间")
private Date usedTime;
@Size(max = 255, message = "使用地点长度不能超过255")
@ApiModelProperty("使用地点")
private String usedLocation;
@ApiModelProperty("检验周期")
private Integer inspectionPeriod;
@ApiModelProperty("本次检验日期")
private Date inspectionCurrentTime;
@ApiModelProperty("下次检验日期")
private Date inspectionNextTime;
@ApiModelProperty("上次检验日期")
private Date inspectionLastTime;
@Size(max = 50, message = "设备管理人长度不能超过50")
@ApiModelProperty("设备管理人")
private String manager;
@Size(max = 20, message = "设备状态长度不能超过20")
@ApiModelProperty("设备状态")
private String deviceStatus;
}

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

@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@ -21,9 +22,11 @@ import java.util.Date;
@ApiModel(value = "卫生自查计划实体类")
public class HygienePlanEntity extends BaseEntity {
@Size(max = 50, message = "计划名称字段长度不能超过50")
@ApiModelProperty("计划名称")
private String name;
@Size(max = 50, message = "单位字段长度不能超过50")
@ApiModelProperty("单位")
private String unit;

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

@ -39,9 +39,11 @@ public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("实际结束时间")
private Date actualEndTime;
@Size(max = 20, message = "检查人字段长度不能超过20")
@ApiModelProperty("检查人")
private String checkUser;
@Size(max = 1000, message = "责任区id字段长度不能超过1000")
@ApiModelProperty("责任区id")
private String hygieneZoneIds;

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

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Size;
/**
* @author liwen
* @date 2024-01-02
@ -20,15 +22,18 @@ public class HygieneZoneEntity extends BaseEntity {
@ApiModelProperty("卫生自查计划id")
private Long hygienePlanId;
@Size(max = 50, message = "责任区字段长度不能超过50")
@ApiModelProperty("责任区")
private String zone;
@Size(max = 20, message = "责任人字段长度不能超过20")
@ApiModelProperty("责任人")
private String principal;
@ApiModelProperty("检查项")
private String checkItem;
@Size(max = 255, message = "检查项分值字段长度不能超过255")
@ApiModelProperty("检查项分值")
private String checkItemScore;
}

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

@ -1,7 +1,5 @@
package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -18,7 +16,6 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ExcelIgnoreUnannotated
@TableName("hzims_train_record")
@ApiModel(value = "培训记录实体类")
public class TrainRecordEntity extends BaseEntity {
@ -28,34 +25,27 @@ public class TrainRecordEntity extends BaseEntity {
@Size(max = 50, message = "名称字段长度不能超过50")
@ApiModelProperty("培训记录名称")
@ExcelProperty(value = "培训记录名称", index = 1)
private String trainRecordName;
@Size(max = 50, message = "编码字段长度不能超过50")
@ApiModelProperty("编码")
@ExcelProperty(value = "编码", index = 0)
private String code;
@Size(max = 5000, message = "培训学员字段长度超出限制范围")
@ApiModelProperty("培训学员")
@ExcelProperty(value = "培训学员", index = 3)
private String peopleName;
@ApiModelProperty("培训内容")
@ExcelProperty(value = "培训内容", index = 2)
private String content;
@ApiModelProperty("实际培训开始时间")
@ExcelProperty(value = "实际开始时间", index = 5)
private Date actualStartTime;
@ApiModelProperty("实际培训结束时间")
@ExcelProperty(value = "实际结束时间", index = 6)
private Date actualEndTime;
@Size(max = 250, message = "培训评价字段长度不能超过250")
@ApiModelProperty("培训评价")
@ExcelProperty(value = "培训评价", index = 4)
private String command;
@Size(max = 1000, message = "培训图片字段长度不能超过1000")

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 车辆维保类型枚举类
*
* @author liwen
* @date 2024-01-16
*/
public enum CarMaintenanceTypeEnum {
MAINTAIN("MAINTAIN", "保养"),
REPAIR("REPAIR", "维修");
private final String value;
private final String desc;
CarMaintenanceTypeEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 特种设备状态枚举类
*
* @author liwen
* @date 2024-01-16
*/
public enum DeviceStatusEnum {
NORMAL("NORMAL", "正常"),
EXPIRED("EXPIRED", "待检修");
private final String value;
private final String desc;
DeviceStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

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

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

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
@ -19,6 +20,9 @@ public class CarCheckRecordDetailVO {
@ApiModelProperty("检查人")
private String checker;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("品牌")
private String carBrand;

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

@ -58,4 +58,7 @@ public class CarMaintenanceDetailVO {
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("维保类型")
private String maintenanceType;
}

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

@ -27,6 +27,9 @@ public class CarUsedRecordDetailVO {
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车辆类型")
private String carType;
@ApiModelProperty("车牌号")
private String plateNumber;

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

@ -0,0 +1,55 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-15
*/
@Data
@ApiModel(value = "会议记录表VO类")
public class ConferenceRecordDetailVO {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("会议实际开始时间")
private Date actualStartTime;
@ApiModelProperty("会议实际结束时间")
private Date actualEndTime;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("会议地点")
private String location;
@ApiModelProperty("主持人")
private String host;
@ApiModelProperty("会议方式")
private String conferenceMethod;
@ApiModelProperty("会议主题")
private String theme;
@ApiModelProperty("记录人")
private String recorder;
@ApiModelProperty("参会人员")
private String peopleName;
@ApiModelProperty("会议内容")
private String content;
@ApiModelProperty("会议图片")
private String imgPath;
@ApiModelProperty("会议附件")
private String filePath;
}

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

@ -0,0 +1,55 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-15
*/
@Data
@ApiModel(value = "演练记录表VO类")
public class RehearsalRecordDetailVO {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("参演人员")
private String peopleName;
@ApiModelProperty("演练实际开始时间")
private Date actualStartTime;
@ApiModelProperty("演练实际结束时间")
private Date actualEndTime;
@ApiModelProperty("演练记录")
private String record;
@ApiModelProperty("演练评价")
private String comment;
@ApiModelProperty("演练图片")
private String imgPath;
@ApiModelProperty("演练附件")
private String filePath;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("演练地点")
private String location;
@ApiModelProperty("总指挥")
private String commander;
@ApiModelProperty("演练方式")
private String rehearsalMethod;
@ApiModelProperty("演练科目")
private String subject;
}

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

@ -0,0 +1,55 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-15
*/
@Data
@ApiModel(value = "培训记录表VO类")
public class TrainRecordDetailVO {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("实际培训开始时间")
private Date actualStartTime;
@ApiModelProperty("实际培训结束时间")
private Date actualEndTime;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("培训地点")
private String location;
@ApiModelProperty("培训方式")
private String trainMethod;
@ApiModelProperty("培训讲师")
private String teacher;
@ApiModelProperty("培训课程")
private String lesson;
@ApiModelProperty("培训学员")
private String peopleName;
@ApiModelProperty("培训内容")
private String content;
@ApiModelProperty("培训评价")
private String command;
@ApiModelProperty("培训图片")
private String imgPath;
@ApiModelProperty("培训附件")
private String filePath;
}

22
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java

@ -1,12 +1,19 @@
package com.hnac.hzims.ticket.repair.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -30,7 +37,7 @@ public class WorkTaskEntity extends TenantEntity {
@ApiModelProperty(value = "工作负责人名称")
private String headName;
@ApiModelProperty(value = "工作负责人名称")
@ApiModelProperty(value = "工作负责人处理时间")
private Date headHandleTime;
@ApiModelProperty(value = "班组ID")
@ -45,12 +52,6 @@ public class WorkTaskEntity extends TenantEntity {
@ApiModelProperty(value = "班组成员名称 : 按 “,”分割")
private String memberName;
@ApiModelProperty(value = "签名班组人员ID : 按 “,”分割")
private String signatureMember;
@ApiModelProperty(value = "签名班组成员名称 : 按 “,”分割")
private String signatureMemberName;
@ApiModelProperty(value = "工作计划开始时间")
private Date planStartTime;
@ -78,6 +79,12 @@ public class WorkTaskEntity extends TenantEntity {
@ApiModelProperty(value = "许可时间")
private Date licensorTime;
@ApiModelProperty(value = "工作终结人")
private Long terminator;
@ApiModelProperty(value = "工作终结人名称")
private String terminatorName;
@ApiModelProperty(value = "工作结束时间")
private Date workEndTime;
@ -95,4 +102,5 @@ public class WorkTaskEntity extends TenantEntity {
@ApiModelProperty(value = "创建机构名称")
private String deptName;
}

21
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java

@ -0,0 +1,21 @@
package com.hnac.hzims.ticket.repair.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class WorkTaskContentVO {
@ApiModelProperty(value = "工作地点")
private String location;
@ApiModelProperty(value = "工作内容")
private String content;
@ApiModelProperty(value = "下标")
private Integer $index;
}

101
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java

@ -0,0 +1,101 @@
package com.hnac.hzims.ticket.repair.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class WorkTaskPreviewVO extends WorkTaskEntity {
@ApiModelProperty("创建人")
private Long userId;
@ApiModelProperty("创建部门")
private Long deptId;
@ApiModelProperty("创建时间")
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private Date time;
@ApiModelProperty(value = "单位")
private String company;
@ApiModelProperty(value = "班组成员数量")
private Integer groupCount;
@ApiModelProperty(value = "工作地点")
private String location;
@ApiModelProperty(value = "工作内容")
private String content;
@ApiModelProperty(value = "计划工作时间")
private String planTimeInterval;
@ApiModelProperty(value = "工作派工单签发人")
private String createName;
@ApiModelProperty(value = "签发时间: 年")
private Integer createYear;
@ApiModelProperty(value = "签发时间: 月")
private Integer createMon;
@ApiModelProperty(value = "签发时间: 日")
private Integer createDay;
@ApiModelProperty(value = "签发时间: 时")
private Integer createHour;
@ApiModelProperty(value = "签发时间: 分")
private Integer createMin;
@ApiModelProperty(value = "开票处理时间: 年")
private Integer headYear;
@ApiModelProperty(value = "开票处理时间: 月")
private Integer headMon;
@ApiModelProperty(value = "开票处理时间: 日")
private Integer headDay;
@ApiModelProperty(value = "开票处理时间: 时")
private Integer headHour;
@ApiModelProperty(value = "开票处理时间: 分")
private Integer headMin;
@ApiModelProperty(value = "结束时间: 年")
private Integer endYear;
@ApiModelProperty(value = "结束时间: 月")
private Integer endMon;
@ApiModelProperty(value = "结束时间: 日")
private Integer endDay;
@ApiModelProperty(value = "结束时间: 时")
private Integer endHour;
@ApiModelProperty(value = "结束时间: 分")
private Integer endMin;
@ApiModelProperty(value = "许可时间")
private String licensorExportTime;
}

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java

@ -301,6 +301,7 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
mailMessageDTO.setBusinessClassify("system");
mailMessageDTO.setBusinessKey("Mail");
mailMessageDTO.setSubject("邮件发送");
mailMessageDTO.setContent(name+"websocket链接失败;"+"链接失败次数:"+num);
R<List<User>> res = userClient.userListByRoleAlias("200000", "sendMail");
if (!res.isSuccess()||CollectionUtil.isEmpty(res.getData())){

12
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java

@ -4,9 +4,13 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.repair.fegin.IWorkTaskClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.WORK_TASK;
/**
@ -19,6 +23,8 @@ public class WorkTaskServiceImpl extends ProcessAbstractService {
private final ProcessDictService processDictService;
private final IWorkTaskClient workTaskClient;
/**
* 消息确认-工作任务单
* @param flowQueue
@ -36,9 +42,9 @@ public class WorkTaskServiceImpl extends ProcessAbstractService {
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
/*if (!defect.isSuccess()) {
R<Boolean> workTask = workTaskClient.listener(response);
if (!workTask.isSuccess() || !workTask.getData()) {
throw new ServiceException("检修任务业务执行异常!");
}*/
}
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -1242,7 +1242,7 @@ public class TargetServiceImpl implements TargetService {
detail.setElectric(Double.valueOf(mon.getPower()));
return detail;
}
detail.setElectric((double) (monMap.get(mon.getStrMonth()) + mon.getPower()));
detail.setElectric((double) (Optional.ofNullable(monMap.get(mon.getStrMonth())).orElse(0f) + mon.getPower()));
return detail;
}).collect(Collectors.toList());
}else if(HomePageConstant.MON.equals(type)){

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java

@ -45,6 +45,7 @@ public class GenerateController extends BladeController {
public R saveOrUpdate(@RequestBody GenerateEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 新增
*/

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java

@ -21,6 +21,7 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* @author ysj
@ -40,11 +41,23 @@ public class RainfallController extends BladeController {
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
@ApiOperation(value = "新增", notes = "传入RainfallEntity对象")
public R saveOrUpdate(@RequestBody RainfallEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 批量新增
*/
@PostMapping("/batchSave")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入RainfallEntity对象集合")
public R batchSave(@RequestBody List<RainfallEntity> rains) {
return R.status(service.batchSave(rains));
}
/**
* 删除
*/

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java

@ -20,6 +20,8 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author ysj
* @date 2023/04/10 11:16:07
@ -38,16 +40,26 @@ public class UseController extends BladeController {
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
@ApiOperation(value = "新增", notes = "传入UseEntity对象")
public R saveOrUpdate(@RequestBody UseEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 批量新增
*/
@PostMapping("/batchSave")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "批量新增", notes = "传入UseEntity对象集合")
public R batchSave(@RequestBody List<UseEntity> uses) {
return R.status(service.batchSave(uses));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperationSupport(order = 3)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java

@ -8,14 +8,12 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
import java.util.List;
/**
* 接入电站历史发电量填报
* @author ysj
*/
public interface RainfallService extends BaseService<RainfallEntity> {
@ -24,4 +22,7 @@ public interface RainfallService extends BaseService<RainfallEntity> {
// 新增/修改水利降雨量填报数据
boolean saveUpdate(RainfallEntity entity);
// 批量保存降雨量填补数据
boolean batchSave(List<RainfallEntity> rains);
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java

@ -22,6 +22,9 @@ public interface UseService extends BaseService<UseEntity> {
// 分页查询用电量填报数据
R<IPage<UseVo>> pageCondition(QueryVo filter, Query query);
// 批量报错用电量填报数据
boolean batchSave(List<UseEntity> uses);
// 新增/修改用电量填报数据
boolean saveUpdate(UseEntity entity);

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java

@ -102,8 +102,8 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
//发电量为空的,且有ID的为删除
List<Long> ids = entityList.stream().
filter(s -> ObjectUtil.isEmpty(s.getGenerate()))
.filter(s -> ObjectUtil.isNotEmpty(s.getId()))
.map(GenerateEntity::getId).collect(Collectors.toList());
.map(GenerateEntity::getId)
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
boolean deleteFlag =true;
if (CollectionUtil.isNotEmpty(ids)){
deleteFlag= this.deleteLogic(ids);
@ -178,7 +178,12 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
powerDay.setGenerate(0f);
return powerDay;
}
powerDay.setGenerate((float) records.stream().filter(record->record.getFillDate().equals(day)).mapToDouble(GenerateEntity::getGenerate).sum());
double sum = records.stream().filter(record->record.getFillDate().equals(day)).mapToDouble(GenerateEntity::getGenerate).sum();
if(Math.abs(sum) > 0){
powerDay.setGenerate((float)sum);
}else{
powerDay.setGenerate(0f);
}
return powerDay;
}).collect(Collectors.toList());
}
@ -231,7 +236,12 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
powerMonth.setPower(0f);
return powerMonth;
}
powerMonth.setPower((float) format.stream().filter(o->o.getFillDate().equals(mon)).mapToDouble(GenerateEntity::getGenerate).sum());
double sum = format.stream().filter(o->o.getFillDate().equals(mon)).mapToDouble(GenerateEntity::getGenerate).sum();
if(Math.abs(sum) > 0){
powerMonth.setPower((float)sum);
}else{
powerMonth.setPower(0f);
}
return powerMonth;
}).collect(Collectors.toList());
}

30
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java

@ -3,15 +3,13 @@ package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.entity.StorageEntity;
import com.hnac.hzims.operational.fill.mapper.RainfallMapper;
import com.hnac.hzims.operational.fill.service.RainfallService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.RainfallVo;
import com.hnac.hzims.operational.fill.wrapper.OverWrapper;
import com.hnac.hzims.operational.fill.wrapper.RainfallWrapper;
import com.hnac.hzims.operational.fill.wrapper.StorageWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
@ -19,11 +17,14 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
@ -78,4 +79,27 @@ public class RainFallServiceImpl extends BaseServiceImpl<RainfallMapper, Rainfal
}
return this.updateById(entity);
}
/**
* 批量保存降雨量填补数据
* @param rains
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean batchSave(List<RainfallEntity> rains) {
// 查询填报数据中存在的填报数据
List<RainfallEntity> filleds = this.list(Wrappers.<RainfallEntity>lambdaQuery()
.eq(RainfallEntity::getStationCode,rains.get(0).getStationCode())
.in(RainfallEntity::getFillDate,rains.stream().map(RainfallEntity::getFillDate).collect(Collectors.toList()))
);
// 如果存在就进行删除原来的填报数据
if(CollectionUtil.isNotEmpty(filleds)){
this.deleteLogic(filleds.stream().map(RainfallEntity::getId).collect(Collectors.toList()));
}
// 批量保存填报数据
return this.saveBatch(rains);
}
}

27
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java

@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.fill.entity.PowerEntity;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.mapper.UseMapper;
import com.hnac.hzims.operational.fill.service.UseService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import com.hnac.hzims.operational.fill.wrapper.UseWrapper;
import com.hnac.hzims.operational.main.vo.PowerMonthVo;
import com.hnac.hzims.operational.main.vo.UsrPowerVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -26,6 +23,7 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@ -66,6 +64,29 @@ public class UseServiceImpl extends BaseServiceImpl<UseMapper, UseEntity> implem
}
/**
* 批量报错用电量填报数据
* @param uses
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean batchSave(List<UseEntity> uses) {
// 查询填报数据中存在的填报数据
List<UseEntity> filleds = this.list(Wrappers.<UseEntity>lambdaQuery()
.eq(UseEntity::getStationCode,uses.get(0).getStationCode())
.in(UseEntity::getFillDate,uses.stream().map(UseEntity::getFillDate).collect(Collectors.toList()))
);
// 如果存在就进行删除原来的填报数据
if(CollectionUtil.isNotEmpty(filleds)){
this.deleteLogic(filleds.stream().map(UseEntity::getId).collect(Collectors.toList()));
}
// 批量保存填报数据
return this.saveBatch(uses);
}
/**
* 新增/修改用电量填报数据
* @param entity
* @return

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

@ -252,4 +252,15 @@ public class CarController extends BladeController {
public void exportCarCheckRecordData(@RequestParam Long id, HttpServletResponse response) {
carCheckRecordService.exportCarCheckRecordData(id, response);
}
@GetMapping("/exportCarMilesData")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "year", value = "年份", dataType = "query", paramType = "string")
})
@ApiOperation(value = "导出年度里程数据")
@ApiOperationSupport(order = 27)
public void exportCarMilesData(@ApiIgnore @RequestParam Map<String, Object> param, Query query, HttpServletResponse response) {
carService.exportCarMilesData(param, query, response);
}
}

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

@ -7,6 +7,7 @@ import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.service.IConferencePlanService;
import com.hnac.hzims.safeproduct.service.IConferenceRecordService;
import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -103,8 +104,8 @@ public class ConferenceController extends BladeController {
@GetMapping("/recordDetail")
@ApiOperation(value = "会议记录详情")
@ApiOperationSupport(order = 9)
public R<ConferenceRecordEntity> recordDetail(@RequestParam Long id) {
return R.data(conferenceRecordService.getById(id));
public R<ConferenceRecordDetailVO> recordDetail(@RequestParam Long id) {
return R.data(conferenceRecordService.getConferenceRecordDetailById(id));
}
@GetMapping("/recordPage")
@ -130,4 +131,11 @@ public class ConferenceController extends BladeController {
public void exportConferenceData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
conferencePlanService.exportConferenceData(param, response);
}
@GetMapping("/exportConferenceRecordData")
@ApiOperation(value = "会议记录表导出")
@ApiOperationSupport(order = 12)
public void exportConferenceRecordData(@RequestParam Long id, HttpServletResponse response) {
conferenceRecordService.exportConferenceRecordData(id, response);
}
}

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

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

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

@ -131,11 +131,11 @@ public class HygieneController extends BladeController {
return R.data(page);
}
@GetMapping("/exportHygieneData")
@ApiOperation(value = "卫生自查数据导出")
@GetMapping("/exportHygieneRecordData")
@ApiOperation(value = "卫生自查记录表导出")
@ApiOperationSupport(order = 12)
public void exportHygieneData(@RequestParam Long hygieneRecordId, HttpServletResponse response) {
hygieneRecordService.exportHygieneData(hygieneRecordId, response);
public void exportHygieneRecordData(@RequestParam Long id, HttpServletResponse response) {
hygieneRecordService.exportHygieneRecordData(id, response);
}
@GetMapping("/exportMonthData")

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

@ -7,6 +7,7 @@ import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.service.IRehearsalPlanService;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import io.swagger.annotations.Api;
@ -105,8 +106,8 @@ public class RehearsalController extends BladeController {
@GetMapping("/rehearsalRecordDetail")
@ApiOperation(value = "演练记录详情")
@ApiOperationSupport(order = 9)
public R<RehearsalRecordEntity> rehearsalRecordDetail(@RequestParam Long id) {
return R.data(rehearsalRecordService.getById(id));
public R<RehearsalRecordDetailVO> rehearsalRecordDetail(@RequestParam Long id) {
return R.data(rehearsalRecordService.getRecordDetailVOById(id));
}
@GetMapping("/rehearsalRecordPage")
@ -152,7 +153,7 @@ public class RehearsalController extends BladeController {
@GetMapping("/exportRecordDetailData")
@ApiOperation(value = "演练记录表导出")
@ApiOperationSupport(order = 14)
public void exportRecordDetailData(@RequestParam Long id) {
rehearsalRecordService.exportRecordDetailData(id);
public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) {
rehearsalRecordService.exportRehearsalRecordData(id, response);
}
}

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

@ -15,6 +15,7 @@ import com.hnac.hzims.safeproduct.service.ITrainPlanService;
import com.hnac.hzims.safeproduct.service.ITrainRecordService;
import com.hnac.hzims.safeproduct.vo.TestScoreVO;
import com.hnac.hzims.safeproduct.vo.TrainMonthVO;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.TrainYearVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -117,8 +118,8 @@ public class TrainController extends BladeController {
@GetMapping("/trainRecordDetail")
@ApiOperation(value = "培训记录详情")
@ApiOperationSupport(order = 9)
public R<TrainRecordEntity> trainRecordDetail(@RequestParam Long id) {
return R.data(trainRecordService.getById(id));
public R<TrainRecordDetailVO> trainRecordDetail(@RequestParam Long id) {
return R.data(trainRecordService.getTrainRecordDetailById(id));
}
@GetMapping("/trainRecordPage")
@ -193,8 +194,8 @@ public class TrainController extends BladeController {
@GetMapping("/testScoreList")
@ApiOperation(value = "考试成绩列表")
@ApiOperationSupport(order = 18)
public R<List<TestScoreVO>> testScoreList(@RequestParam Long testId) {
List<TestScoreVO> list = testScoreService.testScoreList(testId);
public R<List<TestScoreVO>> testScoreList(@RequestParam Long testId, String name) {
List<TestScoreVO> list = testScoreService.testScoreList(testId, name);
return R.data(list);
}
@ -234,12 +235,9 @@ public class TrainController extends BladeController {
}
@GetMapping("/exportTrainRecordData")
@ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "培训记录数据导出")
@ApiOperation(value = "培训记录表导出")
@ApiOperationSupport(order = 23)
public void exportTrainRecordData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
trainRecordService.exportTrainRecordData(param, response);
public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) {
trainRecordService.exportTrainRecordData(id, response);
}
}

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

@ -1,4 +1,43 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.enums.ConferenceStatusEnum;
import com.hnac.hzims.safeproduct.service.IConferencePlanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* 会议管理模块定时任务
*
* @author liwen
* @date 2024-01-15
*/
@Component
public class ConferenceJob {
@Autowired
IConferencePlanService conferencePlanService;
@XxlJob("autoChangeConferencePlanStatus")
public ReturnT<String> autoChangeConferencePlanStatus(String param) {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
// 查询前一天的超时未完成会议计划
List<ConferencePlanEntity> list = conferencePlanService.getWaitingConferencePlanInTimeRange(yesterday, today);
list.forEach(x -> {
x.setConferenceStatus(ConferenceStatusEnum.UNFINISHED.getValue());
});
// 将状态置为未完成
boolean flag = conferencePlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
}
}

41
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java

@ -0,0 +1,41 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum;
import com.hnac.hzims.safeproduct.service.IDeviceService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* 特种设备模块定时任务
*
* @author liwen
* @date 2024-01-16
*/
@Component
public class DeviceJob {
@Autowired
IDeviceService deviceService;
@XxlJob("autoChangeDeviceStatus")
public ReturnT<String> autoChangeDeviceStatus(String param) {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
String today = DateUtil.format(current, "yyyy-mm-dd");
String yesterday = DateUtil.format(before, "yyyy-mm-dd");
// 查询昨天的过期设备
List<DeviceEntity> list = deviceService.getExpiredDeviceByTime(yesterday, today);
list.forEach(e -> e.setDeviceStatus(DeviceStatusEnum.EXPIRED.getValue()));
// 更新状态
boolean update = deviceService.updateBatchById(list);
return update ? ReturnT.SUCCESS : ReturnT.FAIL;
}
}

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

@ -1,4 +1,43 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.enums.TrainStatusEnum;
import com.hnac.hzims.safeproduct.service.IHygienePlanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* 卫生自查模块定时任务
*
* @author liwen
* @date 2024-01-15
*/
@Component
public class HygieneJob {
@Autowired
IHygienePlanService hygienePlanService;
@XxlJob("autoChangeHygienePlanStatus")
public ReturnT<String> autoChangeHygienePlanStatus(String param) {
// 获取时间范围
Date current = DateUtil.now();
Date before = DateUtil.minusDays(current, 1);
String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
// 查询前一天的超时未完成卫生自查计划
List<HygienePlanEntity> list = hygienePlanService.getWaitingHygienePlanInTimeRange(yesterday, today);
list.forEach(x -> {
x.setHygienePlanStatus(TrainStatusEnum.UNFINISHED.getValue());
});
// 将状态置为未完成
boolean flag = hygienePlanService.updateBatchById(list);
return flag ? ReturnT.SUCCESS : ReturnT.FAIL;
}
}

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

@ -31,7 +31,7 @@ public class RehearsalJob {
Date before = DateUtil.minusDays(current, 1);
String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss");
String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss");
// 查询前一天的超时未完成演练记录
// 查询前一天的超时未完成演练计划
List<RehearsalPlanEntity> list = rehearsalPlanService.getWaitingRehearsalInTimeRange(yesterday, today);
list.forEach(x -> {
x.setRehearsalStatus(RehearsalStatusEnum.UNFINISHED.getValue());

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml

@ -5,7 +5,7 @@
<select id="getCarMaintenance" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO">
SELECT
t1.code, t1.start_time, t1.end_time, t1.location, t1.cost, t1.maintainer, t1.content, t1.img_path, t1.file_path,
t1.manager_advice, t1.confirmation_time, t2.plate_number, t2.unit, t2.car_brand, t2.car_type
t1.manager_advice, t1.confirmation_time, t2.plate_number, t2.unit, t2.car_brand, t2.car_type, t1.maintanence_type
FROM
hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml

@ -5,7 +5,7 @@
<select id="getCarUsedRecord" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO">
SELECT
t1.code, t1.start_time, t1.used_location, t1.remark, t1.unit, t1.start_miles, t1.end_miles, t1.miles,
t1.img_path, t1.user, t1.end_time, t1.confirmation_time, t2.manager, t2.car_brand, t2.plate_number
t1.img_path, t1.user, t1.end_time, t1.confirmation_time, t2.manager, t2.car_brand, t2.car_type, t2.plate_number
FROM
hzims_car_used_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id

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

@ -2,6 +2,7 @@ package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -13,4 +14,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ConferenceRecordMapper extends BaseMapper<ConferenceRecordEntity> {
/**
* 查询会议记录表详情
* @param id 会议记录id
* @return 会议记录表VO类
*/
ConferenceRecordDetailVO getConferenceRecordDetailById(Long id);
}

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

@ -1,4 +1,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper">
<select id="getConferenceRecordDetailById"
resultType="com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO">
SELECT
t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.host, t2.conference_method, t2.theme,
t1.recorder, t1.people_name, t1.content, t1.img_path, t1.file_path
FROM
hzims_conference_record t1
LEFT JOIN hzims_conference_plan t2 ON t1.conference_plan_id = t2.id
WHERE
t1.is_deleted = 0
AND t1.id = #{id}
</select>
</mapper>

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

@ -0,0 +1,16 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.DeviceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 特种设备Mapper类
*
* @author liwen
* @date 2024-01-12
*/
@Mapper
public interface DeviceMapper extends BaseMapper<DeviceEntity> {
}

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

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

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

@ -2,6 +2,7 @@ package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -13,4 +14,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface RehearsalRecordMapper extends BaseMapper<RehearsalRecordEntity> {
/**
* 查询演练记录表详情
* @param id 演练记录id
* @return 演练记录表VO类
*/
RehearsalRecordDetailVO getRecordDetailVOById(Long id);
}

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

@ -2,4 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper">
<select id="getRecordDetailVOById" resultType="com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO">
SELECT
t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.rehearsal_method, t2.commander,
t2.subject, t1.people_name, t1.record, t1.img_path, t1.comment, t1.file_path
FROM
hzims_rehearsal_record t1
LEFT JOIN hzims_rehearsal_plan t2 ON t1.rehearsal_plan_id = t2.id
WHERE
t1.is_deleted = 0
AND t1.id = #{id}
</select>
</mapper>

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java

@ -19,7 +19,8 @@ public interface TestScoreMapper extends BaseMapper<TestScoreEntity> {
/**
* 查询考试成绩列表
* @param testId 考试记录id
* @param name 姓名
* @return 考试成绩列表
*/
List<TestScoreVO> testScoreList(Long testId);
List<TestScoreVO> testScoreList(Long testId, String name);
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.xml

@ -12,6 +12,9 @@
<if test="testId != null and testId != ''">
AND test_id = #{testId}
</if>
<if test="name != null and name != ''">
AND name like concat('%', #{name}, '%'}
</if>
ORDER BY
score DESC
</select>

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java

@ -3,6 +3,7 @@ package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -22,4 +23,11 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
* @return 培训记录名称列表
*/
List<TrainRecordDTO> getTrainRecordNameList(String trainPlanId);
/**
* 查询培训记录表详情
* @param id 培训记录id
* @return 培训记录表VO类
*/
TrainRecordDetailVO getTrainRecordDetailById(Long id);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -15,4 +15,16 @@
ORDER BY
create_time DESC
</select>
<select id="getTrainRecordDetailById" resultType="com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO">
SELECT
t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.train_method, t2.teacher, t2.lesson,
t1.people_name, t1.content, t1.img_path, t1.command, t1.file_path
FROM
hzims_train_record t1
LEFT JOIN hzims_train_plan t2 ON t1.train_plan_id = t2.id
WHERE
t1.is_deleted = 0
AND t1.id = #{id}
</select>
</mapper>

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

@ -7,7 +7,9 @@ import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 车辆管理服务类
@ -62,4 +64,12 @@ public interface ICarService extends IService<CarEntity> {
* @return true-成功false-失败
*/
boolean removeCar(Long id);
/**
* 导出年度里程数据
* @param param 参数
* @param query 分页类
* @param response 响应类
*/
void exportCarMilesData(Map<String, Object> param, Query query, HttpServletResponse response);
}

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java

@ -6,6 +6,7 @@ import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
@ -37,4 +38,12 @@ public interface IConferencePlanService extends IService<ConferencePlanEntity> {
* @param response 响应类
*/
void exportConferenceData(Map<String, Object> param, HttpServletResponse response);
/**
* 查询时间范围内未开始的会议计划数据
* @param startTime 开始时间
* @param endTime 结束时间
* @return 会议计划数据
*/
List<ConferencePlanEntity> getWaitingConferencePlanInTimeRange(String startTime, String endTime);
}

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

@ -2,6 +2,9 @@ package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO;
import javax.servlet.http.HttpServletResponse;
/**
* 会议记录服务类
@ -24,4 +27,18 @@ public interface IConferenceRecordService extends IService<ConferenceRecordEntit
* @return true-成功false-失败
*/
boolean saveRecord(ConferenceRecordEntity conferenceRecord);
/**
* 会议记录表导出
* @param id 会议记录id
* @param response 响应类
*/
void exportConferenceRecordData(Long id, HttpServletResponse response);
/**
* 查询会议记录表详情
* @param id 会议记录id
* @return 会议记录表VO类
*/
ConferenceRecordDetailVO getConferenceRecordDetailById(Long id);
}

22
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java

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

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

@ -10,6 +10,7 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
@ -76,4 +77,12 @@ public interface IHygienePlanService extends IService<HygienePlanEntity> {
* 月度数据导出
*/
void exportMonthData(Map<String, Object> param, Query query, HttpServletResponse response);
/**
* 查询时间范围内未开始的卫生自查计划数据
* @param startTime 开始时间
* @param endTime 结束时间
* @return 卫生自查计划数据
*/
List<HygienePlanEntity> getWaitingHygienePlanInTimeRange(String startTime, String endTime);
}

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

@ -57,9 +57,9 @@ public interface IHygieneRecordService extends IService<HygieneRecordEntity> {
IPage<HygieneRecordPageVO> recordPage(Map<String, Object> param, Query query);
/**
* 卫生自查记录数据导出
* @param hygieneRecordId 卫生自查记录id
* 卫生自查记录导出
* @param id 卫生自查记录id
* @param response 响应类
*/
void exportHygieneData(Long hygieneRecordId, HttpServletResponse response);
void exportHygieneRecordData(Long id, HttpServletResponse response);
}

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

@ -2,6 +2,9 @@ package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import javax.servlet.http.HttpServletResponse;
/**
* 演练记录服务类
@ -35,6 +38,14 @@ public interface IRehearsalRecordService extends IService<RehearsalRecordEntity>
/**
* 演练记录表导出
* @param id 演练记录id
* @param response 响应类
*/
void exportRehearsalRecordData(Long id, HttpServletResponse response);
/**
* 查询演练记录表详情
* @param id 演练记录id
* @return 演练记录表VO类
*/
void exportRecordDetailData(Long id);
RehearsalRecordDetailVO getRecordDetailVOById(Long id);
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITestScoreService.java

@ -18,9 +18,10 @@ public interface ITestScoreService extends IService<TestScoreEntity> {
/**
* 查询考试成绩列表
* @param testId 考试记录id
* @param name 姓名
* @return 考试成绩列表
*/
List<TestScoreVO> testScoreList(Long testId);
List<TestScoreVO> testScoreList(Long testId, String name);
/**
* 批量填写分数

13
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java

@ -3,10 +3,10 @@ package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 培训记录服务类
@ -53,8 +53,15 @@ public interface ITrainRecordService extends IService<TrainRecordEntity> {
/**
* 培训记录数据导出
* @param param 入参
* @param id 培训记录id
* @param response 响应类
*/
void exportTrainRecordData(Map<String, Object> param, HttpServletResponse response);
void exportTrainRecordData(Long id, HttpServletResponse response);
/**
* 查询培训记录表详情
* @param id 培训记录id
* @return 培训记录表VO类
*/
TrainRecordDetailVO getTrainRecordDetailById(Long id);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java

@ -6,6 +6,7 @@ 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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
@ -87,6 +88,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
CarCheckRecordDetailVO carCheckRecordDetailVO = new CarCheckRecordDetailVO();
// 车检记录属性
carCheckRecordDetailVO.setCode(carCheckRecord.getCode());
carCheckRecordDetailVO.setCheckTime(carCheckRecord.getCheckTime());
carCheckRecordDetailVO.setChecker(carCheckRecord.getChecker());
carCheckRecordDetailVO.setConclusion(carCheckRecord.getConclusion());
carCheckRecordDetailVO.setRemark(carCheckRecord.getRemark());
@ -187,11 +189,11 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
*/
@Override
public void exportCarCheckRecordData(Long id, HttpServletResponse response) {
CarCheckRecordEntity carCheckRecordEntity = this.getById(id);
Map<String, Object> params = BaseUtil.obj2Map(carCheckRecordEntity);
String templateFile = "template/车检记录单.docx";
String wordPath = savePath + "/车检记录单.docx";
String pdfPath = savePath + "/车检记录单.pdf";
CarCheckRecordDetailVO carCheckRecordDetailVO = this.getCarCheckRecord(id);
Map<String, Object> params = BaseUtil.obj2Map(carCheckRecordDetailVO);
String templateFile = "template/车辆检查表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/车辆检查表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/车辆检查表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}

19
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java

@ -6,10 +6,12 @@ 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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.enums.CarMaintenanceStatusEnum;
import com.hnac.hzims.safeproduct.enums.CarMaintenanceTypeEnum;
import com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
@ -111,11 +113,18 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
*/
@Override
public void exportCarMaintenanceData(Long id, HttpServletResponse response) {
CarMaintenanceEntity carMaintenanceEntity = this.getById(id);
Map<String, Object> params = BaseUtil.obj2Map(carMaintenanceEntity);
String templateFile = "template/车辆维保记录单.docx";
String wordPath = savePath + "/车辆维保记录单.docx";
String pdfPath = savePath + "/车辆维保记录单.pdf";
CarMaintenanceDetailVO carMaintenanceDetailVO = this.getCarMaintenance(id);
// 维保类型
String maintenanceType = carMaintenanceDetailVO.getMaintenanceType();
if (maintenanceType.equals(CarMaintenanceTypeEnum.MAINTAIN.getValue())) {
carMaintenanceDetailVO.setMaintenanceType(CarMaintenanceTypeEnum.MAINTAIN.getDesc());
} else {
carMaintenanceDetailVO.setMaintenanceType(CarMaintenanceTypeEnum.REPAIR.getDesc());
}
Map<String, Object> params = BaseUtil.obj2Map(carMaintenanceDetailVO);
String templateFile = "template/车辆维保记录单" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/车辆维保记录单" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/车辆维保记录单" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}

59
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java

@ -1,17 +1,25 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.converters.longconverter.LongStringConverter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
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.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
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.factory.annotation.Autowired;
@ -19,9 +27,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -194,4 +207,50 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
}
return false;
}
/**
* 导出年度里程数据
*/
@Override
public void exportCarMilesData(Map<String, Object> param, Query query, HttpServletResponse response) {
ServletOutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
String unit = String.valueOf(param.get("unit"));
String year = String.valueOf(param.get("year"));
IPage<CarMilesYearVO> page = milesDataByYear(year, unit, query);
List<CarMilesYearVO> list = page.getRecords();
// 设置响应头
// 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(CarMilesYearVO.class)
.build();
excelWriter.write(list, 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());
}
}
}
}
}

26
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java

@ -6,16 +6,15 @@ 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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.enums.CarUsedRecordEnum;
import com.hnac.hzims.safeproduct.mapper.CarUsedRecordMapper;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.utils.AsposeUtil;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
@ -24,7 +23,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -56,9 +54,9 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
// 若不存在,新增编号
String code = BaseUtil.getUniqueCode("YCJL", lastCode, currentSimpleMonth);
carUsedRecordEntity.setCode(code);
// 收车公里数
BigDecimal endMiles = carUsedRecordEntity.getStartMiles().add(carUsedRecordEntity.getMiles());
carUsedRecordEntity.setEndMiles(endMiles);
// 行驶公里数
BigDecimal miles = carUsedRecordEntity.getEndMiles().subtract(carUsedRecordEntity.getStartMiles());
carUsedRecordEntity.setMiles(miles);
return this.save(carUsedRecordEntity);
}
@ -100,9 +98,9 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
*/
@Override
public boolean updateCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity) {
// 收车公里数
BigDecimal endMiles = carUsedRecordEntity.getStartMiles().add(carUsedRecordEntity.getMiles());
carUsedRecordEntity.setEndMiles(endMiles);
// 行驶公里数
BigDecimal miles = carUsedRecordEntity.getEndMiles().subtract(carUsedRecordEntity.getStartMiles());
carUsedRecordEntity.setMiles(miles);
return this.save(carUsedRecordEntity);
}
@ -111,11 +109,11 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
*/
@Override
public void exportCarUsedRecordData(Long id, HttpServletResponse response) {
CarUsedRecordEntity carUsedRecordEntity = this.getById(id);
Map<String, Object> params = BaseUtil.obj2Map(carUsedRecordEntity);
String templateFile = "template/用车记录单.docx";
String wordPath = savePath + "/用车记录单.docx";
String pdfPath = savePath + "/用车记录单.pdf";
CarUsedRecordDetailVO carUsedRecordDetailVO = this.getCarUsedRecord(id);
Map<String, Object> params = BaseUtil.obj2Map(carUsedRecordDetailVO);
String templateFile = "template/用车记录单" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/用车记录单" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/用车记录单" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}

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

@ -147,6 +147,18 @@ public class ConferencePlanServiceImpl extends ServiceImpl<ConferencePlanMapper,
}
/**
* 查询时间范围内未开始的会议计划数据
*/
@Override
public List<ConferencePlanEntity> getWaitingConferencePlanInTimeRange(String startTime, String endTime) {
QueryWrapper<ConferencePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ConferencePlanEntity::getConferenceStatus, ConferenceStatusEnum.WAITING.getValue())
.ge(ConferencePlanEntity::getScheduledEndTime, startTime)
.le(ConferencePlanEntity::getScheduledEndTime, endTime);
return this.list(queryWrapper);
}
/**
* 根据单位和计划时间查询会议记录
* @param unit 单位
* @param startTime 计划开始时间

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

@ -7,16 +7,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity;
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity;
import com.hnac.hzims.safeproduct.enums.ConferenceMethodEnum;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper;
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.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -31,6 +36,9 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
@Resource
ConferencePlanMapper conferencePlanMapper;
@Value("${hzims.conference.savePath}")
private String savePath;
/**
* 删除关联会议记录
*/
@ -72,6 +80,36 @@ 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());
} else if (conferenceMethod.equals(ConferenceMethodEnum.ONLINE.getValue())) {
conferenceRecordDetailVO.setConferenceMethod(ConferenceMethodEnum.ONLINE.getDesc());
} else {
conferenceRecordDetailVO.setConferenceMethod(ConferenceMethodEnum.OFFLINE.getDesc());
}
Map<String, Object> params = BaseUtil.obj2Map(conferenceRecordDetailVO);
String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/会议记录表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}
/**
* 查询会议记录表详情
*/
@Override
public ConferenceRecordDetailVO getConferenceRecordDetailById(Long id) {
return baseMapper.getConferenceRecordDetailById(id);
}
/**
* 查询是否存在同月编号
* @param currentMonth 当月
* @return 存在则返回上一编号否则返回null

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.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.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);
}
}

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

@ -13,6 +13,7 @@ import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.HygienePlanDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity;
import com.hnac.hzims.safeproduct.enums.HygieneStatusEnum;
import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper;
import com.hnac.hzims.safeproduct.service.IHygienePlanService;
import com.hnac.hzims.safeproduct.service.IHygieneRecordService;
@ -284,4 +285,16 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
}
}
}
/**
* 查询时间范围内未开始的卫生自查计划数据
*/
@Override
public List<HygienePlanEntity> getWaitingHygienePlanInTimeRange(String startTime, String endTime) {
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.WAITING.getValue())
.ge(HygienePlanEntity::getScheduledEndTime, startTime)
.le(HygienePlanEntity::getScheduledEndTime, endTime);
return this.list(queryWrapper);
}
}

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

@ -1,13 +1,7 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.converters.longconverter.LongStringConverter;
import com.alibaba.excel.util.CollectionUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -17,7 +11,6 @@ import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper;
import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper;
@ -27,18 +20,15 @@ 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 javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.WeekFields;
@ -60,6 +50,9 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
@Autowired
IHygieneZoneService hygieneZoneService;
@Value("${hzims.hygiene.savePath}")
private String savePath;
/**
* 删除关联卫生自查记录
*/
@ -170,50 +163,13 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
* 卫生自查数据导出
*/
@Override
public void exportHygieneData(Long hygieneRecordId, HttpServletResponse response) {
ServletOutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
HygieneRecordDetailVO recordDetailVO = getRecordDetail(hygieneRecordId);
List<HygieneZoneDetailVO> records = recordDetailVO.getCheckList();
// 设置响应头
// 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();
Date endTime = recordDetailVO.getActualEndTime();
String name = DateUtil.format(endTime, "yyyy年mm月") + "第" + recordDetailVO.getWeekNum() + "周卫生自查表";
List<String> head = new ArrayList<>();
head.add(name);
WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查记录数据表")
.head(Collections.singletonList(head))
.head(HygieneZoneDetailVO.class)
.build();
excelWriter.write(records, 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());
}
}
}
public void exportHygieneRecordData(Long id, HttpServletResponse response) {
HygieneRecordDetailVO hygieneRecordDetailVO = this.getRecordDetail(id);
Map<String, Object> params = BaseUtil.obj2Map(hygieneRecordDetailVO);
String templateFile = "template/卫生自查表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/卫生自查表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/卫生自查表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}
/**

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

@ -8,22 +8,19 @@ import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.enums.RehearsalMethodEnum;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper;
import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.ticket.constants.WorkTicketConstants;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
@ -40,6 +37,9 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
@Resource
RehearsalPlanMapper rehearsalPlanMapper;
@Value("${hzims.rehearsal.savePath}")
private String savePath;
/**
* 新增演练
*/
@ -130,11 +130,29 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
* 演练记录表导出
*/
@Override
public void exportRecordDetailData(Long id) {
RehearsalRecordEntity rehearsalRecordEntity = this.getById(id);
String tempFileName = "演练记录表.xlsx";
Assert.isTrue(StringUtil.isNotBlank(tempFileName),() -> {
throw new ServiceException("未找到模板文件,预览失败!");
});
public void exportRehearsalRecordData(Long id, HttpServletResponse response) {
RehearsalRecordDetailVO rehearsalRecordDetailVO = this.getRecordDetailVOById(id);
// 演练方式字段
String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod();
if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) {
rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc());
} else if (rehearsalMethod.equals(RehearsalMethodEnum.ONLINE.getValue())) {
rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.ONLINE.getDesc());
} else {
rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.OFFLINE.getDesc());
}
Map<String, Object> params = BaseUtil.obj2Map(rehearsalRecordDetailVO);
String templateFile = "template/演练记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/演练记录表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/演练记录表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}
/**
* 查询演练记录表详情
*/
@Override
public RehearsalRecordDetailVO getRecordDetailVOById(Long id) {
return baseMapper.getRecordDetailVOById(id);
}
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java

@ -28,8 +28,8 @@ public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScore
* 查询考试成绩列表
*/
@Override
public List<TestScoreVO> testScoreList(Long testId) {
return baseMapper.testScoreList(testId);
public List<TestScoreVO> testScoreList(Long testId, String name) {
return baseMapper.testScoreList(testId, name);
}
/**

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

@ -1,35 +1,28 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.converters.longconverter.LongStringConverter;
import com.alibaba.excel.util.CollectionUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.enums.TrainMethodEnum;
import com.hnac.hzims.safeproduct.enums.TrainStatusEnum;
import com.hnac.hzims.safeproduct.mapper.TrainPlanMapper;
import com.hnac.hzims.safeproduct.mapper.TrainRecordMapper;
import com.hnac.hzims.safeproduct.service.ITestService;
import com.hnac.hzims.safeproduct.service.ITrainRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import org.springblade.core.log.exception.ServiceException;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
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.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -50,6 +43,9 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
@Resource
TrainPlanMapper trainPlanMapper;
@Value("${hzims.train.savePath}")
private String savePath;
/**
* 新增培训记录
*/
@ -138,44 +134,30 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
* 培训记录数据导出
*/
@Override
public void exportTrainRecordData(Map<String, Object> param, HttpServletResponse response) {
ServletOutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
String trainPlanId = String.valueOf(param.get("trainPlanId"));
List<TrainRecordEntity> trainRecordList = getTrainRecordByTrainPlanId(trainPlanId);
// 设置响应头
// 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(TrainRecordEntity.class)
.build();
excelWriter.write(trainRecordList, 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());
}
}
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());
} else if (trainMethod.equals(TrainMethodEnum.ONLINE.getValue())) {
trainRecordDetailVO.setTrainMethod(TrainMethodEnum.ONLINE.getDesc());
} else {
trainRecordDetailVO.setTrainMethod(TrainMethodEnum.OFFLINE.getDesc());
}
Map<String, Object> params = BaseUtil.obj2Map(trainRecordDetailVO);
String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX;
String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX;
String pdfPath = savePath + "/培训记录表" + SafeProductConstant.PDF_SUFFIX;
BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response);
}
/**
* 查询培训记录表详情
*/
@Override
public TrainRecordDetailVO getTrainRecordDetailById(Long id) {
return baseMapper.getTrainRecordDetailById(id);
}
/**
@ -202,18 +184,4 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
.orderByDesc(TrainRecordEntity::getCode);
return this.list(queryWrapper);
}
/**
* 根据培训计划id查询培训记录数据
* @param trainPlanId 培训计划id
* @return 培训记录列表
*/
public List<TrainRecordEntity> getTrainRecordByTrainPlanId(String trainPlanId) {
LambdaQueryWrapper<TrainRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
if (!trainPlanId.equals("null")) {
queryWrapper.ge(TrainRecordEntity::getTrainPlanId, trainPlanId);
}
queryWrapper.orderByDesc(TrainRecordEntity::getCreateTime);
return this.list(queryWrapper);
}
}

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

@ -55,7 +55,28 @@ public class BaseUtil {
}
/**
* 文件导出
* pdf文件导出
* @param templateFile 模板文件路径
* @param params 数据参数
* @param wordPath 文件生成路径
* @param pdfPath pdf生成路径
* @param response 响应类
*/
public static void exportDocument(String templateFile, Map<String, Object> params, String wordPath, String pdfPath, HttpServletResponse response) {
try {
List<XWPFDocument> res = new ArrayList<>();
XWPFDocument document = BaseUtil.fillDocument(templateFile, params);
res.add(document);
BaseUtil.exportWord(res, wordPath);
} catch (Exception e) {
log.error("文件导出异常: {}", e.getMessage());
}
AsposeUtil.wordToPdf(wordPath, pdfPath);
BaseUtil.readPdf(response,pdfPath);
}
/**
* word文件导出
* @param documents doc文件
* @param savePath 存储路径
*/
@ -67,22 +88,22 @@ public class BaseUtil {
document.write(out);
}
} catch (IOException e) {
log.error("文件导出异常: {}", e.getMessage());
log.error("word文件导出异常: {}", e.getMessage());
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
log.error("文件导出-输出流关闭异常: {}", e.getMessage());
log.error("word文件导出-输出流关闭异常: {}", e.getMessage());
}
}
}
}
/**
* 数据写入模板文件
* @param templatePath 模板路径
* @param params 数据
* 数据写入
* @param templatePath 模板文件路径
* @param params 数据参数
*/
public static XWPFDocument fillDocument(String templatePath, Map<String, Object> params) {
XWPFDocument xwpfDocument = null;
@ -90,6 +111,7 @@ public class BaseUtil {
xwpfDocument = WordExportUtil.exportWord07(templatePath, params);
} catch (Exception e) {
log.error("数据写入异常: {}", e.getMessage());
e.printStackTrace();
}
return xwpfDocument;
}
@ -113,7 +135,7 @@ public class BaseUtil {
"inline; filename= " + URLEncoder.encode(file.getName(), "UTF-8"));
outputStream.flush();
} catch (IOException e) {
e.printStackTrace();
log.error("本地pdf文件读取异常: {}", e.getMessage());
} finally {
try {
if (fileInputStream != null) {
@ -128,6 +150,11 @@ public class BaseUtil {
}
}
/**
* 对象转map
* @param obj 对象类
* @return map参数
*/
public static Map<String, Object> obj2Map(Object obj) {
if (ObjectUtil.isNotEmpty(obj) && null != obj.getClass()) {
Map<String, Object> result = new HashMap<>();
@ -191,7 +218,7 @@ public class BaseUtil {
* @return map对象
*/
public static Map<String, Object> LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) {
HashMap<String, Object> result = new HashMap<String, Object>() {{
return new HashMap<String, Object>() {{
put(prefix + split + "year", dateTime.getYear());
put(prefix + split + "month", dateTime.getMonthValue());
put(prefix + split + "day", dateTime.getDayOfMonth());
@ -199,19 +226,5 @@ public class BaseUtil {
put(prefix + split + "minuter", dateTime.getMinute());
put(prefix + split + "second", dateTime.getSecond());
}};
return result;
}
public static void exportDocument(String templateFile, Map<String, Object> params, String wordPath, String pdfPath, HttpServletResponse response) {
try {
List<XWPFDocument> res = new ArrayList<>();
XWPFDocument document = BaseUtil.fillDocument(templateFile, params);
res.add(document);
BaseUtil.exportWord(res, wordPath);
} catch (Exception e) {
throw new RuntimeException(e);
}
AsposeUtil.wordToPdf(wordPath, pdfPath);
BaseUtil.readPdf(response,pdfPath);
}
}

340
hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

@ -10,343 +10,3 @@ create table document_management
is_deleted tinyint default 0 comment '逻辑删除'
) comment '文档管理';
CREATE TABLE `hzims_rehearsal_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`subject` varchar(50) NOT NULL COMMENT '演练科目',
`scheduled_start_time` date NOT NULL COMMENT '演练计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '演练计划结束时间',
`location` varchar(255) NOT NULL COMMENT '演练地点',
`commander` varchar(10) NOT NULL COMMENT '总指挥',
`rehearsal_method` varchar(20) DEFAULT '' COMMENT '演练方式',
`rehearsal_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '演练状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_rehearsal_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`rehearsal_plan_id` bigint(20) NOT NULL COMMENT '演练计划id',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数',
`people_name` varchar(5000) DEFAULT '' COMMENT '参演人员',
`actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间',
`actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间',
`record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录',
`comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_train_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`scheduled_start_time` date NOT NULL COMMENT '计划培训开始时间',
`scheduled_end_time` date NOT NULL COMMENT '计划培训结束时间',
`lesson` varchar(255) NOT NULL COMMENT '培训课程',
`location` varchar(255) NOT NULL COMMENT '培训地点',
`train_method` varchar(20) DEFAULT '' COMMENT '培训方式',
`teacher` varchar(20) NOT NULL DEFAULT '' COMMENT '培训讲师',
`train_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '培训状态',
`is_test` int(2) NOT NULL DEFAULT '0' COMMENT '关联考试:0-否,1-是',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_train_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id',
`train_record_name` varchar(50) NOT NULL DEFAULT '' COMMENT '培训记录名称',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_name` varchar(5000) DEFAULT '' COMMENT '培训学员',
`content` mediumtext DEFAULT '' COMMENT '培训内容',
`actual_start_time` datetime DEFAULT NULL COMMENT '实际培训开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '实际培训结束时间',
`command` varchar(250) DEFAULT NULL COMMENT '培训评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_test` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id',
`train_record_id` bigint(20) DEFAULT NULL COMMENT '培训记录id',
`test_name` varchar(50) NOT NULL DEFAULT '' COMMENT '考试记录名称',
`code` varchar(50) NOT NULL COMMENT '编号',
`unit` varchar(50) NOT NULL COMMENT '单位',
`test_start_time` datetime NOT NULL COMMENT '考试开始时间',
`test_end_time` datetime NOT NULL COMMENT '考试结束时间',
`location` varchar(255) NOT NULL COMMENT '考试地点',
`subject` varchar(50) NOT NULL COMMENT '考试科目',
`proctor` varchar(20) NOT NULL COMMENT '监考人',
`people_name` varchar(1000) DEFAULT '' COMMENT '参考人员',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_test_score` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`test_id` bigint(20) DEFAULT NULL COMMENT '考试记录id',
`name` varchar(50) NOT NULL COMMENT '姓名',
`score` int(10) DEFAULT NULL COMMENT '成绩',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试成绩表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_conference_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`theme` varchar(50) NOT NULL COMMENT '会议主题',
`scheduled_start_time` date NOT NULL COMMENT '会议计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '会议计划结束时间',
`location` varchar(255) NOT NULL COMMENT '会议地点',
`host` varchar(10) NOT NULL COMMENT '主持人',
`conference_method` varchar(20) DEFAULT '' COMMENT '会议方式',
`conference_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '会议状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_conference_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`conference_plan_id` bigint(20) NOT NULL COMMENT '会议计划id',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_name` varchar(5000) DEFAULT '' COMMENT '参会人员',
`actual_start_time` datetime DEFAULT NULL COMMENT '会议实际开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '会议实际结束时间',
`recorder` varchar(20) DEFAULT '' COMMENT '记录人',
`content` mediumtext DEFAULT '' DEFAULT '' COMMENT '会议内容',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`code` varchar(50) NOT NULL COMMENT '编码',
`standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值',
`scheduled_start_time` date NOT NULL COMMENT '计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '计划结束时间',
`hygiene_plan_status` varchar(50) NOT NULL DEFAULT 'WAITING' COMMENT '自查计划状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_zone` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id',
`zone` varchar(50) NOT NULL COMMENT '责任区',
`principal` varchar(20) NOT NULL COMMENT '责任人',
`check_item` mediumtext NOT NULL COMMENT '检查项',
`check_item_score` varchar(255) NOT NULL COMMENT '检查项分值',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查区域表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`code` varchar(50) NOT NULL COMMENT '编号',
`actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间',
`actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间',
`check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人',
`hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id',
`check_result` mediumtext NOT NULL COMMENT '检查结果',
`comprehensive_score` int(10) NOT NULL COMMENT '综合评分',
`week_num` int(10) NOT NULL COMMENT '周数',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '检查图片',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`car_brand` varchar(50) NOT NULL COMMENT '品牌',
`car_type` varchar(50) NOT NULL COMMENT '型号',
`plate_number` varchar(50) NOT NULL COMMENT '车牌号',
`registration_time` date NOT NULL COMMENT '上牌时间',
`insurance_pay_last_time` date NOT NULL COMMENT '上期缴车保时间',
`insurance_pay_next_time` date NOT NULL COMMENT '下期缴车保时间',
`annual_inspection_time` date NOT NULL COMMENT '年检时间',
`annual_inspection_status` varchar(50) NOT NULL COMMENT '年检状态',
`insurance_status` varchar(50) NOT NULL COMMENT '保险状态',
`maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间',
`maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间',
`maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态',
`manager` varchar(50) NOT NULL COMMENT '车辆管理人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆台账表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_maintenance` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`maintenance_type` varchar(50) NOT NULL COMMENT '维保类型',
`content` mediumtext NOT NULL COMMENT '维保内容',
`start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保开始时间',
`end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保结束时间',
`location` varchar(255) NOT NULL COMMENT '维保地点',
`cost` bigint(20) NOT NULL COMMENT '维保费用',
`maintainer` varchar(20) NOT NULL COMMENT '维保人',
`manager_advice` varchar(500) DEFAULT NULL COMMENT '车辆管理人意见',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '维保状态',
`confirmation_time` datetime DEFAULT NULL COMMENT '确认时间',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆维保记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_used_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`unit` varchar(50) NOT NULL COMMENT '用车单位',
`used_location` varchar(255) NOT NULL COMMENT '使用地点',
`user` varchar(20) NOT NULL COMMENT '使用人',
`remark` mediumtext DEFAULT NULL COMMENT '使用详情',
`start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间',
`end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '收车时间',
`start_miles` decimal(10, 2) NOT NULL COMMENT '出车公里数',
`end_miles` decimal(10, 2) NOT NULL COMMENT '收车公里数',
`miles` decimal(10, 2) NOT NULL COMMENT '行驶公里数',
`used_status` varchar(50) DEFAULT NULL COMMENT '用车状态',
`confirmation_time` datetime DEFAULT NULL COMMENT '确认时间',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用车记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_check_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`checker` varchar(50) NOT NULL COMMENT '检查人',
`check_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间',
`conclusion` mediumtext NOT NULL COMMENT '检查结论',
`remark` varchar(500) NOT NULL DEFAULT '' COMMENT '填报备注',
`confirmation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '确认时间',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_check_item` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_check_record_id` bigint(20) NOT NULL COMMENT '车检记录id',
`check_item` varchar(500) NOT NULL COMMENT '检查项目',
`check_content` mediumtext NOT NULL COMMENT '检查内容',
`check_result` mediumtext NOT NULL COMMENT '检查结果',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检项表' ROW_FORMAT=Dynamic;

364
hzims-service/safeproduct/src/main/resources/db/1.0.2.sql

@ -1 +1,365 @@
alter table `hzims_safe_safety_tool` add column `advance_notice_days` tinyint(4) default 0 comment '安全工器具提前通知天数';
CREATE TABLE `hzims_rehearsal_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`subject` varchar(50) NOT NULL COMMENT '演练科目',
`scheduled_start_time` date NOT NULL COMMENT '演练计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '演练计划结束时间',
`location` varchar(255) NOT NULL COMMENT '演练地点',
`commander` varchar(10) NOT NULL COMMENT '总指挥',
`rehearsal_method` varchar(20) DEFAULT '' COMMENT '演练方式',
`rehearsal_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '演练状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_rehearsal_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`rehearsal_plan_id` bigint(20) NOT NULL COMMENT '演练计划id',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数',
`people_name` varchar(5000) DEFAULT '' COMMENT '参演人员',
`actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间',
`actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间',
`record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录',
`comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_train_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`scheduled_start_time` date NOT NULL COMMENT '计划培训开始时间',
`scheduled_end_time` date NOT NULL COMMENT '计划培训结束时间',
`lesson` varchar(255) NOT NULL COMMENT '培训课程',
`location` varchar(255) NOT NULL COMMENT '培训地点',
`train_method` varchar(20) DEFAULT '' COMMENT '培训方式',
`teacher` varchar(20) NOT NULL DEFAULT '' COMMENT '培训讲师',
`train_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '培训状态',
`is_test` int(2) NOT NULL DEFAULT '0' COMMENT '关联考试:0-否,1-是',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_train_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id',
`train_record_name` varchar(50) NOT NULL DEFAULT '' COMMENT '培训记录名称',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_name` varchar(5000) DEFAULT '' COMMENT '培训学员',
`content` mediumtext COMMENT '培训内容',
`actual_start_time` datetime DEFAULT NULL COMMENT '实际培训开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '实际培训结束时间',
`command` varchar(250) DEFAULT NULL COMMENT '培训评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_test` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id',
`train_record_id` bigint(20) DEFAULT NULL COMMENT '培训记录id',
`test_name` varchar(50) NOT NULL DEFAULT '' COMMENT '考试记录名称',
`code` varchar(50) NOT NULL COMMENT '编号',
`unit` varchar(50) NOT NULL COMMENT '单位',
`test_start_time` datetime NOT NULL COMMENT '考试开始时间',
`test_end_time` datetime NOT NULL COMMENT '考试结束时间',
`location` varchar(255) NOT NULL COMMENT '考试地点',
`subject` varchar(50) NOT NULL COMMENT '考试科目',
`proctor` varchar(20) NOT NULL COMMENT '监考人',
`people_name` varchar(1000) DEFAULT '' COMMENT '参考人员',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_test_score` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`test_id` bigint(20) DEFAULT NULL COMMENT '考试记录id',
`name` varchar(50) NOT NULL COMMENT '姓名',
`score` int(10) DEFAULT NULL COMMENT '成绩',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试成绩表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_conference_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`theme` varchar(50) NOT NULL COMMENT '会议主题',
`scheduled_start_time` date NOT NULL COMMENT '会议计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '会议计划结束时间',
`location` varchar(255) NOT NULL COMMENT '会议地点',
`host` varchar(10) NOT NULL COMMENT '主持人',
`conference_method` varchar(20) DEFAULT '' COMMENT '会议方式',
`conference_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '会议状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_conference_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`conference_plan_id` bigint(20) NOT NULL COMMENT '会议计划id',
`code` varchar(50) NOT NULL COMMENT '编号',
`people_name` varchar(5000) DEFAULT '' COMMENT '参会人员',
`actual_start_time` datetime DEFAULT NULL COMMENT '会议实际开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '会议实际结束时间',
`recorder` varchar(20) DEFAULT '' COMMENT '记录人',
`content` mediumtext COMMENT '会议内容',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_plan` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`name` varchar(50) NOT NULL COMMENT '名称',
`standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值',
`scheduled_start_time` date NOT NULL COMMENT '计划开始时间',
`scheduled_end_time` date NOT NULL COMMENT '计划结束时间',
`hygiene_plan_status` varchar(50) NOT NULL DEFAULT 'WAITING' COMMENT '自查计划状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查计划表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_zone` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id',
`zone` varchar(50) NOT NULL COMMENT '责任区',
`principal` varchar(20) NOT NULL COMMENT '责任人',
`check_item` mediumtext NOT NULL COMMENT '检查项',
`check_item_score` varchar(255) NOT NULL COMMENT '检查项分值',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查区域表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_hygiene_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`code` varchar(50) NOT NULL COMMENT '编号',
`actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间',
`actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间',
`check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人',
`hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id',
`check_result` mediumtext NOT NULL COMMENT '检查结果',
`comprehensive_score` varchar(500) NOT NULL COMMENT '综合评分',
`week_num` int(10) NOT NULL COMMENT '周数',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '检查图片',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`unit` varchar(50) NOT NULL COMMENT '单位',
`car_brand` varchar(50) NOT NULL COMMENT '品牌',
`car_type` varchar(50) NOT NULL COMMENT '型号',
`plate_number` varchar(50) NOT NULL COMMENT '车牌号',
`registration_time` date NOT NULL COMMENT '上牌时间',
`insurance_pay_last_time` date NOT NULL COMMENT '上期缴车保时间',
`insurance_pay_next_time` date NOT NULL COMMENT '下期缴车保时间',
`annual_inspection_time` date NOT NULL COMMENT '年检时间',
`annual_inspection_status` varchar(50) NOT NULL COMMENT '年检状态',
`insurance_status` varchar(50) NOT NULL COMMENT '保险状态',
`maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间',
`maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间',
`maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态',
`manager` varchar(50) NOT NULL COMMENT '车辆管理人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆台账表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_maintenance` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`maintenance_type` varchar(50) NOT NULL COMMENT '维保类型',
`content` mediumtext NOT NULL COMMENT '维保内容',
`start_time` date NOT NULL COMMENT '维保开始时间',
`end_time` date NOT NULL COMMENT '维保结束时间',
`location` varchar(255) NOT NULL COMMENT '维保地点',
`cost` bigint(20) NOT NULL COMMENT '维保费用',
`maintainer` varchar(20) NOT NULL COMMENT '维保人',
`manager_advice` varchar(500) DEFAULT NULL COMMENT '车辆管理人意见',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '维保状态',
`confirmation_time` datetime DEFAULT NULL COMMENT '确认时间',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保附件',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆维保记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_used_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`unit` varchar(50) NOT NULL COMMENT '用车单位',
`used_location` varchar(255) NOT NULL COMMENT '使用地点',
`user` varchar(20) NOT NULL COMMENT '使用人',
`remark` mediumtext DEFAULT NULL COMMENT '使用详情',
`start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间',
`end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '收车时间',
`start_miles` decimal(10, 2) NOT NULL COMMENT '出车公里数',
`end_miles` decimal(10, 2) NOT NULL COMMENT '收车公里数',
`miles` decimal(10, 2) NOT NULL COMMENT '行驶公里数',
`used_status` varchar(50) DEFAULT NULL COMMENT '用车状态',
`confirmation_time` datetime DEFAULT NULL COMMENT '确认时间',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用车记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_check_record` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号',
`checker` varchar(50) NOT NULL COMMENT '检查人',
`check_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间',
`conclusion` mediumtext NOT NULL COMMENT '检查结论',
`remark` varchar(500) NOT NULL DEFAULT '' COMMENT '填报备注',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检记录表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_car_check_item` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`car_check_record_id` bigint(20) NOT NULL COMMENT '车检记录id',
`check_item` varchar(500) NOT NULL COMMENT '检查项目',
`check_content` mediumtext NOT NULL COMMENT '检查内容',
`check_result` mediumtext NOT NULL COMMENT '检查结果',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检项表' ROW_FORMAT=Dynamic;
CREATE TABLE `hzims_device` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`name` varchar(50) NOT NULL COMMENT '设备名称',
`type` varchar(50) NOT NULL DEFAULT '' COMMENT '规格型号',
`code` varchar(50) NOT NULL COMMENT '编码',
`quality_cerfiticate_no` varchar(255) NOT NULL DEFAULT '' COMMENT '产品合格证号',
`production_time` date DEFAULT NULL COMMENT '生产日期',
`used_time` date DEFAULT NULL COMMENT '使用日期',
`used_location` varchar(255) NOT NULL DEFAULT '' COMMENT '使用地点',
`inspection_period` int(10) DEFAULT NULL COMMENT '检验周期',
`inspection_current_time` date DEFAULT NULL COMMENT '本次检验日期',
`inspection_next_time` date DEFAULT NULL COMMENT '下次检验日期',
`inspection_last_time` date DEFAULT NULL COMMENT '上次检验日期',
`manager` varchar(50) NOT NULL DEFAULT '' COMMENT '设备管理人',
`device_status` varchar(20) NOT NULL DEFAULT 'NORMAL' COMMENT '设备状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='特种设备表' ROW_FORMAT=Dynamic;

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.

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.

BIN
hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx

Binary file not shown.

18
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java

@ -52,20 +52,22 @@ public class WorkTaskController extends BladeController {
return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask));
}
@GetMapping("/workTicketList")
@GetMapping("/preview")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页")
@ApiOperation(value = "工作任务单预览", notes = "工作任务单预览")
public void preview(@RequestParam @ApiParam("工作任务单预览主键ID") @NotNull @Valid Long id) {
workTaskService.preview(id);
}
@GetMapping("/workTicketList")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "查询工作票")
public R<List<WorkTicketInfoEntity>> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) {
return R.data(workTaskService.workTicketList(ticketCode));
}
/**
* 工作任务单-开启流程
* @param workTask
* @return
*/
@PostMapping("/startProcess")
@ApiOperationSupport(order = 3)
@ApiOperationSupport(order = 4)
@ApiOperation(value = "工作任务单")
public R startV4(@RequestBody WorkTaskVO workTask) {
return R.status(workTaskService.start(workTask));

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/WorkTaskMapper.java

@ -1,6 +1,8 @@
package com.hnac.hzims.ticket.repair.mapper;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import com.hnac.hzims.ticket.repair.vo.WorkTaskPreviewVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
@ -8,4 +10,5 @@ import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
*/
public interface WorkTaskMapper extends UserDataScopeBaseMapper<WorkTaskEntity> {
WorkTaskPreviewVO workTask(@Param("id") Long id);
}

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/WorkTaskMapper.xml

@ -3,4 +3,9 @@
<mapper namespace="com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper">
<select id="workTask" resultType="com.hnac.hzims.ticket.repair.vo.WorkTaskPreviewVO">
SELECT *,CREATE_DEPT AS deptId,CREATE_USER AS userId,CREATE_TIME AS time FROM HZIMS_WORK_TASK
WHERE IS_DELETED = 0
AND ID = #{id}
</select>
</mapper>

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java

@ -21,5 +21,8 @@ public interface IWorkTaskService extends BaseService<WorkTaskEntity> {
IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask);
void preview(Long id);
List<WorkTicketInfoEntity> workTicketList(String ticketName);
}

267
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

@ -1,38 +1,45 @@
package com.hnac.hzims.ticket.repair.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity;
import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper;
import com.hnac.hzims.ticket.repair.service.IWorkTaskService;
import com.hnac.hzims.ticket.repair.vo.WorkTaskContentVO;
import com.hnac.hzims.ticket.repair.vo.WorkTaskPreviewVO;
import com.hnac.hzims.ticket.repair.vo.WorkTaskVO;
import com.hnac.hzims.ticket.utils.ExcelUtil;
import com.hnac.hzims.ticket.utils.PdfUtils;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
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.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.*;
import org.springblade.flow.core.entity.BladeFlow;
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.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* @author ysj
@ -48,43 +55,14 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
private final ISysClient sysClient;
/**
* 工作任务单-分页查询
* @param page
* @param workTask
* @return
*/
@Override
public IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask) {
QueryWrapper wrapper = Condition.getQueryWrapper(workTask);
if(StringUtil.isNotBlank(workTask.getStartTime())){
wrapper.ge("CREATE_TIME",workTask.getStartTime());
}
if(StringUtil.isNotBlank(workTask.getEndTime())){
wrapper.le("CREATE_TIME",workTask.getEndTime());
}
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("GROUP_ID",workTask.getGroupId());
}
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("CREATE_DEPT",workTask.getDeptId());
}
return super.page(page, wrapper);
}
private final IUserClient userClient;
@Value("${hzims.ticket.workTask.saveWrokTask.xlsx}")
private String saveWrokTaskXlsxPath;
@Value("${hzims.ticket.workTask.saveWrokTask.pdf}")
private String saveWrokTaskPdfPath;
/**
* 查询工作票数据
* @param ticketCode
* @return
*/
@Override
public List<WorkTicketInfoEntity> workTicketList(String ticketCode) {
if(StringUtil.isEmpty(ticketCode)){
return workTicketInfoService.list();
}
return workTicketInfoService.list(Wrappers.<WorkTicketInfoEntity>lambdaQuery()
.like(WorkTicketInfoEntity::getCode,ticketCode));
}
/**
* 工作任务单-开启流程
@ -106,9 +84,13 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
variables.put("head", TaskUtil.getTaskUser(String.valueOf(workTask.getHead())));
// 班组成员
String[] member = workTask.getMember().split(",");
for(int i = 1;i <= member.length ; i++){
for(int i = 1;i <= 5 ; i++){
if(i > member.length){
variables.put("duty" + i, "");
}else{
variables.put("duty" + i, TaskUtil.getTaskUser(member[i-1]));
}
}
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey("work_task", FlowUtil.getBusinessKey("work_task_v4",String.valueOf(workTask.getId())), workTask.getCode(), variables);
log.error("work_task_start_process_result :{}",result);
// 更新任务流程Id
@ -142,14 +124,207 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
@Override
public boolean listener(ProcessWorkFlowResponse processWorkFlowResponse) {
Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables();
log.error("work_task_listener_variables : {}",variables);
Object head = variables.get("head");
if(ObjectUtil.isNotEmpty(head)){
variables.put("head",head.toString().replaceAll("taskUser_",""));
}
WorkTaskVO entity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference<WorkTaskVO>(){});
// 当前流程名称
entity.setTaskName(processWorkFlowResponse.getTaskName());
// 流程阶段执行人员名称
entity.setNextStepOperator(processWorkFlowResponse.getNextStepOperator());
if(ObjectUtil.isNotEmpty(entity.getWorkTicketId())){
entity.setHeadHandleTime(new Date());
}
if(ObjectUtil.isNotEmpty(entity.getTerminator())){
entity.setWorkEndTime(new Date());
entity.setTaskName("结束");
entity.setNextStepOperator("流程结束,无需人员处理");
}
if(StringUtil.isNotBlank(entity.getLicensorName())){
entity.setLicensorTime(new Date());
}
// 更新工作任务单信息
this.updateById(entity);
return false;
return true;
}
/**
* 工作任务单-分页查询
* @param page
* @param workTask
* @return
*/
@Override
public IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask) {
QueryWrapper wrapper = Condition.getQueryWrapper(workTask);
if(StringUtil.isNotBlank(workTask.getStartTime())){
wrapper.ge("CREATE_TIME",workTask.getStartTime());
}
if(StringUtil.isNotBlank(workTask.getEndTime())){
wrapper.le("CREATE_TIME",workTask.getEndTime());
}
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("GROUP_ID",workTask.getGroupId());
}
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("CREATE_DEPT",workTask.getDeptId());
}
return super.page(page, wrapper);
}
/**
* 工作任务单预览
* @param id
*/
@Override
public void preview(Long id) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
//准备数据
WorkTaskPreviewVO preview = this.workTaskExport(id);
if(ObjectUtil.isEmpty(preview)){
throw new ServiceException("查询应急抢修单失败");
}
Map<String,Object> params = new HashMap<>();
try {
params = PdfUtils.objectToMap(preview);
log.error("preview_to_map : {}",params);
}catch (Exception e) {
log.error("转换对象失败!");
}
TemplateExportParams templateExportParams = new TemplateExportParams("template/excel/work_task_template.xlsx", true);
Workbook workbook = null;
try {
workbook = ExcelUtil.getWorkbook(templateExportParams,params);
} catch (Exception e) {
e.printStackTrace();
}
//上传xlsx至服务器
String fileName = preview.getCode() + "_工作任务单" + PdfUtils.XLSX_SUFFIX;
try {
ExcelUtil.upload(workbook,saveWrokTaskXlsxPath,fileName);
} catch (Exception e) {
e.printStackTrace();
}
//将docx文件转换为pdf并保存
String pdfFileName = preview.getCode() + "_工作任务单" + PdfUtils.PDF_SUFFIX;
String xlsxFileName = preview.getCode() + "_工作任务单" + PdfUtils.XLSX_SUFFIX;
PdfUtils.convertPdf(saveWrokTaskPdfPath, xlsxFileName, saveWrokTaskPdfPath, pdfFileName);
String savePath = saveWrokTaskPdfPath + pdfFileName;
// 设置response参数,可以打开下载页面
PdfUtils.readPdf(response,savePath);
}
/**
* 转换工作任务单预览对象
* @param id
* @return
*/
private WorkTaskPreviewVO workTaskExport(Long id) {
// 查询工作任务单对象
WorkTaskPreviewVO preview = this.baseMapper.workTask(id);
log.error("preview_work_taks : {}",preview);
if(ObjectUtil.isEmpty(preview)){
throw new ServiceException("未查询到工作任务单数据!");
}
// 机构名称
R<Dept> result = sysClient.getDept(preview.getDeptId());
if(result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())){
preview.setCompany(result.getData().getDeptName());
}
// 工作派工单签发人
R<User> user = userClient.userInfoById(preview.getUserId());
if(user.isSuccess() && ObjectUtil.isNotEmpty(user.getData())){
preview.setCreateName(user.getData().getName());
}
// 班组数量
if(StringUtil.isNotBlank(preview.getMember())){
preview.setGroupCount(preview.getMember().split(",").length);
}
// 工作地点 、工作内容
if(StringUtil.isNotBlank(preview.getWorkTask())){
List<WorkTaskContentVO> contents = JSONObject.parseObject(preview.getWorkTask(), new TypeReference<List<WorkTaskContentVO>>() {});
if(CollectionUtil.isNotEmpty(contents)){
StringBuilder location = new StringBuilder(),content = new StringBuilder();
for(WorkTaskContentVO item : contents){
location.append(item.getLocation()).append("\n");
content.append(item.getContent()).append("\n");
}
preview.setLocation(location.substring(0,location.toString().length() - 1));
preview.setContent(content.substring(0,location.toString().length() - 1));
}
}
// 计划工作时间
if(ObjectUtil.isNotEmpty(preview.getPlanStartTime()) && ObjectUtil.isNotEmpty(preview.getPlanEndTime())){
Calendar start = Calendar.getInstance();
start.setTime(preview.getPlanStartTime());
StringBuilder planTimeInterval = new StringBuilder();
planTimeInterval.append(start.get(Calendar.YEAR)).append(" 年 ").append(start.get(Calendar.MONTH)).append(" 月 ").append(start.get(Calendar.DAY_OF_MONTH))
.append(" 日 ").append(start.get(Calendar.HOUR_OF_DAY)).append(" 时 ").append(start.get(Calendar.MINUTE)).append(" 分").append(" 至 ");
Calendar end = Calendar.getInstance();
end.setTime(preview.getPlanStartTime());
planTimeInterval.append(end.get(Calendar.YEAR)).append(" 年 ").append(end.get(Calendar.MONTH)).append(" 月 ").append(end.get(Calendar.DAY_OF_MONTH))
.append(" 日 ").append(end.get(Calendar.HOUR_OF_DAY)).append(" 时 ").append(end.get(Calendar.MINUTE)).append(" 分");
preview.setPlanTimeInterval(planTimeInterval.toString());
}
// 工作派工单签发时间
if(ObjectUtil.isNotEmpty(preview.getTime())){
Calendar createTime = Calendar.getInstance();
createTime.setTime(preview.getTime());
preview.setCreateYear(createTime.get(Calendar.YEAR));
preview.setCreateMon(createTime.get(Calendar.MONTH));
preview.setCreateDay(createTime.get(Calendar.DAY_OF_MONTH));
preview.setCreateHour(createTime.get(Calendar.HOUR_OF_DAY));
preview.setCreateMin(createTime.get(Calendar.MINUTE));
}
// 开票处理时间
if(ObjectUtil.isNotEmpty(preview.getHeadHandleTime())){
Calendar headTime = Calendar.getInstance();
headTime.setTime(preview.getHeadHandleTime());
preview.setHeadYear(headTime.get(Calendar.YEAR));
preview.setHeadMon(headTime.get(Calendar.MONTH));
preview.setHeadDay(headTime.get(Calendar.DAY_OF_MONTH));
preview.setHeadHour(headTime.get(Calendar.HOUR_OF_DAY));
preview.setHeadMin(headTime.get(Calendar.MINUTE));
}
// 工单结束时间
if(ObjectUtil.isNotEmpty(preview.getWorkEndTime())){
Calendar entTime = Calendar.getInstance();
entTime.setTime(preview.getWorkEndTime());
preview.setEndYear(entTime.get(Calendar.YEAR));
preview.setEndMon(entTime.get(Calendar.MONTH));
preview.setEndDay(entTime.get(Calendar.DAY_OF_MONTH));
preview.setEndHour(entTime.get(Calendar.HOUR_OF_DAY));
preview.setEndMin(entTime.get(Calendar.MINUTE));
}
// 许可时间
if(ObjectUtil.isNotEmpty(preview.getLicensorTime())){
Calendar licensorTime = Calendar.getInstance();
licensorTime.setTime(preview.getLicensorTime());
String licensorExportTime = licensorTime.get(Calendar.YEAR) + "年" + licensorTime.get(Calendar.MONTH) + "月" + licensorTime.get(Calendar.DAY_OF_MONTH) +
"日" + licensorTime.get(Calendar.HOUR_OF_DAY) + "时" + licensorTime.get(Calendar.MINUTE) + "分";
preview.setLicensorExportTime(licensorExportTime);
}
return preview;
}
/**
* 查询工作票数据
* @param ticketCode
* @return
*/
@Override
public List<WorkTicketInfoEntity> workTicketList(String ticketCode) {
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper();
queryWrapper.lambda().orderByDesc(WorkTicketInfoEntity::getCreateTime);
if(StringUtil.isEmpty(ticketCode)){
return workTicketInfoService.list(queryWrapper);
}
queryWrapper.lambda().like(WorkTicketInfoEntity::getCode,ticketCode);
return workTicketInfoService.list(queryWrapper);
}
}

BIN
hzims-service/ticket/src/main/resources/template/excel/work_task_template.xlsx

Binary file not shown.
Loading…
Cancel
Save