Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 11 months ago
parent
commit
021ef4be05
  1. 46
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckRecordDTO.java
  2. 13
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java
  3. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java
  4. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java
  5. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java
  6. 14
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java
  7. 16
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java
  8. 21
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java
  9. 16
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java
  10. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  11. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  12. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java
  13. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java
  14. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java
  15. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java
  16. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java
  17. 37
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordPageVO.java
  18. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java
  19. 9
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java
  20. 4
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/fegin/IRepairClient.java
  21. BIN
      hzims-service/safeproduct/lib/aspose-words-15.8.0-jdk16.jar
  22. 8
      hzims-service/safeproduct/pom.xml
  23. 65
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java
  24. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  25. 41
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java
  26. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java
  27. 17
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml
  28. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  29. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml
  30. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml
  31. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml
  32. 22
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckItemService.java
  33. 39
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckRecordService.java
  34. 13
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java
  35. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarService.java
  36. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarUsedRecordService.java
  37. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  38. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java
  39. 41
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckItemServiceImpl.java
  40. 106
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  41. 118
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  42. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  43. 50
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java
  44. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  45. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java
  46. 35
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  47. 73
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  48. 126
      hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

46
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckRecordDTO.java

@ -0,0 +1,46 @@
package com.hnac.hzims.safeproduct.dto;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
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.util.Date;
import java.util.List;
/**
* @author liwen
* @date 2024-01-09
*/
@Data
@ApiModel(value = "车检记录DTO类")
public class CarCheckRecordDTO {
@ApiModelProperty("车检记录id")
private Long id;
@ApiModelProperty("车辆id")
private Long carId;
@NotNull
@Size(max = 50, message = "检查人长度不能超过50")
@ApiModelProperty("检查人")
private String checker;
@NotNull
@ApiModelProperty("检查时间")
private Date checkTime;
@NotNull
@ApiModelProperty("检查结论")
private String conclusion;
@Size(max = 500, message = "填报备注长度不能超过50")
@ApiModelProperty("填报备注")
private String remark;
@ApiModelProperty("检查项列表")
List<CarCheckItemEntity> itemList;
}

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

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -14,12 +16,19 @@ import java.util.Date;
@ApiModel(value = "车辆维保记录确认DTO类") @ApiModel(value = "车辆维保记录确认DTO类")
public class CarMaintenanceConfirmationDTO { public class CarMaintenanceConfirmationDTO {
@NotNull
@ApiModelProperty("车辆维保记录id") @ApiModelProperty("车辆维保记录id")
private Long carMaintenanceId; private Long carMaintenanceId;
@NotNull
@ApiModelProperty("车辆管理人意见") @ApiModelProperty("车辆管理人意见")
private String managerAdvice; private String managerAdvice;
@ApiModelProperty("确认时间") @NotNull
private Date confirmationTime; @ApiModelProperty("下次维保时间")
private Date maintenanceNextTime;
@NotNull
@ApiModelProperty("维保里程")
private BigDecimal maintenanceMileage;
} }

