浏览代码

Merge remote-tracking branch 'origin/master' into rmd-dev

Rmengdi 1 年之前
父节点
当前提交
066a92a866

+ 1 - 1
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/LogController.java

@@ -30,7 +30,7 @@ public class LogController {
 
     @Autowired
     private RedisCache redisCache;
-    @Log(title = "算法", businessType = BusinessType.UPDATE)
+
     @GetMapping(value = "/info/{taskId}")
     public AjaxResult getLogInfo(@PathVariable("taskId") String taskId) throws IOException {
         return success("成功", redisLogService.getLogInfo(taskId));

+ 0 - 1
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmServiceImpl.java

@@ -226,7 +226,6 @@ public class AlgorithmServiceImpl implements IAlgorithmService
         requestDto.setResultList(resultAddress);
         redisLogService.info(key , "分析算法程序开始.....");
         runAlgorithmService.runAlgorithm(id, (String)list.get(0).get("url"), requestDto);
-        redisLogService.info(key , "执行算法完成.....");
         redisLogService.info(key , "保存结果数据.....");
         Date completedTime = DateUtils.getNowDate();
         algorithmMapper.updateCompletedTimeById(id, completedTime);

+ 8 - 1
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunPythonImpl.java

@@ -6,6 +6,7 @@ import com.pdaaphm.biz.domain.SubAlgorithm;
 import com.pdaaphm.biz.dto.RequestDTO;
 import com.pdaaphm.biz.mapper.FileMapper;
 import com.pdaaphm.biz.mapper.SubAlgorithmMapper;
+import com.pdaaphm.biz.service.IRedisLogService;
 import com.pdaaphm.biz.service.RunAlgorithmService;
 import com.pdaaphm.common.config.PadaphmConfig;
 import com.pdaaphm.common.utils.DateUtils;
@@ -38,6 +39,9 @@ public class RunPythonImpl implements RunAlgorithmService {
     @Autowired
     private SubAlgorithmMapper subAlgorithmMapper;
 
+    @Autowired
+    private IRedisLogService redisLogService;
+
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
     @Override
@@ -49,6 +53,7 @@ public class RunPythonImpl implements RunAlgorithmService {
         httpRequestFactory.setConnectTimeout(3000);
         httpRequestFactory.setReadTimeout(3000);
         WebClient webClient = WebClient.create(url);
+        redisLogService.info("TASK-"+ id, "分析算法程序......");
         // send post
         Mono<BaseResponse> result = webClient.post()  // 使用POST方法
                 .uri("/request")  // 指定URI
@@ -68,7 +73,8 @@ public class RunPythonImpl implements RunAlgorithmService {
                 });  // 将响应体转换为String
         // get response
         BaseResponse res = result.block();
-
+        redisLogService.info("TASK-"+ id, "分析算法文件完成......");
+        redisLogService.info("TASK-"+ id, "执行算法......");
         // save result path to subAlgorithm
         List<String> resultList = requestDto.getResultList();
         List<Map> subAlgorithmOutputList = subAlgorithmMapper.selectSubAlgorithmOutputList(id);
@@ -109,6 +115,7 @@ public class RunPythonImpl implements RunAlgorithmService {
                 // update algorithm
             }
         }
+        redisLogService.info("TASK-"+ id, "执行算法完成......");
         return res;
     }
 

+ 4 - 4
pdaaphm-admin/src/main/resources/application-druid.yml

@@ -13,9 +13,9 @@ spring:
             slave:
                 # 从数据源开关/默认关闭
                 enabled: false
-                url: 
-                username: 
-                password: 
+                url:
+                username:
+                password:
             # 初始连接数
             initialSize: 5
             # 最小连接池数量
@@ -39,7 +39,7 @@ spring:
             testWhileIdle: true
             testOnBorrow: false
             testOnReturn: false
-            webStatFilter: 
+            webStatFilter:
                 enabled: true
             statViewServlet:
                 enabled: true

+ 1 - 1
pdaaphm-admin/src/main/resources/application.yml

@@ -1,7 +1,7 @@
 # 项目相关配置
 ruoyi:
   # 名称
-  name: RuoYi
+  name: Pdaaphm
   # 版本
   version: 3.8.6
   # 版权年份

+ 6 - 4
pdaaphm-ui/src/views/algoManager/algorithm/algoRun.vue

@@ -76,19 +76,21 @@ export default {
       this.show = true
       const taskId = `TASK-${id}`
       runAlgorithms(id).then(res => {
-        this.timer = setInterval(this.getLogInfo, 1000, taskId)
+        this.timer = setInterval(this.getLogInfo, 3000, taskId)
       })
     },
     getLogInfo(taskId) {
       getLog(taskId).then(response => {
-        let logData = response.data || `<p style='color: #58e072'> INFO: [2023-10-23 15:00:14] -> 算法执行中...... </p>`
+        let logData = response.data
         console.log('response.data', logData);
         if (logData && logData.includes('任务执行完成')) {
           console.log("定时器销毁");
           clearInterval(this.timer)
           this.isOK=false
         }
-        this.message = this.message + logData
+        if (logData) {
+          this.message = this.message + logData
+        }
       })
     },
     // 跳转查看结果列表
@@ -157,4 +159,4 @@ export default {
     padding: 15px;
   }
 }
-</style>
+</style>

+ 0 - 1
pdaaphm-ui/src/views/algoManager/algorithm/index.vue

@@ -441,7 +441,6 @@ export default {
         // this.fileContent = response.data;
       } catch (error) {
         console.error('Error fetching the file:', error)
-        alert('无法加载文件内容')
       }
     },
 

+ 2 - 3
pdaaphm-ui/src/views/algoManager/algorithm2/index.vue

@@ -155,7 +155,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -476,7 +476,7 @@ export default {
         },
       })
     },
-    
+
     createTypeMap() {
       this.typeMap = new Map();
       for (const algorithmSub of this.algorithmSubList) {
@@ -539,7 +539,6 @@ export default {
         // this.fileContent = response.data;
       } catch (error) {
         console.error("Error fetching the file:", error);
-        alert('无法加载文件内容');
       }
     },
 

+ 2 - 3
pdaaphm-ui/src/views/algoManager/algorithm3/index.vue

@@ -179,7 +179,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -501,7 +501,7 @@ export default {
         },
       })
     },
-    
+
     createTypeMap() {
       this.typeMap = new Map();
       for (const algorithmSub of this.algorithmSubList) {
@@ -564,7 +564,6 @@ export default {
         // this.fileContent = response.data;
       } catch (error) {
         console.error("Error fetching the file:", error);
-        alert('无法加载文件内容');
       }
     },
 

+ 1 - 2
pdaaphm-ui/src/views/algoManager/result.vue

@@ -143,7 +143,6 @@ export default {
         }
       } catch (error) {
         console.error('Error fetching the file:', error)
-        alert('无法加载文件内容')
       }
     },
 
@@ -184,4 +183,4 @@ export default {
 .img {
   width: 100%;
 }
-</style>
+</style>