Jelajahi Sumber

算法库编号修改

zhaoyan 3 tahun lalu
induk
melakukan
a7d2fc45ff

+ 3 - 0
api-common/src/main/java/api/common/pojo/param/algorithm/AlgorithmParameter.java

@@ -13,6 +13,9 @@ public class AlgorithmParameter extends PageParameter {
     //算法名称
     private String algorithmName;
 
+    //算法名称
+    private String algorithmCode;
+
     //算法描述
     private String description;
 

+ 3 - 0
api-common/src/main/java/api/common/pojo/po/algorithm/AlgorithmPO.java

@@ -13,6 +13,9 @@ public class AlgorithmPO extends BasePo {
     //算法名称
     private String algorithmName;
 
+    //算法编号
+    private String algorithmCode;
+
     //算法描述
     private String description;
 

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/algorithm/AlgorithmVO.java

@@ -13,6 +13,9 @@ public class AlgorithmVO {
     //算法ID
     private String id;
 
+    //算法名称
+    private String algorithmCode;
+
     //算法名称
     private String algorithmName;
 

+ 4 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java

@@ -5,7 +5,6 @@ import api.common.pojo.param.system.DictParam;
 import api.common.pojo.po.algorithm.AlgorithmPO;
 import api.common.pojo.constants.DictConstants;
 import api.common.util.StringUtil;
-import api.common.util.FileUtil;
 import api.common.pojo.vo.algorithm.AlgorithmVO;
 import api.common.pojo.vo.algorithm.RunningProjectVO;
 import api.common.util.TimeUtil;
@@ -18,7 +17,6 @@ import com.css.simulation.resource.system.service.DictService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -48,6 +46,8 @@ public class AlgorithmServiceImpl implements AlgorithmService {
                 //添加
                 String algorithmId = StringUtil.getRandomUUID();
                 param.setId(algorithmId);
+                String algorithmCode = StringUtil.getRandomCode();
+                param.setAlgorithmCode(algorithmCode);
                 AlgorithmPO po = setPo(param, false);
                 int add = algorithmMapper.add(po);
                 if(add > 0){
@@ -196,6 +196,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
             po.setMinioPath(param.getMinioPath());
             po.setFileName(fileName);
         }
+        po.setAlgorithmCode(param.getAlgorithmCode());
         po.setAlgorithmName(param.getAlgorithmName());
         po.setDescription(param.getDescription());
         po.setUploadMode(param.getUploadMode());
@@ -209,6 +210,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         }else {
             po.setIsDeleted("0");
             po.setCreateTime(TimeUtil.getNowForMysql());
+            po.setModifyTime(TimeUtil.getNowForMysql());
             po.setCreateUserId(AuthUtil.getCurrentUserId());
             po.setModifyTime(TimeUtil.getNowForMysql());
         }

+ 9 - 7
simulation-resource-server/src/main/resources/mapper/algorithm/AlgorithmMapper.xml

@@ -52,12 +52,12 @@
 
     <!--查询算法列表—私有-->
     <select id="selectAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
-        select id, algorithm_name, description, validation_status, upload_mode from algorithm
+        select id, algorithm_code, algorithm_name, description, validation_status, upload_mode from algorithm
         <where>
             is_deleted = '0' and share = '0'
         </where>
-        <if test="id != null and id != ''">
-            and id like CONCAT('%',#{id,jdbcType=VARCHAR},'%')
+        <if test="algorithmCode != null and algorithmCode != ''">
+            and algorithm_code like CONCAT('%',#{algorithmCode,jdbcType=VARCHAR},'%')
         </if>
         <if test="algorithmName != null and algorithmName != ''">
             and algorithm_name like CONCAT('%',#{algorithmName,jdbcType=VARCHAR},'%')
@@ -99,17 +99,20 @@
         <if test="id != null and id != ''">
             and id != #{id,jdbcType=VARCHAR}
         </if>
+        <if test="share != null and share != ''">
+            and share = #{share,jdbcType=VARCHAR}
+        </if>
     </select>
 
 
     <!--查询算法列表—公有-->
     <select id="selectSharedAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
-        select id, algorithm_name, description, validation_status, upload_mode from algorithm
+        select id, algorithm_code, algorithm_name, description, validation_status, upload_mode from algorithm
         <where>
             is_deleted = '0'
         </where>
-        <if test="id != null and id != ''">
-            and id like CONCAT('%',#{id,jdbcType=VARCHAR},'%')
+        <if test="algorithmCode != null and algorithmCode != ''">
+            and algorithm_code like CONCAT('%',#{algorithmCode,jdbcType=VARCHAR},'%')
         </if>
         <if test="algorithmName != null and algorithmName != ''">
             and algorithm_name like CONCAT('%',#{algorithmName,jdbcType=VARCHAR},'%')
@@ -152,7 +155,6 @@
         git_token=#{gitToken,jdbcType=VARCHAR},
         file_name=#{fileName,jdbcType=VARCHAR},
         minio_path=#{minioPath,jdbcType=VARCHAR},
-        linux_path=#{linuxPath,jdbcType=VARCHAR},
         modify_time=#{modifyTime,jdbcType=VARCHAR},
         modify_user_id=#{modifyUserId,jdbcType=VARCHAR}
         where id=#{id,jdbcType=VARCHAR}