diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java index 3a4e9b9..fd81755 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java @@ -10,6 +10,8 @@ public interface SafeProductConstant { String TENANT_ID = "200000"; + String SAFEPRODUCT_EXPORT_DATE = "yyyy-MM-dd HH:mm:ss"; + int SUCCESS = 1; int FAILURE = 0; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarAnnualInspectionEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarAnnualInspectionEntity.java index 8f64585..c123440 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarAnnualInspectionEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarAnnualInspectionEntity.java @@ -37,18 +37,10 @@ public class CarAnnualInspectionEntity extends BaseEntity { @ApiModelProperty("年检地点") private String location; - @ApiModelProperty("年检费用") - private Long cost; - - @Size(max = 50, message = "年间负责人长度不能超过50") - @ApiModelProperty("年检负责人") - private String inspectionManager; - - @Size(max = 1000, message = "年间照片长度不能超过1000") + @Size(max = 1000, message = "年检照片长度不能超过1000") @ApiModelProperty("年检照片") private String imgPath; - @TableField(exist = false) @ApiModelProperty("下次年检时间") private Date nextAnnualInspectionTime; } 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 index 0a2b7c0..706093a 100644 --- 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 @@ -48,12 +48,10 @@ public class CarEntity extends BaseEntity { @ApiModelProperty("上牌时间") private Date registrationTime; - @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("上期缴车保时间") private Date insurancePayLastTime; - @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("下期缴车保时间") private Date insurancePayNextTime; @@ -62,7 +60,6 @@ public class CarEntity extends BaseEntity { @ApiModelProperty("上期年检时间") private Date lastAnnualInspectionTime; - @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("下期年检时间") private Date nextAnnualInspectionTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarInsuranceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarInsuranceEntity.java index b7172c4..c3e895f 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarInsuranceEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarInsuranceEntity.java @@ -37,18 +37,10 @@ public class CarInsuranceEntity extends BaseEntity { @ApiModelProperty("车保地点") private String location; - @ApiModelProperty("车保费用") - private Long cost; - - @Size(max = 50, message = "车保负责人长度不能超过50") - @ApiModelProperty("车保负责人") - private String insuranceManager; - @Size(max = 1000, message = "车保照片长度不能超过1000") @ApiModelProperty("车保照片") private String imgPath; - @TableField(exist = false) @ApiModelProperty("下次车保时间") private Date nextInsuranceTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarAnnualInspectionPageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarAnnualInspectionPageVO.java index 708dafc..eef34a3 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarAnnualInspectionPageVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarAnnualInspectionPageVO.java @@ -14,6 +14,9 @@ import java.util.Date; @ApiModel(value = "年检记录页面VO类") public class CarAnnualInspectionPageVO { + @ApiModelProperty("年检记录id") + private Long id; + @ApiModelProperty("车辆id") private Long carId; @@ -34,10 +37,4 @@ public class CarAnnualInspectionPageVO { @ApiModelProperty("年检地点") private String location; - - @ApiModelProperty("年检费用") - private Long cost; - - @ApiModelProperty("年检负责人") - private String inspectionManager; } 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 index 4aa745b..255857a 100644 --- 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 @@ -43,4 +43,10 @@ public class CarCheckRecordDetailVO { @ApiModelProperty("检查列表") private List checkItemList; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarInsurancePageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarInsurancePageVO.java index 5035121..1c4f314 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarInsurancePageVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarInsurancePageVO.java @@ -14,6 +14,9 @@ import java.util.Date; @ApiModel(value = "年保记录页面VO类") public class CarInsurancePageVO { + @ApiModelProperty("年保记录id") + private Long id; + @ApiModelProperty("车辆id") private Long carId; @@ -34,10 +37,4 @@ public class CarInsurancePageVO { @ApiModelProperty("年保地点") private String location; - - @ApiModelProperty("年保费用") - private Long cost; - - @ApiModelProperty("年保负责人") - private String insuranceManager; } 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 index dbeec77..2fe4817 100644 --- 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 @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -61,4 +63,13 @@ public class CarMaintenanceDetailVO { @ApiModelProperty("维保类型") private String maintenanceType; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } 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 index 5b166b6..521c997 100644 --- 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 @@ -46,4 +46,7 @@ public class CarMaintenancePageVO { @ApiModelProperty("确认时间") private Date confirmationTime; + + @ApiModelProperty("维保状态") + private String maintenanceStatus; } 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 index b415ff1..50564f4 100644 --- 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 @@ -1,11 +1,13 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; +import java.util.List; /** * @author liwen @@ -62,4 +64,13 @@ public class CarUsedRecordDetailVO { @ApiModelProperty("确认时间") private Date confirmationTime; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } 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 index d24ba26..a42d939 100644 --- 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 @@ -18,7 +18,7 @@ public class CarUsedRecordPageVO { @ApiModelProperty("用车记录id") private Long id; - @ApiModelProperty("用车单位") + @ApiModelProperty("单位") private String unit; @ApiModelProperty("品牌") 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 index 5a1aa23..6c47539 100644 --- 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 @@ -22,6 +22,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.util.List; import java.util.Map; /** @@ -119,9 +120,11 @@ public class CarController extends BladeController { @GetMapping("/carMaintenancePage") @ApiImplicitParams({ + @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "plateNumber", 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") + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "车辆维保记录分页") @ApiOperationSupport(order = 10) @@ -148,7 +151,7 @@ public class CarController extends BladeController { @ApiOperation(value = "修改用车记录") @ApiOperationSupport(order = 13) public R updateCarUsedRecord(@Valid @RequestBody CarUsedRecordEntity carUsedRecordEntity) { - return R.status(carUsedRecordService.updateCarUsedRecord(carUsedRecordEntity)); + return carUsedRecordService.updateCarUsedRecord(carUsedRecordEntity); } @PostMapping("/removeCarUsedRecord") @@ -167,7 +170,11 @@ public class CarController extends BladeController { @GetMapping("/carUsedRecordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "用车记录分页") @ApiOperationSupport(order = 16) @@ -221,8 +228,11 @@ public class CarController extends BladeController { @GetMapping("/carCheckRecordPage") @ApiImplicitParams({ + @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "车检记录分页") @ApiOperationSupport(order = 23) @@ -295,7 +305,9 @@ public class CarController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "annualInspectionTime", value = "年检时间", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "年检记录分页") @ApiOperationSupport(order = 32) @@ -334,8 +346,11 @@ public class CarController extends BladeController { @GetMapping("/carInsurancePage") @ApiImplicitParams({ + @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "carId", value = "车辆id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "车保记录分页") @ApiOperationSupport(order = 37) @@ -343,4 +358,12 @@ public class CarController extends BladeController { IPage page = carInsuranceService.getCarInsurancePage(param, query); return R.data(page); } + + @GetMapping("/carList") + @ApiOperation(value = "查询车辆列表") + @ApiOperationSupport(order = 38) + public R> carList(String plateNumber) { + List list = carService.getCarListByPlateNumber(plateNumber); + return R.data(list); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml index 7af47db..c0d4b86 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml @@ -5,7 +5,7 @@ diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml index 1e3835d..ea39dc6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml @@ -4,7 +4,7 @@ SELECT t2.unit, t2.car_brand, t2.car_type, t2.plate_number, t1.id, t1.maintenance_type, t1.content, t1.location, - t1.cost, t1.maintainer, t1.confirmation_time + t1.cost, t1.maintainer, t1.confirmation_time, t1.maintenance_status FROM hzims_car_maintenance t1 LEFT JOIN hzims_car t2 ON t1.car_id = t2.id @@ -28,6 +28,9 @@ AND t2.unit like concat('%', #{param.unit}, '%') + + AND t2.plate_number like concat('%', #{param.plateNumber}, '%') + AND t1.start_time >= #{param.startTime} 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 index ad456ed..b04c67c 100644 --- 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 @@ -18,7 +18,7 @@ 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 index 3ea3522..1db48cd 100644 --- 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 @@ -80,4 +80,11 @@ public interface ICarService extends IService { * @return 车辆列表数据 */ List getCarListByAnnualInspectionTime(String today, String yesterday); + + /** + * 根据车牌查询车辆 + * @param plateNumber 车牌号 + * @return 车辆列表 + */ + List getCarListByPlateNumber(String plateNumber); } 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 index a9548b3..27dec30 100644 --- 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 @@ -52,9 +52,9 @@ public interface ICarUsedRecordService extends IService { /** * 更新用车记录 * @param carUsedRecordEntity 用车记录实体类 - * @return true-成功,false-失败 + * @return 结果封装类 */ - boolean updateCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity); + R updateCarUsedRecord(CarUsedRecordEntity carUsedRecordEntity); /** * 导出用车记录单 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 index ad33674..12819bf 100644 --- 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 @@ -1,11 +1,13 @@ package com.hnac.hzims.safeproduct.service.impl; +import cn.afterturn.easypoi.entity.ImageEntity; import cn.hutool.core.date.DatePattern; import com.alibaba.excel.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO; import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity; @@ -28,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -190,6 +193,11 @@ public class CarCheckRecordServiceImpl extends ServiceImpl params = BaseUtil.obj2Map(carCheckRecordDetailVO); String templateFile = "template/车辆检查表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/车辆检查表" + SafeProductConstant.DOCX_SUFFIX; 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 index a2e3a32..f8da351 100644 --- 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 @@ -1,11 +1,13 @@ package com.hnac.hzims.safeproduct.service.impl; +import cn.afterturn.easypoi.entity.ImageEntity; import cn.hutool.core.date.DatePattern; import com.alibaba.excel.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO; import com.hnac.hzims.safeproduct.entity.CarEntity; @@ -27,6 +29,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -116,6 +119,22 @@ public class CarMaintenanceServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + carMaintenanceDetailVO.setImages(list); + } + // 表头年月 + String code = carMaintenanceDetailVO.getCode(); + carMaintenanceDetailVO.setYear(code.substring(4, 8)); + carMaintenanceDetailVO.setMonth(code.substring(8, 10)); // 维保类型 String maintenanceType = carMaintenanceDetailVO.getMaintenanceType(); if (maintenanceType.equals(CarMaintenanceTypeEnum.MAINTAIN.getValue())) { @@ -135,8 +154,7 @@ public class CarMaintenanceServiceImpl extends ServiceImpl implements queryWrapper.lambda().eq(CarEntity::getPlateNumber, carEntity.getPlateNumber()); CarEntity car = this.getOne(queryWrapper); if (car == null) { - carEntity.setMaintenanceStatus(CarMaintenanceStatusEnum.UNMAINTAINED.getValue()); return R.status(this.save(carEntity)); } return R.fail("车牌号已存在"); @@ -264,4 +264,17 @@ public class CarServiceImpl extends ServiceImpl implements .ge(CarEntity::getNextAnnualInspectionTime, yesterday); return this.list(queryWrapper); } + + /** + * 根据车牌查询车辆 + */ + @Override + public List getCarListByPlateNumber(String plateNumber) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotEmpty(plateNumber)) { + queryWrapper.lambda().like(CarEntity::getPlateNumber, plateNumber); + } + queryWrapper.lambda().orderByDesc(CarEntity::getCreateTime); + return this.list(queryWrapper); + } } 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 index 0de32ed..7f9f808 100644 --- 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 @@ -1,11 +1,13 @@ package com.hnac.hzims.safeproduct.service.impl; +import cn.afterturn.easypoi.entity.ImageEntity; import cn.hutool.core.date.DatePattern; import com.alibaba.excel.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO; import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity; @@ -23,6 +25,7 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -97,11 +100,14 @@ public class CarUsedRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + carUsedRecordDetailVO.setImages(list); + } + // 表头年月 + String code = carUsedRecordDetailVO.getCode(); + carUsedRecordDetailVO.setYear(code.substring(4, 8)); + carUsedRecordDetailVO.setMonth(code.substring(8, 10)); Map params = BaseUtil.obj2Map(carUsedRecordDetailVO); String templateFile = "template/用车记录单" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/用车记录单" + SafeProductConstant.DOCX_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx index e56cfba..366f01b 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx and b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx index 3d8ba1d..8868b7d 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx and b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx b/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx index 5d1dd59..9161a20 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx and b/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx differ