Эх сурвалжийг харах

解决将算法模块拆分后的分页查询bug

twzydn20000928 1 жил өмнө
parent
commit
86b44d7ab1

+ 11 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmController.java

@@ -2,9 +2,13 @@ package com.pdaaphm.biz.controller;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 
 import com.pdaaphm.biz.dto.AlgorithmDTO;
+import com.pdaaphm.common.core.domain.entity.SysDictData;
+import com.pdaaphm.common.utils.StringUtils;
+import com.pdaaphm.system.service.ISysDictTypeService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -37,6 +41,9 @@ public class AlgorithmController extends BaseController
     @Autowired
     private IAlgorithmService algorithmService;
 
+    @Autowired
+    private ISysDictTypeService sysDictTypeService;
+
     /**
      * 查询算法列表
      */
@@ -45,6 +52,10 @@ public class AlgorithmController extends BaseController
     public TableDataInfo list(Algorithm algorithm)
     {
         startPage();
+        if (StringUtils.isNotEmpty(algorithm.getDictType())){
+            List<SysDictData> sysDictDataList = sysDictTypeService.selectDictDataByType(algorithm.getDictType());
+            algorithm.setTypes(sysDictDataList.stream().map(SysDictData::getDictValue).collect(Collectors.toList()));
+        }
         List<Algorithm> list = algorithmService.selectAlgorithmList(algorithm);
         return getDataTable(list);
     }

+ 9 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/Algorithm.java

@@ -1,6 +1,8 @@
 package com.pdaaphm.biz.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import com.pdaaphm.common.annotation.Excel;
@@ -60,4 +62,11 @@ public class Algorithm extends BaseEntity
     /** 算法子类型名称 */
     @Excel(name = "算法子类型名称")
     private String algoSubName;
+
+    /**
+     * 字典类型
+     */
+    private String dictType;
+
+    private List<String> types;
 }

+ 6 - 0
pdaaphm-admin/src/main/resources/mapper/algoManager/AlgorithmMapper.xml

@@ -37,6 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startTime != null "> and start_time = #{startTime}</if>
             <if test="completedTime != null "> and completed_time = #{completedTime}</if>
             <if test="costSecond != null "> and cost_second = #{costSecond}</if>
+            <if test="types != null and types.size > 0">
+                AND algo.type in
+                <foreach collection="types" item="type" open="(" separator="," close=")">
+                    #{type}
+                </foreach>
+            </if>
         </where>
     </select>
 

+ 2 - 9
pdaaphm-ui/src/views/algoManager/algorithm/index.vue

@@ -122,7 +122,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList()"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="processList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="algorithmList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="算法类型" align="center" prop="type">
@@ -300,8 +300,6 @@ export default {
       total: 0,
       // 算法表格数据
       algorithmList: [],
-      // 数据处理模块算法
-      processList: [],
       // 算法子类列表
       algorithmSubList: [],
       // 算法特定类列表
@@ -322,6 +320,7 @@ export default {
         subTypeId: null,
 
         name: null,
+        dictType: "process_type",
         startTime: null,
         completedTime: null,
         costSecond: null,
@@ -354,12 +353,6 @@ export default {
       this.loading = true;
       listAlgorithm(this.queryParams).then(response => {
         this.algorithmList = response.rows;
-        this.processList = [];
-        for(const algorithm of this.algorithmList) {
-          if(algorithm.type == 3 || algorithm.type == 5 || algorithm.type == 6) {
-            this.processList.push(algorithm);
-          }
-        }
         this.total = response.total;
         this.loading = false;
       });

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

@@ -122,7 +122,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList()"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="extractList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="algorithmList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="算法类型" align="center" prop="type">
@@ -321,6 +321,7 @@ export default {
         subTypeId: null,
 
         name: null,
+        dictType: "extract_type",
         startTime: null,
         completedTime: null,
         costSecond: null,
@@ -353,12 +354,6 @@ export default {
       this.loading = true;
       listAlgorithm(this.queryParams).then(response => {
         this.algorithmList = response.rows;
-        this.extractList = [];
-        for(const algorithm of this.algorithmList) {
-          if(algorithm.type == 2) {
-            this.extractList.push(algorithm);
-          }
-        }
         this.total = response.total;
         this.loading = false;
       });

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

@@ -122,7 +122,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList()"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="predictList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="algorithmList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="算法类型" align="center" prop="type">
@@ -321,6 +321,7 @@ export default {
         subTypeId: null,
 
         name: null,
+        dictType: "predict_type",
         startTime: null,
         completedTime: null,
         costSecond: null,
@@ -353,12 +354,6 @@ export default {
       this.loading = true;
       listAlgorithm(this.queryParams).then(response => {
         this.algorithmList = response.rows;
-        this.predictList = [];
-        for(const algorithm of this.algorithmList) {
-          if(algorithm.type == 1 || algorithm.type == 4) {
-            this.predictList.push(algorithm);
-          }
-        }
         this.total = response.total;
         this.loading = false;
       });