1
0

5 コミット 8b8d71bf3a ... d400da4c2e

作者 SHA1 メッセージ 日付
  twzydn20000928 d400da4c2e 算法管理全部功能基本实现 2 年 前
  twzydn20000928 986790050a 算法管理 2 年 前
  twzydn20000928 80e3ed71c0 算法管理 2 年 前
  twzydn20000928 59426daf5b 算法管理 2 年 前
  twzydn20000928 5aa35efe54 算法管理 2 年 前
53 ファイル変更4842 行追加27 行削除
  1. 23 7
      pdaaphm-admin/pom.xml
  2. 139 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmController.java
  3. 113 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmIoFieldController.java
  4. 104 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmSubTypeController.java
  5. 107 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/FileController.java
  6. 104 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/SubAlgorithmController.java
  7. 54 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/Algorithm.java
  8. 43 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/AlgorithmIoField.java
  9. 98 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/AlgorithmSubType.java
  10. 56 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/BaseResponse.java
  11. 84 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/File.java
  12. 84 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/SubAlgorithm.java
  13. 60 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/AlgorithmDTO.java
  14. 11 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/RequestDTO.java
  15. 44 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/SubAlgorithmDTO.java
  16. 25 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/factory/AlgorithmFactory.java
  17. 67 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmIoFieldMapper.java
  18. 70 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmMapper.java
  19. 61 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmSubTypeMapper.java
  20. 70 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/FileMapper.java
  21. 68 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/SubAlgorithmMapper.java
  22. 66 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmIoFieldService.java
  23. 85 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmService.java
  24. 61 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmSubTypeService.java
  25. 65 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IFileService.java
  26. 61 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/ISubAlgorithmService.java
  27. 10 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/RunAlgorithmService.java
  28. 102 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmIoFieldServiceImpl.java
  29. 215 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmServiceImpl.java
  30. 96 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmSubTypeServiceImpl.java
  31. 101 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/FileServiceImpl.java
  32. 17 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunMatlabImpl.java
  33. 142 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunPythonImpl.java
  34. 96 0
      pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/SubAlgorithmServiceImpl.java
  35. 4 2
      pdaaphm-admin/src/main/resources/application.yml
  36. 121 0
      pdaaphm-admin/src/main/resources/mapper/algoManager/AlgorithmMapper.xml
  37. 102 0
      pdaaphm-admin/src/main/resources/mapper/algoManager/FileMapper.xml
  38. 104 0
      pdaaphm-admin/src/main/resources/mapper/algoManager/SubAlgorithmMapper.xml
  39. 125 0
      pdaaphm-admin/src/main/resources/mapper/conf/AlgorithmIoFieldMapper.xml
  40. 91 0
      pdaaphm-admin/src/main/resources/mapper/conf/AlgorithmSubTypeMapper.xml
  41. 19 1
      pdaaphm-common/src/main/java/com/pdaaphm/common/config/PadaphmConfig.java
  42. 29 1
      pdaaphm-common/src/main/java/com/pdaaphm/common/utils/file/FileUploadUtils.java
  43. 11 11
      pdaaphm-system/src/main/java/com/pdaaphm/system/service/impl/SysConfigServiceImpl.java
  44. 77 0
      pdaaphm-ui/src/api/algoManager/algorithm.js
  45. 52 0
      pdaaphm-ui/src/api/algoManager/file.js
  46. 52 0
      pdaaphm-ui/src/api/conf/field.js
  47. 44 0
      pdaaphm-ui/src/api/conf/subType.js
  48. 1 2
      pdaaphm-ui/src/components/FileUpload/index.vue
  49. 460 0
      pdaaphm-ui/src/views/algoManager/algorithm/index.vue
  50. 297 0
      pdaaphm-ui/src/views/algoManager/file/index.vue
  51. 344 0
      pdaaphm-ui/src/views/conf/field/index.vue
  52. 302 0
      pdaaphm-ui/src/views/conf/subType/index.vue
  53. 5 3
      sql/pdaaphm.sql

+ 23 - 7
pdaaphm-admin/pom.xml

@@ -60,6 +60,22 @@
             <groupId>com.pdaaphm</groupId>
             <artifactId>pdaaphm-generator</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- 添加Spring WebFlux Starter依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.14</version>
+        </dependency>
 
     </dependencies>
 
@@ -80,17 +96,17 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>   
-                <groupId>org.apache.maven.plugins</groupId>   
-                <artifactId>maven-war-plugin</artifactId>   
-                <version>3.1.0</version>   
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>3.1.0</version>
                 <configuration>
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <warName>${project.artifactId}</warName>
-                </configuration>   
-           </plugin>   
+                </configuration>
+           </plugin>
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>
 
-</project>
+</project>

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

@@ -0,0 +1,139 @@
+package com.pdaaphm.biz.controller;
+
+import java.io.IOException;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.pdaaphm.biz.dto.AlgorithmDTO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pdaaphm.common.annotation.Log;
+import com.pdaaphm.common.core.controller.BaseController;
+import com.pdaaphm.common.core.domain.AjaxResult;
+import com.pdaaphm.common.enums.BusinessType;
+import com.pdaaphm.biz.domain.Algorithm;
+import com.pdaaphm.biz.service.IAlgorithmService;
+import com.pdaaphm.common.utils.poi.ExcelUtil;
+import com.pdaaphm.common.core.page.TableDataInfo;
+
+/**
+ * 算法Controller
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@RestController
+@RequestMapping("/algoManager/algorithm")
+public class AlgorithmController extends BaseController
+{
+    @Autowired
+    private IAlgorithmService algorithmService;
+
+    /**
+     * 查询算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Algorithm algorithm)
+    {
+        startPage();
+        List<Algorithm> list = algorithmService.selectAlgorithmList(algorithm);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:export')")
+    @Log(title = "算法", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, Algorithm algorithm)
+    {
+        List<Algorithm> list = algorithmService.selectAlgorithmList(algorithm);
+        ExcelUtil<Algorithm> util = new ExcelUtil<Algorithm>(Algorithm.class);
+        util.exportExcel(response, list, "算法数据");
+    }
+
+    /**
+     * 获取算法详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(algorithmService.selectAlgorithmById(id));
+    }
+
+    /**
+     * 获取算法对象详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:query')")
+    @GetMapping(value = "/getAlgorithmDto/{id}")
+    public AjaxResult getAlgorithmDto(@PathVariable("id") Long id)
+    {
+        return success(algorithmService.getAlgorithmDto(id));
+    }
+
+    /**
+     * 新增算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:add')")
+    @Log(title = "算法", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Algorithm algorithm)
+    {
+        return toAjax(algorithmService.insertAlgorithm(algorithm));
+    }
+
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:add')")
+    @Log(title = "算法", businessType = BusinessType.INSERT)
+    @PostMapping("/addOrUpdateDto")
+    public AjaxResult addDto(@RequestBody AlgorithmDTO algorithm)
+    {
+        return toAjax(algorithmService.addOrUpdateDto(algorithm));
+    }
+
+
+    /**
+     * 修改算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:edit')")
+    @Log(title = "算法", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Algorithm algorithm)
+    {
+        return toAjax(algorithmService.updateAlgorithm(algorithm));
+    }
+
+    /**
+     * 删除算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:remove')")
+    @Log(title = "算法", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(algorithmService.deleteAlgorithmByIds(ids));
+    }
+
+    @GetMapping("/getOption")
+    public AjaxResult getOption() { return success(algorithmService.getOption()); }
+
+    /**
+     * 运行算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:algorithm:edit')")
+    @Log(title = "算法", businessType = BusinessType.UPDATE)
+    @GetMapping(value = "/runAlgorithms/{id}")
+    public AjaxResult runAlgorithms(@PathVariable("id") Long id) throws IOException {
+        return success(algorithmService.runAlgorithms(id));
+    }
+}

+ 113 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmIoFieldController.java

@@ -0,0 +1,113 @@
+package com.pdaaphm.biz.controller;
+
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+
+import com.pdaaphm.biz.dto.SubAlgorithmDTO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pdaaphm.common.annotation.Log;
+import com.pdaaphm.common.core.controller.BaseController;
+import com.pdaaphm.common.core.domain.AjaxResult;
+import com.pdaaphm.common.enums.BusinessType;
+import com.pdaaphm.biz.domain.AlgorithmIoField;
+import com.pdaaphm.biz.service.IAlgorithmIoFieldService;
+import com.pdaaphm.common.utils.poi.ExcelUtil;
+import com.pdaaphm.common.core.page.TableDataInfo;
+
+/**
+ * 算法输入输出字段Controller
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@RestController
+@RequestMapping("/conf/field")
+public class AlgorithmIoFieldController extends BaseController
+{
+    @Autowired
+    private IAlgorithmIoFieldService algorithmIoFieldService;
+
+    /**
+     * 查询算法输入输出字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AlgorithmIoField algorithmIoField)
+    {
+        startPage();
+        List<AlgorithmIoField> list = algorithmIoFieldService.selectAlgorithmIoFieldList(algorithmIoField);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出算法输入输出字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:export')")
+    @Log(title = "算法输入输出字段", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AlgorithmIoField algorithmIoField)
+    {
+        List<AlgorithmIoField> list = algorithmIoFieldService.selectAlgorithmIoFieldList(algorithmIoField);
+        ExcelUtil<AlgorithmIoField> util = new ExcelUtil<AlgorithmIoField>(AlgorithmIoField.class);
+        util.exportExcel(response, list, "算法输入输出字段数据");
+    }
+
+    /**
+     * 获取算法输入输出字段详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(algorithmIoFieldService.selectAlgorithmIoFieldById(id));
+    }
+
+    /**
+     * 新增算法输入输出字段
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:add')")
+    @Log(title = "算法输入输出字段", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AlgorithmIoField algorithmIoField)
+    {
+        return toAjax(algorithmIoFieldService.insertAlgorithmIoField(algorithmIoField));
+    }
+
+    /**
+     * 修改算法输入输出字段
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:edit')")
+    @Log(title = "算法输入输出字段", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AlgorithmIoField algorithmIoField)
+    {
+        return toAjax(algorithmIoFieldService.updateAlgorithmIoField(algorithmIoField));
+    }
+
+    /**
+     * 删除算法输入输出字段
+     */
+    @PreAuthorize("@ss.hasPermi('conf:field:remove')")
+    @Log(title = "算法输入输出字段", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(algorithmIoFieldService.deleteAlgorithmIoFieldByIds(ids));
+    }
+
+    @GetMapping(value = "/getIoSubList/{subTypeId}/{algoId}")
+    public AjaxResult getIoSubList(@PathVariable("subTypeId") Long subTypeId, @PathVariable("subTypeId") Long algoId) {
+        List<SubAlgorithmDTO> map = algorithmIoFieldService.getIoSubList(subTypeId, algoId);
+        return success(map);
+    }
+}

+ 104 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/AlgorithmSubTypeController.java

@@ -0,0 +1,104 @@
+package com.pdaaphm.biz.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pdaaphm.common.annotation.Log;
+import com.pdaaphm.common.core.controller.BaseController;
+import com.pdaaphm.common.core.domain.AjaxResult;
+import com.pdaaphm.common.enums.BusinessType;
+import com.pdaaphm.biz.domain.AlgorithmSubType;
+import com.pdaaphm.biz.service.IAlgorithmSubTypeService;
+import com.pdaaphm.common.utils.poi.ExcelUtil;
+import com.pdaaphm.common.core.page.TableDataInfo;
+
+/**
+ * 算法子类型Controller
+ * 
+ * @author allen
+ * @date 2023-07-26
+ */
+@RestController
+@RequestMapping("/conf/subType")
+public class AlgorithmSubTypeController extends BaseController
+{
+    @Autowired
+    private IAlgorithmSubTypeService algorithmSubTypeService;
+
+    /**
+     * 查询算法子类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AlgorithmSubType algorithmSubType)
+    {
+        startPage();
+        List<AlgorithmSubType> list = algorithmSubTypeService.selectAlgorithmSubTypeList(algorithmSubType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出算法子类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:export')")
+    @Log(title = "算法子类型", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AlgorithmSubType algorithmSubType)
+    {
+        List<AlgorithmSubType> list = algorithmSubTypeService.selectAlgorithmSubTypeList(algorithmSubType);
+        ExcelUtil<AlgorithmSubType> util = new ExcelUtil<AlgorithmSubType>(AlgorithmSubType.class);
+        util.exportExcel(response, list, "算法子类型数据");
+    }
+
+    /**
+     * 获取算法子类型详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(algorithmSubTypeService.selectAlgorithmSubTypeById(id));
+    }
+
+    /**
+     * 新增算法子类型
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:add')")
+    @Log(title = "算法子类型", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AlgorithmSubType algorithmSubType)
+    {
+        return toAjax(algorithmSubTypeService.insertAlgorithmSubType(algorithmSubType));
+    }
+
+    /**
+     * 修改算法子类型
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:edit')")
+    @Log(title = "算法子类型", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AlgorithmSubType algorithmSubType)
+    {
+        return toAjax(algorithmSubTypeService.updateAlgorithmSubType(algorithmSubType));
+    }
+
+    /**
+     * 删除算法子类型
+     */
+    @PreAuthorize("@ss.hasPermi('conf:subType:remove')")
+    @Log(title = "算法子类型", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(algorithmSubTypeService.deleteAlgorithmSubTypeByIds(ids));
+    }
+}

