Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 11 months ago
parent
commit
91c0085ce3
  1. 73
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java
  2. 38
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java
  3. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java
  4. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMilesYearDTO.java
  5. 22
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java
  6. 28
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java
  7. 45
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java
  8. 93
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java
  9. 63
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java
  10. 64
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java
  11. 23
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckItemVO.java
  12. 41
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java
  13. 61
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java
  14. 41
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java
  15. 64
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java
  16. 62
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java
  17. 44
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java
  18. 1
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  19. 84
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java
  20. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.java
  21. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.xml
  22. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java
  23. 116
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java
  24. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/ConstructionWrapper.java
  25. BIN
      hzims-service/operational/src/main/resources/template/excel/constructio_template.xlsx
  26. 232
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java
  27. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java
  28. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java
  29. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.java
  30. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.xml
  31. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java
  32. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml
  33. 35
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.java
  34. 42
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  35. 45
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.java
  36. 58
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml
  37. 35
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.java
  38. 34
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml
  39. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckItemService.java
  40. 28
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckRecordService.java
  41. 49
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java
  42. 26
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarService.java
  43. 50
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarUsedRecordService.java
  44. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckItemServiceImpl.java
  45. 122
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  46. 107
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  47. 105
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  48. 100
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java
  49. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml

73
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java

@ -0,0 +1,73 @@
package com.hnac.hzims.operational.access.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author ysj
*/
@Data
@TableName("hzims_oper_construction")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "检修施工日志表")
public class OperConstructionEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "施工编号")
private String code;
@ApiModelProperty(value = "施工时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date constructionTime;
@ApiModelProperty(value = "检修名称")
private String overhaulName;
@ApiModelProperty(value = "施工地点")
private String constructionLocation;
@ApiModelProperty(value = "检修负责人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long overhaulHead;
@ApiModelProperty(value = "检修人员: 根据“,”分割")
private String overhaulPersonnel;
@ApiModelProperty(value = "检修时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date overhaulTime;
@ApiModelProperty(value = "今日工作完成情况描述")
private String completeWorkDesc;
@ApiModelProperty(value = "明日工作计划描述")
private String planWorkDesc;
@ApiModelProperty(value = "施工图片: 根据“,”分割")
private String constructionImg;
@ApiModelProperty(value = "施工附件")
private String constructionAttachment;
@ApiModelProperty(value = "记录人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long recorder;
@ApiModelProperty(value = "审核人")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long reviewer;
}

38
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java

@ -0,0 +1,38 @@
package com.hnac.hzims.operational.access.vo;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ConstructionVo extends OperConstructionEntity {
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "创建人名称")
private String createUserName;
@ApiModelProperty(value = "修改人名称")
private String updateUserName;
@ApiModelProperty(value = "检修负责人名称")
private String overhaulHeadName;
@ApiModelProperty(value = "记录人名称")
private String recorderName;
@ApiModelProperty(value = "审核人名称")
private String reviewerName;
@ApiModelProperty(value = "检修人员名称Name")
private String overhaulPersonnelName;
}

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

@ -0,0 +1,25 @@
package com.hnac.hzims.safeproduct.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "车辆维保记录确认DTO类")
public class CarMaintenanceConfirmationDTO {
@ApiModelProperty("车辆维保记录id")
private Long carMaintenanceId;
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

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

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author liwen
* @date 2024-01-05
*/
@Data
@ApiModel(value = "年度里程DTO类")
public class CarMilesYearDTO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("日期")
private String dateTime;
@ApiModelProperty("里程数")
private BigDecimal miles;
}

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

@ -0,0 +1,22 @@
package com.hnac.hzims.safeproduct.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "用车记录确认DTO类")
public class CarUsedRecordConfirmationDTO {
@ApiModelProperty("用车记录id")
private Long carUsedRecordId;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

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

@ -0,0 +1,28 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* @author liwen
* @date 2024-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_check_item")
@ApiModel(value = "车检项实体类")
public class CarCheckItemEntity extends BaseEntity {
@ApiModelProperty("车检记录id")
private Long carCheckRecordId;
@ApiModelProperty("检查项目")
private String checkItem;
@ApiModelProperty("检查内容")
private String checkContent;
}

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

@ -0,0 +1,45 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_check_record")
@ApiModel(value = "车检记录实体类")
public class CarCheckRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("检查人")
private String checker;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("检查项id")
private String checkItemIds;
@ApiModelProperty("检查项结果")
private String checkItemResults;
@ApiModelProperty("检查结论")
private String conclusion;
@ApiModelProperty("填报备注")
private String remark;
}

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

@ -0,0 +1,93 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car")
@ApiModel(value = "车辆实体类")
public class CarEntity extends BaseEntity {
@NotNull
@Size(max = 50, message = "单位长度不能超过50")
@ApiModelProperty("单位")
private String unit;
@NotNull
@Size(max = 50, message = "品牌长度不能超过50")
@ApiModelProperty("品牌")
private String carBrand;
@NotNull
@Size(max = 50, message = "型号长度不能超过50")
@ApiModelProperty("型号")
private String carType;
@NotNull
@Size(max = 50, message = "车牌号长度不能超过50")
@ApiModelProperty("车牌号")
private String plateNumber;
@NotNull
@ApiModelProperty("上牌时间")
private Date registrationTime;
@NotNull
@ApiModelProperty("上期缴车保时间")
private Date insurancePayLastTime;
@NotNull
@ApiModelProperty("下期缴车保时间")
private Date insurancePayNextTime;
@NotNull
@ApiModelProperty("年检时间")
private Date annualInspectionTime;
@NotNull
@ApiModelProperty("年检状态")
private String annualInspectionStatus;
@NotNull
@ApiModelProperty("保险状态")
private String insuranceStatus;
@NotNull
@ApiModelProperty("上期保养时间")
private Date maintenanceLastTime;
@NotNull
@ApiModelProperty("下期保养时间")
private Date maintenanceNextTime;
@ApiModelProperty("保养里程")
private BigDecimal maintenanceMileage;
@NotNull
@ApiModelProperty("保养状态")
private String maintenanceStatus;
@NotNull
@ApiModelProperty("车辆管理人")
private String manager;
@ApiModelProperty("车辆照片")
private String imgPath;
@ApiModelProperty("车辆附件")
private String filePath;
}

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

