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

模型、服务、审核发布

ZhuDeKang 2 сар өмнө
parent
commit
a344ef0a4d

+ 1 - 1
ruoyi-admin/src/test/java/com/ruoyi/JasyptTest.java

@@ -83,7 +83,7 @@ public class JasyptTest {
 
         });*/
 
-        String encrypt = sm4Util.encrypt("13472574285");
+        String encrypt = sm4Util.decrypt("oMd930VR5zYn5ySU4ZJHPg==");
 
         System.out.println(encrypt);
 

+ 111 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdFileUoloadController.java

@@ -0,0 +1,111 @@
+package com.ruoyi.interfaces.controller;
+
+import java.util.List;
+
+import com.ruoyi.interfaces.domain.MdFileUoload;
+import com.ruoyi.interfaces.service.IMdFileUoloadService;
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 模型文件上传Controller
+ * 
+ * @author ruoyi
+ * @date 2025-11-01
+ */
+@RestController
+@RequestMapping("/md/file")
+public class MdFileUoloadController extends BaseController
+{
+    @Autowired
+    private IMdFileUoloadService mdFileUoloadService;
+
+    /**
+     * 查询模型文件上传列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(MdFileUoload mdFileUoload)
+    {
+        startPage();
+        List<MdFileUoload> list = mdFileUoloadService.selectMdFileUoloadList(mdFileUoload);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出模型文件上传列表
+     */
+    @Log(title = "模型文件上传", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(MdFileUoload mdFileUoload)
+    {
+        List<MdFileUoload> list = mdFileUoloadService.selectMdFileUoloadList(mdFileUoload);
+        ExcelUtil<MdFileUoload> util = new ExcelUtil<MdFileUoload>(MdFileUoload.class);
+        return util.exportExcel(list, "模型文件上传数据");
+    }
+
+    /**
+     * 获取模型文件上传详细信息
+     */
+    @GetMapping(value = "/{fileId}")
+    public AjaxResult getInfo(@PathVariable("fileId") Integer fileId)
+    {
+        return AjaxResult.success(mdFileUoloadService.selectMdFileUoloadByFileId(fileId));
+    }
+
+    /**
+     * 新增模型文件上传
+     */
+    @Log(title = "模型文件上传", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MdFileUoload mdFileUoload)
+    {
+        mdFileUoload.setCreateBy(getUsername());
+        return toAjax(mdFileUoloadService.insertMdFileUoload(mdFileUoload));
+    }
+
+    /**
+     * 修改模型文件上传
+     */
+    @Log(title = "模型文件上传", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MdFileUoload mdFileUoload)
+    {
+        return toAjax(mdFileUoloadService.updateMdFileUoload(mdFileUoload));
+    }
+
+    /**
+     * 删除模型文件上传
+     */
+    @Log(title = "模型文件上传", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{fileIds}")
+    public AjaxResult remove(@PathVariable Integer[] fileIds)
+    {
+        return toAjax(mdFileUoloadService.deleteMdFileUoloadByFileIds(fileIds));
+    }
+
+    /**
+     *
+     * @return
+     */
+    @PostMapping("/start")
+    public AjaxResult start(@RequestBody MdFileUoload mdFileUoload){
+        mdFileUoload.setUpdateBy(getUsername());
+
+
+        return toAjax(mdFileUoloadService.start(mdFileUoload));
+    }
+
+}

+ 3 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdModelInfoController.java

@@ -182,6 +182,9 @@ public class MdModelInfoController extends BaseController {
         int i = mdAuditService.insertMdAudit(audit);
         modelInfo.setPublishBy(getUsername());
         modelInfo.setPublishTime(DateUtils.getNowDate());
+        if (modelInfo.getPublish().equals("5")){ // 5 = 更新操作,但是模型状态还需要是 已发布
+            modelInfo.setPublish("1");
+        }
         return success(mdModelInfoService.publish(modelInfo));
     }
 

+ 1 - 1
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceController.java

@@ -79,7 +79,7 @@ public class PtServiceController extends BaseController {
             mdModelInfo.setAudit("3");
             mdModelInfoService.audit(mdModelInfo);
         }
-        if ("1".equals(mdModelInfo.getPublish())){ //模型以审核通过
+        if ("1".equals(mdModelInfo.getPublish())){ //模型以更新通过
             mdModelInfo.setPublish("3");
             mdModelInfoService.publish(mdModelInfo);
         }

+ 5 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdCatalog.java

@@ -26,6 +26,11 @@ public class MdCatalog extends BaseEntity {
      * 祖级列表
      */
     private String ancestors;
+
+    /**
+     * 标签
+     */
+    private String label;
     /**
      * 目录说明
      */

+ 91 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdFileUoload.java

@@ -0,0 +1,91 @@
+package com.ruoyi.interfaces.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 模型文件上传对象 md_file_uoload
+ * 
+ * @author ruoyi
+ * @date 2025-11-01
+ */
+public class MdFileUoload extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    private Integer fileId;
+    /** 模型id */
+    private String mdid;
+
+    /** 模型文件版本 */
+    private String fileVersion;
+
+    /** 模型文件path地址 */
+    @Excel(name = "模型文件path地址")
+    private String filePath;
+
+    /**
+     * 启用状态 0=未启用;1=启用
+     */
+    private String state;
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public Integer getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(Integer fileId) {
+        this.fileId = fileId;
+    }
+
+    public void setMdid(String mdid)
+    {
+        this.mdid = mdid;
+    }
+
+    public String getMdid() 
+    {
+        return mdid;
+    }
+    public void setFileVersion(String fileVersion) 
+    {
+        this.fileVersion = fileVersion;
+    }
+
+    public String getFileVersion() 
+    {
+        return fileVersion;
+    }
+    public void setFilePath(String filePath) 
+    {
+        this.filePath = filePath;
+    }
+
+    public String getFilePath() 
+    {
+        return filePath;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("mdid", getMdid())
+            .append("fileVersion", getFileVersion())
+            .append("remark", getRemark())
+            .append("filePath", getFilePath())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 15 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdModelInfo.java

@@ -377,12 +377,27 @@ public class MdModelInfo extends BaseEntity {
     private String auditRemark;
 
     /**
+     * 0=未发布;1=已发布 ; 2=下线 ;3=待更新;5=更新
+     *
      * 发布操作
      */
     private String publish;
     private String publishBy;
     private Date publishTime;
 
+    /**
+     * 模型使用状态 0 = 未启用 ; 1= 已启用
+     */
+    private Integer mdFileId;
+
+    public Integer getMdFileId() {
+        return mdFileId;
+    }
+
+    public void setMdFileId(Integer mdFileId) {
+        this.mdFileId = mdFileId;
+    }
+
     public String getPublish() {
         return publish;
     }

+ 80 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdFileUoloadMapper.java

@@ -0,0 +1,80 @@
+package com.ruoyi.interfaces.mapper;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.interfaces.domain.MdFileUoload;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 模型文件上传Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-11-01
+ */
+@Mapper
+@DataSource(DataSourceType.SLAVE)
+public interface MdFileUoloadMapper 
+{
+    /**
+     * 查询模型文件上传
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 模型文件上传
+     */
+    public MdFileUoload selectMdFileUoloadByFileId(Integer mdid);
+
+    /**
+     * 查询模型文件上传列表
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 模型文件上传集合
+     */
+    public List<MdFileUoload> selectMdFileUoloadList(MdFileUoload mdFileUoload);
+
+    /**
+     * 新增模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    public int insertMdFileUoload(MdFileUoload mdFileUoload);
+
+    /**
+     * 修改模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    public int updateMdFileUoload(MdFileUoload mdFileUoload);
+
+    /**
+     * 删除模型文件上传
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 结果
+     */
+    public int deleteMdFileUoloadByMdid(String mdid);
+
+    /**
+     * 批量删除模型文件上传
+     * 
+     * @param mdids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteMdFileUoloadByMdids(Integer[] mdids);
+
+    /**
+     * 启动模型文件
+     * @param mdFileUoload
+     */
+    int startMdFileUoload(MdFileUoload mdFileUoload);
+
+    /**
+     * 关闭模型指定id以外的其他模型文件
+     * @param mdFileUoload
+     * @return
+     */
+    int shutMdFileUoload(MdFileUoload mdFileUoload);
+}

+ 1 - 1
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdModelInfoMapper.java

@@ -18,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
 public interface MdModelInfoMapper 
 {
     /**
-     * 查询模型信息
+     * 查询已启动模型信息
      * 
      * @param mdid 模型信息主键
      * @return 模型信息

+ 64 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdFileUoloadService.java

@@ -0,0 +1,64 @@
+package com.ruoyi.interfaces.service;
+
+import com.ruoyi.interfaces.domain.MdFileUoload;
+
+import java.util.List;
+
+/**
+ * 模型文件上传Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-11-01
+ */
+public interface IMdFileUoloadService 
+{
+    /**
+     * 查询模型文件上传
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 模型文件上传
+     */
+    public MdFileUoload selectMdFileUoloadByFileId(Integer mdid);
+
+    /**
+     * 查询模型文件上传列表
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 模型文件上传集合
+     */
+    public List<MdFileUoload> selectMdFileUoloadList(MdFileUoload mdFileUoload);
+
+    /**
+     * 新增模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    public int insertMdFileUoload(MdFileUoload mdFileUoload);
+
+    /**
+     * 修改模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    public int updateMdFileUoload(MdFileUoload mdFileUoload);
+
+    /**
+     * 批量删除模型文件上传
+     * 
+     * @param fileIds 需要删除的模型文件上传主键集合
+     * @return 结果
+     */
+    public int deleteMdFileUoloadByFileIds(Integer[] fileIds);
+
+    /**
+     * 删除模型文件上传信息
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 结果
+     */
+    public int deleteMdFileUoloadByMdid(String mdid);
+
+    int start(MdFileUoload mdFileUoload);
+}

+ 129 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdFileUoloadServiceImpl.java

@@ -0,0 +1,129 @@
+package com.ruoyi.interfaces.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.interfaces.domain.MdFileUoload;
+import com.ruoyi.interfaces.domain.MdModelInfo;
+import com.ruoyi.interfaces.mapper.MdFileUoloadMapper;
+import com.ruoyi.interfaces.service.IMdFileUoloadService;
+import com.ruoyi.interfaces.service.IMdModelInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 模型文件上传Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-11-01
+ */
+@Service
+public class MdFileUoloadServiceImpl implements IMdFileUoloadService
+{
+    @Autowired
+    private MdFileUoloadMapper mdFileUoloadMapper;
+
+    /**
+     * 查询模型文件上传
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 模型文件上传
+     */
+    @Override
+    public MdFileUoload selectMdFileUoloadByFileId(Integer mdid)
+    {
+        return mdFileUoloadMapper.selectMdFileUoloadByFileId(mdid);
+    }
+
+    /**
+     * 查询模型文件上传列表
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 模型文件上传
+     */
+    @Override
+    public List<MdFileUoload> selectMdFileUoloadList(MdFileUoload mdFileUoload)
+    {
+        return mdFileUoloadMapper.selectMdFileUoloadList(mdFileUoload);
+    }
+
+    /**
+     * 新增模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    @Override
+    public int insertMdFileUoload(MdFileUoload mdFileUoload)
+    {
+        mdFileUoload.setCreateTime(DateUtils.getNowDate());
+        return mdFileUoloadMapper.insertMdFileUoload(mdFileUoload);
+    }
+
+    /**
+     * 修改模型文件上传
+     * 
+     * @param mdFileUoload 模型文件上传
+     * @return 结果
+     */
+    @Override
+    public int updateMdFileUoload(MdFileUoload mdFileUoload)
+    {
+        mdFileUoload.setUpdateTime(DateUtils.getNowDate());
+        return mdFileUoloadMapper.updateMdFileUoload(mdFileUoload);
+    }
+
+    /**
+     * 批量删除模型文件上传
+     * 
+     * @param fileIds 需要删除的模型文件上传主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdFileUoloadByFileIds(Integer[] fileIds)
+    {
+        return mdFileUoloadMapper.deleteMdFileUoloadByMdids(fileIds);
+    }
+
+    /**
+     * 删除模型文件上传信息
+     * 
+     * @param mdid 模型文件上传主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdFileUoloadByMdid(String mdid)
+    {
+        return mdFileUoloadMapper.deleteMdFileUoloadByMdid(mdid);
+    }
+
+    @Autowired
+    private IMdModelInfoService  mdModelInfoService;
+    @Override
+    public int start(MdFileUoload mdFileUoload)
+    {
+        MdModelInfo mdModelInfo = mdModelInfoService.selectMdModelInfoByMdid(mdFileUoload.getMdid());
+        if (mdModelInfo == null) {
+            throw  new ServiceException("模型不存在");
+        }
+
+        mdFileUoloadMapper.startMdFileUoload(mdFileUoload);
+        mdFileUoloadMapper.shutMdFileUoload(mdFileUoload);
+
+        if ("1".equals(mdModelInfo.getAudit())){ //模型以审核通过
+            mdModelInfo.setAudit("3");
+            mdModelInfoService.audit(mdModelInfo);
+        }
+        if ("1".equals(mdModelInfo.getPublish())){ //模型以更新通过
+            mdModelInfo.setPublish("3");  //4 = 代更新状态
+            mdModelInfoService.publish(mdModelInfo);
+        }
+
+        mdModelInfo.setMdFileId(mdFileUoload.getFileId());
+        mdModelInfo.setUpdateBy(mdModelInfo.getUpdateBy());
+        mdModelInfo.setUpdateTime(DateUtils.getNowDate());
+        mdModelInfo.setVersion(mdFileUoload.getFileVersion());
+        return mdModelInfoService.updateMdModelInfo(mdModelInfo);
+    }
+}

+ 18 - 12
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdCatalogMapper.xml

@@ -11,6 +11,7 @@
                                ancestors,
                                remark,
                                sort,
+                               label,
                                status,
                                create_by,
                                create_time,
@@ -21,6 +22,7 @@
                , #{ancestors,jdbcType=VARCHAR}
                , #{remark,jdbcType=VARCHAR}
                , #{sort,jdbcType=INTEGER}
+               , #{label,jdbcType=VARCHAR}
                , #{status,jdbcType=VARCHAR}
                , #{createBy,jdbcType=VARCHAR}
                , sysdate
@@ -58,6 +60,9 @@
             <if test="sort != null ">
                 sort = #{sort},
             </if>
+            <if test="label != null ">
+                label = #{label},
+            </if>
             <if test="status != null">
                 status = #{status},
             </if>
@@ -70,7 +75,7 @@
             <if test="updateBy != null">
                 update_by = #{updateBy},
             </if>
-                update_time = sysdate
+            update_time = sysdate
         </set>
         where catalog_id = #{catalogId}
     </update>
@@ -86,16 +91,17 @@
     </delete>
     <select id="selectCatalogById" resultType="com.ruoyi.interfaces.domain.MdCatalog">
         select catalog_id,
-               catalog_name,
-               parent_id,
-               ancestors,
-               remark,
-               sort,
-               status,
-               create_by,
-               create_time,
-               update_by,
-               update_time
+        catalog_name,
+        parent_id,
+        ancestors,
+        remark,
+        sort,
+        label,
+        status,
+        create_by,
+        create_time,
+        update_by,
+        update_time
         from md_catalog
         <where>
             catalog_id = #{catalogId}
@@ -113,7 +119,7 @@
     </select>
     <select id="selectCatalogList" resultType="com.ruoyi.interfaces.domain.MdCatalog">
         select
-        catalog_id,catalog_name,parent_id,ancestors,remark,sort,status,create_by,create_time,update_by,update_time
+        catalog_id,catalog_name,parent_id,ancestors,remark,sort,label,status,create_by,create_time,update_by,update_time
         from md_catalog
         <where>
             <if test="catalogId != null">

+ 99 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdFileUoloadMapper.xml

@@ -0,0 +1,99 @@
+<?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.ruoyi.interfaces.mapper.MdFileUoloadMapper">
+
+    <resultMap type="com.ruoyi.interfaces.domain.MdFileUoload" id="MdFileUoloadResult">
+        <result property="mdid"    column="mdid"    />
+        <result property="fileVersion"    column="file_version"    />
+        <result property="state"    column="state"    />
+        <result property="remark"    column="remark"    />
+        <result property="filePath"    column="file_path"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectMdFileUoloadVo">
+        select file_Id, mdid, file_version,state, remark, file_path, create_by, create_time, update_by, update_time from md_file_uoload
+    </sql>
+
+    <select id="selectMdFileUoloadList" parameterType="com.ruoyi.interfaces.domain.MdFileUoload" resultMap="MdFileUoloadResult">
+        <include refid="selectMdFileUoloadVo"/>
+        <where>
+            <if test="mdid != null  and mdid != ''">and mdid = #{mdid}</if>
+            <if test="state != null  and state != ''">and state = #{state}</if>
+            <if test="filePath != null  and filePath != ''">and file_path = #{filePath}</if>
+        </where>
+        order by create_by desc
+    </select>
+
+    <select id="selectMdFileUoloadByFileId" parameterType="String" resultMap="MdFileUoloadResult">
+        <include refid="selectMdFileUoloadVo"/>
+        where file_Id = #{fileId}
+    </select>
+
+    <insert id="insertMdFileUoload" parameterType="com.ruoyi.interfaces.domain.MdFileUoload" useGeneratedKeys="true" keyProperty="mdid">
+        insert into md_file_uoload
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="mdid != null">mdid,</if>
+            <if test="fileVersion != null">file_version,</if>
+            <if test="state != null">state,</if>
+            <if test="remark != null">remark,</if>
+            <if test="filePath != null">file_path,</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>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="mdid != null">#{mdid},</if>
+            <if test="fileVersion != null">#{fileVersion},</if>
+            <if test="state != null">#{state},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="filePath != null">#{filePath},</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>
+        </trim>
+    </insert>
+
+    <update id="updateMdFileUoload" parameterType="com.ruoyi.interfaces.domain.MdFileUoload">
+        update md_file_uoload
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="mdid != null">mdid = #{mdid},</if>
+            <if test="fileVersion != null">file_version = #{fileVersion},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="filePath != null">file_path = #{filePath},</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>
+        </trim>
+        where file_Id = #{fileId}
+    </update>
+    <update id="startMdFileUoload">
+        update md_file_uoload set state = '1'
+        where file_Id = #{fileId}
+    </update>
+    <update id="shutMdFileUoload">
+        update md_file_uoload
+        set state = '0'
+        where file_Id != #{fileId}
+          and mdid = #{mdid}
+    </update>
+
+    <delete id="deleteMdFileUoloadByMdid" parameterType="String">
+        delete from md_file_uoload where file_id = #{fileId}
+    </delete>
+
+    <delete id="deleteMdFileUoloadByMdids" >
+        delete from md_file_uoload where file_id in
+        <foreach item="fileId" collection="array" open="(" separator="," close=")">
+            #{fileId}
+        </foreach>
+    </delete>
+</mapper>

+ 4 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdModelInfoMapper.xml

@@ -72,6 +72,7 @@
         <result property="publish" column="PUBLISH"/>
         <result property="publishBy" column="PUBLISH_BY"/>
         <result property="publishTime" column="PUBLISH_TIME"/>
+        <result property="mdFileId" column="md_File_Id"/>
     </resultMap>
 
     <sql id="selectMdModelInfoVo">
@@ -142,6 +143,7 @@
                PUBLISH,
                PUBLISH_BY,
                PUBLISH_TIME
+                   ,md_File_Id
         from md_model_info
     </sql>
 
@@ -221,6 +223,7 @@
                 and "AUDIT" is not null
                 and "AUDIT" not in ('0','2')
             </if>
+
         </where>
         order by SORT
     </select>
@@ -440,6 +443,7 @@
             MODIFYBY = #{modifyby,jdbcType=TIMESTAMP},
             REG_USER = #{regUser,jdbcType=VARCHAR},
             SORT = #{sort,jdbcType=INTEGER},
+            md_file_id = #{mdFileId,jdbcType=VARCHAR},
         </trim>
         where MDID = #{mdid}
     </update>

+ 5 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/SM4Util.java

@@ -86,7 +86,8 @@ public class SM4Util {
             byte[] encrypted = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8));
             return Base64.getEncoder().encodeToString(encrypted);
         } catch (Exception e) {
-            throw new RuntimeException("SM4加密失败", e);
+            return data;
+           // throw new RuntimeException("SM4加密失败", e);
         }
     }
 
@@ -108,7 +109,8 @@ public class SM4Util {
         } catch (Exception e) {
             System.out.println(encryptedData);
             System.out.println(ExceptionUtil.getRootErrorMessage(e));
-            throw new RuntimeException("SM4解密失败", e);
+            return encryptedData;
+            //throw new RuntimeException("SM4解密失败", e);
         }
     }
 
@@ -125,6 +127,7 @@ public class SM4Util {
             cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
             return cipher.doFinal(data);
         } catch (Exception e) {
+
             throw new RuntimeException("SM4加密失败", e);
         }
     }