6
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import javax.validation.constraints.NotNull;
/** /**
* @author liwen * @author liwen
@ -14,9 +14,7 @@ import java.util.Date;
@ApiModel(value = "用车记录确认DTO类") @ApiModel(value = "用车记录确认DTO类")
public class CarUsedRecordConfirmationDTO { public class CarUsedRecordConfirmationDTO {
@NotNull
@ApiModelProperty("用车记录id") @ApiModelProperty("用车记录id")
private Long carUsedRecordId; private Long carUsedRecordId;
@ApiModelProperty("确认时间")
private Date confirmationTime;
} }

7
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java

@ -21,8 +21,11 @@ import java.util.List;
@ApiModel(value = "卫生自查计划DTO类") @ApiModel(value = "卫生自查计划DTO类")
public class HygienePlanDTO extends BaseEntity { public class HygienePlanDTO extends BaseEntity {
@ApiModelProperty("编码") @ApiModelProperty("卫生自查计划id")
private String code; private Long id;
@ApiModelProperty("计划名称")
private String name;
@ApiModelProperty("标准总分值") @ApiModelProperty("标准总分值")
private Integer standardScore; private Integer standardScore;

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

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.entity; package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -7,6 +8,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/** /**
* @author liwen * @author liwen
* @date 2024-01-05 * @date 2024-01-05
@ -20,9 +24,16 @@ public class CarCheckItemEntity extends BaseEntity {
@ApiModelProperty("车检记录id") @ApiModelProperty("车检记录id")
private Long carCheckRecordId; private Long carCheckRecordId;
@NotNull
@Size(max = 500, message = "检查项目长度不能超过50")
@ApiModelProperty("检查项目") @ApiModelProperty("检查项目")
private String checkItem; private String checkItem;
@NotNull
@ApiModelProperty("检查内容") @ApiModelProperty("检查内容")
private String checkContent; private String checkContent;
@NotNull
@ApiModelProperty("检查结果")
private String checkResult;
} }

14
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
@ -22,24 +24,24 @@ public class CarCheckRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id") @ApiModelProperty("车辆id")
private Long carId; private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码") @ApiModelProperty("编码")
private String code; private String code;
@NotNull
@Size(max = 50, message = "检查人长度不能超过50")
@ApiModelProperty("检查人") @ApiModelProperty("检查人")
private String checker; private String checker;
@NotNull
@ApiModelProperty("检查时间") @ApiModelProperty("检查时间")
private Date checkTime; private Date checkTime;
@ApiModelProperty("检查项id") @NotNull
private String checkItemIds;
@ApiModelProperty("检查项结果")
private String checkItemResults;
@ApiModelProperty("检查结论") @ApiModelProperty("检查结论")
private String conclusion; private String conclusion;
@Size(max = 500, message = "填报备注长度不能超过50")
@ApiModelProperty("填报备注") @ApiModelProperty("填报备注")
private String remark; private String remark;
} }

16
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java

@ -1,6 +1,7 @@
package com.hnac.hzims.safeproduct.entity; package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -43,51 +44,60 @@ public class CarEntity extends BaseEntity {
private String plateNumber; private String plateNumber;
@NotNull @NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上牌时间") @ApiModelProperty("上牌时间")
private Date registrationTime; private Date registrationTime;
@NotNull @NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上期缴车保时间") @ApiModelProperty("上期缴车保时间")
private Date insurancePayLastTime; private Date insurancePayLastTime;
@NotNull @NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("下期缴车保时间") @ApiModelProperty("下期缴车保时间")
private Date insurancePayNextTime; private Date insurancePayNextTime;
@NotNull @NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("年检时间") @ApiModelProperty("年检时间")
private Date annualInspectionTime; private Date annualInspectionTime;
@NotNull @NotNull
@Size(max = 50, message = "年检状态长度不能超过50")
@ApiModelProperty("年检状态") @ApiModelProperty("年检状态")
private String annualInspectionStatus; private String annualInspectionStatus;
@NotNull @NotNull
@Size(max = 50, message = "保险状态长度不能超过50")
@ApiModelProperty("保险状态") @ApiModelProperty("保险状态")
private String insuranceStatus; private String insuranceStatus;
@NotNull @JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上期保养时间") @ApiModelProperty("上期保养时间")
private Date maintenanceLastTime; private Date maintenanceLastTime;
@NotNull @JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("下期保养时间") @ApiModelProperty("下期保养时间")
private Date maintenanceNextTime; private Date maintenanceNextTime;
@ApiModelProperty("保养里程") @ApiModelProperty("保养里程")
private BigDecimal maintenanceMileage; private BigDecimal maintenanceMileage;
@NotNull @Size(max = 50, message = "保养状态长度不能超过50")
@ApiModelProperty("保养状态") @ApiModelProperty("保养状态")
private String maintenanceStatus; private String maintenanceStatus;
@NotNull @NotNull
@Size(max = 50, message = "车辆管理人长度不能超过50")
@ApiModelProperty("车辆管理人") @ApiModelProperty("车辆管理人")
private String manager; private String manager;
@Size(max = 1000, message = "车辆照片长度不能超过1000")
@ApiModelProperty("车辆照片") @ApiModelProperty("车辆照片")
private String imgPath; private String imgPath;
@Size(max = 1000, message = "车辆附件长度不能超过1000")
@ApiModelProperty("车辆附件") @ApiModelProperty("车辆附件")
private String filePath; private String filePath;
} }

21
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java

@ -1,12 +1,15 @@
package com.hnac.hzims.safeproduct.entity; package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
@ -22,42 +25,60 @@ public class CarMaintenanceEntity extends BaseEntity {
@ApiModelProperty("车辆id") @ApiModelProperty("车辆id")
private Long carId; private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码") @ApiModelProperty("编码")
private String code; private String code;
@NotNull
@Size(max = 50, message = "维保类型长度不能超过50")
@ApiModelProperty("维保类型") @ApiModelProperty("维保类型")
private String maintenanceType; private String maintenanceType;
@NotNull
@ApiModelProperty("维保内容") @ApiModelProperty("维保内容")
private String content; private String content;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("维保开始时间") @ApiModelProperty("维保开始时间")
private Date startTime; private Date startTime;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("维保结束时间") @ApiModelProperty("维保结束时间")
private Date endTime; private Date endTime;
@NotNull
@Size(max = 255, message = "维保地点长度不能超过255")
@ApiModelProperty("维保地点") @ApiModelProperty("维保地点")
private String location; private String location;
@NotNull
@ApiModelProperty("维保费用") @ApiModelProperty("维保费用")
private Long cost; private Long cost;
@NotNull
@Size(max = 20, message = "维保人长度不能超过20")
@ApiModelProperty("维保人") @ApiModelProperty("维保人")
private String maintainer; private String maintainer;
@Size(max = 1000, message = "维保照片长度不能超过1000")
@ApiModelProperty("维保照片") @ApiModelProperty("维保照片")
private String imgPath; private String imgPath;
@Size(max = 1000, message = "维保附件长度不能超过1000")
@ApiModelProperty("维保附件") @ApiModelProperty("维保附件")
private String filePath; private String filePath;
@Size(max = 500, message = "车辆管理人意见长度不能超过500")
@ApiModelProperty("车辆管理人意见") @ApiModelProperty("车辆管理人意见")
private String managerAdvice; private String managerAdvice;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("确认时间") @ApiModelProperty("确认时间")
private Date confirmationTime; private Date confirmationTime;
@Size(max = 50, message = "维保状态长度不能超过50")
@ApiModelProperty("维保状态") @ApiModelProperty("维保状态")
private String maintenanceStatus; private String maintenanceStatus;
} }

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

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -23,33 +25,44 @@ public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id") @ApiModelProperty("车辆id")
private Long carId; private Long carId;
@Size(max = 50, message = "编码长度不能超过50")
@ApiModelProperty("编码") @ApiModelProperty("编码")
private String code; private String code;
@NotNull
@Size(max = 50, message = "用车单位长度不能超过50")
@ApiModelProperty("用车单位") @ApiModelProperty("用车单位")
private String unit; private String unit;
@NotNull
@ApiModelProperty("使用时间") @ApiModelProperty("使用时间")
private Date startTime; private Date startTime;
@NotNull
@Size(max = 255, message = "使用地点长度不能超过255")
@ApiModelProperty("使用地点") @ApiModelProperty("使用地点")
private String usedLocation; private String usedLocation;
@NotNull
@Size(max = 20, message = "使用人长度不能超过20")
@ApiModelProperty("使用人") @ApiModelProperty("使用人")
private String user; private String user;
@ApiModelProperty("用途详情") @ApiModelProperty("用途详情")
private String remark; private String remark;
@NotNull
@ApiModelProperty("出车公里数") @ApiModelProperty("出车公里数")
private BigDecimal startMiles; private BigDecimal startMiles;
@ApiModelProperty("收车公里数") @ApiModelProperty("收车公里数")
private BigDecimal endMiles; private BigDecimal endMiles;
@NotNull
@ApiModelProperty("行驶公里数") @ApiModelProperty("行驶公里数")
private BigDecimal miles; private BigDecimal miles;
@NotNull
@ApiModelProperty("收车时间") @ApiModelProperty("收车时间")
private Date endTime; private Date endTime;
@ -59,6 +72,7 @@ public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("用车状态") @ApiModelProperty("用车状态")
private String usedStatus; private String usedStatus;
@ApiModelProperty("图片路径") @Size(max = 1000, message = "用车图片长度不能超过1000")
@ApiModelProperty("用车图片")
private String imgPath; private String imgPath;
} }

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

@ -9,7 +9,6 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
@ -22,8 +21,8 @@ import java.util.Date;
@ApiModel(value = "卫生自查计划实体类") @ApiModel(value = "卫生自查计划实体类")
public class HygienePlanEntity extends BaseEntity { public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("编码") @ApiModelProperty("计划名称")
private String code; private String name;
@ApiModelProperty("标准总分值") @ApiModelProperty("标准总分值")
private Integer standardScore; private Integer standardScore;
@ -38,8 +37,6 @@ public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("计划结束时间") @ApiModelProperty("计划结束时间")
private Date scheduledEndTime; private Date scheduledEndTime;
@NotNull @ApiModelProperty("自查计划状态")
@Size(max = 20, message = "卫生自查状态字段长度不能超过20") private String hygienePlanStatus;
@ApiModelProperty("卫生自查状态")
private String hygieneStatus;
} }

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

@ -45,6 +45,7 @@ public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("责任区id") @ApiModelProperty("责任区id")
private String hygieneZoneIds; private String hygieneZoneIds;
@NotNull
@ApiModelProperty("检查结果") @ApiModelProperty("检查结果")
private String checkResult; private String checkResult;
@ -58,4 +59,7 @@ public class HygieneRecordEntity extends BaseEntity {
@Size(max = 1000, message = "检查图片字段长度不能超过1000") @Size(max = 1000, message = "检查图片字段长度不能超过1000")
@ApiModelProperty("检查图片") @ApiModelProperty("检查图片")
private String imgPath; private String imgPath;
@ApiModelProperty("自查记录状态")
private String hygieneRecordStatus;
} }

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

@ -9,6 +9,7 @@ import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
@ -38,12 +39,15 @@ public class RehearsalRecordEntity extends BaseEntity {
@ApiModelProperty("参演人员") @ApiModelProperty("参演人员")
private String peopleName; private String peopleName;
@NotNull
@ApiModelProperty("演练实际开始时间") @ApiModelProperty("演练实际开始时间")
private Date actualStartTime; private Date actualStartTime;
@NotNull
@ApiModelProperty("演练实际结束时间") @ApiModelProperty("演练实际结束时间")
private Date actualEndTime; private Date actualEndTime;
@NotNull
@Size(max = 250, message = "演练记录字段长度不能超过250") @Size(max = 250, message = "演练记录字段长度不能超过250")
@ApiModelProperty("演练记录") @ApiModelProperty("演练记录")
private String record; private String record;

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

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 车辆保险记录状态枚举类
*
* @author liwen
* @date 2024-01-11
*/
public enum CarInsuranceStatusEnum {
INSURED("INSURED", "已参保"),
UNINSURED("UNINSURED", "未参保");
private final String value;
private final String desc;
CarInsuranceStatusEnum(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/CarMaintenanceStatusEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 车辆维保记录状态枚举类
*
* @author liwen
* @date 2024-01-10
*/
public enum CarMaintenanceStatusEnum {
MAINTAINED("MAINTAINED", "已维保"),
UNMAINTAINED("UNMAINTAINED", "未维保");
private final String value;
private final String desc;
CarMaintenanceStatusEnum(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/CarUsedRecordEnum.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 用车记录枚举类
*
* @author liwen
* @date 2024-01-10
*/
public enum CarUsedRecordEnum {
USING("USING", "使用中"),
USED("USED", "已使用");
private final String value;
private final String desc;
CarUsedRecordEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

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

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.vo; package com.hnac.hzims.safeproduct.vo;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -37,5 +38,5 @@ public class CarCheckRecordDetailVO {
private String remark; private String remark;
@ApiModelProperty("检查列表") @ApiModelProperty("检查列表")
private List<CarCheckItemVO> checkItemList; private List<CarCheckItemEntity> checkItemList;
} }

37
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordPageVO.java

@ -0,0 +1,37 @@
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-09
*/
@Data
@ApiModel(value = "车检记录页面VO类")
public class CarCheckRecordPageVO {
@ApiModelProperty("车检记录id")
private Long id;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("检查人")
private String checker;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("检查结论")
private String conclusion;
}

10
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @author liwen * @author liwen
* @date 2024-01-04 * @date 2024-01-04
@ -24,8 +26,11 @@ public class CarMaintenancePageVO {
@ApiModelProperty("型号") @ApiModelProperty("型号")
private String carType; private String carType;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("维保类型") @ApiModelProperty("维保类型")
private String type; private String maintenanceType;
@ApiModelProperty("维保内容") @ApiModelProperty("维保内容")
private String content; private String content;
@ -38,4 +43,7 @@ public class CarMaintenancePageVO {
@ApiModelProperty("维保人") @ApiModelProperty("维保人")
private String maintainer; private String maintainer;
@ApiModelProperty("确认时间")
private Date confirmationTime;
} }

9
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java

@ -15,6 +15,9 @@ import java.util.Date;
@ApiModel(value = "用车记录页面VO类") @ApiModel(value = "用车记录页面VO类")
public class CarUsedRecordPageVO { public class CarUsedRecordPageVO {
@ApiModelProperty("用车记录id")
private Long id;
@ApiModelProperty("用车单位") @ApiModelProperty("用车单位")
private String unit; private String unit;
@ -24,6 +27,9 @@ public class CarUsedRecordPageVO {
@ApiModelProperty("车牌号") @ApiModelProperty("车牌号")
private String plateNumber; private String plateNumber;
@ApiModelProperty("使用地点")
private String usedLocation;
@ApiModelProperty("使用时间") @ApiModelProperty("使用时间")
private Date startTime; private Date startTime;
@ -41,4 +47,7 @@ public class CarUsedRecordPageVO {
@ApiModelProperty("行驶公里数") @ApiModelProperty("行驶公里数")
private BigDecimal miles; private BigDecimal miles;
@ApiModelProperty("确认时间")
private Date confirmationTime;
} }

4
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/fegin/IRepairClient.java

@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author ysj * @author ysj
*/ */
@FeignClient( @FeignClient(
value = TicketConstants.APP_NAME, value = TicketConstants.APP_NAME
fallback = RepairClientFallback.class // fallback = RepairClientFallback.class
) )
public interface IRepairClient { public interface IRepairClient {

BIN
hzims-service/safeproduct/lib/aspose-words-15.8.0-jdk16.jar

Binary file not shown.

8
hzims-service/safeproduct/pom.xml

@ -132,6 +132,14 @@
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>ticket-api</artifactId> <artifactId>ticket-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>15.8.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/aspose-words-15.8.0-jdk16.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>

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

@ -3,9 +3,9 @@ package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.entity.CarEntity; import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity; import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity; import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
@ -25,6 +25,7 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Map; import java.util.Map;
@ -84,7 +85,8 @@ public class CarController extends BladeController {
@ApiOperation(value = "车辆分页") @ApiOperation(value = "车辆分页")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
public R<IPage<CarEntity>> carPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { public R<IPage<CarEntity>> carPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarEntity> page = carService.page(Condition.getPage(query), Condition.getQueryWrapper(param, CarEntity.class)); IPage<CarEntity> page = carService.page(Condition.getPage(query), Condition.getQueryWrapper(param, CarEntity.class)
.lambda().orderByDesc(CarEntity::getCreateTime));
return R.data(page); return R.data(page);
} }
@ -133,8 +135,8 @@ public class CarController extends BladeController {
@PostMapping("/confirmCarMaintenance") @PostMapping("/confirmCarMaintenance")
@ApiOperation(value = "车辆维保记录确认") @ApiOperation(value = "车辆维保记录确认")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
public R confirmCarMaintenance(@RequestBody CarMaintenanceConfirmationDTO confirmationDTO) { public R confirmCarMaintenance(@Valid @RequestBody CarMaintenanceConfirmationDTO confirmationDTO) {
return R.status(carMaintenanceService.confirmCarMaintenance(confirmationDTO)); return carMaintenanceService.confirmCarMaintenance(confirmationDTO);
} }
@PostMapping("/saveCarUsedRecord") @PostMapping("/saveCarUsedRecord")
@ -148,7 +150,7 @@ public class CarController extends BladeController {
@ApiOperation(value = "修改用车记录") @ApiOperation(value = "修改用车记录")
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
public R updateCarUsedRecord(@Valid @RequestBody CarUsedRecordEntity carUsedRecordEntity) { public R updateCarUsedRecord(@Valid @RequestBody CarUsedRecordEntity carUsedRecordEntity) {
return R.status(carUsedRecordService.updateById(carUsedRecordEntity)); return R.status(carUsedRecordService.updateCarUsedRecord(carUsedRecordEntity));
} }
@PostMapping("/removeCarUsedRecord") @PostMapping("/removeCarUsedRecord")
@ -167,9 +169,10 @@ public class CarController extends BladeController {
@GetMapping("/carUsedRecordPage") @GetMapping("/carUsedRecordPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string") @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "车辆维保记录分页") @ApiOperation(value = "车记录分页")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 16)
public R<IPage<CarUsedRecordPageVO>> carUsedRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { public R<IPage<CarUsedRecordPageVO>> carUsedRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarUsedRecordPageVO> page = carUsedRecordService.getCarUsedRecordPage(param, query); IPage<CarUsedRecordPageVO> page = carUsedRecordService.getCarUsedRecordPage(param, query);
@ -179,8 +182,8 @@ public class CarController extends BladeController {
@PostMapping("/confirmCarUsedRecord") @PostMapping("/confirmCarUsedRecord")
@ApiOperation(value = "用车记录确认") @ApiOperation(value = "用车记录确认")
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
public R confirmCarUsedRecord(@RequestBody CarUsedRecordConfirmationDTO confirmationDTO) { public R confirmCarUsedRecord(@Valid @RequestBody CarUsedRecordConfirmationDTO confirmationDTO) {
return R.status(carUsedRecordService.confirmCarUsedRecord(confirmationDTO)); return carUsedRecordService.confirmCarUsedRecord(confirmationDTO);
} }
@GetMapping("/milesDataByYear") @GetMapping("/milesDataByYear")
@ -194,39 +197,61 @@ public class CarController extends BladeController {
@PostMapping("/saveCarCheckRecord") @PostMapping("/saveCarCheckRecord")
@ApiOperation(value = "新增车检记录") @ApiOperation(value = "新增车检记录")
@ApiOperationSupport(order = 19) @ApiOperationSupport(order = 19)
public R saveCarCheckRecord(@Valid @RequestBody CarCheckRecordEntity carCheckRecordEntity) { public R saveCarCheckRecord(@Valid @RequestBody CarCheckRecordDTO carCheckRecordDTO) {
return R.status(carCheckRecordService.saveCarCheckRecord(carCheckRecordEntity)); return R.status(carCheckRecordService.saveCarCheckRecord(carCheckRecordDTO));
} }
@PostMapping("/updateCarCheckRecord") @PostMapping("/updateCarCheckRecord")
@ApiOperation(value = "修改车检记录") @ApiOperation(value = "修改车检记录")
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
public R updateCarCheckRecord(@Valid @RequestBody CarCheckRecordEntity carCheckRecordEntity) { public R updateCarCheckRecord(@Valid @RequestBody CarCheckRecordDTO carCheckRecordDTO) {
return R.status(carCheckRecordService.updateById(carCheckRecordEntity)); return R.status(carCheckRecordService.updateCarCheckRecord(carCheckRecordDTO));
} }
@PostMapping("/removeCarCheckRecord") @PostMapping("/removeCarCheckRecord")
@ApiOperation(value = "删除车检记录") @ApiOperation(value = "删除车检记录")
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
public R removeCarCheckRecord(@RequestParam Long id) { public R removeCarCheckRecord(@RequestParam Long id) {
return R.status(carCheckRecordService.removeById(id)); return R.status(carCheckRecordService.removeCarCheckRecord(id));
} }
@GetMapping("/carCheckRecordDetail") @GetMapping("/carCheckRecordDetail")
@ApiOperation(value = "车检记录详情") @ApiOperation(value = "车检记录详情")
@ApiOperationSupport(order = 15) @ApiOperationSupport(order = 22)
public R<CarCheckRecordDetailVO> carCheckRecordDetail(@RequestParam Long id) { public R<CarCheckRecordDetailVO> carCheckRecordDetail(@RequestParam Long id) {
return R.data(carCheckRecordService.getCarCheckRecord(id)); return R.data(carCheckRecordService.getCarCheckRecord(id));
} }
@GetMapping("/carCheckRecordPage") @GetMapping("/carCheckRecordPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string") @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "车辆维保记录分页") @ApiOperation(value = "车记录分页")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 23)
public R<IPage<CarUsedRecordPageVO>> carCheckRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { public R<IPage<CarCheckRecordPageVO>> carCheckRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarUsedRecordPageVO> page = carUsedRecordService.getCarUsedRecordPage(param, query); IPage<CarCheckRecordPageVO> page = carCheckRecordService.getCarCheckRecordPage(param, query);
return R.data(page); return R.data(page);
} }
@GetMapping("/exportCarMaintenanceData")
@ApiOperation(value = "导出车辆维保记录单")
@ApiOperationSupport(order = 24)
public void exportCarMaintenanceData(@RequestParam Long id, HttpServletResponse response) {
carMaintenanceService.exportCarMaintenanceData(id, response);
}
@GetMapping("/exportCarUsedRecordData")
@ApiOperation(value = "导出用车记录单")
@ApiOperationSupport(order = 25)
public void exportCarUsedRecordData() {
}
@GetMapping("/exportCarCheckRecordData")
@ApiOperation(value = "导出车检记录单")
@ApiOperationSupport(order = 26)
public void exportCarCheckRecordData() {
}
} }

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

@ -148,4 +148,11 @@ public class RehearsalController extends BladeController {
public void exportRehearsalData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) { public void exportRehearsalData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
rehearsalPlanService.exportRehearsalPlanData(param, response); rehearsalPlanService.exportRehearsalPlanData(param, response);
} }
@GetMapping("/exportRecordDetailData")
@ApiOperation(value = "演练记录表导出")
@ApiOperationSupport(order = 14)
public void exportRecordDetailData(@RequestParam Long id) {
rehearsalRecordService.exportRecordDetailData(id);
}
} }

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

@ -0,0 +1,41 @@
package com.hnac.hzims.safeproduct.jobs;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springblade.core.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-11
*/
@Component
public class CarJob {
@Autowired
ICarService carService;
/**
* 车辆台账自动变更
*/
@XxlJob("autoChangeCarStatus")
public ReturnT<String> autoChangeCarStatus(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<CarEntity> uninsuredCarList = carService.getCarListByInsuranceTime(today, yesterday);
// uninsuredCarList.forEach(car -> car.setInsuranceStatus());
// List<CarEntity> carListByMaintenanceTime = carService.getCarListByMaintenanceTime(today, yesterday);
return ReturnT.SUCCESS;
}
}

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

@ -1,9 +1,13 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity; import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/** /**
* 车检记录Mapper类 * 车检记录Mapper类
* *
@ -13,4 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface CarCheckRecordMapper extends BaseMapper<CarCheckRecordEntity> { public interface CarCheckRecordMapper extends BaseMapper<CarCheckRecordEntity> {
/**
* 车检记录分页
* @param param 入参
* @param page 分页类
* @return 分页数据
*/
IPage<CarCheckRecordPageVO> getCarCheckRecordPage(IPage<CarCheckRecordPageVO> page, Map<String, Object> param);
} }

17
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml

@ -2,4 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.CarCheckRecordMapper"> <mapper namespace="com.hnac.hzims.safeproduct.mapper.CarCheckRecordMapper">
<select id="getCarCheckRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO">
SELECT
t1.id, t2.unit, t2.car_brand, t2.plate_number, t1.checker, t1.check_time, t1.conclusion
FROM
hzims_car_check_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE
t1.is_deleted = 0
<if test="param.unit != null and param.unit != ''">
AND t2.unit like concat('%', #{param.unit}, '%')
</if>
<if test="param.carId != null and param.carId != ''">
AND t1.car_id = #{param.carId}
</if>
ORDER BY
t1.create_time DESC
</select>
</mapper> </mapper>

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

@ -10,7 +10,7 @@
hzims_car_maintenance t1 hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE WHERE
is_deleted = 0 t1.is_deleted = 0
<if test="carMaintenanceId != null and carMaintenanceId != ''"> <if test="carMaintenanceId != null and carMaintenanceId != ''">
AND t1.id = #{carMaintenanceId} AND t1.id = #{carMaintenanceId}
</if> </if>
@ -18,12 +18,13 @@
<select id="getCarMaintenancePage" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO"> <select id="getCarMaintenancePage" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO">
SELECT SELECT
t2.unit, t2.car_brand, t2.car_type, t1.id, t1.type, t1.content, t1.location, t1.cost, t1.maintainer t2.unit, t2.car_brand, t2.car_type, t2.plate_number, t1.id, t1.maintenance_type, t1.content, t1.location,
t1.cost, t1.maintainer, t1.confirmation_time
FROM FROM
hzims_car_maintenance t1 hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE WHERE
is_deleted = 0 t1.is_deleted = 0
<if test="param.unit != null and param.unit != ''"> <if test="param.unit != null and param.unit != ''">
AND t2.unit = #{param.unit} AND t2.unit = #{param.unit}
</if> </if>

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml

@ -22,24 +22,24 @@
<select id="selectMilesByCar" resultType="com.hnac.hzims.safeproduct.dto.CarMilesYearDTO"> <select id="selectMilesByCar" resultType="com.hnac.hzims.safeproduct.dto.CarMilesYearDTO">
SELECT SELECT
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t1.confirmation_time, '%m') as dateTime, sum(t2.miles) as miles t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles
FROM FROM
hzims_car t1 hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id
WHERE WHERE
t1.is_deleted = 0 t1.is_deleted = 0
<if test="year != null and year != ''"> <if test="year != null and year != ''">
AND t2.confirmation_time like concat('%', #{year}, '%') AND t2.end_time like concat('%', #{year}, '%')
</if> </if>
AND t2.used_status = 'CONFIRMED' AND t2.used_status = 'USED'
AND t1.plate_number in AND t1.plate_number in
<foreach collection="carList" item="car" open="(" close=")" separator=","> <foreach collection="carList" item="car" open="(" close=")" separator=",">
#{car} #{car}
</foreach> </foreach>
GROUP BY GROUP BY
t1.plate_number, DATE_FORMAT(t1.confirmation_time, '%m') t1.plate_number, DATE_FORMAT(t2.end_time, '%m')
ORDER BY ORDER BY
t1.end_time DESC t1.create_time DESC
</select> </select>
<select id="selectMilesByPlateNumber" resultType="java.math.BigDecimal"> <select id="selectMilesByPlateNumber" resultType="java.math.BigDecimal">

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

@ -18,8 +18,8 @@
<select id="getCarUsedRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO"> <select id="getCarUsedRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO">
SELECT SELECT
t1.unit, t1.start_time, t1.user, t1.remark, t1.start_miles, t1.end_miles, t1.miles, t1.id, t1.unit, t1.start_time, t1.user, t1.remark, t1.start_miles, t1.end_miles, t1.miles,
t2.car_brand, t2.plate_number t2.car_brand, t2.plate_number, t1.used_location, t1.confirmation_time, t1.used_location
FROM FROM
hzims_car_used_record t1 hzims_car_used_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -28,6 +28,9 @@
<if test="param.unit != null and param.unit != ''"> <if test="param.unit != null and param.unit != ''">
AND t1.unit = #{param.unit} AND t1.unit = #{param.unit}
</if> </if>
<if test="param.carId != null and param.carId != ''">
AND t1.car_id = #{param.carId}
</if>
ORDER BY ORDER BY
t1.create_time DESC t1.create_time DESC
</select> </select>

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

@ -22,11 +22,11 @@
SELECT SELECT
unit, count(1) as finished_task_num unit, count(1) as finished_task_num
FROM FROM
hzims_hygiene_plan hzims_hygiene_record
WHERE WHERE
is_deleted = 0 is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%') AND scheduled_end_time like concat('%', #{month}, '%')
AND hygiene_status = 'FINISHED' AND hygiene_plan_status = 'FINISHED'
<if test="unit != null and unit != ''"> <if test="unit != null and unit != ''">
AND unit like concat('%', #{unit}, '%') AND unit like concat('%', #{unit}, '%')
</if> </if>

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

@ -3,6 +3,8 @@ package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity; import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import java.util.List;
/** /**
* 车检项服务类 * 车检项服务类
* *
@ -11,4 +13,24 @@ import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
*/ */
public interface ICarCheckItemService extends IService<CarCheckItemEntity> { public interface ICarCheckItemService extends IService<CarCheckItemEntity> {
/**
* 根据检查项获取数据
* @param checkContent 检查内容
* @return 检查项数据
*/
CarCheckItemEntity getDetailByCheckContent(String checkContent);
/**
* 删除关联检查项数据
* @param carCheckRecordId 车检记录id
* @return true-成功false-失败
*/
boolean removeRelativeCarCheckItem(Long carCheckRecordId);
/**
* 根据车检记录id查询检查项数据
* @param carCheckRecordId 车检记录id
* @return 检查项数据
*/
List<CarCheckItemEntity> getListByCarCheckRecordId(Long carCheckRecordId);
} }

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

@ -1,8 +1,14 @@
package com.hnac.hzims.safeproduct.service; package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity; import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO;
import org.springblade.core.mp.support.Query;
import java.util.Map;
/** /**
* 车检记录服务类 * 车检记录服务类
@ -14,10 +20,10 @@ public interface ICarCheckRecordService extends IService<CarCheckRecordEntity> {
/** /**
* 新增车检记录 * 新增车检记录
* @param carCheckRecordEntity 车检记录实体 * @param carCheckRecordDTO 车检记录DTO
* @return true-成功false-失败 * @return true-成功false-失败
*/ */
boolean saveCarCheckRecord(CarCheckRecordEntity carCheckRecordEntity); boolean saveCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO);
/** /**
* 车检记录详情 * 车检记录详情
@ -25,4 +31,33 @@ public interface ICarCheckRecordService extends IService<CarCheckRecordEntity> {
* @return 车检记录详情VO类 * @return 车检记录详情VO类
*/ */
CarCheckRecordDetailVO getCarCheckRecord(Long id); CarCheckRecordDetailVO getCarCheckRecord(Long id);
/**
* 车检记录分页
* @param param 入参
* @param query 分页类
* @return 分页数据
*/
IPage<CarCheckRecordPageVO> getCarCheckRecordPage(Map<String, Object> param, Query query);
/**
* 根据编码查询车检记录
* @param code 编码
* @return 车检记录实体类
*/
CarCheckRecordEntity getCarCheckRecordByCode(String code);
/**
* 修改车检记录
* @param carCheckRecordDTO 车检记录DTO类
* @return true-成功false-失败
*/
boolean updateCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO);
/**
* 删除车检记录
* @param id 车检记录id
* @return true-成功false-失败
*/
boolean removeCarCheckRecord(Long id);
} }

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

