Ver código fonte

模型评分

ZhuDeKang 3 meses atrás
pai
commit
f69a5b009b

+ 0 - 13
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdAppFlowController.java

@@ -46,19 +46,6 @@ public class MdAppFlowController extends BaseController
         return success(list);
     }
 
-    /**
-     * 导出模型应用流程列表
-     */
-    @Log(title = "模型应用流程", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, MdAppFlow mdAppFlow)
-    {
-        List<MdAppFlow> list = mdAppFlowService.selectMdAppFlowList(mdAppFlow);
-        ExcelUtil<MdAppFlow> util = new ExcelUtil<MdAppFlow>(MdAppFlow.class);
-        util.exportExcel(response, list, "模型应用流程数据");
-    }
-
-
 
     /**
      * 获取模型应用流程详细信息

+ 98 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdEstimateController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.interfaces.controller;
+
+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.MdEstimate;
+import com.ruoyi.interfaces.domain.MdModelInfo;
+import com.ruoyi.interfaces.domain.vo.MdEstimateMdVo;
+import com.ruoyi.interfaces.service.IMdEstimateService;
+import com.ruoyi.interfaces.service.IMdModelInfoService;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RestController
+@RequestMapping("/md/estimate")
+public class MdEstimateController extends BaseController {
+
+
+    @Autowired
+    private IMdEstimateService mdEstimateService;
+
+    @Autowired
+    private IMdModelInfoService mdModelInfoService;
+
+
+    /**
+     * 查询模型应用流程列表
+     */
+    @GetMapping("/list")
+    public AjaxResult list(MdEstimate mdEstimate)
+    {
+        List<MdEstimate> list = mdEstimateService.selectMdEstimateList(mdEstimate);
+        return success(list);
+    }
+
+    @GetMapping("/mdList")
+    public AjaxResult mdList(MdEstimate mdEstimate){
+        ArrayList<MdModelInfo> data = new ArrayList<>();
+        MdModelInfo mdModelInfo = new MdModelInfo();
+        List<MdModelInfo> mdModelInfos = mdModelInfoService.selectMdModelInfoList(mdModelInfo);
+        for (MdModelInfo modelInfo : mdModelInfos) {
+            MdEstimateMdVo mdEstimateMdVo = new MdEstimateMdVo();
+            mdEstimateMdVo.setMdid(modelInfo.getMdid());
+            mdEstimateMdVo.setName(modelInfo.getName());
+            MdEstimate par = new MdEstimate();
+            par.setMdid(modelInfo.getMdid());
+            mdEstimateMdVo.setEstimateList(mdEstimateService.selectMdEstimateList(par));
+            data.add(mdEstimateMdVo);
+        }
+        return success(data);
+    }
+
+
+
+    /**
+     * 获取模型应用流程详细信息
+     */
+    @GetMapping(value = "/{estimateId}")
+    public AjaxResult getInfo(@PathVariable("estimateId") Integer estimateId)
+    {
+        return success(mdEstimateService.selectMdEstimateByEstimateId(estimateId));
+    }
+
+    /**
+     * 新增模型应用流程
+     */
+    @Log(title = "模型应用流程", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MdEstimate mdEstimate)
+    {
+        return toAjax(mdEstimateService.insertMdEstimate(mdEstimate));
+    }
+
+    /**
+     * 修改模型应用流程
+     */
+    @Log(title = "模型应用流程", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MdEstimate mdEstimate)
+    {
+        return toAjax(mdEstimateService.updateMdEstimate(mdEstimate));
+    }
+
+    /**
+     * 删除模型应用流程
+     */
+    @Log(title = "模型应用流程", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{estimateIds}")
+    public AjaxResult remove(@PathVariable Long[] estimateIds)
+    {
+        return toAjax(mdEstimateService.deleteMdEstimateByEstimateIds(estimateIds));
+    }
+}

+ 87 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdEstimate.java

