Ver Fonte

保存图片修改路径

gushoubang há 11 meses atrás
pai
commit
df00c386df

+ 3 - 13
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/FzssController.java

@@ -28,10 +28,8 @@ import java.util.Map;
 public class FzssController extends BaseController {
     @Autowired
     private IFzssService fzssService;
-    @Value("${Hgxfx.tempWin}")
-    public String tempWin;
-    @Value("${Hgxfx.tempLinux}")
-    public String tempLinux;
+    @Value("${Hgxfx.temp}")
+    private String temp;
 
 
     // 报告服务
@@ -113,15 +111,7 @@ public class FzssController extends BaseController {
 
     @GetMapping("/DownloadReport")
     public void fileDownload(String filePath, HttpServletResponse response) throws IOException {
-        String path = tempWin;
-        // windows 使用 tempWin, linux 使用 tempLinux
-        System.out.println("####获取操作系统名称####");
-        System.out.println("os.name: " + System.getProperty("os.name").toLowerCase());
-        if (System.getProperty("os.name").toLowerCase().contains("linux")) {
-            path = tempLinux;
-        }
-
-        String realFileName = path + filePath;
+        String realFileName = temp + filePath;
         response.setCharacterEncoding("utf-8");
         response.setContentType("multipart/form-data");
         response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");

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

@@ -51,22 +51,14 @@ public class ReportServiceImpl implements IReportService {
     @Resource
     ShpFileMapper shpFileMapper;
 
-    @Value("${Hgxfx.tempWin}")
-    private String tempWin;
-    @Value("${Hgxfx.tempLinux}")
-    private String tempLinux;
+    @Value("${Hgxfx.temp}")
+    private String temp;
 
     @Resource
     GhdkaMapper ghdkaMapper;
 
     // 根据选址任务生成报告
     public FzxzReport createReport(String bsm, List<String> dkIds) {
-        String temp = tempWin;
-        // windows 使用 tempWin, linux 使用 tempLinux
-        if (System.getProperty("os.name").toLowerCase().contains("linux")) {
-            temp = tempLinux;
-        }
-
         // 保存生成报告日志
         iLogService.saveLog(bsm, "智能选址", "开始生成选址报告", "info");
 
@@ -85,7 +77,7 @@ public class ReportServiceImpl implements IReportService {
             }
             String reportPath = res.getXmmc() + "(选址报告)_" + timeStamp + ".docx";
             // TODO ###选址报告耗时,暂时隐藏###
-            // createReport(res, allPath + "/" + reportPath, dkIds);
+            createReport(res, allPath + "/" + reportPath, dkIds);
             // 生成返回结果
             fzxzReport.setReportfile(filePath + "/" + reportPath);
             fzxzReport.setBsm(bsm);

+ 2 - 2
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/impl/ImageServiceImpl.java

@@ -45,9 +45,9 @@ import java.util.UUID;
  */
 @Service
 public class ImageServiceImpl implements IImageService {
-    @Value("${Path.RsImage}")
+    @Value("${Path.rsImage}")
     public String rsImage;
-    @Value("${Path.RootPath}")
+    @Value("${Path.rootPath}")
     public String rootPath;
 
     @Override