@ -0,0 +1,63 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_maintenance")
@ApiModel(value = "车辆维保实体类")
public class CarMaintenanceEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("维保类型")
private String maintenanceType;
@ApiModelProperty("维保内容")
private String content;
@ApiModelProperty("维保开始时间")
private Date startTime;
@ApiModelProperty("维保结束时间")
private Date endTime;
@ApiModelProperty("维保地点")
private String location;
@ApiModelProperty("维保费用")
private Long cost;
@ApiModelProperty("维保人")
private String maintainer;
@ApiModelProperty("维保照片")
private String imgPath;
@ApiModelProperty("维保附件")
private String filePath;
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@ApiModelProperty("确认时间")
private Date confirmationTime;
@ApiModelProperty("维保状态")
private String maintenanceStatus;
}

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

@ -0,0 +1,64 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_used_record")
@ApiModel(value = "用车记录实体类")
public class CarUsedRecordEntity extends BaseEntity {
@ApiModelProperty("车辆id")
private Long carId;
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("用车单位")
private String unit;
@ApiModelProperty("使用时间")
private Date startTime;
@ApiModelProperty("使用地点")
private String usedLocation;
@ApiModelProperty("使用人")
private String user;
@ApiModelProperty("用途详情")
private String remark;
@ApiModelProperty("出车公里数")
private BigDecimal startMiles;
@ApiModelProperty("收车公里数")
private BigDecimal endMiles;
@ApiModelProperty("行驶公里数")
private BigDecimal miles;
@ApiModelProperty("收车时间")
private Date endTime;
@ApiModelProperty("确认时间")
private Date confirmationTime;
@ApiModelProperty("用车状态")
private String usedStatus;
@ApiModelProperty("图片路径")
private String imgPath;
}

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

@ -0,0 +1,23 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2024-01-05
*/
@Data
@ApiModel(value = "车辆检查项VO类")
public class CarCheckItemVO {
@ApiModelProperty("检查项目")
private String checkItem;
@ApiModelProperty("检查内容")
private String checkContent;
@ApiModelProperty("检查结果")
private String checkResult;
}

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

@ -0,0 +1,41 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author liwen
* @date 2024-01-05
*/
@Data
@ApiModel(value = "车辆检查记录详情VO类")
public class CarCheckRecordDetailVO {
@ApiModelProperty("检查人")
private String checker;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("行驶里程")
private BigDecimal miles;
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("检查结论")
private String conclusion;
@ApiModelProperty("填报备注")
private String remark;
@ApiModelProperty("检查列表")
private List<CarCheckItemVO> checkItemList;
}

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

@ -0,0 +1,61 @@
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-04
*/
@Data
@ApiModel(value = "车辆维保记录详情VO类")
public class CarMaintenanceDetailVO {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("维保开始时间")
private Date startTime;
@ApiModelProperty("维保结束时间")
private Date endTime;
@ApiModelProperty("维保地点")
private String location;
@ApiModelProperty("维保费用")
private Long cost;
@ApiModelProperty("维保人")
private String maintainer;
@ApiModelProperty("维保内容")
private String content;
@ApiModelProperty("维保照片")
private String imgPath;
@ApiModelProperty("维保附件")
private String filePath;
@ApiModelProperty("车辆管理人意见")
private String managerAdvice;
@ApiModelProperty("确认时间")
private Date confirmationTime;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("型号")
private String carType;
@ApiModelProperty("车牌号")
private String plateNumber;
}

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

@ -0,0 +1,41 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "车辆维保记录页面VO类")
public class CarMaintenancePageVO {
@ApiModelProperty("车辆维保记录id")
private Long id;
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("型号")
private String carType;
@ApiModelProperty("维保类型")
private String type;
@ApiModelProperty("维保内容")
private String content;
@ApiModelProperty("维保地点")
private String location;
@ApiModelProperty("维保费用")
private Long cost;
@ApiModelProperty("维保人")
private String maintainer;
}

64
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java

@ -0,0 +1,64 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "年度里程数据VO类")
public class CarMilesYearVO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("1月里程数")
private BigDecimal januaryMiles;
@ApiModelProperty("2月里程数")
private BigDecimal februaryMiles;
@ApiModelProperty("3月里程数")
private BigDecimal marchMiles;
@ApiModelProperty("4月里程数")
private BigDecimal aprilMiles;
@ApiModelProperty("5月里程数")
private BigDecimal mayMiles;
@ApiModelProperty("6月里程数")
private BigDecimal juneMiles;
@ApiModelProperty("7月里程数")
private BigDecimal julyMiles;
@ApiModelProperty("8月里程数")
private BigDecimal augustMiles;
@ApiModelProperty("9月里程数")
private BigDecimal septemberMiles;
@ApiModelProperty("10月里程数")
private BigDecimal octoberMiles;
@ApiModelProperty("11月里程数")
private BigDecimal novemberMiles;
@ApiModelProperty("12月里程数")
private BigDecimal decemberMiles;
@ApiModelProperty("合计里程数")
private BigDecimal sumMiles;
}

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

@ -0,0 +1,62 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "用车记录详情VO类")
public class CarUsedRecordDetailVO {
@ApiModelProperty("编码")
private String code;
@ApiModelProperty("使用时间")
private Date startTime;
@ApiModelProperty("使用地点")
private String usedLocation;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("用途详情")
private String remark;
@ApiModelProperty("用车单位")
private String unit;
@ApiModelProperty("出车公里数")
private BigDecimal startMiles;
@ApiModelProperty("收车公里数")
private BigDecimal endMiles;
@ApiModelProperty("行驶公里数")
private BigDecimal miles;
@ApiModelProperty("图片路径")
private String imgPath;
@ApiModelProperty("使用人")
private String user;
@ApiModelProperty("车辆管理人")
private String manager;
@ApiModelProperty("收车时间")
private Date endTime;
@ApiModelProperty("确认时间")
private Date confirmationTime;
}

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

