| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | |
| | | import com.stylefeng.guns.modular.system.util.videoGateway.VideoGateway; |
| | | import com.stylefeng.guns.modular.system.util.videoGateway.model.Ship; |
| | | import com.stylefeng.guns.modular.system.util.videoGateway.model.Vehicle; |
| | | import com.stylefeng.guns.modular.system.warpper.VehicleSpeed; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/17 20:18 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class PatrolTaskController extends BaseController { |
| | |
| | | |
| | | |
| | | |
| | | @GetMapping("/api/patrolTask/getTaskDetailList") |
| | | @PostMapping("/api/patrolTask/getTaskDetailList") |
| | | @ApiOperation(value = "获取任务列表数据", tags = {"任务管理"}) |
| | | public PageInfoBT<TaskDetailList> getTaskDetailList(TaskDetailListVo vo){ |
| | | public PageInfoBT<TaskDetailList> getTaskDetailList(@RequestBody TaskDetailListVo vo){ |
| | | Page<TaskDetailList> pageInfo = new Page(vo.getLimit(), vo.getOffset()); |
| | | List<TaskDetailList> taskDetailList = taskDetailService.getTaskDetailList(pageInfo, vo); |
| | | pageInfo.setRecords(taskDetailList); |
| | |
| | | |
| | | |
| | | |
| | | @GetMapping("/api/patrolTask/getTaskRecordList") |
| | | @PostMapping("/api/patrolTask/getTaskRecordList") |
| | | @ApiOperation(value = "获取任务记录列表", tags = {"任务记录"}) |
| | | public PageInfoBT<TaskRecordList> getTaskRecordList(TaskRecordListVo vo){ |
| | | public PageInfoBT<TaskRecordList> getTaskRecordList(@RequestBody TaskRecordListVo vo){ |
| | | Page<TaskRecordList> pageInfo = new Page(vo.getLimit(), vo.getOffset()); |
| | | List<TaskRecordList> taskRecordList = taskDetailService.getTaskRecordList(pageInfo, vo); |
| | | pageInfo.setRecords(taskRecordList); |
| | |
| | | String userId = JwtTokenUtil.getPrivateClaimFromToken(token, "userId"); |
| | | return taskDetailService.manualAudit(vo, userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "列表数据id,多个逗号分隔", name = "ids", dataType = "String"), |
| | | @ApiImplicitParam(value = "状态(1=待执行,2=进行中,3=成功,4=失败)", name = "status", dataType = "int"), |
| | | @ApiImplicitParam(value = "规则编号", name = "code", dataType = "String"), |
| | | @ApiImplicitParam(value = "系统审核状态(1=未执行,2=正常,3=异常)", name = "sysStatus", dataType = "int"), |
| | | }) |
| | | public void downloadTaskRecord(String ids, String code, Integer status, HttpServletResponse response){ |
| | | public void downloadTaskRecord(String ids, String code, Integer status,Integer sysStatus, HttpServletResponse response){ |
| | | List<String> id = null; |
| | | if(ToolUtil.isNotEmpty(ids)){ |
| | | String[] split = ids.split(","); |
| | | id = Arrays.asList(split); |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, status, response); |
| | | taskDetailService.downloadTaskRecord(id, code, status,sysStatus, response); |
| | | } |
| | | |
| | | |
| | | @PutMapping("/base/patrolTask/vehicleSpeed") |
| | | @PostMapping("/base/patrolTask/vehicleSpeed") |
| | | @ApiOperation(value = "变更车辆状态", tags = {"互联互通接口"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车牌号", name = "vehicleNum", dataType = "String", required = true), |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "double", required = true), |
| | | @ApiImplicitParam(value = "经度", name = "longitude", dataType = "double", required = true), |
| | | }) |
| | | public ResultUtil vehicleSpeed(String vehicleNum, Integer vehicleStatus, Integer vehicleType, String communicationNum, String vehicleGpsProtocol, Double latitude, Double longitude){ |
| | | patrolTaskService.vehicleSpeed(vehicleNum, vehicleStatus, vehicleType, communicationNum, vehicleGpsProtocol, latitude, longitude); |
| | | public ResultUtil vehicleSpeed(@RequestBody VehicleSpeed vehicleSpeed){ |
| | | log.info("推送车辆状态:{}", JSON.toJSONString(vehicleSpeed)); |
| | | patrolTaskService.vehicleSpeed(vehicleSpeed.getVehicleNum(), vehicleSpeed.getVehicleStatus(), vehicleSpeed.getVehicleType(), |
| | | vehicleSpeed.getCommunicationNum(), vehicleSpeed.getVehicleGpsProtocol(), vehicleSpeed.getLatitude(), vehicleSpeed.getLongitude()); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |