| | |
| | | import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Resource |
| | | private CarInsuranceMapper carInsuranceMapper; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | |
| | | public ResultUtil saveCarInsurance(CarInsurance carInsurance){ |
| | | if(carInsurance.getId() == null){ |
| | | carInsuranceMapper.insert(carInsurance); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 1); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | carInsuranceMapper.updateById(carInsurance); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 2); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | |
| | | @RequestMapping(value = "/delCarInsurance", method = RequestMethod.POST) |
| | | public ResultUtil delCarInsurance(Integer id){ |
| | | carInsuranceMapper.deleteById(id); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(id, 3); |
| | | } |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | } |
| | | tCarServiceService.insert(service); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | //清除相对应的司机关联车辆ID |
| | | List<TDriver> list = tDriverService.selectList(new EntityWrapper<TDriver>().eq("carId", tCarId)); |
| | | for (TDriver obj : list){ |
| | | obj.setCarId(null); |
| | | // obj.setCarId(null); |
| | | tDriverService.updateById(obj); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | tCarService.updateById(tCar); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |