Ver Fonte

Merge remote-tracking branch 'origin/20240522-saq-fix' into 20240522-saq-fix

LingxinMeng há 1 ano atrás
pai
commit
5931ab07a7

+ 18 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/SimulationProjectServiceImpl.java

@@ -149,6 +149,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     @Resource
     private SceneAccidentMapper sceneAccidentMapper;
 
+    @Resource
+    private SimulationProjectService simulationProjectService;
+
     // * -------------------------------- Comment --------------------------------
 
     private final String[] dateFmtArr = new String[]{"yyyyMMdd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd"};
@@ -5425,6 +5428,21 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 }
                 in.close();
             }
+            ResponseBodyVO<ProjectReportForReferenceVO> projectReportForReferenceVOResponseBodyVO = simulationProjectService.getProjectReportForAllReferenceScene(param);
+            if (projectReportForReferenceVOResponseBodyVO != null) {
+                String path = "场景评价报告.json";
+                FileWriter writer = new FileWriter(path);
+                String json = JsonUtil.beanToJson(projectReportForReferenceVOResponseBodyVO);
+                writer.write(json);
+                writer.close();
+                ZipEntry entry = new ZipEntry(path);
+                zos.putNextEntry(entry);
+                BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(path)));
+                while ((len = in.read(buffer)) != -1) {
+                    zos.write(buffer, 0, len);
+                }
+                in.close();
+            }
             zos.close();
         } catch (Exception ex) {
             log.error("下载失败", ex);