@ -7,7 +7,9 @@ import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO; import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO; import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;
import java.util.Map; import java.util.Map;
/** /**
@ -43,7 +45,14 @@ public interface ICarMaintenanceService extends IService<CarMaintenanceEntity> {
/** /**
* 车辆维保记录确认 * 车辆维保记录确认
* @param confirmationDTO 车辆维保记录确认DTO类 * @param confirmationDTO 车辆维保记录确认DTO类
* @return true-成功false-失败 * @return 封装结果类
*/
R confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO);
/**
* 导出车辆维保记录单
* @param id 车辆维保记录id
* @param response 响应类
*/ */
boolean confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO); void exportCarMaintenanceData(Long id, HttpServletResponse response);
} }

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

@ -1,12 +1,13 @@
package com.hnac.hzims.safeproduct.service; package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarEntity; import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO; import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import java.util.List;
/** /**
* 车辆管理服务类 * 车辆管理服务类
* *
@ -23,4 +24,12 @@ public interface ICarService extends IService<CarEntity> {
* @return 分页数据 * @return 分页数据
*/ */
IPage<CarMilesYearVO> milesDataByYear(String year, String unit, Query query); IPage<CarMilesYearVO> milesDataByYear(String year, String unit, Query query);
/**
* 根据参保时间查询车辆列表
* @param today 当天
* @param yesterday 昨天
* @return 车辆列表数据
*/
List<CarEntity> getCarListByInsuranceTime(String today, String yesterday);
} }

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