@ -0,0 +1,44 @@
package com.hnac.hzims.safeproduct.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author liwen
* @date 2024-01-04
*/
@Data
@ApiModel(value = "用车记录页面VO类")
public class CarUsedRecordPageVO {
@ApiModelProperty("用车单位")
private String unit;
@ApiModelProperty("品牌")
private String carBrand;
@ApiModelProperty("车牌号")
private String plateNumber;
@ApiModelProperty("使用时间")
private Date startTime;
@ApiModelProperty("使用人")
private String user;
@ApiModelProperty("用途详情")
private String remark;
@ApiModelProperty("出车公里数")
private BigDecimal startMiles;
@ApiModelProperty("收车公里数")
private BigDecimal endMiles;
@ApiModelProperty("行驶公里数")
private BigDecimal miles;
}

1
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -66,6 +66,7 @@ public class EmInfoController extends BladeController {
/**
* 元件列表 分页
*/
@GetMapping("/partList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "元件分页", notes = "传入em_info,必须传gpid(上级设备ID)")

84
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java

@ -0,0 +1,84 @@
package com.hnac.hzims.operational.access.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.access.dto.AccessPlanV4DTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanFlowDTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanListDTO;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.service.AccessPlanV4Service;
import com.hnac.hzims.operational.access.service.ConstructionService;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.access.vo.OperAccessPlanVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author ysj
*/
@RestController
@AllArgsConstructor
@RequestMapping("/construction")
@Api(tags = "施工日志")
public class ConstructionController extends BladeController {
private final ConstructionService service;
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增")
public R save(@RequestBody OperConstructionEntity entity) {
return R.status(service.save(entity));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/update")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "修改")
public R update(@Valid @RequestBody OperConstructionEntity entity) {
return R.status(service.updateById(entity));
}
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@OperationAnnotation(moduleName = "检修管理",title = "检修计划",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询检修计划列表")
@ApiOperation(value = "分页 查询参数:code,name,gradeCode,manager,techLead,handleStatus,status")
public R<IPage<ConstructionVo>> list(ConstructionVo construction, Query query) {
return R.data(service.pageCondition(Condition.getPage(query), construction));
}
@GetMapping("/preview")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "检修施工日志预览", notes = "检修施工日志预览")
public void preview(@RequestParam @ApiParam("检修施工记录Id") @NotNull @Valid Long id) {
service.preview(id);
}
}

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.operational.access.mapper;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface ConstructionMapper extends UserDataScopeBaseMapper<OperConstructionEntity> {
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.xml

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.access.mapper.ConstructionMapper">
</mapper>

19
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java

@ -0,0 +1,19 @@
package com.hnac.hzims.operational.access.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
*/
public interface ConstructionService extends BaseService<OperConstructionEntity> {
IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction);
void preview(Long id);
}

116
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java

@ -0,0 +1,116 @@
package com.hnac.hzims.operational.access.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.mapper.ConstructionMapper;
import com.hnac.hzims.operational.access.service.ConstructionService;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.access.wrapper.ConstructionWrapper;
import com.hnac.hzims.operational.util.ExcelUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
/**
* @author ysj
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper, OperConstructionEntity> implements ConstructionService {
@Value("${hzims.operational.construction.save.xlsx}")
private String constructionSaveXlsxPath;
@Value("${hzims.operational.construction.save.pdf}")
private String constructionSavePdfPath;
/**
* 施工日志记录分页查询
* @param page
* @param construction
* @return
*/
@Override
public IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction) {
QueryWrapper wrapper = Condition.getQueryWrapper(construction);
if(StringUtil.isNotBlank(construction.getStartTime())){
wrapper.ge("CREATE_TIME",construction.getStartTime());
}
if(StringUtil.isNotBlank(construction.getEndTime())){
wrapper.le("CREATE_TIME",construction.getEndTime());
}
IPage pages = super.page(page, wrapper);
pages.setRecords(ConstructionWrapper.build().listVO(pages.getRecords()));
return pages;
}
/**
* 施工日志记录预览
* @param id
*/
@Override
public void preview(Long id) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
//准备数据
ConstructionVo construction = this.record(id);
Map<String,Object> params = new HashMap<>();
/*try {
params = PdfUtils.objectToMap(construction);
}catch (Exception e) {
log.error("转换对象失败!");
}*/
TemplateExportParams templateExportParams = new TemplateExportParams("template/constructio_template.xlsx", true);
Workbook workbook = null;
try {
workbook = ExcelUtil.getWorkbook(templateExportParams,params);
} catch (Exception e) {
e.printStackTrace();
}
//上传xlsx至服务器
//String fileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.XLSX_SUFFIX;
/* try {
ExcelUtil.upload(workbook,constructionSaveXlsxPath,fileName);
} catch (Exception e) {
e.printStackTrace();
}*/
//将docx文件转换为pdf并保存
//String pdfFileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.PDF_SUFFIX;
//String xlsxFileName = DateUtil.format(construction.getConstructionTime(),DateUtil.PATTERN_DATETIME) + "_" + construction.getOverhaulName() + "_施工日志" + PdfUtils.XLSX_SUFFIX;
//PdfUtils.convertPdf(constructionSaveXlsxPath, xlsxFileName, constructionSavePdfPath, pdfFileName);
//String savePath = constructionSavePdfPath + pdfFileName;
// 设置response参数,可以打开下载页面
//PdfUtils.readPdf(response,savePath);
}
/**
* 查询施工日志记录
* @param id
* @return
*/
private ConstructionVo record(Long id) {
OperConstructionEntity entity = this.getById(id);
if(ObjectUtil.isEmpty(entity)){
throw new ServiceException("施工日志记录不存在!");
}
return ConstructionWrapper.build().entityVO(entity);
}
}

