xyc
2024-08-06 a8230f1ab02069431738bd72f36ab95a0ace01ae
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);