| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | |
| | | * @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){ |
| | |
| | | } |
| | | } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Car car = new Car(); |
| | | car.setDriverId(uid); |
| | | car = carMapper.selectOne(car); |
| | |
| | | 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()); |