rain
2024-07-08 158150837c8355f5ca78326529395e56a9bccbdd
更新图斑状态变更、定时航线生成参数调整
3 files modified
50 ■■■■ changed files
src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/controller/PatchesController.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/utils/TimerUtil.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java
@@ -106,17 +106,7 @@
        MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file);
        fileEntity.setWorkspaceId(workspaceId);
        fileEntity.setFileId(UUID.randomUUID().toString());
        return mapper.insert(fileEntity);
    }
    public void saveMarkFile(String workspaceId, FileUploadDTO file) throws IOException, FontFormatException, ImageProcessingException {
        boolean endsWith = file.getObjectKey().endsWith(".mp4");
        if (endsWith) {
            MediaFileMarkEntity mediaFileMarkEntity = this.fileUploadConvertToMarkEntity(file);
            mediaFileMarkEntity.setWorkspaceId(workspaceId);
            mediaFileMarkEntity.setFileId(UUID.randomUUID().toString());
            markMapper.insert(mediaFileMarkEntity);
        } else {
        try {
            boolean contains = file.getName().contains("~");
            if (contains) {
                String name = TimerUtil.getDkbh(file.getName());
@@ -129,6 +119,20 @@
                    patchesMapper.update(null, updateWrapper);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mapper.insert(fileEntity);
    }
    public void saveMarkFile(String workspaceId, FileUploadDTO file) throws IOException, FontFormatException, ImageProcessingException {
        boolean endsWith = file.getObjectKey().endsWith(".mp4");
        if (endsWith) {
            MediaFileMarkEntity mediaFileMarkEntity = this.fileUploadConvertToMarkEntity(file);
            mediaFileMarkEntity.setWorkspaceId(workspaceId);
            mediaFileMarkEntity.setFileId(UUID.randomUUID().toString());
            markMapper.insert(mediaFileMarkEntity);
        }
            MediaFileMarkEntity mediaFileMarkEntity = this.fileUploadConvertToMarkEntity(file);
            String url = "http://139.196.74.78:9000/cloud-bucket" + file.getObjectKey();
            File file1 = TbFjServiceImpl.downloadFile(url);
@@ -151,7 +155,7 @@
            uploadFile(endpoint, accessKey, secretKey, bucketName, objectName, file2);
            markMapper.insert(mediaFileMarkEntity);
        }
    }
    @Override
src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -152,7 +152,22 @@
            return ResponseResult.success(infoMap);
        }
    @GetMapping("/useMyTask")
    public ResponseResult useMyTask() throws Exception {
        try {
//            timerUtil.myTask();
//            timerUtil.myTask2();
//            timerUtil.myTask3();
            timerUtil.mytask4();
            timerUtil.mytask5();
            timerUtil.mytask6();
            timerUtil.mytask7();
        } catch (Exception e) {
            throw new RuntimeException("db存储发送出现异常" + e);
        }
        return ResponseResult.success();
    }
    @GetMapping ("/tests")
    public ResponseResult use()  {
src/main/java/com/dji/sample/patches/utils/TimerUtil.java
@@ -144,7 +144,7 @@
//    }
    @Scheduled(cron = "0 0 1 * * ?")
    public void mytask4() throws IOException {
        Long time = getCurrentTimestampPlus8Hours(8);
        Long time = getCurrentTimestampPlus8Hours(1);
        List<List<Long>> listOfLists = new ArrayList<>();
        List<Long> sublist = new ArrayList<>();
        sublist.add(time); // 添加整数值
@@ -152,7 +152,7 @@
        List<Long> lists1 = new ArrayList<>();
        lists1.add(time);
        String times = convertTimestampToFormattedString(time);
        sendPostWithParameters("别墅巡查一段", "a07229af-471a-4058-9da6-5a2b84308b9e", times, lists1, listOfLists);
        sendPostWithParameters("别墅巡查一段", "c1b9c70e-2e58-4147-b43e-aa4f639726bb", times, lists1, listOfLists);
    }
    @Scheduled(cron = "0 50 0 * * ?")
@@ -494,7 +494,7 @@
                + "\"dock_sn\":\"4TADKCM0010016\","
                + "\"task_type\":1,"
                + "\"select_execute_time\":\"%s\","
                + "\"rth_altitude\":80,"
                + "\"rth_altitude\":100,"
                + "\"out_of_control_action\":0,"
                + "\"executeTimeContinuousArr\":[{\"index\":1,\"value\":[]}],"
                + "\"executeTimeRepeatArr\":[{\"index\":1,\"value\":\"\"}],"
@@ -502,6 +502,7 @@
                + "\"rep_fre_type\":3,"
                + "\"rep_rule_type\":1,"
                + "\"time_range\":[],"
                + "\"rth_mode\":1,"
                + "\"1conValue\":[],"
                + "\"1repValue\":\"\","
                + "\"task_days\":%s,"