| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.PythonResult; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ReliaSimLibResult; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.BufferedReader; |
| | |
| | | // if (exitCode == 0) { |
| | | logger.info("启动python计算成功"); |
| | | if (line != null) { |
| | | PythonResult rtn = JSONObject.parseObject(line, PythonResult.class); |
| | | ReliaSimLibResult rtn = JSONObject.parseObject(line, ReliaSimLibResult.class); |
| | | if ("0".equals(rtn.getCode())) { |
| | | result = Result.ok(); |
| | | } else { |
| | |
| | | private void setParamToRedis(SimulatAssess simulatAssess) { |
| | | String key = simulatAssess.getId().toString() + taskType; |
| | | logger.info("redis key:" + key); |
| | | /* |
| | | String xmlfile = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + |
| | | "<des name=\"General system\">\n" + |
| | | " <tasks>\n" + |
| | |
| | | " </repair_model>\n" + |
| | | " </repair_models>\n" + |
| | | "</des>"; |
| | | */ |
| | | /* |
| | | String xmlfile = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + |
| | | "<des name=\"General system\">\n" + |
| | | " <tasks>\n" + |
| | |
| | | " </repair_model>\n" + |
| | | " </repair_models>\n" + |
| | | "</des>"; |
| | | */ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | /* |
| | | Long simulate_times = 10000L; |