瀏覽代碼

1.增加转人工关键词界面
2.增加看课记录是否是会员筛选项

jzp 3 周之前
父節點
當前提交
a1b90e81c8

+ 97 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastgptChatArtificialWordsController.java

@@ -0,0 +1,97 @@
+package com.fs.fastGpt;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.fastGpt.domain.FastgptChatArtificialWords;
+import com.fs.fastGpt.service.IFastgptChatArtificialWordsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 转人工提示词Controller
+ * 
+ * @author fs
+ * @date 2025-05-07
+ */
+@RestController
+@RequestMapping("/fastGpt/fastgptChatArtificialWords")
+public class FastgptChatArtificialWordsController extends BaseController
+{
+    @Autowired
+    private IFastgptChatArtificialWordsService fastgptChatArtificialWordsService;
+
+    /**
+     * 查询转人工提示词列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        startPage();
+        List<FastgptChatArtificialWords> list = fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsList(fastgptChatArtificialWords);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出转人工提示词列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:export')")
+    @Log(title = "转人工提示词", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        List<FastgptChatArtificialWords> list = fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsList(fastgptChatArtificialWords);
+        ExcelUtil<FastgptChatArtificialWords> util = new ExcelUtil<FastgptChatArtificialWords>(FastgptChatArtificialWords.class);
+        return util.exportExcel(list, "转人工提示词数据");
+    }
+
+    /**
+     * 获取转人工提示词详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsById(id));
+    }
+
+    /**
+     * 新增转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:add')")
+    @Log(title = "转人工提示词", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return toAjax(fastgptChatArtificialWordsService.insertFastgptChatArtificialWords(fastgptChatArtificialWords));
+    }
+
+    /**
+     * 修改转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:edit')")
+    @Log(title = "转人工提示词", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return toAjax(fastgptChatArtificialWordsService.updateFastgptChatArtificialWords(fastgptChatArtificialWords));
+    }
+
+    /**
+     * 删除转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:remove')")
+    @Log(title = "转人工提示词", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastgptChatArtificialWordsService.deleteFastgptChatArtificialWordsByIds(ids));
+    }
+}

+ 3 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogListParam.java

@@ -75,4 +75,7 @@ public class FsCourseWatchLogListParam implements Serializable {
      * 部门类型 00 管理员 01 员工
      */
     private String userType;
+
+    //是否是会员
+    private Integer isVip;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchLogListVO.java

@@ -116,5 +116,7 @@ public class FsCourseWatchLogListVO extends BaseEntity
     private Long companyUserId;
     private Long courseId;
     private Long videoId;
+    private Integer isVip;
+
 
 }

+ 62 - 0
fs-service/src/main/java/com/fs/fastGpt/mapper/FastgptChatArtificialWordsMapper.java