@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity; import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import java.util.Map; import java.util.Map;
@ -44,7 +44,14 @@ public interface ICarUsedRecordService extends IService<CarUsedRecordEntity> {
/** /**
* 用车记录确认 * 用车记录确认
* @param confirmationDTO 用车记录确认DTO类 * @param confirmationDTO 用车记录确认DTO类
* @return 封装结果类
*/
R confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO);
/**
* 更新用车记录
* @param carUsedRecordEntity 用车记录实体类
* @return true-成功false-失败 * @return true-成功false-失败
*/ */
boolean confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO); boolean updateCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity);
} }

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

@ -66,11 +66,11 @@ public interface IHygienePlanService extends IService<HygienePlanEntity> {
HygienePlanDetailVO getPlan(Long id); HygienePlanDetailVO getPlan(Long id);
/** /**
* 根据编码查询卫生自查计划 * 根据名称查询卫生自查计划
* @param code 编码 * @param name 名称
* @return 卫生自查计划实体类 * @return 卫生自查计划实体类
*/ */
HygienePlanEntity getPlanByCode(String code); HygienePlanEntity getPlanByName(String name);
/** /**
* 月度数据导出 * 月度数据导出

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

@ -31,4 +31,10 @@ public interface IRehearsalRecordService extends IService<RehearsalRecordEntity>
* @return true-成功false-失败 * @return true-成功false-失败
*/ */
boolean removeRelativeRehearsalRecord(Long rehearsalPlanId); boolean removeRelativeRehearsalRecord(Long rehearsalPlanId);
/**
* 演练记录表导出
* @param id 演练记录id
*/
void exportRecordDetailData(Long id);
} }

