| | |
| | | |
| | | @GetMapping("/getMediaInfo") |
| | | public ResponseResult mediaInfo(@RequestParam String fileName) { |
| | | Object info = fileService.mediaInfo(fileName); |
| | | if (info == null) { |
| | | return ResponseResult.error("图片正在解析中"); |
| | | } |
| | | return ResponseResult.success(fileService.mediaInfo(fileName)); |
| | | } |
| | | |
| | |
| | | @RequestParam(name = "updateStart", required = false) Long photoStart, |
| | | @RequestParam(name = "updateEnd", required = false) Long photoEnd, |
| | | @RequestParam(name = "jobName", required = false) String jobName, |
| | | @RequestParam( required = false) String type |
| | | @RequestParam(required = false) String type |
| | | ) { |
| | | |
| | | return ResponseResult.success(fileService.MediaQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName,workspaceId,type)); |
| | | return ResponseResult.success(fileService.MediaQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName, workspaceId, type)); |
| | | |
| | | } |
| | | |
| | |
| | | import com.dji.sample.media.model.param.SearchMediaParam; |
| | | import com.dji.sample.media.service.IMediaService; |
| | | import com.dji.sample.wayline.model.dto.WaylineJobDTO; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/upload-callback") |
| | | public ResponseResult<String> uploadCallback(@PathVariable(name = "workspace_id") String workspaceId, @RequestBody FileUploadDTO file) throws IOException, FontFormatException { |
| | | public ResponseResult<String> uploadCallback(@PathVariable(name = "workspace_id") String workspaceId, @RequestBody FileUploadDTO file) throws IOException, FontFormatException, ImageProcessingException { |
| | | mediaService.saveMediaFile(workspaceId, file); |
| | | return ResponseResult.success(file.getObjectKey()); |
| | | } |
| | |
| | | * @param file |
| | | * @return |
| | | */ |
| | | Integer saveFile(String workspaceId, FileUploadDTO file); |
| | | Integer saveFile(String workspaceId, FileUploadDTO file) throws ImageProcessingException, IOException; |
| | | |
| | | /** |
| | | * 存储水印图片 |
| | |
| | | import com.dji.sample.media.model.MediaJobDTO; |
| | | import com.dji.sample.media.model.param.SearchMediaParam; |
| | | import com.dji.sample.wayline.model.dto.WaylineJobDTO; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.awt.*; |
| | |
| | | * @param file |
| | | * @return |
| | | */ |
| | | Integer saveMediaFile(String workspaceId, FileUploadDTO file); |
| | | Integer saveMediaFile(String workspaceId, FileUploadDTO file) throws ImageProcessingException, IOException; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveFile(String workspaceId, FileUploadDTO file) { |
| | | public Integer saveFile(String workspaceId, FileUploadDTO file) throws ImageProcessingException, IOException { |
| | | MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file); |
| | | fileEntity.setWorkspaceId(workspaceId); |
| | | fileEntity.setFileId(UUID.randomUUID().toString()); |
| | | Integer count= mapper.insert(fileEntity); |
| | | try { |
| | | boolean contains = file.getName().contains("~"); |
| | | if (contains) { |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return mapper.insert(fileEntity); |
| | | return count; |
| | | } |
| | | |
| | | public void saveMarkFile(String workspaceId, FileUploadDTO file) throws IOException, FontFormatException, ImageProcessingException { |
| | |
| | | |
| | | @Override |
| | | public Object mediaInfo(String filename) { |
| | | String name = "mark" + filename; |
| | | String name = "mark"+filename; |
| | | MediaFileMarkEntity entity = markMapper.selectOne(new LambdaQueryWrapper<MediaFileMarkEntity>() |
| | | .eq(MediaFileMarkEntity::getFileName, name)); |
| | | return entity.getDronedata(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateMarkMediaFileNames(String jobId) { |
| | | try { |
| | |
| | | import com.dji.sample.media.service.IMediaService; |
| | | import com.dji.sample.wayline.model.dto.WaylineJobDTO; |
| | | import com.dji.sample.wayline.service.IWaylineJobService; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveMediaFile(String workspaceId, FileUploadDTO file) { |
| | | public Integer saveMediaFile(String workspaceId, FileUploadDTO file) throws ImageProcessingException, IOException { |
| | | return fileService.saveFile(workspaceId, file); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ServiceActivator(inputChannel = ChannelName.INBOUND_EVENTS_FILE_UPLOAD_CALLBACK, outputChannel = ChannelName.OUTBOUND_EVENTS) |
| | | public CommonTopicReceiver handleFileUploadCallBack(CommonTopicReceiver receiver) throws IOException, FontFormatException { |
| | | public CommonTopicReceiver handleFileUploadCallBack(CommonTopicReceiver receiver) throws IOException, FontFormatException, ImageProcessingException { |
| | | FileUploadCallback callback = objectMapper.convertValue(receiver.getData(), FileUploadCallback.class); |
| | | if (callback.getResult() != ResponseResult.CODE_SUCCESS) { |
| | | log.error("媒体文件上传失败;Media file upload failed!"); |
| | |
| | | BizCodeEnum.FILE_UPLOAD_CALLBACK.getCode(), mediaFileCount); |
| | | } |
| | | |
| | | private Boolean parseMediaFile(FileUploadCallback callback, WaylineJobDTO job) throws IOException, FontFormatException { |
| | | private Boolean parseMediaFile(FileUploadCallback callback, WaylineJobDTO job) throws IOException, FontFormatException, ImageProcessingException { |
| | | // Set the drone sn that shoots the media |
| | | Optional<DeviceDTO> dockDTO = deviceService.getDeviceBySn(job.getDockSn()); |
| | | dockDTO.ifPresent(dock -> callback.getFile().getExt().setSn(dock.getChildDeviceSn())); |
| | |
| | | @RequestParam(name = "xmc", required = false) String xmc, |
| | | @RequestParam(name = "investigate", required = false) Integer investigate |
| | | ) { |
| | | fileService.getNoaddFile(); |
| | | //调用service分页查询 |
| | | PatchesParam param = PatchesParam.builder() |
| | | .page(page) |
| | |
| | | @RequestParam String dkbh) { |
| | | |
| | | try { |
| | | fileService.getNoaddFile(); |
| | | PatchesParam param = PatchesParam.builder() |
| | | .page(page) |
| | | .workspaceId(workspaceId) |
| | |
| | | // } |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void mytask4() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(1); |
| | | Long time = getCurrentTimestampPlus8Hours(8); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | |
| | | List<Long> lists1 = new ArrayList<>(); |
| | | lists1.add(time); |
| | | String times = convertTimestampToFormattedString(time); |
| | | sendPostWithParameters("别墅巡查二段", "561ecb37-d673-40f8-a859-05dbfc7d9976", times, lists1, listOfLists); |
| | | sendPostWithParameters("别墅巡查二段", "a07229af-471a-4058-9da6-5a2b84308b9e", times, lists1, listOfLists); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 40 1 * * ?") |
| | |
| | | sendPostWithParameters("九洲巡河二段", "58cd4261-02d7-4c4e-b876-25a4a2630c18", times, lists1, listOfLists); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 30 2 * * ?") |
| | | public void mytask8() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(12); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | | listOfLists.add(sublist); |
| | | List<Long> lists1 = new ArrayList<>(); |
| | | lists1.add(time); |
| | | String times = convertTimestampToFormattedString(time); |
| | | sendPostWithParameters("定时任务2:30", "c3a7b125-bc0b-49d4-96ed-80743200ab80", times, lists1, listOfLists); |
| | | } |
| | | @Scheduled(cron = "0 30 2 * * ?") |
| | | public void mytask9() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(14); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | | listOfLists.add(sublist); |
| | | List<Long> lists1 = new ArrayList<>(); |
| | | lists1.add(time); |
| | | String times = convertTimestampToFormattedString(time); |
| | | sendPostWithParameters("定时任务4:30", "c3a7b125-bc0b-49d4-96ed-80743200ab80", times, lists1, listOfLists); |
| | | } |
| | | /** |
| | | * 完成对未推送的图斑数据进行整合发送 |
| | | * |