41
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/ConstructionWrapper.java

@ -0,0 +1,41 @@
package com.hnac.hzims.operational.access.wrapper;
import com.hnac.hzims.operational.access.constants.DictConstant;
import com.hnac.hzims.operational.access.entity.OperAccessPlanEntity;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.access.vo.OperAccessPlanVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.DictCache;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import java.util.Optional;
/**
* @author ysj
*/
public class ConstructionWrapper extends BaseEntityWrapper<OperConstructionEntity, ConstructionVo> {
public static ConstructionWrapper build() {
return new ConstructionWrapper();
}
@Override
public ConstructionVo entityVO(OperConstructionEntity entity) {
ConstructionVo vo = BeanUtil.copy(entity, ConstructionVo.class);
User create = UserCache.getUser(entity.getCreateUser());
User update = UserCache.getUser(entity.getUpdateUser());
User head = UserCache.getUser(entity.getOverhaulHead());
User recorder = UserCache.getUser(entity.getRecorder());
User reviewer = UserCache.getUser(entity.getReviewer());
vo.setCreateUserName(Optional.ofNullable(create).map(User :: getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(update).map(User :: getName).orElse(null));
vo.setOverhaulHeadName(Optional.ofNullable(head).map(User :: getName).orElse(null));
vo.setRecorderName(Optional.ofNullable(recorder).map(User :: getName).orElse(null));
vo.setReviewerName(Optional.ofNullable(reviewer).map(User :: getName).orElse(null));
return vo;
}
}

BIN
hzims-service/operational/src/main/resources/template/excel/constructio_template.xlsx

Binary file not shown.

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

@ -0,0 +1,232 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
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.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.Map;
/**
* 车辆管理接口类
*
* @author liwen
* @date 2024-01-03
*/
@RestController
@RequestMapping("/car")
@AllArgsConstructor
@Api(value = "车辆管理", tags = "车辆管理接口")
public class CarController extends BladeController {
private final ICarService carService;
private final ICarMaintenanceService carMaintenanceService;
private final ICarUsedRecordService carUsedRecordService;
private final ICarCheckRecordService carCheckRecordService;
@PostMapping("/saveCar")
@ApiOperation(value = "新增车辆")
@ApiOperationSupport(order = 1)
public R saveCar(@Valid @RequestBody CarEntity carEntity) {
return R.status(carService.save(carEntity));
}
@PostMapping("/updateCar")
@ApiOperation(value = "修改车辆")
@ApiOperationSupport(order = 2)
public R updateCar(@Valid @RequestBody CarEntity carEntity) {
return R.status(carService.updateById(carEntity));
}
@PostMapping("/removeCar")
@ApiOperation(value = "删除车辆")
@ApiOperationSupport(order = 3)
public R removeCar(@RequestParam Long id) {
return R.status(carService.removeById(id));
}
@GetMapping("/carDetail")
@ApiOperation(value = "车辆详情")
@ApiOperationSupport(order = 4)
public R<CarEntity> carDetail(@RequestParam Long id) {
return R.data(carService.getById(id));
}
@GetMapping("/carPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string")
})
@ApiOperation(value = "车辆分页")
@ApiOperationSupport(order = 5)
public R<IPage<CarEntity>> carPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarEntity> page = carService.page(Condition.getPage(query), Condition.getQueryWrapper(param, CarEntity.class));
return R.data(page);
}
@PostMapping("/saveCarMaintenance")
@ApiOperation(value = "新增车辆维保记录")
@ApiOperationSupport(order = 6)
public R saveCarMaintenance(@Valid @RequestBody CarMaintenanceEntity carMaintenanceEntity) {
return R.status(carMaintenanceService.saveCarMaintenance(carMaintenanceEntity));
}
@PostMapping("/updateCarMaintenance")
@ApiOperation(value = "修改车辆维保记录")
@ApiOperationSupport(order = 7)
public R updateCarMaintenance(@Valid @RequestBody CarMaintenanceEntity carMaintenanceEntity) {
return R.status(carMaintenanceService.updateById(carMaintenanceEntity));
}
@PostMapping("/removeCarMaintenance")
@ApiOperation(value = "删除车辆维保记录")
@ApiOperationSupport(order = 8)
public R removeCarMaintenance(@RequestParam Long id) {
return R.status(carMaintenanceService.removeById(id));
}
@GetMapping("/carMaintenanceDetail")
@ApiOperation(value = "车辆维保记录详情")
@ApiOperationSupport(order = 9)
public R<CarMaintenanceDetailVO> carMaintenanceDetail(@RequestParam Long id) {
return R.data(carMaintenanceService.getCarMaintenance(id));
}
@GetMapping("/carMaintenancePage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string")
})
@ApiOperation(value = "车辆维保记录分页")
@ApiOperationSupport(order = 10)
public R<IPage<CarMaintenancePageVO>> carMaintenancePage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarMaintenancePageVO> page = carMaintenanceService.getCarMaintenancePage(param, query);
return R.data(page);
}
@PostMapping("/confirmCarMaintenance")
@ApiOperation(value = "车辆维保记录确认")
@ApiOperationSupport(order = 11)
public R confirmCarMaintenance(@RequestBody CarMaintenanceConfirmationDTO confirmationDTO) {
return R.status(carMaintenanceService.confirmCarMaintenance(confirmationDTO));
}
@PostMapping("/saveCarUsedRecord")
@ApiOperation(value = "新增用车记录")
@ApiOperationSupport(order = 12)
public R saveCarUsedRecord(@Valid @RequestBody CarUsedRecordEntity carUsedRecordEntity) {
return R.status(carUsedRecordService.saveCarUsedRecord(carUsedRecordEntity));
}
@PostMapping("/updateCarUsedRecord")
@ApiOperation(value = "修改用车记录")
@ApiOperationSupport(order = 13)
public R updateCarUsedRecord(@Valid @RequestBody CarUsedRecordEntity carUsedRecordEntity) {
return R.status(carUsedRecordService.updateById(carUsedRecordEntity));
}
@PostMapping("/removeCarUsedRecord")
@ApiOperation(value = "删除用车记录")
@ApiOperationSupport(order = 14)
public R removeCarUsedRecord(@RequestParam Long id) {
return R.status(carUsedRecordService.removeById(id));
}
@GetMapping("/carUsedRecordDetail")
@ApiOperation(value = "用车记录详情")
@ApiOperationSupport(order = 15)
public R<CarUsedRecordDetailVO> carUsedRecordDetail(@RequestParam Long id) {
return R.data(carUsedRecordService.getCarUsedRecord(id));
}
@GetMapping("/carUsedRecordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string")
})
@ApiOperation(value = "车辆维保记录分页")
@ApiOperationSupport(order = 16)
public R<IPage<CarUsedRecordPageVO>> carUsedRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarUsedRecordPageVO> page = carUsedRecordService.getCarUsedRecordPage(param, query);
return R.data(page);
}
@PostMapping("/confirmCarUsedRecord")
@ApiOperation(value = "用车记录确认")
@ApiOperationSupport(order = 17)
public R confirmCarUsedRecord(@RequestBody CarUsedRecordConfirmationDTO confirmationDTO) {
return R.status(carUsedRecordService.confirmCarUsedRecord(confirmationDTO));
}
@GetMapping("/milesDataByYear")
@ApiOperation(value = "年度里程数据")
@ApiOperationSupport(order = 18)
public R<IPage<CarMilesYearVO>> milesDataByYear(@RequestParam String year, String unit, Query query) {
IPage<CarMilesYearVO> page = carService.milesDataByYear(year, unit, query);
return R.data(page);
}
@PostMapping("/saveCarCheckRecord")
@ApiOperation(value = "新增车检记录")
@ApiOperationSupport(order = 19)
public R saveCarCheckRecord(@Valid @RequestBody CarCheckRecordEntity carCheckRecordEntity) {
return R.status(carCheckRecordService.saveCarCheckRecord(carCheckRecordEntity));
}
@PostMapping("/updateCarCheckRecord")
@ApiOperation(value = "修改车检记录")
@ApiOperationSupport(order = 20)
public R updateCarCheckRecord(@Valid @RequestBody CarCheckRecordEntity carCheckRecordEntity) {
return R.status(carCheckRecordService.updateById(carCheckRecordEntity));
}
@PostMapping("/removeCarCheckRecord")
@ApiOperation(value = "删除车检记录")
@ApiOperationSupport(order = 21)
public R removeCarCheckRecord(@RequestParam Long id) {
return R.status(carCheckRecordService.removeById(id));
}
@GetMapping("/carCheckRecordDetail")
@ApiOperation(value = "车检记录详情")
@ApiOperationSupport(order = 15)
public R<CarCheckRecordDetailVO> carCheckRecordDetail(@RequestParam Long id) {
return R.data(carCheckRecordService.getCarCheckRecord(id));
}
@GetMapping("/carCheckRecordPage")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string")
})
@ApiOperation(value = "车辆维保记录分页")
@ApiOperationSupport(order = 16)
public R<IPage<CarUsedRecordPageVO>> carCheckRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarUsedRecordPageVO> page = carUsedRecordService.getCarUsedRecordPage(param, query);
return R.data(page);
}
}

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