41
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckItemServiceImpl.java

@ -1,11 +1,16 @@
package com.hnac.hzims.safeproduct.service.impl; package com.hnac.hzims.safeproduct.service.impl;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity; import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import com.hnac.hzims.safeproduct.mapper.CarCheckItemMapper; import com.hnac.hzims.safeproduct.mapper.CarCheckItemMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckItemService; import com.hnac.hzims.safeproduct.service.ICarCheckItemService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* 车检项服务实现类 * 车检项服务实现类
* *
@ -15,4 +20,40 @@ import org.springframework.stereotype.Service;
@Service @Service
public class CarCheckItemServiceImpl extends ServiceImpl<CarCheckItemMapper, CarCheckItemEntity> implements ICarCheckItemService { public class CarCheckItemServiceImpl extends ServiceImpl<CarCheckItemMapper, CarCheckItemEntity> implements ICarCheckItemService {
/**
* 根据检查项获取数据
*/
@Override
public CarCheckItemEntity getDetailByCheckContent(String checkContent) {
QueryWrapper<CarCheckItemEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckItemEntity::getCheckContent, checkContent);
return this.getOne(queryWrapper);
}
/**
* 删除关联检查项数据
*/
@Override
public boolean removeRelativeCarCheckItem(Long carCheckRecordId) {
QueryWrapper<CarCheckItemEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckItemEntity::getCarCheckRecordId, carCheckRecordId);
List<CarCheckItemEntity> list = this.list(queryWrapper);
// 若无相关检查项,返回true
if (CollectionUtils.isEmpty(list)) {
return true;
}
List<Long> ids = list.stream().map(CarCheckItemEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids);
}
/**
* 根据车检记录id查询检查项数据
*/
@Override
public List<CarCheckItemEntity> getListByCarCheckRecordId(Long carCheckRecordId) {
QueryWrapper<CarCheckItemEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckItemEntity::getCarCheckRecordId, carCheckRecordId)
.orderByDesc(CarCheckItemEntity::getCheckItem);
return this.list(queryWrapper);
}
} }

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

