| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhangzeli |
| | |
| | | } |
| | | return new ResultUtil<List<CarVo>>().setData(carVos); |
| | | } |
| | | @RequestMapping(value = "/getInfo", method = RequestMethod.GET) |
| | | @ApiOperation(value = "通过车辆id获取") |
| | | public Result<List<Car>> getInfo(String beginTime,String endTime) { |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | wrapper.ge(beginTime!=null && beginTime!="","a.add_date",beginTime); |
| | | wrapper.le(endTime!=null && endTime!="","a.add_date",endTime); |
| | | wrapper.groupBy("car_no"); |
| | | List<Car> list2 = iCarService.getCarInfo2(wrapper); |
| | | List<Car> list = iCarService.getCarInfo(); |
| | | for (Car car:list2){ |
| | | for (Car car1:list){ |
| | | if (car.getId().equals(car1.getId())){ |
| | | car1.setAmount(car.getAmount()); |
| | | car1.setMileage(car.getMileage()); |
| | | car1.setMoney(car.getMoney()); |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | return new ResultUtil<List<Car>>().setData(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getByPage", method = RequestMethod.GET) |
| | | @ApiOperation(value = "分页获取") |