diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java new file mode 100644 index 0000000..1467abe --- /dev/null +++ b/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; + +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/ConstructionVo.java new file mode 100644 index 0000000..aeaf0aa --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMaintenanceConfirmationDTO.java new file mode 100644 index 0000000..313ecc5 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMilesYearDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarMilesYearDTO.java new file mode 100644 index 0000000..39568c4 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarUsedRecordConfirmationDTO.java new file mode 100644 index 0000000..47a8df7 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckItemEntity.java new file mode 100644 index 0000000..21dd74b --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckRecordEntity.java new file mode 100644 index 0000000..8035cf5 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java new file mode 100644 index 0000000..b0292ef --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java new file mode 100644 index 0000000..2d106df --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarUsedRecordEntity.java new file mode 100644 index 0000000..baf0c43 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckItemVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckItemVO.java new file mode 100644 index 0000000..4c5fd37 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckRecordDetailVO.java new file mode 100644 index 0000000..2a48891 --- /dev/null +++ b/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 checkItemList; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenanceDetailVO.java new file mode 100644 index 0000000..278e6b7 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMaintenancePageVO.java new file mode 100644 index 0000000..0c54dc9 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java new file mode 100644 index 0000000..492587d --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordDetailVO.java new file mode 100644 index 0000000..06cdf91 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarUsedRecordPageVO.java new file mode 100644 index 0000000..38fa1eb --- /dev/null +++ b/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; +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java index e1346c1..6239612 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java +++ b/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)") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java new file mode 100644 index 0000000..aa03b00 --- /dev/null +++ b/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> 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); + } + + +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.java new file mode 100644 index 0000000..e5dd121 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.xml new file mode 100644 index 0000000..b1358be --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/ConstructionMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java new file mode 100644 index 0000000..a70cedc --- /dev/null +++ b/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 { + + + IPage pageCondition(IPage page, ConstructionVo construction); + + void preview(Long id); +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java new file mode 100644 index 0000000..91e4ca1 --- /dev/null +++ b/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 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 pageCondition(IPage 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 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); + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/ConstructionWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/ConstructionWrapper.java new file mode 100644 index 0000000..93d1aba --- /dev/null +++ b/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 { + + 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; + } + +} diff --git a/hzims-service/operational/src/main/resources/template/excel/constructio_template.xlsx b/hzims-service/operational/src/main/resources/template/excel/constructio_template.xlsx new file mode 100644 index 0000000..201df42 Binary files /dev/null and b/hzims-service/operational/src/main/resources/template/excel/constructio_template.xlsx differ diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java new file mode 100644 index 0000000..6d83610 --- /dev/null +++ b/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 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> carPage(@ApiIgnore @RequestParam Map param, Query query) { + IPage 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 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> carMaintenancePage(@ApiIgnore @RequestParam Map param, Query query) { + IPage 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 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> carUsedRecordPage(@ApiIgnore @RequestParam Map param, Query query) { + IPage 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> milesDataByYear(@RequestParam String year, String unit, Query query) { + IPage 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 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> carCheckRecordPage(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = carUsedRecordService.getCarUsedRecordPage(param, query); + return R.data(page); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java new file mode 100644 index 0000000..83ea0fa --- /dev/null +++ b/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 { +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java new file mode 100644 index 0000000..745ae01 --- /dev/null +++ b/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 { +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.java new file mode 100644 index 0000000..d068070 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.xml new file mode 100644 index 0000000..1aa7909 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckItemMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java new file mode 100644 index 0000000..608b499 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml new file mode 100644 index 0000000..f372a67 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.java new file mode 100644 index 0000000..2a6dc38 --- /dev/null +++ b/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 { + + /** + * 查询车辆维保记录详情 + * @param carMaintenanceId 车辆维保记录id + * @return 车辆维保记录详情VO类 + */ + CarMaintenanceDetailVO getCarMaintenance(Long carMaintenanceId); + + /** + * 车辆维保记录数据页 + * @param param 入参 + * @param page 分页类 + * @return 分页数据 + */ + IPage getCarMaintenancePage(IPage page, Map param); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml new file mode 100644 index 0000000..86c1564 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.java new file mode 100644 index 0000000..f327415 --- /dev/null +++ b/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 { + + /** + * 查询当年的全部车辆 + * @param page 分页类 + * @param year 年份 + * @param unit 单位 + * @return 分页车辆数据 + */ + IPage selectCarByYear(IPage page, String year, String unit); + + /** + * 查询车辆当年的月度里程数 + * @param carList 车牌列表 + * @param year 年份 + * @return 里程数列表 + */ + List selectMilesByCar(List carList, String year); + + /** + * 查询车辆的里程数 + * @param plateNumber 车牌号 + * @return 里程数 + */ + BigDecimal selectMilesByPlateNumber(String plateNumber); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml new file mode 100644 index 0000000..0fda798 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.java new file mode 100644 index 0000000..38f26bd --- /dev/null +++ b/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 { + + /** + * 用车记录详情 + * @param carUsedRecordId 用车记录id + * @return 用车记录详情VO类 + */ + CarUsedRecordDetailVO getCarUsedRecord(Long carUsedRecordId); + + /** + * 用车记录页面 + * @param param 入参 + * @param page 分页类 + * @return 分页数据 + */ + IPage getCarUsedRecordPage(IPage page, Map param); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml new file mode 100644 index 0000000..8a10fa4 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckItemService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckItemService.java new file mode 100644 index 0000000..9bd0042 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckRecordService.java new file mode 100644 index 0000000..0337b44 --- /dev/null +++ b/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 { + + /** + * 新增车检记录 + * @param carCheckRecordEntity 车检记录实体类 + * @return true-成功,false-失败 + */ + boolean saveCarCheckRecord(CarCheckRecordEntity carCheckRecordEntity); + + /** + * 车检记录详情 + * @param id 车检记录id + * @return 车检记录详情VO类 + */ + CarCheckRecordDetailVO getCarCheckRecord(Long id); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarMaintenanceService.java new file mode 100644 index 0000000..f85ba53 --- /dev/null +++ b/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 { + + /** + * 新增车辆维保记录 + * @param carMaintenanceEntity 车辆维保记录实体类 + * @return true-成功,false-失败 + */ + boolean saveCarMaintenance(CarMaintenanceEntity carMaintenanceEntity); + + /** + * 查询车辆维保记录详情 + * @param id 车辆维保记录id + * @return 车辆维保记录详情VO类 + */ + CarMaintenanceDetailVO getCarMaintenance(Long id); + + /** + * 车辆维保记录数据页 + * @param param 入参 + * @param query 分页类 + * @return 分页数据 + */ + IPage getCarMaintenancePage(Map param, Query query); + + /** + * 车辆维保记录确认 + * @param confirmationDTO 车辆维保记录确认DTO类 + * @return true-成功,false-失败 + */ + boolean confirmCarMaintenance(CarMaintenanceConfirmationDTO confirmationDTO); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarService.java new file mode 100644 index 0000000..43c815f --- /dev/null +++ b/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 { + + /** + * 年度里程数页面 + * @param year 年份 + * @param unit 单位 + * @param query 分页类 + * @return 分页数据 + */ + IPage milesDataByYear(String year, String unit, Query query); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarUsedRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarUsedRecordService.java new file mode 100644 index 0000000..b8ba1f9 --- /dev/null +++ b/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 { + + /** + * 新增用车记录 + * @param carUsedRecordEntity 用车记录实体类 + * @return true-成功,false-失败 + */ + boolean saveCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity); + + /** + * 用车记录详情 + * @param id 用车记录id + * @return 用车记录详情VO类 + */ + CarUsedRecordDetailVO getCarUsedRecord(Long id); + + /** + * 用车记录页面 + * @param param 入参 + * @param query 分页类 + * @return 分页数据 + */ + IPage getCarUsedRecordPage(Map param, Query query); + + /** + * 用车记录确认 + * @param confirmationDTO 用车记录确认DTO类 + * @return true-成功,false-失败 + */ + boolean confirmCarUsedRecord(CarUsedRecordConfirmationDTO confirmationDTO); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckItemServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckItemServiceImpl.java new file mode 100644 index 0000000..ede8a3a --- /dev/null +++ b/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 implements ICarCheckItemService { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java new file mode 100644 index 0000000..60a876a --- /dev/null +++ b/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 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 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 list = getCarCheckRecordByMonth(month); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return list.get(0).getCode(); + } + + /** + * 查询当月卫生自查记录 + * @param month 当月 + * @return 当月卫生自查数据表 + */ + private List getCarCheckRecordByMonth(String month) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(CarCheckRecordEntity::getCreateTime, month) + .orderByDesc(CarCheckRecordEntity::getCode); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java new file mode 100644 index 0000000..3aa1cf3 --- /dev/null +++ b/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 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 getCarMaintenancePage(Map param, Query query) { + IPage 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 list = getHygieneByMonth(month); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return list.get(0).getCode(); + } + + /** + * 查询当月车辆维保记录 + * @param month 当月 + * @return 当月车辆维保数据表 + */ + private List getHygieneByMonth(String month) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(CarMaintenanceEntity::getCreateTime, month) + .orderByDesc(CarMaintenanceEntity::getCode); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java new file mode 100644 index 0000000..64c55cd --- /dev/null +++ b/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 implements ICarService { + + /** + * 年度里程数页面 + */ + @Override + public IPage milesDataByYear(String year, String unit, Query query) { + IPage page = new Page<>(query.getCurrent(), query.getSize()); + IPage carPage = baseMapper.selectCarByYear(page, year, unit); + List records = carPage.getRecords(); + // 若无数据,返回空页面 + if (CollectionUtils.isEmpty(records)) { + return carPage; + } + List carList = records.stream().map(CarMilesYearVO::getPlateNumber).collect(Collectors.toList()); + List milesList = baseMapper.selectMilesByCar(carList, year); + List 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; + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java new file mode 100644 index 0000000..2b35beb --- /dev/null +++ b/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 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 getCarUsedRecordPage(Map param, Query query) { + IPage 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 list = getHygieneByMonth(month); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return list.get(0).getCode(); + } + + /** + * 查询当月车辆维保记录 + * @param month 当月 + * @return 当月车辆维保数据表 + */ + private List getHygieneByMonth(String month) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(CarUsedRecordEntity::getCreateTime, month) + .orderByDesc(CarUsedRecordEntity::getCode); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml index 9c57323..2dc2cc3 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml +++ b/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 and info.em_code in