Pārlūkot izejas kodu

:construction_worker: 打包调整

lag 7 mēneši atpakaļ
vecāks
revīzija
9f547ec7a7

+ 1 - 1
download-center-server/pom.xml

@@ -104,7 +104,7 @@
 
 
   <build>
-    <finalName>downloadPictures</finalName>
+    <finalName>bayonetOffsiteCase</finalName>
     <plugins>
       <plugin>
         <artifactId>maven-war-plugin</artifactId>

+ 13 - 12
download-center-server/src/main/java/com/shanghaichengdi/downloadcenterserver/controller/BayonetOffsiteCaseController.java

@@ -26,18 +26,19 @@ public class BayonetOffsiteCaseController {
   @PostMapping("/complements")
   public void execute(@RequestBody Map<String, Object> req) {
     try {
-      LocalDate startDate = LocalDate.of(2024, 8, 1); // 指定开始日期
-      LocalDate currentDate = LocalDate.now(); // 当前日期
-      List<String> dateStrings = new ArrayList<>();
-      DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-      while (!startDate.isAfter(currentDate)) {
-        dateStrings.add(startDate.format(formatter));
-        startDate = startDate.plusDays(1);
-      }
-      for (String dateString : dateStrings) {
-        videoAnalysisService.complements(dateString);
-        Thread.sleep(1000);
-      }
+//      LocalDate startDate = LocalDate.of(2024, 8, 1); // 指定开始日期
+//      LocalDate currentDate = LocalDate.now(); // 当前日期
+//      List<String> dateStrings = new ArrayList<>();
+//      DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+//      while (!startDate.isAfter(currentDate)) {
+//        dateStrings.add(startDate.format(formatter));
+//        startDate = startDate.plusDays(1);
+//      }
+//      for (String dateString : dateStrings) {
+//        videoAnalysisService.complements(dateString);
+//        Thread.sleep(1000);
+//      }
+      videoAnalysisService.complements((String) req.get("time"));
     } catch (Exception e) {
       log.error("补数过程中出错,原因:{}", e.getMessage());
       PrintLogUtils.printErrorLogInfo(e);

+ 6 - 4
download-center-server/src/main/java/com/shanghaichengdi/downloadcenterserver/service/impl/VideoAnalysisServiceImpl.java

@@ -6,6 +6,7 @@ import com.shanghaichengdi.downloadcenterserver.domain.VideoAnalysis;
 import com.shanghaichengdi.downloadcenterserver.mapper.VideoAnalysisMapper;
 import com.shanghaichengdi.downloadcenterserver.service.VideoAnalysisService;
 import com.shanghaichengdi.downloadcenterserver.util.HTTPUtil;
+import com.shanghaigeography.Util.DateUtils;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -31,7 +32,7 @@ public class VideoAnalysisServiceImpl extends ServiceImpl<VideoAnalysisMapper, V
 
   @Override
   public void complements(String time) {
-    log.info("开始生成:{} 这一天的数据",time);
+    log.info("开始生成:{} 这一天的数据", time);
     List<VideoAnalysis> videoAnalyseList = mapper.selectData(time);
     for (VideoAnalysis videoAnalysis : videoAnalyseList) {
       if (!"8".equals(videoAnalysis.getBayonetId())) {
@@ -39,15 +40,16 @@ public class VideoAnalysisServiceImpl extends ServiceImpl<VideoAnalysisMapper, V
             .collect(Collectors.toList());
         Map<String, Object> params = new HashMap<>(2);
         params.put("imageUrls", (List<String>) imageList);
-        params.put("passTime", videoAnalysis.getTime());
+        params.put("passTime", DateUtils.dateToString(videoAnalysis.getTime(),DateUtils.DATE_FORMAT_19));
         params.put("id", videoAnalysis.getEventcode());
         params.put("bayonetId", videoAnalysis.getBayonetId());
         HTTPUtil.httpClientPost(
-            "http://10.121.41.4:8090/download/pictures", JSONObject.toJSON(params).toString(),
+            "http://10.121.41.4:8090/download/pictures/history",
+            JSONObject.toJSON(params).toString(),
             "UTF-8");
       }
     }
-    log.info("{} 的数据生成结束",time);
+    log.info("{} 的数据生成结束", time);
   }
 }