| | |
| | | package com.dji.sample.wayline.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.dji.sample.common.model.CustomClaim; |
| | | import com.dji.sample.common.model.PaginationData; |
| | | import com.dji.sample.common.model.ResponseResult; |
| | | import com.dji.sample.log.aspect.SysLogAnnotation; |
| | | import com.dji.sample.wayline.dao.IWaylineJobMapper; |
| | | import com.dji.sample.wayline.model.dto.WaylineJobCountDTO; |
| | | import com.dji.sample.wayline.model.dto.WaylineJobDTO; |
| | | import com.dji.sample.wayline.model.entity.WaylineJobEntity; |
| | | import com.dji.sample.wayline.model.param.*; |
| | | import com.dji.sample.wayline.service.IWaylineJobService; |
| | | import com.dji.sample.wayline.service.impl.WaylineJobServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import javax.validation.Valid; |
| | | import java.sql.SQLException; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | |
| | | import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 子查询 |
| | | * @param workspaceId |
| | | * @return |
| | | */ |
| | | @GetMapping("/{workspace_id}/getChildrenJobs") |
| | | @SysLogAnnotation(operModul = "计划库", operType = "查询", operDesc = "分页查询") |
| | | public ResponseResult<List<WaylineJobDTO>> getChildrenJobs( |
| | | @PathVariable(name = "workspace_id") String workspaceId, WaylineJobQueryParam waylineJobQueryParam) { |
| | | List<WaylineJobDTO> data = waylineJobService.getChildrenJobs(workspaceId, waylineJobQueryParam); |
| | | return ResponseResult.success(data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询最新的记录 |
| | | * |
| | | * @return |
| | |
| | | * 统计飞行次数 |
| | | */ |
| | | @PostMapping("/{workspace_id}/patrol_statistics") |
| | | public ResponseResult<WaylineJobCountDTO> patrolStatistics(@PathVariable(name = "workspace_id") String workspaceId){ |
| | | public ResponseResult<WaylineJobCountDTO> patrolStatistics(@PathVariable(name = "workspace_id") String workspaceId,String queryTime) { |
| | | |
| | | WaylineJobCountDTO waylineJobCountDTO = waylineJobService.patrolStatistics(workspaceId); |
| | | WaylineJobCountDTO waylineJobCountDTO = waylineJobService.patrolStatistics(workspaceId,queryTime); |
| | | |
| | | return ResponseResult.success(waylineJobCountDTO); |
| | | } |
| | |
| | | * 收藏媒体库 |
| | | */ |
| | | @PostMapping("/update_job_collect") |
| | | public ResponseResult updateJobCollect(HttpServletRequest request, @RequestBody WaylineJobEntity waylineJob){ |
| | | public ResponseResult updateJobCollect(HttpServletRequest request, @RequestBody WaylineJobEntity waylineJob) { |
| | | CustomClaim claims = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | waylineJob.setUserId(claims.getId()); |
| | | waylineJobService.updateJobCollect(waylineJob); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/{sn}/jobs/flyByArea") |
| | | @PostMapping("/{sn}/jobs/{device_sn}/flyByArea") |
| | | @SysLogAnnotation(operModul = "根据区域飞行", operType = "根据区域飞行", operDesc = "根据区域飞行") |
| | | public ResponseResult flyByArea(@PathVariable(name = "sn") String sn, @RequestBody FlyAreaParam flyAreaParam) { |
| | | return waylineJobService.flyByArea(sn,flyAreaParam ); |
| | | public ResponseResult flyByArea(@PathVariable(name = "sn") String sn, @RequestBody FlyAreaParam flyAreaParam,@PathVariable(name = "device_sn")String deviceSn)throws Exception { |
| | | return waylineJobService.flyByArea(sn, flyAreaParam,deviceSn); |
| | | } |
| | | } |