@@ -0,0 +1,62 @@
+package com.fs.fastGpt.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.fastGpt.domain.FastgptChatArtificialWords;
+
+import java.util.List;
+
+/**
+ * 转人工提示词Mapper接口
+ * 
+ * @author fs
+ * @date 2025-05-07
+ */
+public interface FastgptChatArtificialWordsMapper extends BaseMapper<FastgptChatArtificialWords>{
+    /**
+     * 查询转人工提示词
+     * 
+     * @param id 转人工提示词主键
+     * @return 转人工提示词
+     */
+    FastgptChatArtificialWords selectFastgptChatArtificialWordsById(Long id);
+
+    /**
+     * 查询转人工提示词列表
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 转人工提示词集合
+     */
+    List<FastgptChatArtificialWords> selectFastgptChatArtificialWordsList(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 新增转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    int insertFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 修改转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    int updateFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 删除转人工提示词
+     * 
+     * @param id 转人工提示词主键
+     * @return 结果
+     */
+    int deleteFastgptChatArtificialWordsById(Long id);
+
+    /**
+     * 批量删除转人工提示词
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFastgptChatArtificialWordsByIds(Long[] ids);
+}

+ 62 - 0
fs-service/src/main/java/com/fs/fastGpt/service/IFastgptChatArtificialWordsService.java

@@ -0,0 +1,62 @@
+package com.fs.fastGpt.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.fastGpt.domain.FastgptChatArtificialWords;
+
+import java.util.List;
+
+/**
+ * 转人工提示词Service接口
+ * 
+ * @author fs
+ * @date 2025-05-07
+ */
+public interface IFastgptChatArtificialWordsService extends IService<FastgptChatArtificialWords>{
+    /**
+     * 查询转人工提示词
+     * 
+     * @param id 转人工提示词主键
+     * @return 转人工提示词
+     */
+    FastgptChatArtificialWords selectFastgptChatArtificialWordsById(Long id);
+
+    /**
+     * 查询转人工提示词列表
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 转人工提示词集合
+     */
+    List<FastgptChatArtificialWords> selectFastgptChatArtificialWordsList(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 新增转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    int insertFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 修改转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    int updateFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords);
+
+    /**
+     * 批量删除转人工提示词
+     * 
+     * @param ids 需要删除的转人工提示词主键集合
+     * @return 结果
+     */
+    int deleteFastgptChatArtificialWordsByIds(Long[] ids);
+
+    /**
+     * 删除转人工提示词信息
+     * 
+     * @param id 转人工提示词主键
+     * @return 结果
+     */
+    int deleteFastgptChatArtificialWordsById(Long id);
+}

+ 106 - 0
fs-service/src/main/java/com/fs/fastGpt/service/impl/FastgptChatArtificialWordsServiceImpl.java

@@ -0,0 +1,106 @@
+package com.fs.fastGpt.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.DateUtils;
+import com.fs.fastGpt.domain.FastgptChatArtificialWords;
+import com.fs.fastGpt.mapper.FastgptChatArtificialWordsMapper;
+import com.fs.fastGpt.service.IFastgptChatArtificialWordsService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 转人工提示词Service业务层处理
+ * 
+ * @author fs
+ * @date 2025-05-07
+ */
+@Service
+public class FastgptChatArtificialWordsServiceImpl extends ServiceImpl<FastgptChatArtificialWordsMapper, FastgptChatArtificialWords> implements IFastgptChatArtificialWordsService {
+
+    /**
+     * 查询转人工提示词
+     * 
+     * @param id 转人工提示词主键
+     * @return 转人工提示词
+     */
+    @Override
+    public FastgptChatArtificialWords selectFastgptChatArtificialWordsById(Long id)
+    {
+        return baseMapper.selectFastgptChatArtificialWordsById(id);
+    }
+
+    /**
+     * 查询转人工提示词列表
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 转人工提示词
+     */
+    @Override
+    public List<FastgptChatArtificialWords> selectFastgptChatArtificialWordsList(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return baseMapper.selectFastgptChatArtificialWordsList(fastgptChatArtificialWords);
+    }
+
+    /**
+     * 新增转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    @Override
+    public int insertFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        String content = fastgptChatArtificialWords.getContent();
+        if(content == null || "".equals(content)){
+            throw new CustomException("文本不能为空!");
+        }
+        Long type = fastgptChatArtificialWords.getType();
+        if(type == null){
+            throw new CustomException("类型不能为空!");
+        }
+        Long sort = fastgptChatArtificialWords.getSort();
+        if(sort == null){
+            throw new CustomException("排序不能为空!");
+        }
+        fastgptChatArtificialWords.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFastgptChatArtificialWords(fastgptChatArtificialWords);
+    }
+
+    /**
+     * 修改转人工提示词
+     * 
+     * @param fastgptChatArtificialWords 转人工提示词
+     * @return 结果
+     */
+    @Override
+    public int updateFastgptChatArtificialWords(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return baseMapper.updateFastgptChatArtificialWords(fastgptChatArtificialWords);
+    }
+
+    /**
+     * 批量删除转人工提示词
+     * 
+     * @param ids 需要删除的转人工提示词主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFastgptChatArtificialWordsByIds(Long[] ids)
+    {
+        return baseMapper.deleteFastgptChatArtificialWordsByIds(ids);
+    }
+
+    /**
+     * 删除转人工提示词信息
+     * 
+     * @param id 转人工提示词主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFastgptChatArtificialWordsById(Long id)
+    {
+        return baseMapper.deleteFastgptChatArtificialWordsById(id);
+    }
+}

+ 5 - 1
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -58,7 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select l.log_id,l.user_id,uc.course_name,v.title as video_name,qec.avatar as external_user_avatar,
         l.log_type,SEC_TO_TIME(l.duration) as duration,c.company_name,l.camp_period_time,l.finish_time,
         cu.nick_name as company_user_name ,l.send_type,l.create_time,l.update_time,l.last_heartbeat_time,
-        qu.qw_user_name,qec.name as external_user_name,c.company_id,u.avatar as fsAvatar,u.nick_name as fsNickName,qec.create_time as qec_create_time
+        qu.qw_user_name,qec.name as external_user_name,c.company_id,u.avatar as fsAvatar,u.nick_name as fsNickName,qec.create_time as qec_create_time,
+        u.is_vip isVip
          from fs_course_watch_log l
          left join fs_user_course_video v on v.video_id = l.video_id
          left join fs_user_course uc on uc.course_id = l.course_id
@@ -68,6 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          LEFT JOIN qw_user qu on qu.id= l.qw_user_id
          LEFT JOIN qw_external_contact qec on l.qw_external_contact_id = qec.id
         <where>
+            <if test ='maps.isVip !=null'>
+                and l.user_id != 0 and u.is_vip = #{maps.isVip}
+            </if>
             <if test ='maps.sendType !=null'>
                 and l.send_type = #{maps.sendType}
             </if>

+ 76 - 0
fs-service/src/main/resources/mapper/fastGpt/FastgptChatArtificialWordsMapper.xml

@@ -0,0 +1,76 @@
+<?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.fs.fastGpt.mapper.FastgptChatArtificialWordsMapper">
+    
+    <resultMap type="FastgptChatArtificialWords" id="FastgptChatArtificialWordsResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="content"    column="content"    />
+        <result property="status"    column="status"    />
+        <result property="sort"    column="sort"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectFastgptChatArtificialWordsVo">
+        select id, `type`, content, status, sort, create_time from fastgpt_chat_artificial_words
+    </sql>
+
+    <select id="selectFastgptChatArtificialWordsList" parameterType="FastgptChatArtificialWords" resultMap="FastgptChatArtificialWordsResult">
+        <include refid="selectFastgptChatArtificialWordsVo"/>
+        <where>  
+            <if test="type != null "> and `type` = #{type}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+        </where>
+        order by sort asc,id desc
+    </select>
+    
+    <select id="selectFastgptChatArtificialWordsById" parameterType="Long" resultMap="FastgptChatArtificialWordsResult">
+        <include refid="selectFastgptChatArtificialWordsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFastgptChatArtificialWords" parameterType="FastgptChatArtificialWords" useGeneratedKeys="true" keyProperty="id">
+        insert into fastgpt_chat_artificial_words
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">`type`,</if>
+            <if test="content != null">content,</if>
+            <if test="status != null">status,</if>
+            <if test="sort != null">sort,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="content != null">#{content},</if>
+            <if test="status != null">#{status},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFastgptChatArtificialWords" parameterType="FastgptChatArtificialWords">
+        update fastgpt_chat_artificial_words
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFastgptChatArtificialWordsById" parameterType="Long">
+        delete from fastgpt_chat_artificial_words where id = #{id}
+    </delete>
+
+    <delete id="deleteFastgptChatArtificialWordsByIds" parameterType="String">
+        delete from fastgpt_chat_artificial_words where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>