@@ -0,0 +1,87 @@
+package com.ruoyi.interfaces.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;
+
+import java.util.Date;
+
+public class MdEstimate extends BaseEntity {
+    /**
+     * 评价id,;
+     */
+    private Integer estimateId;
+    /**
+     * 模型id,;
+     */
+    private String mdid;
+    /**
+     * 评分;S,A,B,C,;
+     */
+    private String estimateScore;
+    /**
+     * 评价项目;比如响应数据,数据准确性,;
+     */
+    private String estimateType;
+    /**
+     * 评价生效开始日期,;
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date beginTime;
+    /**
+     * 评价生效结束日期,;
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    public Integer getEstimateId() {
+        return estimateId;
+    }
+
+    public void setEstimateId(Integer estimateId) {
+        this.estimateId = estimateId;
+    }
+
+    public String getMdid() {
+        return mdid;
+    }
+
+    public void setMdid(String mdid) {
+        this.mdid = mdid;
+    }
+
+    public String getEstimateScore() {
+        return estimateScore;
+    }
+
+    public void setEstimateScore(String estimateScore) {
+        this.estimateScore = estimateScore;
+    }
+
+    public String getEstimateType() {
+        return estimateType;
+    }
+
+    public void setEstimateType(String estimateType) {
+        this.estimateType = estimateType;
+    }
+
+    public Date getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Date beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public MdEstimate() {
+    }
+}

+ 28 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/MdEstimateMdVo.java

@@ -0,0 +1,28 @@
+package com.ruoyi.interfaces.domain.vo;
+
+import com.ruoyi.interfaces.domain.MdEstimate;
+import com.ruoyi.interfaces.domain.MdModelInfo;
+
+import java.util.List;
+
+public class MdEstimateMdVo extends MdModelInfo {
+    private List<MdEstimate> estimateList;
+
+    public List<MdEstimate> getEstimateList() {
+        return estimateList;
+    }
+
+    public void setEstimateList(List<MdEstimate> estimateList) {
+        this.estimateList = estimateList;
+    }
+
+    public MdEstimateMdVo() {
+
+    }
+    public MdEstimateMdVo(String mdid,String name) {
+        super();
+        setMdid(mdid);
+        setMdid(name);
+    }
+
+}

+ 67 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdEstimateMapper.java

@@ -0,0 +1,67 @@
+package com.ruoyi.interfaces.mapper;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.interfaces.domain.MdEstimate;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 模型评价Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-10-19
+ */
+@Mapper
+@DataSource(DataSourceType.SLAVE)
+public interface MdEstimateMapper
+{
+    /**
+     * 查询模型评价
+     *
+     * @param estimateId 模型评价主键
+     * @return 模型评价
+     */
+    public MdEstimate selectMdEstimateByEstimateId(Integer estimateId);
+
+    /**
+     * 查询模型评价列表
+     *
+     * @param mdEstimate 模型评价
+     * @return 模型评价集合
+     */
+    public List<MdEstimate> selectMdEstimateList(MdEstimate mdEstimate);
+
+    /**
+     * 新增模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    public int insertMdEstimate(MdEstimate mdEstimate);
+
+    /**
+     * 修改模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    public int updateMdEstimate(MdEstimate mdEstimate);
+
+    /**
+     * 删除模型评价
+     *
+     * @param estimateId 模型评价主键
+     * @return 结果
+     */
+    public int deleteMdEstimateByEstimateId(Long estimateId);
+
+    /**
+     * 批量删除模型评价
+     *
+     * @param estimateIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteMdEstimateByEstimateIds(Long[] estimateIds);
+}

+ 56 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdEstimateService.java

@@ -0,0 +1,56 @@
+package com.ruoyi.interfaces.service;
+
+import com.ruoyi.interfaces.domain.MdEstimate;
+
+import java.util.List;
+
+public interface IMdEstimateService {
+    /**
+     * 查询模型评价
+     *
+     * @param estimateId 模型评价主键
+     * @return 模型评价
+     */
+    public MdEstimate selectMdEstimateByEstimateId(Integer estimateId);
+
+
+    /**
+     * 查询模型评价列表
+     *
+     * @param mdEstimate 模型评价
+     * @return 模型评价集合
+     */
+    public List<MdEstimate> selectMdEstimateList(MdEstimate mdEstimate);
+
+    /**
+     * 新增模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    public int insertMdEstimate(MdEstimate mdEstimate);
+
+    /**
+     * 修改模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    public int updateMdEstimate(MdEstimate mdEstimate);
+
+    /**
+     * 批量删除模型评价
+     *
+     * @param estimateIds 需要删除的模型评价主键集合
+     * @return 结果
+     */
+    public int deleteMdEstimateByEstimateIds(Long[] estimateIds);
+
+    /**
+     * 删除模型评价信息
+     *
+     * @param estimateId 模型评价主键
+     * @return 结果
+     */
+    public int deleteMdEstimateByEstimateId(Long estimateId);
+}

+ 91 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdEstimateServiceImpl.java

@@ -0,0 +1,91 @@
+package com.ruoyi.interfaces.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.interfaces.domain.MdEstimate;
+import com.ruoyi.interfaces.mapper.MdEstimateMapper;
+import com.ruoyi.interfaces.service.IMdEstimateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class MdEstimateServiceImpl implements IMdEstimateService {
+
+    @Autowired
+    private MdEstimateMapper mdEstimateMapper;
+
+    /**
+     * 查询模型评价
+     *
+     * @param estimateId 模型评价主键
+     * @return 模型评价
+     */
+    @Override
+    public MdEstimate selectMdEstimateByEstimateId(Integer estimateId)
+    {
+        return mdEstimateMapper.selectMdEstimateByEstimateId(estimateId);
+    }
+
+    /**
+     * 查询模型评价列表
+     *
+     * @param mdEstimate 模型评价
+     * @return 模型评价
+     */
+    @Override
+    public List<MdEstimate> selectMdEstimateList(MdEstimate mdEstimate)
+    {
+        return mdEstimateMapper.selectMdEstimateList(mdEstimate);
+    }
+
+    /**
+     * 新增模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    @Override
+    public int insertMdEstimate(MdEstimate mdEstimate)
+    {
+        mdEstimate.setCreateTime(DateUtils.getNowDate());
+        return mdEstimateMapper.insertMdEstimate(mdEstimate);
+    }
+
+    /**
+     * 修改模型评价
+     *
+     * @param mdEstimate 模型评价
+     * @return 结果
+     */
+    @Override
+    public int updateMdEstimate(MdEstimate mdEstimate)
+    {
+        mdEstimate.setUpdateTime(DateUtils.getNowDate());
+        return mdEstimateMapper.updateMdEstimate(mdEstimate);
+    }
+
+    /**
+     * 批量删除模型评价
+     *
+     * @param estimateIds 需要删除的模型评价主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdEstimateByEstimateIds(Long[] estimateIds)
+    {
+        return mdEstimateMapper.deleteMdEstimateByEstimateIds(estimateIds);
+    }
+
+    /**
+     * 删除模型评价信息
+     *
+     * @param estimateId 模型评价主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdEstimateByEstimateId(Long estimateId)
+    {
+        return mdEstimateMapper.deleteMdEstimateByEstimateId(estimateId);
+    }
+}

+ 96 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdEstimateMapper.xml

@@ -0,0 +1,96 @@
+<?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.MdEstimateMapper">
+
+    <resultMap type="com.ruoyi.interfaces.domain.MdEstimate" id="MdEstimateResult">
+        <result property="estimateId"    column="estimate_id"    />
+        <result property="mdid"    column="mdid"    />
+        <result property="estimateScore"    column="estimate_score"    />
+        <result property="estimateType"    column="estimate_type"    />
+        <result property="remark"    column="remark"    />
+        <result property="beginTime"    column="begin_time"    />
+        <result property="endTime"    column="end_time"    />
+        <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="selectMdEstimateVo">
+        select estimate_id, mdid, estimate_score, estimate_type, remark, begin_time, end_time, create_by, create_time, update_by, update_time from md_estimate
+    </sql>
+
+    <select id="selectMdEstimateList" parameterType="com.ruoyi.interfaces.domain.MdEstimate" resultMap="MdEstimateResult">
+        <include refid="selectMdEstimateVo"/>
+        <where>
+            <if test="mdid != null  and mdid != ''"> and mdid = #{mdid}</if>
+            <if test="estimateScore != null  and estimateScore != ''"> and estimate_score = #{estimateScore}</if>
+            <if test="estimateType != null  and estimateType != ''"> and estimate_type = #{estimateType}</if>
+            <if test="beginTime != null "> and begin_time = #{beginTime}</if>
+            <if test="endTime != null "> and end_time = #{endTime}</if>
+        </where>
+    </select>
+
+    <select id="selectMdEstimateByEstimateId" parameterType="Integer" resultMap="MdEstimateResult">
+        <include refid="selectMdEstimateVo"/>
+        where estimate_id = #{estimateId}
+    </select>
+
+    <insert id="insertMdEstimate" parameterType="com.ruoyi.interfaces.domain.MdEstimate" useGeneratedKeys="true" keyProperty="estimateId">
+        insert into md_estimate
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="mdid != null">mdid,</if>
+            <if test="estimateScore != null">estimate_score,</if>
+            <if test="estimateType != null">estimate_type,</if>
+            <if test="remark != null">remark,</if>
+            <if test="beginTime != null">begin_time,</if>
+            <if test="endTime != null">end_time,</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="estimateScore != null">#{estimateScore},</if>
+            <if test="estimateType != null">#{estimateType},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="beginTime != null">#{beginTime},</if>
+            <if test="endTime != null">#{endTime},</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="updateMdEstimate" parameterType="com.ruoyi.interfaces.domain.MdEstimate">
+        update md_estimate
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="mdid != null">mdid = #{mdid},</if>
+            <if test="estimateScore != null">estimate_score = #{estimateScore},</if>
+            <if test="estimateType != null">estimate_type = #{estimateType},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="beginTime != null">begin_time = #{beginTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</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 estimate_id = #{estimateId}
+    </update>
+
+    <delete id="deleteMdEstimateByEstimateId" parameterType="Long">
+        delete from md_estimate where estimate_id = #{estimateId}
+    </delete>
+
+    <delete id="deleteMdEstimateByEstimateIds" parameterType="String">
+        delete from md_estimate where estimate_id in
+        <foreach item="estimateId" collection="array" open="(" separator="," close=")">
+            #{estimateId}
+        </foreach>
+    </delete>
+</mapper>