@ -1,10 +1,12 @@
package com.hnac.hzims.safeproduct.service.impl; package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils; import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity; import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity; import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.entity.CarEntity; import com.hnac.hzims.safeproduct.entity.CarEntity;
@ -15,14 +17,19 @@ import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarCheckItemVO; import com.hnac.hzims.safeproduct.vo.CarCheckItemVO;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 车检记录服务实现类 * 车检记录服务实现类
@ -42,16 +49,28 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
/** /**
* 新增车检记录 * 新增车检记录
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean saveCarCheckRecord(CarCheckRecordEntity carCheckRecordEntity) { public boolean saveCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO) {
// 编码生成 CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity();
// 获取当月时间(yyyymm) BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity);
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()); // 编码
// 获取当月时间
String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号 // 查询是否存在同月编号
String lastCode = getLastCode(currentMonth); String lastCode = getLastCode(currentNormMonth);
String code = BaseUtil.getUniqueCode("CLJC", lastCode, currentMonth); String code = BaseUtil.getUniqueCode("CLJC", lastCode, currentSimpleMonth);
carCheckRecordEntity.setCode(code); carCheckRecordEntity.setCode(code);
return this.save(carCheckRecordEntity); // 若新增车检记录成功,新增相关检查项数据
boolean saveRecord = this.save(carCheckRecordEntity);
if (saveRecord) {
CarCheckRecordEntity recordEntity = getCarCheckRecordByCode(code);
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
itemList.forEach(x -> x.setCarCheckRecordId(recordEntity.getId()));
return carCheckItemService.saveBatch(itemList);
}
return false;
} }
/** /**
@ -77,31 +96,29 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
carCheckRecordDetailVO.setMiles(miles); carCheckRecordDetailVO.setMiles(miles);
} }
// 拼装检查列表 // 拼装检查列表
List<CarCheckItemVO> checkList = new ArrayList<>(); List<CarCheckItemEntity> itemList = carCheckItemService.getListByCarCheckRecordId(id);
String[] checkItemIds = carCheckRecord.getCheckItemIds().split(",|,"); carCheckRecordDetailVO.setCheckItemList(itemList);
String[] checkItemResults = carCheckRecord.getCheckItemResults().split(",|,");
for (int i = 0; i < checkItemIds.length; i++) {
CarCheckItemEntity checkItemEntity = carCheckItemService.getById(checkItemIds[i]);
CarCheckItemVO carCheckItemVO = new CarCheckItemVO();
carCheckItemVO.setCheckItem(checkItemEntity.getCheckItem());
carCheckItemVO.setCheckContent(checkItemEntity.getCheckContent());
carCheckItemVO.setCheckResult(checkItemResults[i]);
checkList.add(carCheckItemVO);
}
carCheckRecordDetailVO.setCheckItemList(checkList);
return carCheckRecordDetailVO; return carCheckRecordDetailVO;
} }
return null; return null;
} }
/** /**
* 车检记录分页
*/
@Override
public IPage<CarCheckRecordPageVO> getCarCheckRecordPage(Map<String, Object> param, Query query) {
IPage<CarCheckRecordPageVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getCarCheckRecordPage(page, param);
}
/**
* 查询是否存在同月编号 * 查询是否存在同月编号
* @param currentMonth 当月 * @param currentMonth 当月
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null
*/ */
private String getLastCode(String currentMonth) { private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2); List<CarCheckRecordEntity> list = getCarCheckRecordByMonth(currentMonth);
List<CarCheckRecordEntity> list = getCarCheckRecordByMonth(month);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@ -109,9 +126,9 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
} }
/** /**
* 查询当月卫生自查记录 * 查询当月车检记录
* @param month 当月 * @param month 当月
* @return 当月卫生自查数据表 * @return 当月车检记录数据表
*/ */
private List<CarCheckRecordEntity> getCarCheckRecordByMonth(String month) { private List<CarCheckRecordEntity> getCarCheckRecordByMonth(String month) {
QueryWrapper<CarCheckRecordEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<CarCheckRecordEntity> queryWrapper = new QueryWrapper<>();
@ -119,4 +136,45 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
.orderByDesc(CarCheckRecordEntity::getCode); .orderByDesc(CarCheckRecordEntity::getCode);
return this.list(queryWrapper); return this.list(queryWrapper);
} }
/**
* 根据编码查询车检记录
*/
@Override
public CarCheckRecordEntity getCarCheckRecordByCode(String code) {
QueryWrapper<CarCheckRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckRecordEntity::getCode, code);
return this.getOne(queryWrapper);
}
/**
* 修改车检记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO) {
// 更新检查项
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
boolean updateItem = carCheckItemService.updateBatchById(itemList);
// 若更新检查项成功,则更新车检记录
if (updateItem) {
CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity();
BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity);
return this.updateById(carCheckRecordEntity);
}
return false;
}
/**
* 删除车检记录
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeCarCheckRecord(Long id) {
boolean remove = this.removeById(id);
if (remove) {
return carCheckItemService.removeRelativeCarCheckItem(id);
}
return false;
}
} }

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

@ -1,24 +1,41 @@
package com.hnac.hzims.safeproduct.service.impl; package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.CollectionUtils; import com.alibaba.excel.util.CollectionUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO; 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.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.enums.CarMaintenanceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper; import com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService; import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO; import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO; import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import com.hnac.hzims.ticket.constants.WorkTicketConstants;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; 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.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -32,8 +49,8 @@ import java.util.Map;
@Service @Service
public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper, CarMaintenanceEntity> implements ICarMaintenanceService { public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper, CarMaintenanceEntity> implements ICarMaintenanceService {
@Resource @Autowired
CarMapper carMapper; ICarService carService;
/** /**
* 新增车辆维保记录 * 新增车辆维保记录
@ -41,12 +58,13 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
@Override @Override
public boolean saveCarMaintenance(CarMaintenanceEntity carMaintenanceEntity) { public boolean saveCarMaintenance(CarMaintenanceEntity carMaintenanceEntity) {
// 编码生成 // 编码生成
// 获取当月时间(yyyymm) // 获取当月时间
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()); String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号 // 查询是否存在同月编号
String lastCode = getLastCode(currentMonth); String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号 // 若不存在,新增编号
String code = BaseUtil.getUniqueCode("YCJL", lastCode, currentMonth); String code = BaseUtil.getUniqueCode("WBJL", lastCode, currentSimpleMonth);
carMaintenanceEntity.setCode(code); carMaintenanceEntity.setCode(code);
return this.save(carMaintenanceEntity); return this.save(carMaintenanceEntity);
} }
@ -71,12 +89,87 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
/** /**
* 车辆维保记录确认 * 车辆维保记录确认
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO) { public R confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO) {
CarMaintenanceEntity carMaintenanceEntity = this.getById(confirmationDTO.getCarMaintenanceId()); CarMaintenanceEntity carMaintenanceEntity = this.getById(confirmationDTO.getCarMaintenanceId());
// 判断是否已确认
Date confirmationTime = carMaintenanceEntity.getConfirmationTime();
if (confirmationTime != null) {
return R.fail("该维保记录已被确认");
}
carMaintenanceEntity.setManagerAdvice(confirmationDTO.getManagerAdvice()); carMaintenanceEntity.setManagerAdvice(confirmationDTO.getManagerAdvice());
carMaintenanceEntity.setConfirmationTime(DateUtil.now()); carMaintenanceEntity.setConfirmationTime(DateUtil.now());
return this.updateById(carMaintenanceEntity); boolean update = this.updateById(carMaintenanceEntity);
// 若确认成功,更新台账相关信息
if (update) {
CarEntity carEntity = carService.getById(carMaintenanceEntity.getCarId());
carEntity.setMaintenanceLastTime(carMaintenanceEntity.getConfirmationTime());
carEntity.setMaintenanceNextTime(confirmationDTO.getMaintenanceNextTime());
carEntity.setMaintenanceMileage(confirmationDTO.getMaintenanceMileage());
carEntity.setMaintenanceStatus(CarMaintenanceStatusEnum.MAINTAINED.getValue());
return R.status(carService.updateById(carEntity));
}
return R.fail("操作失败");
}
/**
* 导出车辆维保记录单
*/
@Override
public void exportCarMaintenanceData(Long id, HttpServletResponse response) {
CarMaintenanceEntity carMaintenanceEntity = this.getById(id);
Map<String, Object> params = BaseUtil.convertObjectToMap(carMaintenanceEntity);
// String templateFile = ""
try {
List<XWPFDocument> res = new ArrayList<>();
XWPFDocument document = BaseUtil.fillDocument("template/", params);
res.add(document);
BaseUtil.exportWord(res, "");
} catch (Exception e) {
throw new RuntimeException(e);
}
// String pdfPath = this.getFileSavePath() + params.get("code") + "_" + params.get("addressEquName") +".pdf";
// AsposeUtil.wordToPdf(wordPath, pdfPath);
// PdfUtils.readPdf(response,pdfPath);
// ServletOutputStream outputStream = null;
// try {
// outputStream = response.getOutputStream();
// CarMaintenanceDetailVO carMaintenance = getCarMaintenance(id);
// // 设置响应头
// // 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");
// List<CarMaintenanceDetailVO> dataList = new ArrayList<>();
// dataList.add(carMaintenance);
// String templatePath = "template/车辆维保记录单.xlsx";
// Resource resource = new ClassPathResource(templatePath);
// // ExcelWriter初始化
// ExcelWriter excelWriter = EasyExcel
// .write(response.getOutputStream(), CarMaintenanceDetailVO.class)
// .autoCloseStream(Boolean.TRUE)
// .withTemplate(resource.getInputStream())
// .build();
// WriteSheet writeSheet = EasyExcel.writerSheet(1, "车辆维保记录单").build();
// excelWriter.write(dataList, 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());
// }
// }
// }
} }
/** /**
@ -85,8 +178,7 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null
*/ */
private String getLastCode(String currentMonth) { private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2); List<CarMaintenanceEntity> list = getCarMaintenanceByMonth(currentMonth);
List<CarMaintenanceEntity> list = getHygieneByMonth(month);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@ -98,7 +190,7 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
* @param month 当月 * @param month 当月
* @return 当月车辆维保数据表 * @return 当月车辆维保数据表
*/ */
private List<CarMaintenanceEntity> getHygieneByMonth(String month) { private List<CarMaintenanceEntity> getCarMaintenanceByMonth(String month) {
QueryWrapper<CarMaintenanceEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<CarMaintenanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarMaintenanceEntity::getCreateTime, month) queryWrapper.lambda().like(CarMaintenanceEntity::getCreateTime, month)
.orderByDesc(CarMaintenanceEntity::getCode); .orderByDesc(CarMaintenanceEntity::getCode);

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

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.service.impl; package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -102,4 +103,15 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
carPage.setRecords(res); carPage.setRecords(res);
return carPage; return carPage;
} }
/**
* 根据参保时间查询车辆列表
*/
@Override
public List<CarEntity> getCarListByInsuranceTime(String today, String yesterday) {
QueryWrapper<CarEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().le(CarEntity::getInsurancePayLastTime, today)
.ge(CarEntity::getInsurancePayNextTime, today);
return this.list(queryWrapper);
}
} }

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

