src/main/java/com/dji/sample/media/controller/FileController.java
@@ -8,6 +8,7 @@ import com.dji.sample.media.model.MediaFileEntity; import com.dji.sample.media.model.MediaFileQueryParam; import com.dji.sample.media.service.IFileService; import com.drew.imaging.ImageProcessingException; import org.apache.ibatis.annotations.Update; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.*; import java.io.IOException; import java.net.URL; import java.util.List; @@ -62,8 +64,8 @@ } @GetMapping("/getMediaInfo") public ResponseResult mediaInfo(@RequestParam String fileId) { return ResponseResult.success(fileService.mediaInfo(fileId)); public ResponseResult mediaInfo(@RequestParam String fileName) { return ResponseResult.success(fileService.mediaInfo(fileName)); } @GetMapping("/{workspace_id}/files/{job_id}") @@ -107,4 +109,8 @@ e.printStackTrace(); } } @PostMapping("/{workspace_id}/mark") public void eaveMarkFile(@PathVariable(name = "workspace_id") String workspaceId,@RequestBody FileUploadDTO file) throws ImageProcessingException, IOException, FontFormatException { fileService.saveMarkFile(workspaceId,file); } } src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java
@@ -59,7 +59,6 @@ private GetPatchesMapper patchesMapper; @Autowired private IDeviceDictionaryService deviceDictionaryService; @Autowired private OssServiceContext ossService; @@ -131,9 +130,11 @@ } @Override public Object mediaInfo(String fileId) { public Object mediaInfo(String filename) { String name= "mark"+filename; MediaFileMarkEntity entity = markMapper.selectOne(new LambdaQueryWrapper<MediaFileMarkEntity>() .eq(MediaFileMarkEntity::getFileId, fileId)); .eq(MediaFileMarkEntity::getFileName, name)); return entity.getDronedata(); } src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -59,7 +59,9 @@ @RequestParam(name = "dkbh", defaultValue = "") String dkbh, @RequestParam(name = "isPlan", required = false) Integer isPlan, @RequestParam(name = "xzqdm", defaultValue = "") String xzqdm, @RequestParam(name = "bsm", defaultValue = "") String bsm @RequestParam(name = "bsm", defaultValue = "") String bsm, @RequestParam(name = "xmc", defaultValue = "") String xmc, @RequestParam(name = "investigate", required = false) Integer investigate ) { //调用service分页查询 PatchesParam param = PatchesParam.builder() @@ -70,6 +72,8 @@ .isPlan(isPlan) .xzqdm(xzqdm) .bsm(bsm) .xmc(xmc) .investigate(investigate) .build(); PaginationData<LotInfo> data = getPatchesService.limitGet(param); return ResponseResult.success(data); @@ -92,12 +96,16 @@ String xzq = DistrictCodeUtils.nameToCode(code); return ResponseResult.success(xzq); } @GetMapping("/getInfoById") public ResponseResult<LotInfo> wayAndPatchesId(@RequestParam String patchesId) { return ResponseResult.success(getPatchesService.getPatchesFromId(patchesId)); } @GetMapping("/useMyTask") public ResponseResult useMyTask() throws Exception { try { timerUtil.myTask(); timerUtil.myTask2(); // timerUtil.myTask2(); return ResponseResult.success(); } catch (Exception e) { throw new RuntimeException("db存储发送出现异常"); src/main/java/com/dji/sample/patches/model/Param/PatchesParam.java
@@ -25,4 +25,8 @@ private String xzqdm; private String bsm; private String xmc; private Integer investigate; } src/main/java/com/dji/sample/patches/service/GetPatchesService.java
@@ -15,7 +15,6 @@ */ PaginationData<LotInfo> limitGet(PatchesParam param); void delPatches(); /** * 根据条件获取照片的分页数据 * @@ -24,7 +23,7 @@ * @return 返回照片的分页数据,包括分页信息和照片实体列表 */ PaginationData<MediaFileEntity> getPhoto(PatchesParam param,String dkbh); LotInfo getPatchesFromId(String patchesId); /** * 根据条件获取照片的分页数据 * src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java
@@ -33,19 +33,20 @@ */ @Override public PaginationData<LotInfo> limitGet(PatchesParam param) { if (param.getIsPlan() != null) { if (param.getInvestigate() != null) { Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()), new LambdaQueryWrapper<LotInfo>() .eq(LotInfo::getWorkspaceId, param.getWorkspaceId()) .like(LotInfo::getDkbh, param.getDkbh()) .like(LotInfo::getXzqdm, param.getXzqdm()) .like(LotInfo::getBsm,param.getBsm()) .eq(LotInfo::getIsPlan, param.getIsPlan())); .like(LotInfo::getXmc,param.getXmc()) .eq(LotInfo::getInvestigate, param.getInvestigate())); List<LotInfo> records = page.getRecords() .stream() .peek(lotInfo -> { // 修改 xzqdm 字段的值 lotInfo.setXzqdm(DistrictCodeUtils.codeToName(lotInfo.getXzqdm())); // // 修改 xzqdm 字段的值 // lotInfo.setXzqdm(DistrictCodeUtils.codeToName(lotInfo.getXzqdm())); }) .collect(Collectors.toList()); return new PaginationData<LotInfo>(records, new Pagination(page)); @@ -55,12 +56,13 @@ .eq(LotInfo::getWorkspaceId, param.getWorkspaceId()) .like(LotInfo::getDkbh, param.getDkbh()) .like(LotInfo::getBsm,param.getBsm()) .like(LotInfo::getXmc,param.getXmc()) .like(LotInfo::getXzqdm, param.getXzqdm())); List<LotInfo> records = page.getRecords() .stream() .peek(lotInfo -> { // 修改 xzqdm 字段的值 lotInfo.setXzqdm(DistrictCodeUtils.codeToName(lotInfo.getXzqdm())); // // 修改 xzqdm 字段的值 // lotInfo.setXzqdm(DistrictCodeUtils.codeToName(lotInfo.getXzqdm())); }) .collect(Collectors.toList()); return new PaginationData<LotInfo>(records, new Pagination(page)); @@ -120,7 +122,10 @@ public List<LotInfo> listLotinfo() { return mapper.selectList(null); } @Override public LotInfo getPatchesFromId(String patchesId){ return mapper.selectOne(new LambdaQueryWrapper<LotInfo>().eq(LotInfo::getId,patchesId)); } @Override public void insertLotinfo(List<LotInfo> list) { for (int i = 0; i < list.size(); i++) { src/main/java/com/dji/sample/wayline/service/impl/WaylineJobServiceImpl.java
@@ -338,7 +338,7 @@ if (WaylineTaskTypeEnum.IMMEDIATE == waylineJob.getTaskType()) { boolean isExecuted = executeFlightTask(waylineJob.getWorkspaceId(), waylineJob.getJobId()); if (!isExecuted) { return ResponseResult.error("执行任务失败"); return ResponseResult.error("当前状态不支持飞行,请检查是否已有正在执行的飞行任务!"); } }