@ -0,0 +1,4 @@
package com.hnac.hzims.safeproduct.jobs;
public class ConferenceJob {
}

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

@ -0,0 +1,4 @@
package com.hnac.hzims.safeproduct.jobs;
public class HygieneJob {
}

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

@ -0,0 +1,16 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 车检项Mapper类
*
* @author liwen
* @date 2024-01-05
*/
@Mapper
public interface CarCheckItemMapper extends BaseMapper<CarCheckItemEntity> {
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarCheckItemMapper">
</mapper>

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

@ -0,0 +1,16 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 车检记录Mapper类
*
* @author liwen
* @date 2024-01-05
*/
@Mapper
public interface CarCheckRecordMapper extends BaseMapper<CarCheckRecordEntity> {
}

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarCheckRecordMapper">
</mapper>

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

@ -0,0 +1,35 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/**
* 车辆维保记录Mapper类
*
* @author liwen
* @date 2024-01-04
*/
@Mapper
public interface CarMaintenanceMapper extends BaseMapper<CarMaintenanceEntity> {
/**
* 查询车辆维保记录详情
* @param carMaintenanceId 车辆维保记录id
* @return 车辆维保记录详情VO类
*/
CarMaintenanceDetailVO getCarMaintenance(Long carMaintenanceId);
/**
* 车辆维保记录数据页
* @param param 入参
* @param page 分页类
* @return 分页数据
*/
IPage<CarMaintenancePageVO> getCarMaintenancePage(IPage<CarMaintenancePageVO> page, Map<String, Object> param);
}

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

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper">
<select id="getCarMaintenance" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO">
SELECT
t1.code, t1.start_time, t1.end_time, t1.location, t1.cost, t1.maintainer, t1.content, t1.img_path, t1.file_path,
t1.manager_advice, t1.confirmation_time, t2.plate_number, t2.unit, t2.car_brand, t2.car_type
FROM
hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE
is_deleted = 0
<if test="carMaintenanceId != null and carMaintenanceId != ''">
AND t1.id = #{carMaintenanceId}
</if>
</select>
<select id="getCarMaintenancePage" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO">
SELECT
t2.unit, t2.car_brand, t2.car_type, t1.id, t1.type, t1.content, t1.location, t1.cost, t1.maintainer
FROM
hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE
is_deleted = 0
<if test="param.unit != null and param.unit != ''">
AND t2.unit = #{param.unit}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND t1.start_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND t1.end_time &lt; #{param.endTime}
</if>
<if test="param.carId != null and param.carId != ''">
AND t1.car_id = #{param.carId}
</if>
ORDER BY
t1.create_time DESC
</select>
</mapper>

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

@ -0,0 +1,45 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List;
/**
* 车辆管理Mapper类
*
* @author liwen
* @date 2024-01-03
*/
@Mapper
public interface CarMapper extends BaseMapper<CarEntity> {
/**
* 查询当年的全部车辆
* @param page 分页类
* @param year 年份
* @param unit 单位
* @return 分页车辆数据
*/
IPage<CarMilesYearVO> selectCarByYear(IPage<CarMilesYearVO> page, String year, String unit);
/**
* 查询车辆当年的月度里程数
* @param carList 车牌列表
* @param year 年份
* @return 里程数列表
*/
List<CarMilesYearDTO> selectMilesByCar(List<String> carList, String year);
/**
* 查询车辆的里程数
* @param plateNumber 车牌号
* @return 里程数
*/
BigDecimal selectMilesByPlateNumber(String plateNumber);
}

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

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarMapper">
<select id="selectCarByYear" resultType="com.hnac.hzims.safeproduct.vo.CarMilesYearVO">
SELECT
t1.unit, t1.car_brand, t1.plate_number
FROM
hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id
WHERE
t1.is_deleted = 0
<if test="year != null and year != ''">
AND t2.end_time like concat('%', #{year}, '%')
</if>
<if test="unit != null and unit != ''">
AND t1.unit like concat('%', #{unit}, '%')
</if>
ORDER BY
t1.create_time DESC
</select>
<select id="selectMilesByCar" resultType="com.hnac.hzims.safeproduct.dto.CarMilesYearDTO">
SELECT
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t1.confirmation_time, '%m') as dateTime, sum(t2.miles) as miles
FROM
hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id
WHERE
t1.is_deleted = 0
<if test="year != null and year != ''">
AND t2.confirmation_time like concat('%', #{year}, '%')
</if>
AND t2.used_status = 'CONFIRMED'
AND t1.plate_number in
<foreach collection="carList" item="car" open="(" close=")" separator=",">
#{car}
</foreach>
GROUP BY
t1.plate_number, DATE_FORMAT(t1.confirmation_time, '%m')
ORDER BY
t1.end_time DESC
</select>
<select id="selectMilesByPlateNumber" resultType="java.math.BigDecimal">
SELECT
sum(t2.miles)
FROM
hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id
WHERE
t1.is_deleted = 0
<if test="plateNumber != null and plateNumber != ''">
AND t1.plate_number = #{plateNumber}
</if>
</select>
</mapper>

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

@ -0,0 +1,35 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/**
* 用车记录Mapper类
*
* @author liwen
* @date 2024-01-04
*/
@Mapper
public interface CarUsedRecordMapper extends BaseMapper<CarUsedRecordEntity> {
/**
* 用车记录详情
* @param carUsedRecordId 用车记录id
* @return 用车记录详情VO类
*/
CarUsedRecordDetailVO getCarUsedRecord(Long carUsedRecordId);
/**
* 用车记录页面
* @param param 入参
* @param page 分页类
* @return 分页数据
*/
IPage<CarUsedRecordPageVO> getCarUsedRecordPage(IPage<CarUsedRecordPageVO> page, Map<String, Object> param);
}

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

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarUsedRecordMapper">
<select id="getCarUsedRecord" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO">
SELECT
t1.code, t1.start_time, t1.used_location, t1.remark, t1.unit, t1.start_miles, t1.end_miles, t1.miles,
t1.img_path, t1.user, t1.end_time, t1.confirmation_time, t2.manager, t2.car_brand, t2.plate_number
FROM
hzims_car_used_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
WHERE
t1.is_deleted = 0
<if test="carUsedRecordId != null and carUsedRecordId != ''">
AND t1.id = #{carUsedRecordId}
</if>
</select>
<select id="getCarUsedRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO">
SELECT
t1.unit, t1.start_time, t1.user, t1.remark, t1.start_miles, t1.end_miles, t1.miles,
t2.car_brand, t2.plate_number
FROM
hzims_car_used_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 t1.unit = #{param.unit}
</if>
ORDER BY
t1.create_time DESC
</select>
</mapper>

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

@ -0,0 +1,14 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
/**
* 车检项服务类
*
* @author liwen
* @date 2024-01-05
*/
public interface ICarCheckItemService extends IService<CarCheckItemEntity> {
}

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

@ -0,0 +1,28 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO;
/**
* 车检记录服务类
*
* @author liwen
* @date 2024-01-05
*/
public interface ICarCheckRecordService extends IService<CarCheckRecordEntity> {
/**
* 新增车检记录
* @param carCheckRecordEntity 车检记录实体类
* @return true-成功false-失败
*/
boolean saveCarCheckRecord(CarCheckRecordEntity carCheckRecordEntity);
/**
* 车检记录详情
* @param id 车检记录id
* @return 车检记录详情VO类
*/
CarCheckRecordDetailVO getCarCheckRecord(Long id);
}

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

@ -0,0 +1,49 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import org.springblade.core.mp.support.Query;
import java.util.Map;
/**
* 车辆维保记录服务类
*
* @author liwen
* @date 2024-01-04
*/
public interface ICarMaintenanceService extends IService<CarMaintenanceEntity> {
/**
* 新增车辆维保记录
* @param carMaintenanceEntity 车辆维保记录实体类
* @return true-成功false-失败
*/
boolean saveCarMaintenance(CarMaintenanceEntity carMaintenanceEntity);
/**
* 查询车辆维保记录详情
* @param id 车辆维保记录id
* @return 车辆维保记录详情VO类
*/
CarMaintenanceDetailVO getCarMaintenance(Long id);
/**
* 车辆维保记录数据页
* @param param 入参
* @param query 分页类
* @return 分页数据
*/
IPage<CarMaintenancePageVO> getCarMaintenancePage(Map<String, Object> param, Query query);
/**
* 车辆维保记录确认
* @param confirmationDTO 车辆维保记录确认DTO类
* @return true-成功false-失败
*/
boolean confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO);
}

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

@ -0,0 +1,26 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.springblade.core.mp.support.Query;
/**
* 车辆管理服务类
*
* @author liwen
* @date 2024-01-03
*/
public interface ICarService extends IService<CarEntity> {
/**
* 年度里程数页面
* @param year 年份
* @param unit 单位
* @param query 分页类
* @return 分页数据
*/
IPage<CarMilesYearVO> milesDataByYear(String year, String unit, Query query);
}

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

@ -0,0 +1,50 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
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.CarUsedRecordPageVO;
import org.springblade.core.mp.support.Query;
import java.util.Map;
/**
* 用车记录服务类
*
* @author liwen
* @date 2024-01-04
*/
public interface ICarUsedRecordService extends IService<CarUsedRecordEntity> {
/**
* 新增用车记录
* @param carUsedRecordEntity 用车记录实体类
* @return true-成功false-失败
*/
boolean saveCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity);
/**
* 用车记录详情
* @param id 用车记录id
* @return 用车记录详情VO类
*/
CarUsedRecordDetailVO getCarUsedRecord(Long id);
/**
* 用车记录页面
* @param param 入参
* @param query 分页类
* @return 分页数据
*/
IPage<CarUsedRecordPageVO> getCarUsedRecordPage(Map<String, Object> param, Query query);
/**
* 用车记录确认
* @param confirmationDTO 用车记录确认DTO类
* @return true-成功false-失败
*/
boolean confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO);
}

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