@ -8,14 +8,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity; 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.mapper.CarUsedRecordMapper;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService; import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO; import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -35,14 +39,18 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
@Override @Override
public boolean saveCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity) { public boolean saveCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity) {
// 编码生成 // 编码生成
// 获取当月时间(yyyymm) // 获取当月时间
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()); String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号 // 查询是否存在同月编号
String lastCode = getLastCode(currentMonth); String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号 // 若不存在,新增编号
String code = BaseUtil.getUniqueCode("WBJL", lastCode, currentMonth); String code = BaseUtil.getUniqueCode("YCJL", lastCode, currentSimpleMonth);
carUsedRecordEntity.setCode(code); carUsedRecordEntity.setCode(code);
return false; // 收车公里数
BigDecimal endMiles = carUsedRecordEntity.getStartMiles().add(carUsedRecordEntity.getMiles());
carUsedRecordEntity.setEndMiles(endMiles);
return this.save(carUsedRecordEntity);
} }
/** /**
@ -66,10 +74,27 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
* 用车记录确认 * 用车记录确认
*/ */
@Override @Override
public boolean confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO) { public R confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO) {
CarUsedRecordEntity carUsedRecord = this.getById(confirmationDTO.getCarUsedRecordId()); CarUsedRecordEntity carUsedRecord = this.getById(confirmationDTO.getCarUsedRecordId());
carUsedRecord.setConfirmationTime(confirmationDTO.getConfirmationTime()); // 判断是否已确认
return this.updateById(carUsedRecord); Date confirmationTime = carUsedRecord.getConfirmationTime();
if (confirmationTime != null) {
return R.fail("该用车记录已被确认");
}
carUsedRecord.setConfirmationTime(DateUtil.now());
carUsedRecord.setUsedStatus(CarUsedRecordEnum.USED.getValue());
return R.status(this.updateById(carUsedRecord));
}
/**
* 更新用车记录
*/
@Override
public boolean updateCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity) {
// 收车公里数
BigDecimal endMiles = carUsedRecordEntity.getStartMiles().add(carUsedRecordEntity.getMiles());
carUsedRecordEntity.setEndMiles(endMiles);
return this.save(carUsedRecordEntity);
} }
/** /**
@ -78,8 +103,7 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null
*/ */
private String getLastCode(String currentMonth) { private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2); List<CarUsedRecordEntity> list = getCarUsedRecordByMonth(currentMonth);
List<CarUsedRecordEntity> list = getHygieneByMonth(month);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@ -87,11 +111,11 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
} }
/** /**
* 查询当月车辆维保记录 * 查询当月车记录
* @param month 当月 * @param month 当月
* @return 当月车辆维保数据表 * @return 当月用车记录数据表
*/ */
private List<CarUsedRecordEntity> getHygieneByMonth(String month) { private List<CarUsedRecordEntity> getCarUsedRecordByMonth(String month) {
QueryWrapper<CarUsedRecordEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<CarUsedRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarUsedRecordEntity::getCreateTime, month) queryWrapper.lambda().like(CarUsedRecordEntity::getCreateTime, month)
.orderByDesc(CarUsedRecordEntity::getCode); .orderByDesc(CarUsedRecordEntity::getCode);

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

@ -95,14 +95,20 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public R savePlan(HygienePlanDTO hygienePlanDTO) { public R savePlan(HygienePlanDTO hygienePlanDTO) {
// 重名校验
HygienePlanEntity hygienePlan = getPlanByName(hygienePlanDTO.getName());
if (hygienePlan != null) {
return R.fail("名称不可重复");
}
// 新增卫生自查计划 // 新增卫生自查计划
HygienePlanEntity hygienePlanEntity = new HygienePlanEntity(); HygienePlanEntity hygienePlanEntity = new HygienePlanEntity();
BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity); BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity);
hygienePlanDTO.setStandardScore(100);
boolean savePlan = this.save(hygienePlanEntity); boolean savePlan = this.save(hygienePlanEntity);
List<HygieneZoneEntity> zoneList = hygienePlanDTO.getZoneList(); List<HygieneZoneEntity> zoneList = hygienePlanDTO.getZoneList();
// 若计划新增成功,新增关联责任区数据 // 若计划新增成功,新增关联责任区数据
if (savePlan) { if (savePlan) {
HygienePlanEntity hygienePlan = getPlanByCode(hygienePlanDTO.getCode()); hygienePlan = getPlanByName(hygienePlanDTO.getName());
for (HygieneZoneEntity zone : zoneList) { for (HygieneZoneEntity zone : zoneList) {
// 传计划id // 传计划id
if (hygienePlan != null) { if (hygienePlan != null) {
@ -126,6 +132,14 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
*/ */
@Override @Override
public R updatePlan(HygienePlanDTO hygienePlanDTO) { public R updatePlan(HygienePlanDTO hygienePlanDTO) {
// 重名校验
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().ne(HygienePlanEntity::getId, hygienePlanDTO.getId());
queryWrapper.lambda().eq(HygienePlanEntity::getName, hygienePlanDTO.getName());
HygienePlanEntity hygienePlan = this.getOne(queryWrapper);
if (hygienePlan != null) {
return R.fail("名称不可重复");
}
// 修改卫生自查计划 // 修改卫生自查计划
HygienePlanEntity hygienePlanEntity = new HygienePlanEntity(); HygienePlanEntity hygienePlanEntity = new HygienePlanEntity();
BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity); BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity);
@ -211,9 +225,9 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
* 根据编码查询卫生自查计划 * 根据编码查询卫生自查计划
*/ */
@Override @Override
public HygienePlanEntity getPlanByCode(String code) { public HygienePlanEntity getPlanByName(String name) {
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygienePlanEntity::getCode, code); queryWrapper.lambda().eq(HygienePlanEntity::getName, name);
return this.getOne(queryWrapper); return this.getOne(queryWrapper);
} }

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

@ -12,10 +12,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; 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.HygienePlanMapper;
import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper; import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper;
import com.hnac.hzims.safeproduct.service.IHygieneRecordService; import com.hnac.hzims.safeproduct.service.IHygieneRecordService;
@ -101,7 +104,13 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
return R.fail("评分不能大于标准总分值"); return R.fail("评分不能大于标准总分值");
} }
} }
return R.status(this.save(hygieneRecordEntity)); boolean save = this.save(hygieneRecordEntity);
// 若自查记录新增成功,修改自查计划状态为已完成
if (save) {
hygienePlanEntity.setHygienePlanStatus(RehearsalStatusEnum.FINISHED.getValue());
return R.status(hygienePlanMapper.updateById(hygienePlanEntity) == SafeProductConstant.SUCCESS);
}
return R.fail("新增失败");
} }
/** /**

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

@ -13,10 +13,17 @@ import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper;
import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.ticket.constants.WorkTicketConstants;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import lombok.extern.slf4j.Slf4j; 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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,12 +45,13 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
*/ */
@Override @Override
public boolean saveRehearsalRecord(RehearsalRecordEntity rehearsalRecord) { public boolean saveRehearsalRecord(RehearsalRecordEntity rehearsalRecord) {
// 获取当月时间(yyyymm) // 获取当月时间
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()); String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号 // 查询是否存在同月编号
String lastCode = getLastCode(currentMonth); String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号 // 若不存在,新增编号
String code = BaseUtil.getUniqueCode("YLJL", lastCode, currentMonth); String code = BaseUtil.getUniqueCode("YLJL", lastCode, currentSimpleMonth);
rehearsalRecord.setCode(code); rehearsalRecord.setCode(code);
// 参演人数 // 参演人数
String peopleName = rehearsalRecord.getPeopleName(); String peopleName = rehearsalRecord.getPeopleName();
@ -76,13 +84,12 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
} }
/** /**
* 查询是否存在同月编号 * 查询当月的上一编码
* @param currentMonth 当月 * @param currentMonth 当月(yyyy-mm)
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null
*/ */
private String getLastCode(String currentMonth) { private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2); List<RehearsalRecordEntity> list = getRehearsalByMonth(currentMonth);
List<RehearsalRecordEntity> list = getRehearsalByMonth(month);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@ -118,4 +125,16 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
List<Long> ids = rehearsalRecordList.stream().map(RehearsalRecordEntity::getId).collect(Collectors.toList()); List<Long> ids = rehearsalRecordList.stream().map(RehearsalRecordEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids); return this.removeByIds(ids);
} }
/**
* 演练记录表导出
*/
@Override
public void exportRecordDetailData(Long id) {
RehearsalRecordEntity rehearsalRecordEntity = this.getById(id);
String tempFileName = "演练记录表.xlsx";
Assert.isTrue(StringUtil.isNotBlank(tempFileName),() -> {
throw new ServiceException("未找到模板文件,预览失败!");
});
}
} }

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

