From a8230f1ab02069431738bd72f36ab95a0ace01ae Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 06 八月 2024 15:22:22 +0800
Subject: [PATCH] 修改仿真后台

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
index 956940a..3a8dcbe 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
@@ -53,7 +53,6 @@
 @Api(tags = "simulat_assess")
 public class SimulatAssessController {
     private static final Logger logger = LoggerFactory.getLogger(SimulatAssessController.class);
-    private static final String taskTypeProgress = "calcprog";
 
     @Autowired
     private RedisTemplate redisTemplate;
@@ -128,12 +127,18 @@
         }
         String filePath = path + "/" + simulatAssess.getId() + "/" + "result.xml";
         String xml = null;
+        InputStream in =null;
         try {
-            InputStream in = new FileInputStream(filePath);
+            in = new FileInputStream(filePath);
             xml = IOUtils.toString(in);
-            in.close();
         } catch (IOException e) {
             e.printStackTrace();
+        }finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
         }
         xmlJSONObj = XML.toJSONObject(xml);
         simulatAssess.setShowProductId(simulatAssess.getProductId());
@@ -234,7 +239,7 @@
 
     @GetMapping("getCalcProgress")
     public Result getCalcProgress(Long taskId) {
-        String key = taskId.toString() + taskTypeProgress;
+        String key = taskId.toString() + simulatAssessService.RELIA_SIM_TASK_TYPE_PROGRESS;
         String progress = (String) redisTemplate.opsForValue().get(key);
         if (progress == null) progress = "0";
         return Result.ok(progress);

--
Gitblit v1.9.1