| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.PlaybackMsgClient; |
| | | import com.ruoyi.dataInterchange.api.feignClient.RealVideoMsgClient; |
| | |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.api.model.CarType; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.ICarTypeService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Resource |
| | | private UPExgMsgRealLocationClient upExgMsgRealLocationClient; |
| | | |
| | | @Resource |
| | | private ICarTypeService carTypeService; |
| | | |
| | | |
| | | @GetMapping("/getCarList") |
| | | @ApiOperation(value = "获取车辆列表", tags = {"车辆管理"}) |
| | |
| | | car.setDriverName(driver.getName()); |
| | | return R.ok(car); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getRealVideo/{id}") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/playbackMsgControl") |
| | | @ApiOperation(value = "音视频回放远程控制", tags = {"车辆管理"}) |
| | | public R playbackMsgControl(PlaybackMsgControlReq req){ |
| | |
| | | return playbackMsgClient.playbackMsgControl(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber(), |
| | | req.getControlType(), req.getFastTime()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getCarTravel") |
| | |
| | | R<List<OrderTravelVo>> orderTravel = upExgMsgRealLocationClient.getOrderTravel(car.getVehicleNumber(), startTime, endTime); |
| | | return orderTravel; |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarTypeList") |
| | | @ApiOperation(value = "获取车辆类型列表数据", tags = {"车辆类型"}) |
| | | public R<List<CarType>> getCarTypeList(String name) { |
| | | List<CarType> list = carTypeService.list(new LambdaQueryWrapper<CarType>().like(StringUtils.isNotEmpty(name), CarType::getName, name)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarCount") |
| | | @ApiOperation(value = "获取各种车辆类型车辆总数", tags = {"首页"}) |
| | | public R<List<CarType>> getCarCount() { |
| | | List<CarType> list = carTypeService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarStatusCount") |
| | | @ApiOperation(value = "获取车辆状态汇总数据和公司总数等", tags = {"首页"}) |
| | | public R<CarStatusCount> getCarStatusCount() { |
| | | List<Car> list = carService.list(); |
| | | long online = list.stream().filter(s -> s.getStatus() == 1).count(); |
| | | long offline = list.stream().filter(s -> s.getStatus() == 3).count(); |
| | | long breakdown = list.stream().filter(s -> s.getStatus() == 4).count(); |
| | | long abnormal = list.stream().filter(s -> s.getStatus() == 2).count(); |
| | | CarStatusCount carStatusCount = new CarStatusCount(); |
| | | carStatusCount.setOffline(offline); |
| | | carStatusCount.setOnline(online); |
| | | carStatusCount.setBreakdown(breakdown); |
| | | carStatusCount.setAbnormal(abnormal); |
| | | long enterprise = enterpriseService.count(); |
| | | carStatusCount.setEnterprise(enterprise); |
| | | carStatusCount.setCar(list.size()); |
| | | long driver = driverService.count(); |
| | | carStatusCount.setDriver(driver); |
| | | return R.ok(carStatusCount); |
| | | } |
| | | |
| | | } |