@ -1,6 +1,17 @@
package com.hnac.hzims.safeproduct.utils; package com.hnac.hzims.safeproduct.utils;
import cn.afterturn.easypoi.word.WordExportUtil;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 公用工具类 * 公用工具类
@ -8,6 +19,7 @@ import com.hnac.hzims.common.logs.utils.StringUtils;
* @author liwen * @author liwen
* @date 2024-01-02 * @date 2024-01-02
*/ */
@Slf4j
public class BaseUtil { public class BaseUtil {
/** /**
@ -36,4 +48,65 @@ public class BaseUtil {
} }
return code; return code;
} }
/**
* 对象转map
* @param entity 对象
* @return map
*/
public static Map<String, Object> convertObjectToMap(Object entity) {
Map<String, Object> map = new HashMap<>();
Field[] fields = entity.getClass().getFields();
try {
for (Field field : fields) {
field.setAccessible(true);
Object value = field.get(entity);
map.put(field.getName(), value);
}
} catch (IllegalAccessException e) {
log.info("对象转map异常: {}", e.getMessage());
}
return map;
}
/**
* 文件导出
* @param documents doc文件
* @param savePath 存储路径
*/
public static void exportWord(List<XWPFDocument> documents, String savePath) {
FileOutputStream out = null;
try {
out = new FileOutputStream(savePath);
for (XWPFDocument document : documents) {
document.write(out);
}
out.close();
} catch (IOException e) {
log.error("文件导出异常: {}", e.getMessage());
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
log.error("文件导出-输出流关闭异常: {}", e.getMessage());
}
}
}
}
/**
* 数据写入模板文件
* @param templatePath 模板路径
* @param params 数据
*/
public static XWPFDocument fillDocument(String templatePath, Map<String, Object> params) {
XWPFDocument xwpfDocument = null;
try {
xwpfDocument = WordExportUtil.exportWord07(templatePath, params);
} catch (Exception e) {
log.error("数据写入异常: {}", e.getMessage());
}
return xwpfDocument;
}
} }

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

@ -37,10 +37,10 @@ CREATE TABLE `hzims_rehearsal_record` (
`code` varchar(50) NOT NULL COMMENT '编号', `code` varchar(50) NOT NULL COMMENT '编号',
`people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数', `people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数',
`people_name` varchar(5000) DEFAULT '' COMMENT '参演人员', `people_name` varchar(5000) DEFAULT '' COMMENT '参演人员',
`actual_start_time` datetime DEFAULT NULL COMMENT '演练实际开始时间', `actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '演练实际结束时间', `actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间',
`record` varchar(250) DEFAULT '' COMMENT '演练记录', `record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录',
`comment` varchar(250) DEFAULT '' DEFAULT '' COMMENT '演练评价', `comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片', `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片',
`file_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_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
@ -183,6 +183,7 @@ CREATE TABLE `hzims_hygiene_plan` (
`standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值', `standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值',
`scheduled_start_time` date NOT NULL COMMENT '计划开始时间', `scheduled_start_time` date NOT NULL COMMENT '计划开始时间',
`scheduled_end_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_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` 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 '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
@ -232,3 +233,120 @@ CREATE TABLE `hzims_hygiene_record` (
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic; ) 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;
Loading…
Cancel
Save