+ 107 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/FileController.java

@@ -0,0 +1,107 @@
+package com.pdaaphm.biz.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pdaaphm.common.annotation.Log;
+import com.pdaaphm.common.core.controller.BaseController;
+import com.pdaaphm.common.core.domain.AjaxResult;
+import com.pdaaphm.common.enums.BusinessType;
+import com.pdaaphm.biz.domain.File;
+import com.pdaaphm.biz.service.IFileService;
+import com.pdaaphm.common.utils.poi.ExcelUtil;
+import com.pdaaphm.common.core.page.TableDataInfo;
+
+/**
+ * 文件Controller
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@RestController
+@RequestMapping("/algoManager/file")
+public class FileController extends BaseController
+{
+    @Autowired
+    private IFileService fileService;
+
+    /**
+     * 查询文件列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(File file)
+    {
+        startPage();
+        List<File> list = fileService.selectFileList(file);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出文件列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:export')")
+    @Log(title = "文件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, File file)
+    {
+        List<File> list = fileService.selectFileList(file);
+        ExcelUtil<File> util = new ExcelUtil<File>(File.class);
+        util.exportExcel(response, list, "文件数据");
+    }
+
+    /**
+     * 获取文件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(fileService.selectFileById(id));
+    }
+
+    /**
+     * 新增文件
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:add')")
+    @Log(title = "文件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody File file)
+    {
+        return toAjax(fileService.insertFile(file));
+    }
+
+    /**
+     * 修改文件
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:edit')")
+    @Log(title = "文件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody File file)
+    {
+        return toAjax(fileService.updateFile(file));
+    }
+
+    /**
+     * 删除文件
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:file:remove')")
+    @Log(title = "文件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fileService.deleteFileByIds(ids));
+    }
+
+    @GetMapping("/getOption")
+    public AjaxResult getOption() { return success(fileService.getOption()); }
+}

+ 104 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/controller/SubAlgorithmController.java

@@ -0,0 +1,104 @@
+package com.pdaaphm.biz.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pdaaphm.common.annotation.Log;
+import com.pdaaphm.common.core.controller.BaseController;
+import com.pdaaphm.common.core.domain.AjaxResult;
+import com.pdaaphm.common.enums.BusinessType;
+import com.pdaaphm.biz.domain.SubAlgorithm;
+import com.pdaaphm.biz.service.ISubAlgorithmService;
+import com.pdaaphm.common.utils.poi.ExcelUtil;
+import com.pdaaphm.common.core.page.TableDataInfo;
+
+/**
+ * 子算法Controller
+ * 
+ * @author xlk
+ * @date 2023-07-26
+ */
+@RestController
+@RequestMapping("/algoManager/subAlgorithm")
+public class SubAlgorithmController extends BaseController
+{
+    @Autowired
+    private ISubAlgorithmService subAlgorithmService;
+
+    /**
+     * 查询子算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SubAlgorithm subAlgorithm)
+    {
+        startPage();
+        List<SubAlgorithm> list = subAlgorithmService.selectSubAlgorithmList(subAlgorithm);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出子算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:export')")
+    @Log(title = "子算法", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SubAlgorithm subAlgorithm)
+    {
+        List<SubAlgorithm> list = subAlgorithmService.selectSubAlgorithmList(subAlgorithm);
+        ExcelUtil<SubAlgorithm> util = new ExcelUtil<SubAlgorithm>(SubAlgorithm.class);
+        util.exportExcel(response, list, "子算法数据");
+    }
+
+    /**
+     * 获取子算法详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(subAlgorithmService.selectSubAlgorithmById(id));
+    }
+
+    /**
+     * 新增子算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:add')")
+    @Log(title = "子算法", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SubAlgorithm subAlgorithm)
+    {
+        return toAjax(subAlgorithmService.insertSubAlgorithm(subAlgorithm));
+    }
+
+    /**
+     * 修改子算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:edit')")
+    @Log(title = "子算法", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SubAlgorithm subAlgorithm)
+    {
+        return toAjax(subAlgorithmService.updateSubAlgorithm(subAlgorithm));
+    }
+
+    /**
+     * 删除子算法
+     */
+    @PreAuthorize("@ss.hasPermi('algoManager:subAlgorithm:remove')")
+    @Log(title = "子算法", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(subAlgorithmService.deleteSubAlgorithmByIds(ids));
+    }
+}

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

@@ -0,0 +1,54 @@
+package com.pdaaphm.biz.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.pdaaphm.common.annotation.Excel;
+import com.pdaaphm.common.core.domain.BaseEntity;
+
+/**
+ * 算法对象 t_algorithm
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Data
+public class Algorithm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 算法类型 */
+    @Excel(name = "算法类型")
+    private String type;
+
+    /** 子类型id */
+    @Excel(name = "子类型id")
+    private Long subTypeId;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date completedTime;
+
+    /** 耗时(s) */
+    @Excel(name = "耗时(s)")
+    private Long costSecond;
+
+    /** 算法子类型名称 */
+    @Excel(name = "算法子类型名称")
+    private String algoSubName;
+}

+ 43 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/AlgorithmIoField.java

@@ -0,0 +1,43 @@
+package com.pdaaphm.biz.domain;
+
+import com.pdaaphm.common.annotation.DataSource;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.pdaaphm.common.annotation.Excel;
+import com.pdaaphm.common.core.domain.BaseEntity;
+
+/**
+ * 算法输入输出字段对象 t_algorithm_io_field
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Data
+public class AlgorithmIoField extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 算法子类型编号 */
+    @Excel(name = "算法子类型编号")
+    private Long algorithmSubId;
+
+    /** 输入/输出 */
+    @Excel(name = "输入/输出")
+    private String type;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Integer index;
+
+    /** 算法子类型名称 */
+    @Excel(name = "算法子类型名称")
+    private String algoSubName;
+}

+ 98 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/AlgorithmSubType.java

