puzhibing
2022-09-14 ab7cc0cb35f3375b35f7f3d866704d1383ddcff5
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarServiceImpl.java
@@ -1,6 +1,7 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.CarBrandMapper;
import com.stylefeng.guns.modular.system.dao.CarMapper;
import com.stylefeng.guns.modular.system.dao.CarModelMapper;
@@ -14,6 +15,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -124,8 +126,8 @@
     * @throws Exception
     */
    @Override
    public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto,
                             String carPhoto, String insurancePhoto, Integer uid,Integer id) throws Exception {
    public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime,
                             String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid,Integer id) throws Exception {
        Car query = carMapper.query(licensePlate);
        if(id==null){
@@ -138,6 +140,7 @@
            }
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Car car = new Car();
        car.setDriverId(uid);
        car = carMapper.selectOne(car);
@@ -152,9 +155,14 @@
        car.setCarLicensePlate(licensePlate);
        car.setAnnualInspectionTime(time);
        car.setDrivingLicensePhoto(drivingLicensePhoto);
        if(ToolUtil.isNotEmpty(drivingLicenseEndTime)){
            car.setDrivingLicenseEndTime(sdf.parse(drivingLicenseEndTime));
        }
        car.setCarPhoto(carPhoto);
        car.setInsurancePhoto(insurancePhoto);
        if(ToolUtil.isNotEmpty(commercialInsuranceTime)){
            car.setCommercialInsuranceTime(sdf.parse(commercialInsuranceTime));
        }
        Driver driver = driverService.selectById(uid);
        car.setCompanyId(driver.getCompanyId());
        car.setFranchiseeId(driver.getFranchiseeId());