| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ByteArrayResource; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private PatchesConfigPojo patchesConfigPojo; |
| | | @Autowired |
| | | public IWaylineFileService waylineFileService; |
| | | @Autowired |
| | | private IFileMapper fileMapper; |
| | | |
| | | @Autowired |
| | | private ITbFJService tbFJService; |
| | | @Autowired |
| | |
| | | String times = convertTimestampToFormattedString(time); |
| | | sendPostWithParameters(waylineName, waylineFile.getWaylineId(), times, lists1, listOfLists); |
| | | updatePatchesStatu(list); |
| | | time = addOneHourToTimestamp(time,1,30); |
| | | time = addOneHourToTimestamp(time, 1, 0); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(cron = "0 1 0 * * ?") |
| | | public void myTask2() { |
| | | ExecutorService executor = Executors.newSingleThreadExecutor(); |
| | | executor.execute(() -> { |
| | |
| | | // waylineJobService.publishOneFlightTask(waylineJobDTO.get()); |
| | | // } |
| | | // } |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void mytask4() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(9); |
| | | Long time = getCurrentTimestampPlus8Hours(8); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | |
| | | sendPostWithParameters("别墅巡查一段", "a07229af-471a-4058-9da6-5a2b84308b9e", times, lists1, listOfLists); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(cron = "0 50 0 * * ?") |
| | | public void mytask5() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(10); |
| | | Long time = getCurrentTimestampPlus8Hours(9); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | |
| | | sendPostWithParameters("别墅巡查二段", "561ecb37-d673-40f8-a859-05dbfc7d9976", times, lists1, listOfLists); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(cron = "0 40 1 * * ?") |
| | | public void mytask6() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(11); |
| | | Long time = getCurrentTimestampPlus8Hours(9); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | |
| | | sendPostWithParameters("九洲巡河一段", "9f471686-a73a-4e90-8f37-92eed8ed5929", times, lists1, listOfLists); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(cron = "0 40 2 * * ?") |
| | | public void mytask7() throws IOException { |
| | | Long time = getCurrentTimestampPlus8Hours(13); |
| | | Long time = getCurrentTimestampPlus8Hours(9); |
| | | List<List<Long>> listOfLists = new ArrayList<>(); |
| | | List<Long> sublist = new ArrayList<>(); |
| | | sublist.add(time); // 添加整数值 |
| | |
| | | |
| | | // 发送请求 |
| | | ResponseEntity<String> response = restTemplate.exchange( |
| | | "https://jxlandcloud.org.cn/landCloudWork/artifact/media/upload.action", |
| | | "http://39.98.49.177:8083/landCloudWork/artifact/media/upload.action", |
| | | // "http://localhost:6789/territory/tbdkjbxx/upload", |
| | | HttpMethod.POST, |
| | | requestEntity, |
| | |
| | | return timestamp / 1000; |
| | | } |
| | | |
| | | public static Long addOneHourToTimestamp(Long timestampInSeconds,long hours,long min) { |
| | | public static Long addOneHourToTimestamp(Long timestampInSeconds, long hours, long min) { |
| | | // 将输入的秒级时间戳转换为Instant对象 |
| | | Instant instant = Instant.ofEpochSecond(timestampInSeconds); |
| | | |