@@ -0,0 +1,98 @@
+package com.pdaaphm.biz.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.pdaaphm.common.annotation.Excel;
+import com.pdaaphm.common.core.domain.BaseEntity;
+
+/**
+ * 算法子类型对象 t_algorithm_sub_type
+ *
+ * @author allen
+ * @date 2023-07-26
+ */
+public class AlgorithmSubType extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String type;
+
+    /** 算法子名称 */
+    @Excel(name = "算法子名称")
+    private String name;
+
+    /** 算法url */
+    @Excel(name = "算法url")
+    private String url;
+
+    /** 运行类型 */
+    @Excel(name = "运行类型")
+    private String runType;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+    public void setUrl(String url)
+    {
+        this.url = url;
+    }
+
+    public String getUrl()
+    {
+        return url;
+    }
+    public void setRunType(String runType)
+    {
+        this.runType = runType;
+    }
+
+    public String getRunType()
+    {
+        return runType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("type", getType())
+            .append("name", getName())
+            .append("url", getUrl())
+            .append("runType", getRunType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 56 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/BaseResponse.java

@@ -0,0 +1,56 @@
+package com.pdaaphm.biz.domain;
+
+import java.io.Serializable;
+
+/**
+ * 响应基础类
+ *
+ * @author xlk
+ */
+public class BaseResponse implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+    private Integer code;
+    private String msg;
+    private Object data;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    @Override
+    public String toString() {
+        return "BaseResponse{" +
+                "code=" + code +
+                ", msg='" + msg + '\'' +
+                ", data=" + data +
+                '}';
+    }
+
+    public static BaseResponse error(String msg) {
+        BaseResponse baseResponse = new BaseResponse();
+        baseResponse.setCode(500);
+        baseResponse.setMsg(msg);
+        return baseResponse;
+    }
+}

+ 84 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/File.java

@@ -0,0 +1,84 @@
+package com.pdaaphm.biz.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.pdaaphm.common.annotation.Excel;
+import com.pdaaphm.common.core.domain.BaseEntity;
+
+/**
+ * 文件对象 t_file
+ * 
+ * @author xlk
+ * @date 2023-07-26
+ */
+public class File extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 文档名称 */
+    @Excel(name = "文档名称")
+    private String name;
+
+    /** 文档路径 */
+    @Excel(name = "文档路径")
+    private String path;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String type;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setPath(String path) 
+    {
+        this.path = path;
+    }
+
+    public String getPath() 
+    {
+        return path;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("path", getPath())
+            .append("type", getType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 84 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/domain/SubAlgorithm.java

@@ -0,0 +1,84 @@
+package com.pdaaphm.biz.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.pdaaphm.common.annotation.Excel;
+import com.pdaaphm.common.core.domain.BaseEntity;
+
+/**
+ * 子算法对象 t_sub_algorithm
+ * 
+ * @author xlk
+ * @date 2023-07-26
+ */
+public class SubAlgorithm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 主表id */
+    @Excel(name = "主表id")
+    private Long algorithmId;
+
+    /** 字段id */
+    @Excel(name = "字段id")
+    private Long fieldId;
+
+    /** 文件id */
+    @Excel(name = "文件id")
+    private Long uploadId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setAlgorithmId(Long algorithmId) 
+    {
+        this.algorithmId = algorithmId;
+    }
+
+    public Long getAlgorithmId() 
+    {
+        return algorithmId;
+    }
+    public void setFieldId(Long fieldId) 
+    {
+        this.fieldId = fieldId;
+    }
+
+    public Long getFieldId() 
+    {
+        return fieldId;
+    }
+    public void setUploadId(Long uploadId) 
+    {
+        this.uploadId = uploadId;
+    }
+
+    public Long getUploadId() 
+    {
+        return uploadId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("algorithmId", getAlgorithmId())
+            .append("fieldId", getFieldId())
+            .append("uploadId", getUploadId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 60 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/AlgorithmDTO.java

@@ -0,0 +1,60 @@
+package com.pdaaphm.biz.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class AlgorithmDTO {
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 算法类型 */
+    private String type;
+
+    /** 子类型id */
+    private Long subTypeId;
+
+    /** 名称 */
+    private String name;
+
+    /** 开始时间 */
+    private Date startTime;
+
+    /** 完成时间 */
+    private Date completedTime;
+
+    /** 耗时(s) */
+    private Long costSecond;
+
+    /** 算法子类型名称 */
+    private String algoSubName;
+
+    /** 搜索值 */
+    @JsonIgnore
+    private String searchValue;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 备注 */
+    private String remark;
+
+    private List<SubAlgorithmDTO> ioSubList;
+}

+ 11 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/RequestDTO.java

@@ -0,0 +1,11 @@
+package com.pdaaphm.biz.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class RequestDTO {
+    private List<String> docList;
+    private List<String> resultList;
+}

+ 44 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/dto/SubAlgorithmDTO.java

@@ -0,0 +1,44 @@
+package com.pdaaphm.biz.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.pdaaphm.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class SubAlgorithmDTO {
+
+    /** 算法子表id */
+    private Long id;
+
+    /** 算法表id */
+    private Long algorithmId;
+
+    /** 字段id */
+    private Long fieldId;
+
+    /** 文件id */
+    private Long uploadId;
+
+    /** 字段名称 */
+    private String name;
+    /**
+     * 输入输出类型
+     */
+    private String type;
+
+
+    /** 创建者 */
+    private String createBy;
+    /** 创建时间 */
+    private Date createTime;
+    /** 更新者 */
+    private String updateBy;
+    /** 更新时间 */
+    private Date updateTime;
+    /** 备注 */
+    private String remark;
+
+}

+ 25 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/factory/AlgorithmFactory.java

@@ -0,0 +1,25 @@
+package com.pdaaphm.biz.factory;
+
+import com.pdaaphm.biz.service.RunAlgorithmService;
+import com.pdaaphm.biz.service.impl.RunMatlabImpl;
+import com.pdaaphm.biz.service.impl.RunPythonImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AlgorithmFactory {
+    @Autowired
+    private RunMatlabImpl runMatlabImpl;
+    @Autowired
+    private RunPythonImpl runPythonImpl;
+
+    public RunAlgorithmService createRun(String type) {
+        if ("1".equals(type)) {
+            return runPythonImpl;
+        } else if ("2".equals(type)) {
+            return runMatlabImpl;
+        } else {
+            return null;
+        }
+    }
+}

+ 67 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmIoFieldMapper.java

@@ -0,0 +1,67 @@
+package com.pdaaphm.biz.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.AlgorithmIoField;
+import com.pdaaphm.biz.dto.SubAlgorithmDTO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 算法输入输出字段Mapper接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface AlgorithmIoFieldMapper
+{
+    /**
+     * 查询算法输入输出字段
+     *
+     * @param id 算法输入输出字段主键
+     * @return 算法输入输出字段
+     */
+    public AlgorithmIoField selectAlgorithmIoFieldById(Long id);
+
+    /**
+     * 查询算法输入输出字段列表
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 算法输入输出字段集合
+     */
+    public List<AlgorithmIoField> selectAlgorithmIoFieldList(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 新增算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    public int insertAlgorithmIoField(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 修改算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    public int updateAlgorithmIoField(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 删除算法输入输出字段
+     *
+     * @param id 算法输入输出字段主键
+     * @return 结果
+     */
+    public int deleteAlgorithmIoFieldById(Long id);
+
+    /**
+     * 批量删除算法输入输出字段
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmIoFieldByIds(Long[] ids);
+
+    List<SubAlgorithmDTO> getIoSubList(@Param("subTypeId") Long subTypeId,@Param("algoId") Long algoId);
+}

+ 70 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmMapper.java

@@ -0,0 +1,70 @@
+package com.pdaaphm.biz.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.Algorithm;
+import com.pdaaphm.biz.dto.AlgorithmDTO;
+
+/**
+ * 算法Mapper接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface AlgorithmMapper
+{
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    public Algorithm selectAlgorithmById(Long id);
+
+    /**
+     * 查询算法列表
+     *
+     * @param algorithm 算法
+     * @return 算法集合
+     */
+    public List<Algorithm> selectAlgorithmList(Algorithm algorithm);
+
+    /**
+     * 新增算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    public int insertAlgorithm(Algorithm algorithm);
+
+    /**
+     * 修改算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    public int updateAlgorithm(Algorithm algorithm);
+
+    /**
+     * 删除算法
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    public int deleteAlgorithmById(Long id);
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmByIds(Long[] ids);
+
+    public List<Map> getOption();
+
+    public int runAlgorithm(Long id);
+
+    public List<Map> selectUrlAndAddressById(Long id);
+}

+ 61 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/AlgorithmSubTypeMapper.java

@@ -0,0 +1,61 @@
+package com.pdaaphm.biz.mapper;
+
+import java.util.List;
+import com.pdaaphm.biz.domain.AlgorithmSubType;
+
+/**
+ * 算法子类型Mapper接口
+ * 
+ * @author allen
+ * @date 2023-07-26
+ */
+public interface AlgorithmSubTypeMapper 
+{
+    /**
+     * 查询算法子类型
+     * 
+     * @param id 算法子类型主键
+     * @return 算法子类型
+     */
+    public AlgorithmSubType selectAlgorithmSubTypeById(Long id);
+
+    /**
+     * 查询算法子类型列表
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 算法子类型集合
+     */
+    public List<AlgorithmSubType> selectAlgorithmSubTypeList(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 新增算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    public int insertAlgorithmSubType(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 修改算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    public int updateAlgorithmSubType(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 删除算法子类型
+     * 
+     * @param id 算法子类型主键
+     * @return 结果
+     */
+    public int deleteAlgorithmSubTypeById(Long id);
+
+    /**
+     * 批量删除算法子类型
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmSubTypeByIds(Long[] ids);
+}

+ 70 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/FileMapper.java

@@ -0,0 +1,70 @@
+package com.pdaaphm.biz.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.File;
+
+/**
+ * 文件Mapper接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface FileMapper
+{
+    /**
+     * 查询文件
+     *
+     * @param id 文件主键
+     * @return 文件
+     */
+    public File selectFileById(Long id);
+
+    /**
+     * 查询文件列表
+     *
+     * @param file 文件
+     * @return 文件集合
+     */
+    public List<File> selectFileList(File file);
+
+    /**
+     * 新增文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    public int insertFile(File file);
+
+    /**
+     * 修改文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    public int updateFile(File file);
+
+    /**
+     * 删除文件
+     *
+     * @param id 文件主键
+     * @return 结果
+     */
+    public int deleteFileById(Long id);
+
+    /**
+     * 批量删除文件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFileByIds(Long[] ids);
+
+    public List<Map> getOption();
+
+    /**
+     * 查询输出文件是否已存在
+     */
+    public Long selectOutputFile(Long id);
+}

+ 68 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/mapper/SubAlgorithmMapper.java

@@ -0,0 +1,68 @@
+package com.pdaaphm.biz.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.SubAlgorithm;
+
+/**
+ * 子算法Mapper接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface SubAlgorithmMapper
+{
+    /**
+     * 查询子算法
+     *
+     * @param id 子算法主键
+     * @return 子算法
+     */
+    public SubAlgorithm selectSubAlgorithmById(Long id);
+
+    /**
+     * 查询子算法列表
+     *
+     * @param subAlgorithm 子算法
+     * @return 子算法集合
+     */
+    public List<SubAlgorithm> selectSubAlgorithmList(SubAlgorithm subAlgorithm);
+
+    /**
+     * 新增子算法
+     *
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    public int insertSubAlgorithm(SubAlgorithm subAlgorithm);
+
+    /**
+     * 修改子算法
+     *
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    public int updateSubAlgorithm(SubAlgorithm subAlgorithm);
+
+    /**
+     * 删除子算法
+     *
+     * @param id 子算法主键
+     * @return 结果
+     */
+    public int deleteSubAlgorithmById(Long id);
+
+    /**
+     * 批量删除子算法
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSubAlgorithmByIds(Long[] ids);
+
+    /**
+     * 查询算法实例的输出对应的算法关系
+     */
+    public List<Map> selectSubAlgorithmOutputList(Long id);
+}

+ 66 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmIoFieldService.java

@@ -0,0 +1,66 @@
+package com.pdaaphm.biz.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.AlgorithmIoField;
+import com.pdaaphm.biz.dto.SubAlgorithmDTO;
+
+/**
+ * 算法输入输出字段Service接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface IAlgorithmIoFieldService
+{
+    /**
+     * 查询算法输入输出字段
+     *
+     * @param id 算法输入输出字段主键
+     * @return 算法输入输出字段
+     */
+    public AlgorithmIoField selectAlgorithmIoFieldById(Long id);
+
+    /**
+     * 查询算法输入输出字段列表
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 算法输入输出字段集合
+     */
+    public List<AlgorithmIoField> selectAlgorithmIoFieldList(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 新增算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    public int insertAlgorithmIoField(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 修改算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    public int updateAlgorithmIoField(AlgorithmIoField algorithmIoField);
+
+    /**
+     * 批量删除算法输入输出字段
+     *
+     * @param ids 需要删除的算法输入输出字段主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmIoFieldByIds(Long[] ids);
+
+    /**
+     * 删除算法输入输出字段信息
+     *
+     * @param id 算法输入输出字段主键
+     * @return 结果
+     */
+    public int deleteAlgorithmIoFieldById(Long id);
+
+    List<SubAlgorithmDTO> getIoSubList(Long subTypeId, Long algoId);
+}

+ 85 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmService.java

@@ -0,0 +1,85 @@
+package com.pdaaphm.biz.service;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.Algorithm;
+import com.pdaaphm.biz.dto.AlgorithmDTO;
+
+/**
+ * 算法Service接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface IAlgorithmService
+{
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    public Algorithm selectAlgorithmById(Long id);
+
+    /**
+     * 查询算法列表
+     *
+     * @param algorithm 算法
+     * @return 算法集合
+     */
+    public List<Algorithm> selectAlgorithmList(Algorithm algorithm);
+
+    /**
+     * 新增算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    public int insertAlgorithm(Algorithm algorithm);
+
+    /**
+     * 新增算法
+     *
+     * @param algorithmDto 算法
+     * @return 结果
+     */
+    public int addOrUpdateDto(AlgorithmDTO algorithmDto);
+
+    /**
+     * 修改算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    public int updateAlgorithm(Algorithm algorithm);
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的算法主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmByIds(Long[] ids);
+
+    /**
+     * 删除算法信息
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    public int deleteAlgorithmById(Long id);
+
+    public List<Map> getOption();
+
+    /**
+     * 查询算法对象
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    public AlgorithmDTO getAlgorithmDto(Long id);
+
+    public int runAlgorithms(Long id) throws IOException;
+}

+ 61 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IAlgorithmSubTypeService.java

@@ -0,0 +1,61 @@
+package com.pdaaphm.biz.service;
+
+import java.util.List;
+import com.pdaaphm.biz.domain.AlgorithmSubType;
+
+/**
+ * 算法子类型Service接口
+ * 
+ * @author allen
+ * @date 2023-07-26
+ */
+public interface IAlgorithmSubTypeService 
+{
+    /**
+     * 查询算法子类型
+     * 
+     * @param id 算法子类型主键
+     * @return 算法子类型
+     */
+    public AlgorithmSubType selectAlgorithmSubTypeById(Long id);
+
+    /**
+     * 查询算法子类型列表
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 算法子类型集合
+     */
+    public List<AlgorithmSubType> selectAlgorithmSubTypeList(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 新增算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    public int insertAlgorithmSubType(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 修改算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    public int updateAlgorithmSubType(AlgorithmSubType algorithmSubType);
+
+    /**
+     * 批量删除算法子类型
+     * 
+     * @param ids 需要删除的算法子类型主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmSubTypeByIds(Long[] ids);
+
+    /**
+     * 删除算法子类型信息
+     * 
+     * @param id 算法子类型主键
+     * @return 结果
+     */
+    public int deleteAlgorithmSubTypeById(Long id);
+}

+ 65 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/IFileService.java

@@ -0,0 +1,65 @@
+package com.pdaaphm.biz.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.File;
+
+/**
+ * 文件Service接口
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface IFileService
+{
+    /**
+     * 查询文件
+     *
+     * @param id 文件主键
+     * @return 文件
+     */
+    public File selectFileById(Long id);
+
+    /**
+     * 查询文件列表
+     *
+     * @param file 文件
+     * @return 文件集合
+     */
+    public List<File> selectFileList(File file);
+
+    /**
+     * 新增文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    public int insertFile(File file);
+
+    /**
+     * 修改文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    public int updateFile(File file);
+
+    /**
+     * 批量删除文件
+     *
+     * @param ids 需要删除的文件主键集合
+     * @return 结果
+     */
+    public int deleteFileByIds(Long[] ids);
+
+    /**
+     * 删除文件信息
+     *
+     * @param id 文件主键
+     * @return 结果
+     */
+    public int deleteFileById(Long id);
+
+    List<Map> getOption();
+}

+ 61 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/ISubAlgorithmService.java

@@ -0,0 +1,61 @@
+package com.pdaaphm.biz.service;
+
+import java.util.List;
+import com.pdaaphm.biz.domain.SubAlgorithm;
+
+/**
+ * 子算法Service接口
+ * 
+ * @author xlk
+ * @date 2023-07-26
+ */
+public interface ISubAlgorithmService 
+{
+    /**
+     * 查询子算法
+     * 
+     * @param id 子算法主键
+     * @return 子算法
+     */
+    public SubAlgorithm selectSubAlgorithmById(Long id);
+
+    /**
+     * 查询子算法列表
+     * 
+     * @param subAlgorithm 子算法
+     * @return 子算法集合
+     */
+    public List<SubAlgorithm> selectSubAlgorithmList(SubAlgorithm subAlgorithm);
+
+    /**
+     * 新增子算法
+     * 
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    public int insertSubAlgorithm(SubAlgorithm subAlgorithm);
+
+    /**
+     * 修改子算法
+     * 
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    public int updateSubAlgorithm(SubAlgorithm subAlgorithm);
+
+    /**
+     * 批量删除子算法
+     * 
+     * @param ids 需要删除的子算法主键集合
+     * @return 结果
+     */
+    public int deleteSubAlgorithmByIds(Long[] ids);
+
+    /**
+     * 删除子算法信息
+     * 
+     * @param id 子算法主键
+     * @return 结果
+     */
+    public int deleteSubAlgorithmById(Long id);
+}

+ 10 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/RunAlgorithmService.java

@@ -0,0 +1,10 @@
+package com.pdaaphm.biz.service;
+
+import com.pdaaphm.biz.domain.BaseResponse;
+import com.pdaaphm.biz.dto.RequestDTO;
+
+import java.util.List;
+
+public interface RunAlgorithmService {
+    public BaseResponse runAlgorithm(Long id, String url, RequestDTO requestDto);
+}

+ 102 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmIoFieldServiceImpl.java

@@ -0,0 +1,102 @@
+package com.pdaaphm.biz.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.dto.SubAlgorithmDTO;
+import com.pdaaphm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pdaaphm.biz.mapper.AlgorithmIoFieldMapper;
+import com.pdaaphm.biz.domain.AlgorithmIoField;
+import com.pdaaphm.biz.service.IAlgorithmIoFieldService;
+
+/**
+ * 算法输入输出字段Service业务层处理
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Service
+public class AlgorithmIoFieldServiceImpl implements IAlgorithmIoFieldService
+{
+    @Autowired
+    private AlgorithmIoFieldMapper algorithmIoFieldMapper;
+
+    /**
+     * 查询算法输入输出字段
+     *
+     * @param id 算法输入输出字段主键
+     * @return 算法输入输出字段
+     */
+    @Override
+    public AlgorithmIoField selectAlgorithmIoFieldById(Long id)
+    {
+        return algorithmIoFieldMapper.selectAlgorithmIoFieldById(id);
+    }
+
+    /**
+     * 查询算法输入输出字段列表
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 算法输入输出字段
+     */
+    @Override
+    public List<AlgorithmIoField> selectAlgorithmIoFieldList(AlgorithmIoField algorithmIoField)
+    {
+        return algorithmIoFieldMapper.selectAlgorithmIoFieldList(algorithmIoField);
+    }
+
+    /**
+     * 新增算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    @Override
+    public int insertAlgorithmIoField(AlgorithmIoField algorithmIoField)
+    {
+        algorithmIoField.setCreateTime(DateUtils.getNowDate());
+        return algorithmIoFieldMapper.insertAlgorithmIoField(algorithmIoField);
+    }
+
+    /**
+     * 修改算法输入输出字段
+     *
+     * @param algorithmIoField 算法输入输出字段
+     * @return 结果
+     */
+    @Override
+    public int updateAlgorithmIoField(AlgorithmIoField algorithmIoField)
+    {
+        algorithmIoField.setUpdateTime(DateUtils.getNowDate());
+        return algorithmIoFieldMapper.updateAlgorithmIoField(algorithmIoField);
+    }
+
+    /**
+     * 批量删除算法输入输出字段
+     *
+     * @param ids 需要删除的算法输入输出字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmIoFieldByIds(Long[] ids)
+    {
+        return algorithmIoFieldMapper.deleteAlgorithmIoFieldByIds(ids);
+    }
+
+    /**
+     * 删除算法输入输出字段信息
+     *
+     * @param id 算法输入输出字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmIoFieldById(Long id)
+    {
+        return algorithmIoFieldMapper.deleteAlgorithmIoFieldById(id);
+    }
+
+    @Override
+    public List<SubAlgorithmDTO> getIoSubList(Long subTypeId, Long algoId) { return algorithmIoFieldMapper.getIoSubList(subTypeId, algoId); }
+}

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

@@ -0,0 +1,215 @@
+package com.pdaaphm.biz.service.impl;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.biz.domain.AlgorithmSubType;
+import com.pdaaphm.biz.domain.SubAlgorithm;
+import com.pdaaphm.biz.dto.AlgorithmDTO;
+import com.pdaaphm.biz.dto.RequestDTO;
+import com.pdaaphm.biz.dto.SubAlgorithmDTO;
+import com.pdaaphm.biz.factory.AlgorithmFactory;
+import com.pdaaphm.biz.mapper.AlgorithmIoFieldMapper;
+import com.pdaaphm.biz.mapper.AlgorithmSubTypeMapper;
+import com.pdaaphm.biz.mapper.SubAlgorithmMapper;
+import com.pdaaphm.biz.service.RunAlgorithmService;
+import com.pdaaphm.common.config.PadaphmConfig;
+import com.pdaaphm.common.utils.DateUtils;
+import com.pdaaphm.common.utils.file.FileUploadUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pdaaphm.biz.mapper.AlgorithmMapper;
+import com.pdaaphm.biz.domain.Algorithm;
+import com.pdaaphm.biz.service.IAlgorithmService;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * 算法Service业务层处理
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Service
+public class AlgorithmServiceImpl implements IAlgorithmService
+{
+    @Autowired
+    private AlgorithmMapper algorithmMapper;
+    @Autowired
+    private SubAlgorithmMapper subAlgorithmMapper;
+    @Autowired
+    private AlgorithmIoFieldMapper algorithmIoFieldMapper;
+    @Autowired
+    private AlgorithmFactory algorithmFactory;
+    @Autowired
+    private AlgorithmSubTypeMapper algorithmSubTypeMapper;
+
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    @Override
+    public Algorithm selectAlgorithmById(Long id)
+    {
+        return algorithmMapper.selectAlgorithmById(id);
+    }
+
+    /**
+     * 查询算法对象
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    @Override
+    public AlgorithmDTO getAlgorithmDto(Long id)
+    {
+        Algorithm algorithm = this.selectAlgorithmById(id);
+        AlgorithmDTO algorithmDto = new AlgorithmDTO();
+        List<SubAlgorithmDTO> l = algorithmIoFieldMapper.getIoSubList(algorithm.getSubTypeId(),id);
+        BeanUtils.copyProperties(algorithm,algorithmDto);
+        algorithmDto.setIoSubList(l);
+        return algorithmDto;
+    }
+
+    /**
+     * 查询算法列表
+     *
+     * @param algorithm 算法
+     * @return 算法
+     */
+    @Override
+    public List<Algorithm> selectAlgorithmList(Algorithm algorithm)
+    {
+        return algorithmMapper.selectAlgorithmList(algorithm);
+    }
+
+    /**
+     * 新增算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    @Override
+    public int insertAlgorithm(Algorithm algorithm)
+    {
+        algorithm.setCreateTime(DateUtils.getNowDate());
+        return algorithmMapper.insertAlgorithm(algorithm);
+    }
+
+    @Override
+    public int addOrUpdateDto(AlgorithmDTO algorithmDto) {
+        // todo dto 2 domain, save doman
+        // get ioSubList, save SubAlgorithm
+        int res;
+        Algorithm algorithm = new Algorithm();
+        BeanUtils.copyProperties(algorithmDto,algorithm);
+        if(algorithmDto.getId() == null){
+            res = this.insertAlgorithm(algorithm);
+        } else {
+            res = this.updateAlgorithm(algorithm);
+        }
+        List<SubAlgorithmDTO> ioSubList = algorithmDto.getIoSubList();
+        SubAlgorithm subAlgorithm = new SubAlgorithm();
+        for(int i = 0; i < ioSubList.size(); i++){
+            SubAlgorithmDTO subAlgorithmDTO = ioSubList.get(i);
+            BeanUtils.copyProperties(subAlgorithmDTO,subAlgorithm);
+            subAlgorithm.setAlgorithmId(algorithm.getId());
+            if(subAlgorithmDTO.getId() == null){
+                subAlgorithmMapper.insertSubAlgorithm(subAlgorithm);
+            } else {
+                subAlgorithmMapper.updateSubAlgorithm(subAlgorithm);
+            }
+        }
+        return res;
+    }
+
+    /**
+     * 修改算法
+     *
+     * @param algorithm 算法
+     * @return 结果
+     */
+    @Override
+    public int updateAlgorithm(Algorithm algorithm)
+    {
+        algorithm.setUpdateTime(DateUtils.getNowDate());
+        return algorithmMapper.updateAlgorithm(algorithm);
+    }
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmByIds(Long[] ids)
+    {
+        return algorithmMapper.deleteAlgorithmByIds(ids);
+    }
+
+    /**
+     * 删除算法信息
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmById(Long id)
+    {
+        return algorithmMapper.deleteAlgorithmById(id);
+    }
+
+    @Override
+    public List<Map> getOption() { return algorithmMapper.getOption(); }
+
+    @Override
+    public int runAlgorithms(Long id) throws IOException {
+        int res = 0;
+        //1. update Algorithm.startTime to now
+        //2. run algorithmImpl
+        List<Map> list = algorithmMapper.selectUrlAndAddressById(id);
+        Algorithm algorithm = this.selectAlgorithmById(id);
+        AlgorithmSubType algorithmSubType = algorithmSubTypeMapper.selectAlgorithmSubTypeById(algorithm.getSubTypeId());
+        RunAlgorithmService runAlgorithmService = algorithmFactory.createRun(algorithmSubType.getRunType());
+        PadaphmConfig.getProfile();
+        if(CollectionUtils.isEmpty(list)){
+            return res;
+        }
+        List<String> docAddress = new ArrayList<>(list.size());
+        List<String> resultAddress = new ArrayList<>(list.size());
+        String prefix = PadaphmConfig.getProfile();
+        String prefix2 = PadaphmConfig.getResultPath();
+        int j = 1;
+        for (int i = 0; i < list.size(); i++) {
+            if (list.get(i).get("type").equals("1")) {
+                String s = (String)list.get(i).get("path");
+                if (s.startsWith("/profile")) {
+                    s = s.replace("/profile", prefix);
+                }
+                docAddress.add(s);
+            }
+            else {
+                String fileName = "result" + j;
+                j++;
+                String filePrefix = PadaphmConfig.getResultFilePath();
+                String fileNameFinal = FileUploadUtils.upload(filePrefix, fileName);
+                if (fileNameFinal.startsWith("/profile")) {
+                    fileNameFinal = fileNameFinal.replace("/profile", prefix2);
+                }
+                resultAddress.add(fileNameFinal);
+            }
+        }
+        RequestDTO requestDto = new RequestDTO();
+        requestDto.setDocList(docAddress);
+        requestDto.setResultList(resultAddress);
+        runAlgorithmService.runAlgorithm(id, (String)list.get(0).get("url"), requestDto);
+        //3. update Algorithm.completedTime and Algorithm.costSecond
+        //4. res = 1;
+        return res;
+    }
+}

+ 96 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmSubTypeServiceImpl.java

@@ -0,0 +1,96 @@
+package com.pdaaphm.biz.service.impl;
+
+import java.util.List;
+import com.pdaaphm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pdaaphm.biz.mapper.AlgorithmSubTypeMapper;
+import com.pdaaphm.biz.domain.AlgorithmSubType;
+import com.pdaaphm.biz.service.IAlgorithmSubTypeService;
+
+/**
+ * 算法子类型Service业务层处理
+ * 
+ * @author allen
+ * @date 2023-07-26
+ */
+@Service
+public class AlgorithmSubTypeServiceImpl implements IAlgorithmSubTypeService 
+{
+    @Autowired
+    private AlgorithmSubTypeMapper algorithmSubTypeMapper;
+
+    /**
+     * 查询算法子类型
+     * 
+     * @param id 算法子类型主键
+     * @return 算法子类型
+     */
+    @Override
+    public AlgorithmSubType selectAlgorithmSubTypeById(Long id)
+    {
+        return algorithmSubTypeMapper.selectAlgorithmSubTypeById(id);
+    }
+
+    /**
+     * 查询算法子类型列表
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 算法子类型
+     */
+    @Override
+    public List<AlgorithmSubType> selectAlgorithmSubTypeList(AlgorithmSubType algorithmSubType)
+    {
+        return algorithmSubTypeMapper.selectAlgorithmSubTypeList(algorithmSubType);
+    }
+
+    /**
+     * 新增算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    @Override
+    public int insertAlgorithmSubType(AlgorithmSubType algorithmSubType)
+    {
+        algorithmSubType.setCreateTime(DateUtils.getNowDate());
+        return algorithmSubTypeMapper.insertAlgorithmSubType(algorithmSubType);
+    }
+
+    /**
+     * 修改算法子类型
+     * 
+     * @param algorithmSubType 算法子类型
+     * @return 结果
+     */
+    @Override
+    public int updateAlgorithmSubType(AlgorithmSubType algorithmSubType)
+    {
+        algorithmSubType.setUpdateTime(DateUtils.getNowDate());
+        return algorithmSubTypeMapper.updateAlgorithmSubType(algorithmSubType);
+    }
+
+    /**
+     * 批量删除算法子类型
+     * 
+     * @param ids 需要删除的算法子类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmSubTypeByIds(Long[] ids)
+    {
+        return algorithmSubTypeMapper.deleteAlgorithmSubTypeByIds(ids);
+    }
+
+    /**
+     * 删除算法子类型信息
+     * 
+     * @param id 算法子类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmSubTypeById(Long id)
+    {
+        return algorithmSubTypeMapper.deleteAlgorithmSubTypeById(id);
+    }
+}

+ 101 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/FileServiceImpl.java

@@ -0,0 +1,101 @@
+package com.pdaaphm.biz.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import com.pdaaphm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pdaaphm.biz.mapper.FileMapper;
+import com.pdaaphm.biz.domain.File;
+import com.pdaaphm.biz.service.IFileService;
+
+/**
+ * 文件Service业务层处理
+ *
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Service
+public class FileServiceImpl implements IFileService
+{
+    @Autowired
+    private FileMapper fileMapper;
+
+    /**
+     * 查询文件
+     *
+     * @param id 文件主键
+     * @return 文件
+     */
+    @Override
+    public File selectFileById(Long id)
+    {
+        return fileMapper.selectFileById(id);
+    }
+
+    /**
+     * 查询文件列表
+     *
+     * @param file 文件
+     * @return 文件
+     */
+    @Override
+    public List<File> selectFileList(File file)
+    {
+        return fileMapper.selectFileList(file);
+    }
+
+    /**
+     * 新增文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    @Override
+    public int insertFile(File file)
+    {
+        file.setCreateTime(DateUtils.getNowDate());
+        return fileMapper.insertFile(file);
+    }
+
+    /**
+     * 修改文件
+     *
+     * @param file 文件
+     * @return 结果
+     */
+    @Override
+    public int updateFile(File file)
+    {
+        file.setUpdateTime(DateUtils.getNowDate());
+        return fileMapper.updateFile(file);
+    }
+
+    /**
+     * 批量删除文件
+     *
+     * @param ids 需要删除的文件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFileByIds(Long[] ids)
+    {
+        return fileMapper.deleteFileByIds(ids);
+    }
+
+    /**
+     * 删除文件信息
+     *
+     * @param id 文件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFileById(Long id)
+    {
+        return fileMapper.deleteFileById(id);
+    }
+
+    @Override
+    public List<Map> getOption() { return fileMapper.getOption(); }
+}

+ 17 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunMatlabImpl.java

@@ -0,0 +1,17 @@
+package com.pdaaphm.biz.service.impl;
+
+import com.pdaaphm.biz.domain.BaseResponse;
+import com.pdaaphm.biz.dto.RequestDTO;
+import com.pdaaphm.biz.service.RunAlgorithmService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class RunMatlabImpl implements RunAlgorithmService {
+    @Override
+    public BaseResponse runAlgorithm(Long id, String url, RequestDTO requestDto) {
+        System.out.println("runMatlab!");
+        return null;
+    }
+}

+ 142 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunPythonImpl.java

@@ -0,0 +1,142 @@
+package com.pdaaphm.biz.service.impl;
+
+import com.pdaaphm.biz.domain.BaseResponse;
+import com.pdaaphm.biz.domain.File;
+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.RunAlgorithmService;
+import com.pdaaphm.common.config.PadaphmConfig;
+import com.pdaaphm.common.utils.DateUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.reactive.function.client.WebClient;
+import reactor.core.publisher.Mono;
+
+import java.io.FilenameFilter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeoutException;
+
+@Service
+public class RunPythonImpl implements RunAlgorithmService {
+
+    @Autowired
+    private FileMapper fileMapper;
+
+    @Autowired
+    private SubAlgorithmMapper subAlgorithmMapper;
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+//    @Override
+//    public void runAlgorithm(String url, List<String> docAddress) {
+//        // create httpclient, post method
+//        // url/docAddress/
+//        System.out.println("runPython!");
+//    }
+
+    public BaseResponse runAlgorithm(Long id, String url, RequestDTO requestDto) {
+        HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
+        httpRequestFactory.setConnectionRequestTimeout(3000);
+        httpRequestFactory.setConnectTimeout(3000);
+        httpRequestFactory.setReadTimeout(3000);
+//        RestTemplate restTemplate = new RestTemplate(httpRequestFactory);
+//        BaseResponse response = restTemplate.postForObject(url, docAddress, BaseResponse.class);
+        WebClient webClient = WebClient.create(url);
+        Mono<BaseResponse> result = webClient.post()  // 使用POST方法
+                .uri("/request")  // 指定URI
+                .contentType(MediaType.APPLICATION_JSON)  // 设置Content-Type为application/json
+                .bodyValue(requestDto)  // 设置请求body
+                .retrieve()  // 执行请求
+                .bodyToMono(BaseResponse.class)
+                .onErrorResume(e -> {
+                    logger.error("http request error!!!",e);
+                    if (e instanceof TimeoutException) {
+                        // 对超时错误进行处理
+                        return Mono.just(BaseResponse.error("Timeout error"));
+                    } else {
+                        // 对其他错误进行处理
+                        return Mono.just(BaseResponse.error("Other error"));
+                    }
+                });  // 将响应体转换为String
+        BaseResponse res = result.block();
+        List<String> resultList = requestDto.getResultList();
+        List<Map> subAlgorithmOutputList = subAlgorithmMapper.selectSubAlgorithmOutputList(id);
+        for (int i = 0; i < resultList.size(); i++) {
+            String resultPath = resultList.get(i);
+            Map subAlgorithmOutput = subAlgorithmOutputList.get(i);
+            int lastIndex = resultPath.lastIndexOf("/");
+            String dirs = resultPath.substring(0, lastIndex);
+            String prefixName = resultPath.substring(lastIndex + 1);
+            Map<String,String> map = getFinalNameAndPath(dirs, prefixName);
+            if (map != null) {
+                String prefix = PadaphmConfig.getResultPath();
+                String s = map.get("path");
+                if (s.startsWith(prefix)) {
+                    s = s.replace(prefix,"/resultPath");
+                    map.put("path", s);
+                }
+                File resultFile = new File();
+                resultFile.setName(map.get("name"));
+                resultFile.setPath(map.get("path"));
+                resultFile.setType("2");
+                resultFile.setCreateTime(DateUtils.getNowDate());
+                Long fileId = fileMapper.selectOutputFile(id);
+                if (fileId == null) {
+                    fileMapper.insertFile(resultFile);
+                }
+                else {
+                    resultFile.setId(fileId);
+                    fileMapper.updateFile(resultFile);
+                }
+                SubAlgorithm subAlgorithm = new SubAlgorithm();
+                subAlgorithm.setId((Long) subAlgorithmOutput.get("id"));
+                subAlgorithm.setAlgorithmId((Long) subAlgorithmOutput.get("algorithm_id"));
+                subAlgorithm.setFieldId((Long) subAlgorithmOutput.get("field_id"));
+                subAlgorithm.setUploadId(resultFile.getId());
+                subAlgorithm.setCreateTime(DateUtils.getNowDate());
+                subAlgorithmMapper.updateSubAlgorithm(subAlgorithm);
+            }
+            else {
+                logger.error("存在未生成文件!");
+            }
+        }
+        return res;
+    }
+
+    public Map getFinalNameAndPath(String dirs, String prefixName) {
+        // 指定目录路径
+        java.io.File directory = new java.io.File(dirs);
+
+        // 已知的文件名前缀(不带扩展名)
+        String knownFileName = prefixName;
+
+        // 使用FilenameFilter筛选与已知文件名开头的文件
+        String[] matchingFiles = directory.list((dir, name) -> name.startsWith(knownFileName));
+
+        Map<String,String> map = new HashMap<>();
+
+        if (matchingFiles != null && matchingFiles.length == 1) {
+            System.out.println("找到匹配的文件:");
+            map.put("name",matchingFiles[0]);
+            map.put("path",dirs + '/' + matchingFiles[0]);
+            return map;
+        } else if (matchingFiles != null && matchingFiles.length > 1) {
+            System.out.println("找到多个匹配的文件,这不应该发生。");
+            return null;
+        } else {
+            System.out.println("没有找到匹配的文件。");
+            return null;
+        }
+    }
+}

+ 96 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/SubAlgorithmServiceImpl.java

@@ -0,0 +1,96 @@
+package com.pdaaphm.biz.service.impl;
+
+import java.util.List;
+import com.pdaaphm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pdaaphm.biz.mapper.SubAlgorithmMapper;
+import com.pdaaphm.biz.domain.SubAlgorithm;
+import com.pdaaphm.biz.service.ISubAlgorithmService;
+
+/**
+ * 子算法Service业务层处理
+ * 
+ * @author xlk
+ * @date 2023-07-26
+ */
+@Service
+public class SubAlgorithmServiceImpl implements ISubAlgorithmService 
+{
+    @Autowired
+    private SubAlgorithmMapper subAlgorithmMapper;
+
+    /**
+     * 查询子算法
+     * 
+     * @param id 子算法主键
+     * @return 子算法
+     */
+    @Override
+    public SubAlgorithm selectSubAlgorithmById(Long id)
+    {
+        return subAlgorithmMapper.selectSubAlgorithmById(id);
+    }
+
+    /**
+     * 查询子算法列表
+     * 
+     * @param subAlgorithm 子算法
+     * @return 子算法
+     */
+    @Override
+    public List<SubAlgorithm> selectSubAlgorithmList(SubAlgorithm subAlgorithm)
+    {
+        return subAlgorithmMapper.selectSubAlgorithmList(subAlgorithm);
+    }
+
+    /**
+     * 新增子算法
+     * 
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    @Override
+    public int insertSubAlgorithm(SubAlgorithm subAlgorithm)
+    {
+        subAlgorithm.setCreateTime(DateUtils.getNowDate());
+        return subAlgorithmMapper.insertSubAlgorithm(subAlgorithm);
+    }
+
+    /**
+     * 修改子算法
+     * 
+     * @param subAlgorithm 子算法
+     * @return 结果
+     */
+    @Override
+    public int updateSubAlgorithm(SubAlgorithm subAlgorithm)
+    {
+        subAlgorithm.setUpdateTime(DateUtils.getNowDate());
+        return subAlgorithmMapper.updateSubAlgorithm(subAlgorithm);
+    }
+
+    /**
+     * 批量删除子算法
+     * 
+     * @param ids 需要删除的子算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSubAlgorithmByIds(Long[] ids)
+    {
+        return subAlgorithmMapper.deleteSubAlgorithmByIds(ids);
+    }
+
+    /**
+     * 删除子算法信息
+     * 
+     * @param id 子算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSubAlgorithmById(Long id)
+    {
+        return subAlgorithmMapper.deleteSubAlgorithmById(id);
+    }
+}

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

@@ -10,6 +10,8 @@ ruoyi:
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
   profile: D:/padaaphm/uploadPath
+  # 结果文件路径
+  resultPath: D:/padaaphm/resultPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证
@@ -59,9 +61,9 @@ spring:
   servlet:
     multipart:
       # 单个文件大小
-      max-file-size: 10MB
+      max-file-size: 100MB
       # 设置总上传的文件大小
-      max-request-size: 20MB
+      max-request-size: 200MB
   # 服务模块
   devtools:
     restart:

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

@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pdaaphm.biz.mapper.AlgorithmMapper">
+
+    <resultMap type="Algorithm" id="AlgorithmResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="subTypeId"    column="sub_type_id"    />
+        <result property="name"    column="name"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="completedTime"    column="completed_time"    />
+        <result property="costSecond"    column="cost_second"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="algoSubName" column="sub_name"    />
+    </resultMap>
+
+    <sql id="selectAlgorithmVo">
+        select algo.`id`, algo.`type`, algo.sub_type_id, algo.`name`, algo.start_time, algo.completed_time, algo.cost_second, algo.create_by, algo.create_time, algo.update_by, algo.update_time, algo.remark, sub.name as sub_name from t_algorithm as algo left join t_algorithm_sub_type as sub on algo.sub_type_id = sub.id
+    </sql>
+
+    <select id="selectAlgorithmList" parameterType="Algorithm" resultMap="AlgorithmResult">
+        <include refid="selectAlgorithmVo"/>
+        <where>
+            <if test="type != null  and type != ''"> and `type` = #{type}</if>
+            <if test="subTypeId != null "> and sub_type_id = #{subTypeId}</if>
+            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
+            <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>
+        </where>
+    </select>
+
+    <select id="selectAlgorithmById" parameterType="Long" resultMap="AlgorithmResult">
+        <include refid="selectAlgorithmVo"/>
+        where algo.id = #{id}
+    </select>
+
+    <insert id="insertAlgorithm" parameterType="Algorithm" useGeneratedKeys="true" keyProperty="id">
+        insert into t_algorithm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">`type`,</if>
+            <if test="subTypeId != null">sub_type_id,</if>
+            <if test="name != null">`name`,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="completedTime != null">completed_time,</if>
+            <if test="costSecond != null">cost_second,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="subTypeId != null">#{subTypeId},</if>
+            <if test="name != null">#{name},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="completedTime != null">#{completedTime},</if>
+            <if test="costSecond != null">#{costSecond},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlgorithm" parameterType="Algorithm">
+        update t_algorithm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
+            <if test="subTypeId != null">sub_type_id = #{subTypeId},</if>
+            <if test="name != null">`name` = #{name},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="completedTime != null">completed_time = #{completedTime},</if>
+            <if test="costSecond != null">cost_second = #{costSecond},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAlgorithmById" parameterType="Long">
+        delete from t_algorithm where id = #{id}
+    </delete>
+
+    <delete id="deleteAlgorithmByIds" parameterType="String">
+        delete from t_algorithm where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="getOption" resultType="Map">
+        select id, `type`, `name` from t_algorithm_sub_type
+    </select>
+
+    <select id="selectUrlAndAddressById" parameterType="Long" resultType="Map">
+        SELECT
+            tast.url,
+            tf.path,
+            taf.type
+        FROM
+            t_algorithm ta
+                LEFT JOIN t_sub_algorithm tsa ON tsa.algorithm_id = ta.id
+                LEFT JOIN t_algorithm_io_field taf ON taf.id = tsa.field_id
+                LEFT JOIN t_algorithm_sub_type tast ON tast.id = taf.algorithm_sub_id
+                LEFT JOIN t_file tf ON tf.id = tsa.upload_id
+        WHERE
+            ta.id = #{id}
+    </select>
+</mapper>

+ 102 - 0
pdaaphm-admin/src/main/resources/mapper/algoManager/FileMapper.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pdaaphm.biz.mapper.FileMapper">
+
+    <resultMap type="File" id="FileResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="path"    column="path"    />
+        <result property="type"    column="type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectFileVo">
+        select id, `name`, `path`, `type`, create_by, create_time, update_by, update_time, remark from t_file
+    </sql>
+
+    <select id="selectFileList" parameterType="File" resultMap="FileResult">
+        <include refid="selectFileVo"/>
+        <where>
+            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
+            <if test="path != null  and path != ''"> and `path` = #{path}</if>
+            <if test="type != null  and type != ''"> and `type` = #{type}</if>
+        </where>
+    </select>
+
+    <select id="selectFileById" parameterType="Long" resultMap="FileResult">
+        <include refid="selectFileVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertFile" parameterType="File" useGeneratedKeys="true" keyProperty="id">
+        insert into t_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="name != null">`name`,</if>
+            <if test="path != null">`path`,</if>
+            <if test="type != null">`type`,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="name != null">#{name},</if>
+            <if test="path != null">#{path},</if>
+            <if test="type != null">#{type},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFile" parameterType="File">
+        update t_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">`name` = #{name},</if>
+            <if test="path != null">`path` = #{path},</if>
+            <if test="type != null">`type` = #{type},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFileById" parameterType="Long">
+        delete from t_file where id = #{id}
+    </delete>
+
+    <delete id="deleteFileByIds" parameterType="String">
+        delete from t_file where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="getOption" resultType="Map">
+        select id, `name`, `type` from t_file
+    </select>
+
+    <select id="selectOutputFile" resultType="Long">
+        SELECT
+            tf.id
+        FROM
+            t_algorithm ta
+                JOIN t_sub_algorithm tsa ON tsa.algorithm_id = ta.id
+                JOIN t_file tf ON tf.id = tsa.upload_id
+        WHERE
+            ta.id = #{id}
+          AND tf.type = 2
+    </select>
+</mapper>

+ 104 - 0
pdaaphm-admin/src/main/resources/mapper/algoManager/SubAlgorithmMapper.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pdaaphm.biz.mapper.SubAlgorithmMapper">
+
+    <resultMap type="SubAlgorithm" id="SubAlgorithmResult">
+        <result property="id"    column="id"    />
+        <result property="algorithmId"    column="algorithm_id"    />
+        <result property="fieldId"    column="field_id"    />
+        <result property="uploadId"    column="upload_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectSubAlgorithmVo">
+        select id, algorithm_id, field_id, upload_id, create_by, create_time, update_by, update_time, remark from t_sub_algorithm
+    </sql>
+
+    <select id="selectSubAlgorithmList" parameterType="SubAlgorithm" resultMap="SubAlgorithmResult">
+        <include refid="selectSubAlgorithmVo"/>
+        <where>
+            <if test="algorithmId != null "> and algorithm_id = #{algorithmId}</if>
+            <if test="fieldId != null "> and field_id = #{fieldId}</if>
+            <if test="uploadId != null "> and upload_id = #{uploadId}</if>
+        </where>
+    </select>
+
+    <select id="selectSubAlgorithmById" parameterType="Long" resultMap="SubAlgorithmResult">
+        <include refid="selectSubAlgorithmVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSubAlgorithm" parameterType="SubAlgorithm" useGeneratedKeys="true" keyProperty="id">
+        insert into t_sub_algorithm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmId != null">algorithm_id,</if>
+            <if test="fieldId != null">field_id,</if>
+            <if test="uploadId != null">upload_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmId != null">#{algorithmId},</if>
+            <if test="fieldId != null">#{fieldId},</if>
+            <if test="uploadId != null">#{uploadId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSubAlgorithm" parameterType="SubAlgorithm">
+        update t_sub_algorithm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="algorithmId != null">algorithm_id = #{algorithmId},</if>
+            <if test="fieldId != null">field_id = #{fieldId},</if>
+            <if test="uploadId != null">upload_id = #{uploadId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSubAlgorithmById" parameterType="Long">
+        delete from t_sub_algorithm where id = #{id}
+    </delete>
+
+    <delete id="deleteSubAlgorithmByIds" parameterType="String">
+        delete from t_sub_algorithm where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectSubAlgorithmOutputList" parameterType="Long" resultType="Map">
+        SELECT
+            tsa.id,
+            tsa.algorithm_id,
+            tsa.field_id
+        FROM
+            t_algorithm ta
+                JOIN t_algorithm_sub_type tast ON tast.id = ta.sub_type_id
+                JOIN t_algorithm_io_field taif ON taif.algorithm_sub_id = tast.id
+                JOIN t_sub_algorithm tsa ON tsa.field_id = taif.id
+                AND tsa.algorithm_id = ta.id
+        WHERE
+            taif.type = 2
+          AND ta.id = #{id}
+        ORDER BY
+            taif.`index`
+    </select>
+</mapper>

+ 125 - 0
pdaaphm-admin/src/main/resources/mapper/conf/AlgorithmIoFieldMapper.xml

@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pdaaphm.biz.mapper.AlgorithmIoFieldMapper">
+
+    <resultMap type="AlgorithmIoField" id="AlgorithmIoFieldResult">
+        <result property="id"    column="id"    />
+        <result property="algorithmSubId"    column="algorithm_sub_id"    />
+        <result property="type"    column="type"    />
+        <result property="name"    column="name"    />
+        <result property="index"    column="index"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="algoSubName" column="sub_name"    />
+    </resultMap>
+
+    <sql id="selectAlgorithmIoFieldVo">
+        select io.id, io.algorithm_sub_id, io.`type`, io.`name`, io.`index`, io.create_by, io.create_time, io.update_by, io.update_time, io.remark, sub.name as sub_name from t_algorithm_io_field as io left join t_algorithm_sub_type as sub on io.algorithm_sub_id = sub.id
+    </sql>
+
+    <select id="selectAlgorithmIoFieldList" parameterType="AlgorithmIoField" resultMap="AlgorithmIoFieldResult">
+        <include refid="selectAlgorithmIoFieldVo"/>
+        <where>
+            <if test="algorithmSubId != null "> and algorithm_sub_id = #{algorithmSubId}</if>
+            <if test="type != null  and type != ''"> and `type` = #{type}</if>
+            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
+            <if test="index != null "> and `index` = #{index}</if>
+        </where>
+    </select>
+
+    <select id="selectAlgorithmIoFieldById" parameterType="Long" resultMap="AlgorithmIoFieldResult">
+        <include refid="selectAlgorithmIoFieldVo"/>
+        where io.id = #{id}
+    </select>
+
+    <insert id="insertAlgorithmIoField" parameterType="AlgorithmIoField" useGeneratedKeys="true" keyProperty="id">
+        insert into t_algorithm_io_field
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmSubId != null">algorithm_sub_id,</if>
+            <if test="type != null">`type`,</if>
+            <if test="name != null">`name`,</if>
+            <if test="index != null">`index`,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmSubId != null">#{algorithmSubId},</if>
+            <if test="type != null">#{type},</if>
+            <if test="name != null">#{name},</if>
+            <if test="index != null">#{index},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlgorithmIoField" parameterType="AlgorithmIoField">
+        update t_algorithm_io_field
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="algorithmSubId != null">algorithm_sub_id = #{algorithmSubId},</if>
+            <if test="type != null">`type` = #{type},</if>
+            <if test="name != null">`name` = #{name},</if>
+            <if test="index != null">`index` = #{index},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAlgorithmIoFieldById" parameterType="Long">
+        delete from t_algorithm_io_field where id = #{id}
+    </delete>
+
+    <delete id="deleteAlgorithmIoFieldByIds" parameterType="String">
+        delete from t_algorithm_io_field where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="getIoSubList" resultType="com.pdaaphm.biz.dto.SubAlgorithmDTO">
+        SELECT
+            io.id as fieldId,
+            io.`type`,
+            io.`name`,
+            (
+                SELECT
+                    sa.id
+                FROM
+                    t_sub_algorithm sa,
+                    t_algorithm a
+                WHERE
+                    sa.algorithm_id = a.id
+                  AND sa.field_id = io.id
+                  AND a.id = #{algoId}
+            ) AS id,
+            (
+                SELECT
+                    sa.upload_id
+                FROM
+                    t_sub_algorithm sa,
+                    t_algorithm a
+                WHERE
+                    sa.algorithm_id = a.id
+                  AND sa.field_id = io.id
+                  AND a.id = #{algoId}
+            ) AS uploadId
+        FROM
+            t_algorithm_io_field AS io
+        WHERE
+            io.algorithm_sub_id = #{subTypeId}
+    </select>
+</mapper>

+ 91 - 0
pdaaphm-admin/src/main/resources/mapper/conf/AlgorithmSubTypeMapper.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pdaaphm.biz.mapper.AlgorithmSubTypeMapper">
+
+    <resultMap type="AlgorithmSubType" id="AlgorithmSubTypeResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="name"    column="name"    />
+        <result property="url"    column="url"    />
+        <result property="runType"    column="run_type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectAlgorithmSubTypeVo">
+        select id, `type`, `name`, url, run_type, create_by, create_time, update_by, update_time, remark from t_algorithm_sub_type
+    </sql>
+
+    <select id="selectAlgorithmSubTypeList" parameterType="AlgorithmSubType" resultMap="AlgorithmSubTypeResult">
+        <include refid="selectAlgorithmSubTypeVo"/>
+        <where>
+            <if test="type != null  and type != ''"> and `type` = #{type}</if>
+            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</if>
+            <if test="runType != null  and runType != ''"> and run_type = #{runType}</if>
+        </where>
+    </select>
+
+    <select id="selectAlgorithmSubTypeById" parameterType="Long" resultMap="AlgorithmSubTypeResult">
+        <include refid="selectAlgorithmSubTypeVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAlgorithmSubType" parameterType="AlgorithmSubType" useGeneratedKeys="true" keyProperty="id">
+        insert into t_algorithm_sub_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">`type`,</if>
+            <if test="name != null">`name`,</if>
+            <if test="url != null">url,</if>
+            <if test="runType != null">run_type,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="name != null">#{name},</if>
+            <if test="url != null">#{url},</if>
+            <if test="runType != null">#{runType},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAlgorithmSubType" parameterType="AlgorithmSubType">
+        update t_algorithm_sub_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">`type` = #{type},</if>
+            <if test="name != null">`name` = #{name},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="runType != null">run_type = #{runType},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAlgorithmSubTypeById" parameterType="Long">
+        delete from t_algorithm_sub_type where id = #{id}
+    </delete>
+
+    <delete id="deleteAlgorithmSubTypeByIds" parameterType="String">
+        delete from t_algorithm_sub_type where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 19 - 1
pdaaphm-common/src/main/java/com/pdaaphm/common/config/PadaphmConfig.java

@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
 
 /**
  * 读取项目相关配置
- * 
+ *
  * @author Allen
  */
 @Component
@@ -27,6 +27,9 @@ public class PadaphmConfig
     /** 上传路径 */
     private static String profile;
 
+    /** 结果文件路径 */
+    private static String resultPath;
+
     /** 获取地址开关 */
     private static boolean addressEnabled;
 
@@ -83,6 +86,16 @@ public class PadaphmConfig
         PadaphmConfig.profile = profile;
     }
 
+    public static String getResultPath()
+    {
+        return resultPath;
+    }
+
+    public void setResultPath(String resultPath)
+    {
+        PadaphmConfig.resultPath = resultPath;
+    }
+
     public static boolean isAddressEnabled()
     {
         return addressEnabled;
@@ -132,4 +145,9 @@ public class PadaphmConfig
     {
         return getProfile() + "/upload";
     }
+
+    public static String getResultFilePath()
+    {
+        return getResultPath() + "/result";
+    }
 }

+ 29 - 1
pdaaphm-common/src/main/java/com/pdaaphm/common/utils/file/FileUploadUtils.java

@@ -86,6 +86,18 @@ public class FileUploadUtils
         }
     }
 
+    public static final String upload(String baseDir, String fileName) throws IOException
+    {
+        try
+        {
+            return upload(baseDir, fileName, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
+        }
+        catch (Exception e)
+        {
+            throw new IOException(e.getMessage(), e);
+        }
+    }
+
     /**
      * 文件上传
      *
@@ -108,7 +120,7 @@ public class FileUploadUtils
             throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
         }
 
-        assertAllowed(file, allowedExtension);
+//        assertAllowed(file, allowedExtension);
 
         String fileName = extractFilename(file);
 
@@ -117,6 +129,16 @@ public class FileUploadUtils
         return getPathFileName(baseDir, fileName);
     }
 
+    public static final String upload(String baseDir, String fileName, String[] allowedExtension)
+            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
+            InvalidExtensionException
+    {
+        String fileNameTimed = extractFilename(fileName);
+
+        String absPath = getAbsoluteFile(baseDir, fileNameTimed).getAbsolutePath();
+        return getPathFileName(baseDir, fileNameTimed);
+    }
+
     /**
      * 编码文件名
      */
@@ -126,6 +148,12 @@ public class FileUploadUtils
                 FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
     }
 
+    public static final String extractFilename(String fileName)
+    {
+        return StringUtils.format("{}/{}_{}", DateUtils.datePath(),
+                fileName, Seq.getId(Seq.uploadSeqType));
+    }
+
     public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
     {
         File desc = new File(uploadDir + File.separator + fileName);

+ 11 - 11
pdaaphm-system/src/main/java/com/pdaaphm/system/service/impl/SysConfigServiceImpl.java

@@ -19,11 +19,11 @@ import com.pdaaphm.system.service.ISysConfigService;
 
 /**
  * 参数配置 服务层实现
- * 
+ *
  * @author Allen
  */
 @Service
-public class SysConfigServiceImpl implements ISysConfigService
+public class  SysConfigServiceImpl implements ISysConfigService
 {
     @Autowired
     private SysConfigMapper configMapper;
@@ -42,7 +42,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 查询参数配置信息
-     * 
+     *
      * @param configId 参数配置ID
      * @return 参数配置信息
      */
@@ -57,7 +57,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 根据键名查询参数配置信息
-     * 
+     *
      * @param configKey 参数key
      * @return 参数键值
      */
@@ -82,7 +82,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 获取验证码开关
-     * 
+     *
      * @return true开启,false关闭
      */
     @Override
@@ -98,7 +98,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 查询参数配置列表
-     * 
+     *
      * @param config 参数配置信息
      * @return 参数配置集合
      */
@@ -110,7 +110,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 新增参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -127,7 +127,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 修改参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -150,7 +150,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 批量删除参数信息
-     * 
+     *
      * @param configIds 需要删除的参数ID
      */
     @Override
@@ -203,7 +203,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 校验参数键名是否唯一
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -221,7 +221,7 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 设置cache key
-     * 
+     *
      * @param configKey 参数键
      * @return 缓存键key
      */

+ 77 - 0
pdaaphm-ui/src/api/algoManager/algorithm.js

@@ -0,0 +1,77 @@
+import request from '@/utils/request'
+
+// 查询算法列表
+export function listAlgorithm(query) {
+  return request({
+    url: '/algoManager/algorithm/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询算法详细
+export function getAlgorithm(id) {
+  return request({
+    url: '/algoManager/algorithm/' + id,
+    method: 'get'
+  })
+}
+
+// 查询算法对象详细
+export function getAlgorithmDto(id) {
+  return request({
+    url: '/algoManager/algorithm/getAlgorithmDto/' + id,
+    method: 'get'
+  })
+}
+
+// 新增算法
+export function addAlgorithm(data) {
+  return request({
+    url: '/algoManager/algorithm',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改算法
+export function updateAlgorithm(data) {
+  return request({
+    url: '/algoManager/algorithm',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除算法
+export function delAlgorithm(id) {
+  return request({
+    url: '/algoManager/algorithm/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询算法子类管理列表
+export function getAlgoSubOption() {
+  return request({
+    url: '/algoManager/algorithm/getOption',
+    method: 'get',
+  })
+}
+
+// 新增算法
+export function addOrUpdateDto(data) {
+  return request({
+    url: '/algoManager/algorithm/addOrUpdateDto',
+    method: 'post',
+    data: data
+  })
+}
+
+// 运行算法
+export function runAlgorithms(id) {
+  return request({
+    url: '/algoManager/algorithm/runAlgorithms/' + id,
+    method: 'get'
+  })
+}

+ 52 - 0
pdaaphm-ui/src/api/algoManager/file.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询文件列表
+export function listFile(query) {
+  return request({
+    url: '/algoManager/file/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询文件详细
+export function getFile(id) {
+  return request({
+    url: '/algoManager/file/' + id,
+    method: 'get'
+  })
+}
+
+// 新增文件
+export function addFile(data) {
+  return request({
+    url: '/algoManager/file',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改文件
+export function updateFile(data) {
+  return request({
+    url: '/algoManager/file',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除文件
+export function delFile(id) {
+  return request({
+    url: '/algoManager/file/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询所有文件列表
+export function getFileList() {
+  return request({
+    url: '/algoManager/file/getOption',
+    method: 'get',
+  })
+}

+ 52 - 0
pdaaphm-ui/src/api/conf/field.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询算法输入输出字段列表
+export function listField(query) {
+  return request({
+    url: '/conf/field/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询算法输入输出字段详细
+export function getField(id) {
+  return request({
+    url: '/conf/field/' + id,
+    method: 'get'
+  })
+}
+
+// 新增算法输入输出字段
+export function addField(data) {
+  return request({
+    url: '/conf/field',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改算法输入输出字段
+export function updateField(data) {
+  return request({
+    url: '/conf/field',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除算法输入输出字段
+export function delField(id) {
+  return request({
+    url: '/conf/field/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询具体算法输入输出字段列表
+export function getIoSubList(subTypeId,algoId) {
+  return request({
+    url: '/conf/field/getIoSubList/' + subTypeId + '/'+ algoId,
+    method: 'get',
+  })
+}

+ 44 - 0
pdaaphm-ui/src/api/conf/subType.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询算法子类型列表
+export function listSubType(query) {
+  return request({
+    url: '/conf/subType/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询算法子类型详细
+export function getSubType(id) {
+  return request({
+    url: '/conf/subType/' + id,
+    method: 'get'
+  })
+}
+
+// 新增算法子类型
+export function addSubType(data) {
+  return request({
+    url: '/conf/subType',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改算法子类型
+export function updateSubType(data) {
+  return request({
+    url: '/conf/subType',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除算法子类型
+export function delSubType(id) {
+  return request({
+    url: '/conf/subType/' + id,
+    method: 'delete'
+  })
+}

+ 1 - 2
pdaaphm-ui/src/components/FileUpload/index.vue

@@ -55,12 +55,11 @@ export default {
     // 大小限制(MB)
     fileSize: {
       type: Number,
-      default: 5,
+      default: 100,
     },
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
     },
     // 是否显示提示
     isShowTip: {

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

@@ -0,0 +1,460 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="算法类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择算法类型" clearable filterable @change=changeQueryType()>
+          <el-option
+            v-for="dict in dict.type.algorithm_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="算法子类型" prop="subTypeId">
+        <el-select
+          v-model="queryParams.subTypeId"
+          placeholder="请选择算法子类型"
+          clearable
+          filterable
+        >
+          <el-option
+            v-for="item in algoTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!-- <el-form-item label="开始时间" prop="startTime">
+        <el-date-picker clearable
+          v-model="queryParams.startTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择开始时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="完成时间" prop="completedTime">
+        <el-date-picker clearable
+          v-model="queryParams.completedTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择完成时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="耗时(s)" prop="costSecond">
+        <el-input
+          v-model="queryParams.costSecond"
+          placeholder="请输入耗时(s)"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['algoManager:algorithm:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['algoManager:algorithm:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['algoManager:algorithm:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :disabled="single"
+          @click="handleExport"
+          v-hasPermi="['algoManager:algorithm:export']"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-mouse"
+          size="mini"
+          @click="handleRun"
+          v-hasPermi="['algoManager:algorithm:run']"
+        >算法运行</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.algorithm_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="算法子类型" align="center" prop="algoSubName" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="开始时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="完成时间" align="center" prop="completedTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.completedTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="耗时(s)" align="center" prop="costSecond" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['algoManager:algorithm:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['algoManager:algorithm:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改算法对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="算法类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择算法类型" clearable filterable @change='changeFormType()'>
+            <el-option
+              v-for="dict in dict.type.algorithm_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="算法子类型" prop="subTypeId">
+          <el-select
+            v-model="form.subTypeId"
+            placeholder="请选择算法子类型"
+            clearable
+            filterable
+            @change='changeFormSubType()'
+          >
+            <el-option
+              v-for="item in algoTypeList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <template v-if="form.subTypeId">
+          <el-form-item v-for="item in form.ioSubList" :label="item.name" :key="item.id">
+            <!-- <file-upload v-model="form.path"/> -->
+            <el-select
+              v-model="item.uploadId"
+              placeholder="请选择文件"
+              clearable
+              filterable
+            >
+              <el-option
+                v-for="file in fileList"
+                :key="file.id"
+                :label="file.name"
+                :value="file.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAlgorithm, getAlgorithmDto, delAlgorithm, addOrUpdateDto, runAlgorithms } from "@/api/algoManager/algorithm";
+import { getAlgoSubOption } from "@/api/algoManager/algorithm";
+import { getIoSubList } from "@/api/conf/field";
+import { getFileList } from "@/api/algoManager/file";
+
+export default {
+  name: "Algorithm",
+  dicts: ['algorithm_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 算法表格数据
+      algorithmList: [],
+      // 算法子类列表
+      algorithmSubList: [],
+      // 算法特定类列表
+      algoTypeList: [],
+      // 已上传文件列表
+      fileList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        type: null,
+        subTypeId: null,
+
+        name: null,
+        startTime: null,
+        completedTime: null,
+        costSecond: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        subTypeId: [
+          { required: true, message: "算法子类型不能为空", trigger: "blur" }
+        ],
+      },
+      typeMap: new Map(),
+    };
+  },
+  created() {
+    this.getList();
+    this.getAlgoSubOption();
+    this.getFileList();
+  },
+  methods: {
+    /** 查询算法列表 */
+    getList() {
+      this.loading = true;
+      listAlgorithm(this.queryParams).then(response => {
+        this.algorithmList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    getAlgoSubOption() {
+      getAlgoSubOption().then((resp) => {
+        this.algorithmSubList = resp.data;
+        this.createTypeMap();
+        console.info(resp);
+      });
+    },
+
+    getFileList() {
+      getFileList().then((resp) => {
+        this.fileList = resp.data;
+        console.info(resp);
+        console.info(this);
+      });
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        type: null,
+        subTypeId: null,
+        name: null,
+        startTime: null,
+        completedTime: null,
+        costSecond: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null,
+        // 具体算法输入输出文件列表
+        ioSubList: []
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加算法";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAlgorithmDto(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改算法";
+        this.algoTypeList = this.typeMap.get(this.form.type);
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          addOrUpdateDto(this.form).then(response => {
+            this.$modal.msgSuccess("成功");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除算法编号为"' + ids + '"的数据项?').then(function() {
+        return delAlgorithm(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('algoManager/algorithm/export', {
+        ...this.queryParams
+      }, `algorithm_${new Date().getTime()}.xlsx`)
+    },
+    /** 运行算法按钮操作 */
+    handleRun(row) {
+      const id = row.id || this.ids
+      // debugger
+      runAlgorithms(id).then(response => {
+        this.$modal.msgSuccess("成功");
+        this.getList();
+      });
+    },
+    
+    createTypeMap() {
+      for (const algorithmSub of this.algorithmSubList) {
+        if(this.typeMap.has(algorithmSub.type)) {
+          this.typeMap.get(algorithmSub.type).push({
+            id: algorithmSub.id,
+            name: algorithmSub.name
+          });
+        }
+        else {
+          this.typeMap.set(algorithmSub.type, [{
+            id: algorithmSub.id,
+            name: algorithmSub.name
+          }]);
+        }
+      }
+    },
+
+    changeQueryType() {
+      this.queryParams.subTypeId = null;
+      this.algoTypeList = this.typeMap.get(this.queryParams.type);
+    },
+
+    changeFormType() {
+      this.form.subTypeId = null;
+      this.algoTypeList = this.typeMap.get(this.form.type);
+    },
+
+    changeFormSubType() {
+      getIoSubList(this.form.subTypeId,this.form.id).then((resp) => {
+        this.form.ioSubList = resp.data;
+        console.info(resp);
+      });
+    },
+  }
+};
+</script>

+ 297 - 0
pdaaphm-ui/src/views/algoManager/file/index.vue

@@ -0,0 +1,297 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="文档名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入文档名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['algoManager:file:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['algoManager:file:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['algoManager:file:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['algoManager:file:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fileList" @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="name" />
+      <el-table-column label="文档路径" align="center" prop="path" />
+      <el-table-column label="输入/输出" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.algorithm_io_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['algoManager:file:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['algoManager:file:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改文件对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="文档名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入文档名称" />
+        </el-form-item>
+        <el-form-item label="文档路径" prop="path">
+          <file-upload v-model="form.path"/>
+        </el-form-item>
+        <el-form-item label="输入/输出" prop="type">
+          <el-select v-model="form.type" placeholder="请选择输入输出类型" clearable filterable>
+            <el-option
+              v-for="dict in dict.type.algorithm_io_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listFile, getFile, delFile, addFile, updateFile } from "@/api/algoManager/file";
+
+export default {
+  name: "File",
+  dicts: ['algorithm_io_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 文件表格数据
+      fileList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        path: null,
+        type: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询文件列表 */
+    getList() {
+      this.loading = true;
+      listFile(this.queryParams).then(response => {
+        this.fileList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        path: null,
+        type: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加文件";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getFile(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改文件";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if(this.form.name == null) {
+            this.form.name = this.getFileName(this.form.path);
+          }
+          if (this.form.id != null) {
+            updateFile(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFile(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除文件编号为"' + ids + '"的数据项?').then(function() {
+        return delFile(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('algoManager/file/export', {
+        ...this.queryParams
+      }, `file_${new Date().getTime()}.xlsx`)
+    },
+
+    getFileName(path) {
+      if (!path) {
+        return ''
+      } else if (path.lastIndexOf("/") > -1) {
+        const newName = path.slice(path.lastIndexOf("/") + 1)
+        const names = newName.split(".")
+        if ((names.size = 2) && (names[0].length > 19)) {
+          return newName.substring(0, names[0].length - 19) + '.' + names[1]
+        } else {
+          return newName
+        }
+      } else {
+        return '';
+      }
+    },
+  }
+};
+</script>

+ 344 - 0
pdaaphm-ui/src/views/conf/field/index.vue

@@ -0,0 +1,344 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="算法子类型" prop="algorithmSubId">
+        <el-select
+          v-model="form.algorithmSubId"
+          placeholder="请选择算法子类型"
+          filterable
+        >
+          <el-option
+            v-for="item in algorithmSubList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="输入/输出" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择输入/输出" clearable>
+          <el-option
+            v-for="dict in dict.type.algorithm_io_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="排序" prop="index">
+        <el-input
+          v-model="queryParams.index"
+          placeholder="请输入排序"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['conf:field:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['conf:field:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['conf:field:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['conf:field:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fieldList" @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="algoSubName" />
+      <el-table-column label="输入/输出" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.algorithm_io_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="排序" align="center" prop="index" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['conf:field:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['conf:field:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改算法输入输出字段对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="算法子类型" prop="algorithmSubId">
+          <el-select
+            v-model="form.algorithmSubId"
+            placeholder="请选择算法子类型"
+            filterable
+          >
+            <el-option
+              v-for="item in algorithmSubList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="输入/输出" prop="type">
+          <el-select v-model="form.type" placeholder="请选择输入/输出" clearable filterable>
+            <el-option
+              v-for="dict in dict.type.algorithm_io_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="排序" prop="index">
+          <el-input v-model="form.index" placeholder="请输入排序" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listField, getField, delField, addField, updateField } from "@/api/conf/field";
+import { getAlgoSubOption } from "@/api/algoManager/algorithm";
+
+export default {
+  name: "Field",
+  dicts: ['algorithm_io_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 算法输入输出字段表格数据
+      fieldList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        algorithmSubId: null,
+        type: null,
+        name: null,
+        index: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        algorithmSubId: [
+          { required: true, message: "算法子类型编号不能为空", trigger: "blur" }
+        ],
+      },
+      // 算法子类列表
+      algorithmSubList: [],
+    };
+  },
+  created() {
+    this.getAlgoSubOption();
+    this.getList();
+  },
+  methods: {
+    /** 查询算法输入输出字段列表 */
+    getList() {
+      this.loading = true;
+      listField(this.queryParams).then(response => {
+        this.fieldList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        algorithmSubId: null,
+        type: null,
+        name: null,
+        index: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加算法输入输出字段";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getField(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改算法输入输出字段";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateField(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addField(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除算法输入输出字段编号为"' + ids + '"的数据项?').then(function() {
+        return delField(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('conf/field/export', {
+        ...this.queryParams
+      }, `field_${new Date().getTime()}.xlsx`)
+    },
+
+    getAlgoSubOption() {
+      getAlgoSubOption().then((resp) => {
+        this.algorithmSubList = resp.data;
+        console.info(resp);
+        console.info(this);
+      });
+    },
+  }
+};
+</script>

+ 302 - 0
pdaaphm-ui/src/views/conf/subType/index.vue

@@ -0,0 +1,302 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择类型" clearable>
+          <el-option
+            v-for="dict in dict.type.algorithm_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="算法子名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入算法子名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="算法url" prop="url">
+        <el-input
+          v-model="queryParams.url"
+          placeholder="请输入算法url"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['conf:subType:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['conf:subType:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['conf:subType:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['conf:subType:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="subTypeList" @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">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.algorithm_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="算法子名称" align="center" prop="name" />
+      <el-table-column label="算法url" align="center" prop="url" />
+      <el-table-column label="运行类型" align="center" prop="runType" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['conf:subType:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['conf:subType:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改算法子类型对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择类型">
+            <el-option
+              v-for="dict in dict.type.algorithm_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="算法子名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入算法子名称" />
+        </el-form-item>
+        <el-form-item label="算法url" prop="url">
+          <el-input v-model="form.url" placeholder="请输入算法url" />
+        </el-form-item>
+        <el-form-item label="算法运行类型" prop="runType">
+          <el-input v-model="form.runType" placeholder="请输入算法运行类型" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSubType, getSubType, delSubType, addSubType, updateSubType } from "@/api/conf/subType";
+
+export default {
+  name: "SubType",
+  dicts: ['algorithm_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 算法子类型表格数据
+      subTypeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        type: null,
+        name: null,
+        url: null,
+        runType: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询算法子类型列表 */
+    getList() {
+      this.loading = true;
+      listSubType(this.queryParams).then(response => {
+        this.subTypeList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        type: null,
+        name: null,
+        url: null,
+        runType: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加算法子类型";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getSubType(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改算法子类型";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateSubType(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSubType(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除算法子类型编号为"' + ids + '"的数据项?').then(function() {
+        return delSubType(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('conf/subType/export', {
+        ...this.queryParams
+      }, `subType_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 5 - 3
sql/pdaaphm.sql

@@ -716,6 +716,7 @@ CREATE TABLE t_algorithm_sub_type (
 	type VARCHAR ( 10 ) DEFAULT '' COMMENT '类型',
 	`name` VARCHAR ( 200 ) DEFAULT '' COMMENT '算法子名称',
 	url VARCHAR ( 255 ) DEFAULT '' COMMENT '算法url',
+	run_type VARCHAR ( 255 ) DEFAULT '' COMMENT '运行类型',
 	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
 	create_time datetime COMMENT '创建时间',
 	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
@@ -729,6 +730,7 @@ IF
 	EXISTS t_algorithm_io_field;
 CREATE TABLE t_algorithm_io_field (
 	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
+    algorithm_sub_id BIGINT ( 20 ) NOT NULL COMMENT '算法子类型编号',
 	type VARCHAR ( 10 ) DEFAULT '' COMMENT '输入/输出',
 	`name` VARCHAR ( 200 ) DEFAULT '' COMMENT '名称',
 	`index` INT ( 10 ) DEFAULT 0 COMMENT '排序',
@@ -745,7 +747,7 @@ IF
 	EXISTS t_algorithm;
 CREATE TABLE t_algorithm (
 	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
-	type VARCHAR ( 10 ) DEFAULT '' COMMENT '算法类型',
+	`type` VARCHAR ( 10 ) DEFAULT '' COMMENT '算法类型',
 	sub_type_id BIGINT ( 20 ) NOT NULL COMMENT '子类型id',
 	`name` VARCHAR ( 200 ) DEFAULT '' COMMENT '名称',
 	start_time datetime COMMENT '开始时间',
@@ -766,11 +768,11 @@ CREATE TABLE t_sub_algorithm (
 	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
 	algorithm_id BIGINT ( 20 ) NOT NULL COMMENT '主表id',
 	field_id BIGINT ( 20 ) NOT NULL COMMENT '字段id',
-	upload_id BIGINT ( 20 ) NOT NULL COMMENT '文件id',
+	upload_id BIGINT ( 20 ) COMMENT '文件id',
 	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
 	create_time datetime COMMENT '创建时间',
 	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
 	update_time datetime COMMENT '更新时间',
 	remark VARCHAR ( 500 ) DEFAULT NULL COMMENT '备注',
 PRIMARY KEY ( id )
-) ENGINE = INNODB COMMENT = '算法子表';
+) ENGINE = INNODB COMMENT = '算法子表';