From 8b6dccc8ff919ca8970c4981b2e8cb30892e6698 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 06 八月 2024 16:08:52 +0800
Subject: [PATCH] 修改
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java | 14 ++++++++++----
1 files changed, 10 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..475202b 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;
@@ -121,6 +120,7 @@
@PostMapping("getResultXML")
public Result<SimulaDataDto> getResultXML(@RequestBody SimulatAssess simulatAssess) {
+ simulatAssessService.deleteSimInfoInRedis(simulatAssess.getId());
if (simulatAssess.getDataType().equals("fz")) {
Integer num = simulatAssessService.getNumById(simulatAssess.getProductId(), simulatAssess.getTaskModelId());
simulatAssess.setName("浠跨湡璁板綍" + (num + 1));
@@ -128,12 +128,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 +240,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