@ -0,0 +1,18 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import com.hnac.hzims.safeproduct.mapper.CarCheckItemMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckItemService;
import org.springframework.stereotype.Service;
/**
* 车检项服务实现类
*
* @author liwen
* @date 2024-01-05
*/
@Service
public class CarCheckItemServiceImpl extends ServiceImpl<CarCheckItemMapper, CarCheckItemEntity> implements ICarCheckItemService {
}

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

@ -0,0 +1,122 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.mapper.CarCheckRecordMapper;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckItemService;
import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarCheckItemVO;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 车检记录服务实现类
*
* @author liwen
* @date 2024-01-05
*/
@Service
public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper, CarCheckRecordEntity> implements ICarCheckRecordService {
@Resource
CarMapper carMapper;
@Autowired
ICarCheckItemService carCheckItemService;
/**
* 新增车检记录
*/
@Override
public boolean saveCarCheckRecord(CarCheckRecordEntity carCheckRecordEntity) {
// 编码生成
// 获取当月时间(yyyymm)
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号
String lastCode = getLastCode(currentMonth);
String code = BaseUtil.getUniqueCode("CLJC", lastCode, currentMonth);
carCheckRecordEntity.setCode(code);
return this.save(carCheckRecordEntity);
}
/**
* 车检记录详情
*/
@Override
public CarCheckRecordDetailVO getCarCheckRecord(Long id) {
CarCheckRecordEntity carCheckRecord = this.getById(id);
if (carCheckRecord != null) {
CarCheckRecordDetailVO carCheckRecordDetailVO = new CarCheckRecordDetailVO();
// 车检记录属性
carCheckRecordDetailVO.setCode(carCheckRecord.getCode());
carCheckRecordDetailVO.setChecker(carCheckRecord.getChecker());
carCheckRecordDetailVO.setConclusion(carCheckRecord.getConclusion());
carCheckRecordDetailVO.setRemark(carCheckRecord.getRemark());
// 车辆台账属性
CarEntity car = carMapper.selectById(carCheckRecord.getCarId());
if (car != null) {
carCheckRecordDetailVO.setCarBrand(car.getCarBrand());
carCheckRecordDetailVO.setPlateNumber(car.getPlateNumber());
// 用车记录属性
BigDecimal miles = carMapper.selectMilesByPlateNumber(car.getPlateNumber());
carCheckRecordDetailVO.setMiles(miles);
}
// 拼装检查列表
List<CarCheckItemVO> checkList = new ArrayList<>();
String[] checkItemIds = carCheckRecord.getCheckItemIds().split(",|,");
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 null;
}
/**
* 查询是否存在同月编号
* @param currentMonth 当月
* @return 存在则返回上一编号否则返回null
*/
private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2);
List<CarCheckRecordEntity> list = getCarCheckRecordByMonth(month);
if (CollectionUtils.isEmpty(list)) {
return null;
}
return list.get(0).getCode();
}
/**
* 查询当月卫生自查记录
* @param month 当月
* @return 当月卫生自查数据表
*/
private List<CarCheckRecordEntity> getCarCheckRecordByMonth(String month) {
QueryWrapper<CarCheckRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarCheckRecordEntity::getCreateTime, month)
.orderByDesc(CarCheckRecordEntity::getCode);
return this.list(queryWrapper);
}
}

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

