Browse Source

下载报告处理

gushoubang 9 months ago
parent
commit
b598f9777d

+ 5 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/FzssController.java

@@ -108,6 +108,11 @@ public class FzssController extends BaseController {
     public void fileDownload(String fileName, HttpServletResponse response, HttpServletRequest request) {
         try {
             String path = tempWin;
+            // windows 使用 tempWin, linux 使用 tempLinux
+            if (System.getProperty("os.name").toLowerCase().contains("linux")) {
+                path = tempLinux;
+            }
+
             String realFileName = path + fileName;
             response.setCharacterEncoding("utf-8");
             response.setContentType("multipart/form-data");

+ 7 - 3
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java

@@ -51,8 +51,8 @@ public class ReportServiceImpl implements IReportService {
     @Resource
     ShpFileMapper shpFileMapper;
 
-    // @Value("${Hgxfx.tempWin}")
-    // private String tempWin;
+    @Value("${Hgxfx.tempWin}")
+    private String tempWin;
     @Value("${Hgxfx.temp}")
     private String tempLinux;
 
@@ -61,7 +61,11 @@ public class ReportServiceImpl implements IReportService {
 
     // 根据选址任务生成报告
     public FzxzReport createReport(String bsm, List<String> xzbsmList) {
-        String temp = tempLinux;
+        String temp = tempWin;
+        // windows 使用 tempWin, linux 使用 tempLinux
+        if (System.getProperty("os.name").toLowerCase().contains("linux")) {
+            temp = tempLinux;
+        }
 
         // 保存生成报告日志
         iLogService.saveLog(bsm, "智能选址", "开始生成选址报告", "info");