Ver Fonte

模型审核

ZhuDeKang há 4 meses atrás
pai
commit
f8cf921aed

+ 2 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -13,6 +13,8 @@ ruoyi:
   # 验证码类型 math 数字计算 char 字符验证
   captchaType: math
 
+  gateway: http://localhost:8080
+
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080

+ 104 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdAuditController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.interfaces.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.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.interfaces.domain.MdAudit;
+import com.ruoyi.interfaces.service.IMdAuditService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 审核记录Controller
+ * 
+ * @author 朱得糠
+ * @date 2025-09-23
+ */
+@RestController
+@RequestMapping("/interfaces/audit")
+public class MdAuditController extends BaseController
+{
+    @Autowired
+    private IMdAuditService mdAuditService;
+
+    /**
+     * 查询审核记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(MdAudit mdAudit)
+    {
+        startPage();
+        List<MdAudit> list = mdAuditService.selectMdAuditList(mdAudit);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出审核记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:export')")
+    @Log(title = "审核记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, MdAudit mdAudit)
+    {
+        List<MdAudit> list = mdAuditService.selectMdAuditList(mdAudit);
+        ExcelUtil<MdAudit> util = new ExcelUtil<MdAudit>(MdAudit.class);
+        util.exportExcel(response, list, "审核记录数据");
+    }
+
+    /**
+     * 获取审核记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:query')")
+    @GetMapping(value = "/{auditId}")
+    public AjaxResult getInfo(@PathVariable("auditId") Long auditId)
+    {
+        return success(mdAuditService.selectMdAuditByAuditId(auditId));
+    }
+
+    /**
+     * 新增审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:add')")
+    @Log(title = "审核记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MdAudit mdAudit)
+    {
+        return toAjax(mdAuditService.insertMdAudit(mdAudit));
+    }
+
+    /**
+     * 修改审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:edit')")
+    @Log(title = "审核记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MdAudit mdAudit)
+    {
+        return toAjax(mdAuditService.updateMdAudit(mdAudit));
+    }
+
+    /**
+     * 删除审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('interfaces:audit:remove')")
+    @Log(title = "审核记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{auditIds}")
+    public AjaxResult remove(@PathVariable Long[] auditIds)
+    {
+        return toAjax(mdAuditService.deleteMdAuditByAuditIds(auditIds));
+    }
+}

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

@@ -191,6 +191,7 @@ public class PtServiceController extends BaseController {
         PtServiceRunLog ptServiceLog = new PtServiceRunLog(ptService);
         Date nowDate = DateUtils.getNowDate();
         ptServiceLog.setRunTm(nowDate);
+        ptServiceLog.setCreateBy(getUsername());
         String s = "";
         try {
 

+ 82 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdAudit.java

@@ -0,0 +1,82 @@
+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_audit
+ * 
+ * @author 朱得糠
+ * @date 2025-09-23
+ */
+public class MdAudit extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long auditId;
+
+    /** 项目id */
+    @Excel(name = "项目id")
+    private String proId;
+
+    /** 所属项目(md=模型;srv=服务) */
+    @Excel(name = "所属项目", readConverterExp = "m=d=模型;srv=服务")
+    private String proType;
+
+    /** 审核状态 1=未发起 ;2=允许发起 ; 3=已测试; 4=审核通过; 0=驳回 */
+    @Excel(name = "审核状态 1=未发起 ;2=允许发起 ; 3=已测试; 4=审核通过; 0=驳回")
+    private String state;
+
+    public void setAuditId(Long auditId) 
+    {
+        this.auditId = auditId;
+    }
+
+    public Long getAuditId() 
+    {
+        return auditId;
+    }
+    public void setProId(String proId) 
+    {
+        this.proId = proId;
+    }
+
+    public String getProId() 
+    {
+        return proId;
+    }
+    public void setProType(String proType) 
+    {
+        this.proType = proType;
+    }
+
+    public String getProType() 
+    {
+        return proType;
+    }
+    public void setState(String state) 
+    {
+        this.state = state;
+    }
+
+    public String getState() 
+    {
+        return state;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("auditId", getAuditId())
+            .append("proId", getProId())
+            .append("proType", getProType())
+            .append("state", getState())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 1 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/PtServiceRunLogVo.java

@@ -19,6 +19,7 @@ public class PtServiceRunLogVo extends PtServiceRunLog {
         setRunTm(serviceRunLog.getRunTm());
         setExecTm(serviceRunLog.getExecTm());
         setReturnData(serviceRunLog.getReturnData());
+        setCreateBy(serviceRunLog.getCreateBy());
         this.paramList = JsonUtils.jsonToPojo(serviceRunLog.getSenParam(), Object.class);
     }
 

+ 61 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdAuditMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.interfaces.mapper;
+
+import java.util.List;
+import com.ruoyi.interfaces.domain.MdAudit;
+
+/**
+ * 审核记录Mapper接口
+ * 
+ * @author 朱得糠
+ * @date 2025-09-23
+ */
+public interface MdAuditMapper 
+{
+    /**
+     * 查询审核记录
+     * 
+     * @param auditId 审核记录主键
+     * @return 审核记录
+     */
+    public MdAudit selectMdAuditByAuditId(Long auditId);
+
+    /**
+     * 查询审核记录列表
+     * 
+     * @param mdAudit 审核记录
+     * @return 审核记录集合
+     */
+    public List<MdAudit> selectMdAuditList(MdAudit mdAudit);
+
+    /**
+     * 新增审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    public int insertMdAudit(MdAudit mdAudit);
+
+    /**
+     * 修改审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    public int updateMdAudit(MdAudit mdAudit);
+
+    /**
+     * 删除审核记录
+     * 
+     * @param auditId 审核记录主键
+     * @return 结果
+     */
+    public int deleteMdAuditByAuditId(Long auditId);
+
+    /**
+     * 批量删除审核记录
+     * 
+     * @param auditIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteMdAuditByAuditIds(Long[] auditIds);
+}

+ 61 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdAuditService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.interfaces.service;
+
+import java.util.List;
+import com.ruoyi.interfaces.domain.MdAudit;
+
+/**
+ * 审核记录Service接口
+ * 
+ * @author 朱得糠
+ * @date 2025-09-23
+ */
+public interface IMdAuditService 
+{
+    /**
+     * 查询审核记录
+     * 
+     * @param auditId 审核记录主键
+     * @return 审核记录
+     */
+    public MdAudit selectMdAuditByAuditId(Long auditId);
+
+    /**
+     * 查询审核记录列表
+     * 
+     * @param mdAudit 审核记录
+     * @return 审核记录集合
+     */
+    public List<MdAudit> selectMdAuditList(MdAudit mdAudit);
+
+    /**
+     * 新增审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    public int insertMdAudit(MdAudit mdAudit);
+
+    /**
+     * 修改审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    public int updateMdAudit(MdAudit mdAudit);
+
+    /**
+     * 批量删除审核记录
+     * 
+     * @param auditIds 需要删除的审核记录主键集合
+     * @return 结果
+     */
+    public int deleteMdAuditByAuditIds(Long[] auditIds);
+
+    /**
+     * 删除审核记录信息
+     * 
+     * @param auditId 审核记录主键
+     * @return 结果
+     */
+    public int deleteMdAuditByAuditId(Long auditId);
+}

+ 95 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdAuditServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.interfaces.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.interfaces.mapper.MdAuditMapper;
+import com.ruoyi.interfaces.domain.MdAudit;
+import com.ruoyi.interfaces.service.IMdAuditService;
+
+/**
+ * 审核记录Service业务层处理
+ * 
+ * @author 朱得糠
+ * @date 2025-09-23
+ */
+@Service
+public class MdAuditServiceImpl implements IMdAuditService 
+{
+    @Autowired
+    private MdAuditMapper mdAuditMapper;
+
+    /**
+     * 查询审核记录
+     * 
+     * @param auditId 审核记录主键
+     * @return 审核记录
+     */
+    @Override
+    public MdAudit selectMdAuditByAuditId(Long auditId)
+    {
+        return mdAuditMapper.selectMdAuditByAuditId(auditId);
+    }
+
+    /**
+     * 查询审核记录列表
+     * 
+     * @param mdAudit 审核记录
+     * @return 审核记录
+     */
+    @Override
+    public List<MdAudit> selectMdAuditList(MdAudit mdAudit)
+    {
+        return mdAuditMapper.selectMdAuditList(mdAudit);
+    }
+
+    /**
+     * 新增审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    @Override
+    public int insertMdAudit(MdAudit mdAudit)
+    {
+        mdAudit.setCreateTime(DateUtils.getNowDate());
+        return mdAuditMapper.insertMdAudit(mdAudit);
+    }
+
+    /**
+     * 修改审核记录
+     * 
+     * @param mdAudit 审核记录
+     * @return 结果
+     */
+    @Override
+    public int updateMdAudit(MdAudit mdAudit)
+    {
+        return mdAuditMapper.updateMdAudit(mdAudit);
+    }
+
+    /**
+     * 批量删除审核记录
+     * 
+     * @param auditIds 需要删除的审核记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdAuditByAuditIds(Long[] auditIds)
+    {
+        return mdAuditMapper.deleteMdAuditByAuditIds(auditIds);
+    }
+
+    /**
+     * 删除审核记录信息
+     * 
+     * @param auditId 审核记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdAuditByAuditId(Long auditId)
+    {
+        return mdAuditMapper.deleteMdAuditByAuditId(auditId);
+    }
+}

+ 81 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdAuditMapper.xml

@@ -0,0 +1,81 @@
+<?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.MdAuditMapper">
+
+    <resultMap type="com.ruoyi.interfaces.domain.MdAudit" id="MdAuditResult">
+        <result property="auditId"    column="audit_id"    />
+        <result property="proId"    column="pro_id"    />
+        <result property="proType"    column="pro_type"    />
+        <result property="state"    column="state"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectMdAuditVo">
+        select audit_id, pro_id, pro_type, state, create_by, create_time, remark from md_audit
+    </sql>
+
+    <select id="selectMdAuditList" parameterType="com.ruoyi.interfaces.domain.MdAudit" resultMap="MdAuditResult">
+        <include refid="selectMdAuditVo"/>
+        <where>
+            <if test="proId != null  and proId != ''"> and pro_id = #{proId}</if>
+            <if test="proType != null  and proType != ''"> and pro_type = #{proType}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+            <if test="createBy != null  and createBy != ''"> and create_by = #{createBy}</if>
+            <if test="createTime != null "> and create_time = #{createTime}</if>
+            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
+        </where>
+    </select>
+
+    <select id="selectMdAuditByAuditId" parameterType="Long" resultMap="MdAuditResult">
+        <include refid="selectMdAuditVo"/>
+        where audit_id = #{auditId}
+    </select>
+
+    <insert id="insertMdAudit" parameterType="com.ruoyi.interfaces.domain.MdAudit" useGeneratedKeys="true" keyProperty="auditId">
+        insert into md_audit
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="proId != null">pro_id,</if>
+            <if test="proType != null">pro_type,</if>
+            <if test="state != null">state,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="proId != null">#{proId},</if>
+            <if test="proType != null">#{proType},</if>
+            <if test="state != null">#{state},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateMdAudit" parameterType="com.ruoyi.interfaces.domain.MdAudit">
+        update md_audit
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="proId != null">pro_id = #{proId},</if>
+            <if test="proType != null">pro_type = #{proType},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where audit_id = #{auditId}
+    </update>
+
+    <delete id="deleteMdAuditByAuditId" parameterType="Long">
+        delete from md_audit where audit_id = #{auditId}
+    </delete>
+
+    <delete id="deleteMdAuditByAuditIds" parameterType="String">
+        delete from md_audit where audit_id in
+        <foreach item="auditId" collection="array" open="(" separator="," close=")">
+            #{auditId}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 1
ruoyi-api-patform/src/main/resources/mapper/interfaces/PtServiceRunLogMapper.xml

@@ -12,10 +12,11 @@
         <result property="senParam"    column="sen_param"    />
         <result property="returnData"    column="return_data"    />
         <result property="execTm"    column="exec_tm"    />
+        <result property="createBy"    column="create_by"    />
     </resultMap>
 
     <sql id="selectPtServiceRunLogVo">
-        select log_id, ser_id, md_id, run_tm, sen_param, return_data, exec_tm from pt_service_run_log
+        select log_id, ser_id, md_id, run_tm, sen_param, return_data, exec_tm,create_by from pt_service_run_log
     </sql>
 
     <select id="selectPtServiceRunLogList" parameterType="com.ruoyi.interfaces.domain.PtServiceRunLog" resultMap="PtServiceRunLogResult">
@@ -46,6 +47,7 @@
             <if test="senParam != null">sen_param,</if>
             <if test="returnData != null">return_data,</if>
             <if test="execTm != null">exec_tm,</if>
+            <if test="createBy != null">create_by,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="serId != null and serId != ''">#{serId},</if>
@@ -54,6 +56,7 @@
             <if test="senParam != null">#{senParam},</if>
             <if test="returnData != null">#{returnData},</if>
             <if test="execTm != null">#{execTm},</if>
+            <if test="createBy != null">#{createBy},</if>
         </trim>
     </insert>
 
@@ -66,6 +69,7 @@
             <if test="senParam != null">sen_param = #{senParam},</if>
             <if test="returnData != null">return_data = #{returnData},</if>
             <if test="execTm != null">exec_tm = #{execTm},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
         </trim>
         where log_id = #{logId}
     </update>