From 922de4e688e18f508070972876002fa6a3810135 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期一, 10 三月 2025 14:31:31 +0800 Subject: [PATCH] 修改导出bug --- guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java | 60 ++++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 44 insertions(+), 16 deletions(-) diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java b/guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java index c523743..4a1f01b 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/api/PatrolTaskController.java @@ -1,5 +1,6 @@ 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; @@ -15,9 +16,11 @@ 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; @@ -29,8 +32,9 @@ * @author zhibing.pu * @Date 2024/12/17 20:18 */ +@Slf4j @RestController -@RequestMapping("/base/patrolTask") +@RequestMapping("") public class PatrolTaskController extends BaseController { @Resource @@ -41,7 +45,7 @@ - @GetMapping("/getTaskDetailList") + @GetMapping("/api/patrolTask/getTaskDetailList") @ApiOperation(value = "获取任务列表数据", tags = {"任务管理"}) public PageInfoBT<TaskDetailList> getTaskDetailList(TaskDetailListVo vo){ Page<TaskDetailList> pageInfo = new Page(vo.getLimit(), vo.getOffset()); @@ -55,7 +59,7 @@ - @DeleteMapping("/delTaskDetail") + @DeleteMapping("/api/patrolTask/delTaskDetail") @ApiOperation(value = "删除任务", tags = {"任务管理"}) public ResultUtil delTaskDetail(String ids){ List<String> id = Arrays.asList(ids.split(",")); @@ -65,7 +69,7 @@ - @PostMapping("/addPatrolTask") + @PostMapping("/api/patrolTask/addPatrolTask") @ApiOperation(value = "添加巡查任务", tags = {"任务管理"}) public ResultUtil addPatrolTask(@RequestBody PatrolTaskVo vo, HttpServletRequest request){ String token = request.getHeader(JwtConstants.AUTH_HEADER); @@ -77,7 +81,7 @@ return ResultUtil.success(); } - @GetMapping("/getImageModel") + @GetMapping("/api/patrolTask/getImageModel") @ApiOperation(value = "获取图片模型", tags = {"任务管理"}) public ResultUtil<List<Map<String, Object>>> getImageModel(){ ImageModelEnum[] values = ImageModelEnum.values(); @@ -95,7 +99,7 @@ - @GetMapping("/getVideoChannel") + @GetMapping("/api/patrolTask/getVideoChannel") @ApiOperation(value = "获取视频通道", tags = {"任务管理"}) public ResultUtil<List<Map<String, Object>>> getVideoChannel(){ VideoChannelEnum[] values = VideoChannelEnum.values(); @@ -112,7 +116,7 @@ } - @GetMapping("/getVehicleList") + @GetMapping("/api/patrolTask/getVehicleList") @ApiOperation(value = "获取车辆列表", tags = {"任务管理"}) public ResultUtil<List<Vehicle>> getVehicleList(Integer year){ List<Vehicle> vehicleList = VideoGateway.getVehicleList(null, null, null, 0); @@ -132,7 +136,7 @@ - @GetMapping("/getShipList") + @GetMapping("/api/patrolTask/getShipList") @ApiOperation(value = "获取船舶列表", tags = {"任务管理"}) public ResultUtil<List<Ship>> getShipList(Integer year){ List<Ship> shipList = VideoGateway.getShipList(null, null, null, 0); @@ -152,7 +156,7 @@ - @GetMapping("/getTaskRecordList") + @GetMapping("/api/patrolTask/getTaskRecordList") @ApiOperation(value = "获取任务记录列表", tags = {"任务记录"}) public PageInfoBT<TaskRecordList> getTaskRecordList(TaskRecordListVo vo){ Page<TaskRecordList> pageInfo = new Page(vo.getLimit(), vo.getOffset()); @@ -166,14 +170,14 @@ - @GetMapping("/getTaskRecordInfo") + @GetMapping("/api/patrolTask/getTaskRecordInfo") @ApiOperation(value = "获取任务记录详情", tags = {"任务记录"}) public ResultUtil<TaskRecordInfo> getTaskRecordInfo(Integer id){ TaskRecordInfo taskRecordInfo = taskDetailService.getTaskRecordInfo(id); return ResultUtil.success(taskRecordInfo); } - @PostMapping("/getPictureDetailsVehicle") + @PostMapping("/api/patrolTask/getPictureDetailsVehicle") @ApiOperation(value = "获取任务记录详情中的车船数据", tags = {"任务记录"}) public ResultUtil<PictureDetailsVehicle> getPictureDetailsVehicle(@RequestBody PictureDetailsVo vo){ PictureDetailsVehicle pictureDetailsVehicle = taskDetailService.getPictureDetailsVehicle(vo); @@ -182,7 +186,7 @@ - @PostMapping("/getPictureDetails") + @PostMapping("/api/patrolTask/getPictureDetails") @ApiOperation(value = "获取任务记录详情中的视频通道数据", tags = {"任务记录"}) public PageInfoBT<PictureDetails> getPictureDetails(@RequestBody PictureDetailsVo vo){ Page<PictureDetails> pageInfo = new Page(vo.getLimit(), vo.getOffset()); @@ -196,15 +200,20 @@ - @PostMapping("/manualAudit") + @PostMapping("/api/patrolTask/manualAudit") @ApiOperation(value = "人工审核视频通道数据", tags = {"任务记录"}) - public ResultUtil manualAudit(@RequestBody ManualAuditVo vo){ - return taskDetailService.manualAudit(vo); + public ResultUtil manualAudit(@RequestBody ManualAuditVo vo, HttpServletRequest request){ + String token = request.getHeader(JwtConstants.AUTH_HEADER); + if (token != null && token.startsWith("Bearer ")) { + token = token.substring(token.indexOf(" ") + 1); + } + String userId = JwtTokenUtil.getPrivateClaimFromToken(token, "userId"); + return taskDetailService.manualAudit(vo, userId); } - @GetMapping("/downloadTaskRecord") + @GetMapping("/api/patrolTask/downloadTaskRecord") @ApiOperation(value = "下载任务记录数据", tags = {"任务记录"}) @ApiImplicitParams({ @ApiImplicitParam(value = "列表数据id,多个逗号分隔", name = "ids", dataType = "String"), @@ -219,4 +228,23 @@ } taskDetailService.downloadTaskRecord(id, code, status, response); } + + + @PostMapping("/base/patrolTask/vehicleSpeed") + @ApiOperation(value = "变更车辆状态", tags = {"互联互通接口"}) + @ApiImplicitParams({ + @ApiImplicitParam(value = "车牌号", name = "vehicleNum", dataType = "String", required = true), + @ApiImplicitParam(value = "状态(1=行驶中,2=已停止)", name = "vehicleStatus", dataType = "int", required = true), + @ApiImplicitParam(value = "车辆类型(1=车,2=船)", name = "vehicleType", dataType = "int", required = true), + @ApiImplicitParam(value = "通信号", name = "communicationNum", dataType = "String", required = true), + @ApiImplicitParam(value = "gps协议", name = "vehicleGpsProtocol", dataType = "String", required = true), + @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "double", required = true), + @ApiImplicitParam(value = "经度", name = "longitude", dataType = "double", required = true), + }) + 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(); + } } -- Gitblit v1.7.1