| | |
| | | import cn.exrick.xboot.your.service.IOrderTaskService; |
| | | import cn.exrick.xboot.your.util.HaiKangPost; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private ICarService iCarService; |
| | | |
| | | @Autowired |
| | | private HaiKangPost haiKangPost; |
| | | |
| | | @RequestMapping(value = "/getIndex1", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取首页数据") |
| | |
| | | return new ResultUtil<Object>().setData(data.getRecords()); |
| | | } |
| | | |
| | | // @RequestMapping(value = "/getCars", method = RequestMethod.GET) |
| | | // @ApiOperation(value = "获取车辆信息") |
| | | // public Result<Object> getCars() { |
| | | // List<Car> list = iCarService.list(); |
| | | // String codes[] = new String[list.size()]; |
| | | // |
| | | // HaiKangPost.findLatestGps() |
| | | // return new ResultUtil<Object>().setData(data.getRecords()); |
| | | // } |
| | | @RequestMapping(value = "/getCars", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取车辆定位信息") |
| | | public Result<Object> getCars() { |
| | | List<Car> list = iCarService.list(); |
| | | String codes[] = new String[list.size()]; |
| | | |
| | | for(int i=0;i<list.size();i++){ |
| | | codes[i] = list.get(i).getCode(); |
| | | } |
| | | String latestGps = haiKangPost.findLatestGps(codes); |
| | | return new ResultUtil<Object>().setData(JSONUtil.parseObj(latestGps)); |
| | | } |
| | | } |