@ -0,0 +1,107 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
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.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 车辆维保记录服务实现类
*
* @author liwen
* @date 2024-01-04
*/
@Service
public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper, CarMaintenanceEntity> implements ICarMaintenanceService {
@Resource
CarMapper carMapper;
/**
* 新增车辆维保记录
*/
@Override
public boolean saveCarMaintenance(CarMaintenanceEntity carMaintenanceEntity) {
// 编码生成
// 获取当月时间(yyyymm)
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号
String lastCode = getLastCode(currentMonth);
// 若不存在,新增编号
String code = BaseUtil.getUniqueCode("YCJL", lastCode, currentMonth);
carMaintenanceEntity.setCode(code);
return this.save(carMaintenanceEntity);
}
/**
* 查询车辆维保记录详情
*/
@Override
public CarMaintenanceDetailVO getCarMaintenance(Long id) {
return baseMapper.getCarMaintenance(id);
}
/**
* 车辆维保记录数据页
*/
@Override
public IPage<CarMaintenancePageVO> getCarMaintenancePage(Map<String, Object> param, Query query) {
IPage<CarMaintenancePageVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getCarMaintenancePage(page, param);
}
/**
* 车辆维保记录确认
*/
@Override
public boolean confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO) {
CarMaintenanceEntity carMaintenanceEntity = this.getById(confirmationDTO.getCarMaintenanceId());
carMaintenanceEntity.setManagerAdvice(confirmationDTO.getManagerAdvice());
carMaintenanceEntity.setConfirmationTime(DateUtil.now());
return this.updateById(carMaintenanceEntity);
}
/**
* 查询是否存在同月编号
* @param currentMonth 当月
* @return 存在则返回上一编号否则返回null
*/
private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2);
List<CarMaintenanceEntity> list = getHygieneByMonth(month);
if (CollectionUtils.isEmpty(list)) {
return null;
}
return list.get(0).getCode();
}
/**
* 查询当月车辆维保记录
* @param month 当月
* @return 当月车辆维保数据表
*/
private List<CarMaintenanceEntity> getHygieneByMonth(String month) {
QueryWrapper<CarMaintenanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarMaintenanceEntity::getCreateTime, month)
.orderByDesc(CarMaintenanceEntity::getCode);
return this.list(queryWrapper);
}
}

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

@ -0,0 +1,105 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.springblade.core.mp.support.Query;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 车辆管理服务实现类
*
* @author liwen
* @date 2024-01-03
*/
@Service
public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements ICarService {
/**
* 年度里程数页面
*/
@Override
public IPage<CarMilesYearVO> milesDataByYear(String year, String unit, Query query) {
IPage<CarMilesYearVO> page = new Page<>(query.getCurrent(), query.getSize());
IPage<CarMilesYearVO> carPage = baseMapper.selectCarByYear(page, year, unit);
List<CarMilesYearVO> records = carPage.getRecords();
// 若无数据,返回空页面
if (CollectionUtils.isEmpty(records)) {
return carPage;
}
List<String> carList = records.stream().map(CarMilesYearVO::getPlateNumber).collect(Collectors.toList());
List<CarMilesYearDTO> milesList = baseMapper.selectMilesByCar(carList, year);
List<CarMilesYearVO> res = new ArrayList<>();
milesList.forEach(data -> {
CarMilesYearVO carMilesYearVO = records.stream().filter(x -> x.getPlateNumber().equals(data.getPlateNumber()))
.collect(Collectors.toList()).get(0);
BigDecimal sum = carMilesYearVO.getSumMiles() == null ? new BigDecimal(0) : carMilesYearVO.getSumMiles();
// 根据月份匹配写入对应字段
switch (data.getDateTime()) {
case "01":
carMilesYearVO.setJanuaryMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "02":
carMilesYearVO.setFebruaryMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "03":
carMilesYearVO.setMarchMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "04":
carMilesYearVO.setAprilMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "05":
carMilesYearVO.setMayMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "06":
carMilesYearVO.setJuneMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "07":
carMilesYearVO.setJulyMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "08":
carMilesYearVO.setAugustMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "09":
carMilesYearVO.setSeptemberMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "10":
carMilesYearVO.setOctoberMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "11":
carMilesYearVO.setNovemberMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
break;
case "12":
carMilesYearVO.setDecemberMiles(data.getMiles());
carMilesYearVO.setSumMiles(sum.add(data.getMiles()));
}
if (!carMilesYearVO.getSumMiles().equals(new BigDecimal(0))) {
res.add(carMilesYearVO);
}
});
carPage.setRecords(res);
return carPage;
}
}

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

@ -0,0 +1,100 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.mapper.CarUsedRecordMapper;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.springblade.core.mp.support.Query;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 用车记录服务实现类
*
* @author liwen
* @date 2024-01-04
*/
@Service
public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, CarUsedRecordEntity> implements ICarUsedRecordService {
/**
* 新增用车记录
*/
@Override
public boolean saveCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity) {
// 编码生成
// 获取当月时间(yyyymm)
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号
String lastCode = getLastCode(currentMonth);
// 若不存在,新增编号
String code = BaseUtil.getUniqueCode("WBJL", lastCode, currentMonth);
carUsedRecordEntity.setCode(code);
return false;
}
/**
* 用车记录详情
*/
@Override
public CarUsedRecordDetailVO getCarUsedRecord(Long id) {
return baseMapper.getCarUsedRecord(id);
}
/**
* 用车记录页面
*/
@Override
public IPage<CarUsedRecordPageVO> getCarUsedRecordPage(Map<String, Object> param, Query query) {
IPage<CarUsedRecordPageVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getCarUsedRecordPage(page, param);
}
/**
* 用车记录确认
*/
@Override
public boolean confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO) {
CarUsedRecordEntity carUsedRecord = this.getById(confirmationDTO.getCarUsedRecordId());
carUsedRecord.setConfirmationTime(confirmationDTO.getConfirmationTime());
return this.updateById(carUsedRecord);
}
/**
* 查询是否存在同月编号
* @param currentMonth 当月
* @return 存在则返回上一编号否则返回null
*/
private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2);
List<CarUsedRecordEntity> list = getHygieneByMonth(month);
if (CollectionUtils.isEmpty(list)) {
return null;
}
return list.get(0).getCode();
}
/**
* 查询当月车辆维保记录
* @param month 当月
* @return 当月车辆维保数据表
*/
private List<CarUsedRecordEntity> getHygieneByMonth(String month) {
QueryWrapper<CarUsedRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarUsedRecordEntity::getCreateTime, month)
.orderByDesc(CarUsedRecordEntity::getCode);
return this.list(queryWrapper);
}
}

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml

@ -91,7 +91,7 @@
(select count(*) from hzims_work_ticket_info i where flow_description = '作废' and i.id = info.id) as invalid,
(select count(*) from hzims_ticket_info_evaluate e where evaluate = '合格!' and e.id = eval.id) as qualified
from hzims_work_ticket_info info
LEFT JOIN hzims_ticket_info_evaluate eval ON info.id = eval.ticket_i
LEFT JOIN hzims_ticket_info_evaluate eval ON info.id = eval.ticket_id
<where>
<if test="deviceCodes != null">
and info.em_code in

Loading…
Cancel
Save