Jelajahi Sumber

新增:新增设备组-设备详情页面展示知识库名称

This reverts commit 8a3aa5838f52c7ddfd0e8b518463f8e8da39d380.
范志成 3 bulan lalu
induk
melakukan
92f76ecaa0

+ 7 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbDeviceGroupRelVo.java

@@ -66,6 +66,13 @@ public class SmsbDeviceGroupRelVo implements Serializable {
     @ExcelProperty(value = "场景名称")
     private String sceneName;
 
+    /**
+     * 知识库名称
+
+     */
+    @ExcelProperty(value = "知识库名称")
+    private String datasetsName;
+
     /**
      * 备注
 

+ 4 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbDeviceGroupRelMapper.java

@@ -1,6 +1,10 @@
 package com.inspur.device.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.inspur.device.domain.SmsbDeviceGroupRel;
+import com.inspur.device.domain.bo.SmsbDeviceChatKeyBo;
+import com.inspur.device.domain.bo.SmsbDeviceGroupRelBo;
+import com.inspur.device.domain.vo.SmsbDeviceChatKeyVo;
 import com.inspur.device.domain.vo.SmsbDeviceGroupRelVo;
 import org.apache.ibatis.annotations.Param;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

+ 13 - 4
smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbDeviceGroupRelMapper.xml

@@ -15,10 +15,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="queryGroupRelVoListByGoupId" resultType="com.inspur.device.domain.vo.SmsbDeviceGroupRelVo">
-        SELECT *
-        FROM smsb_device_group_rel
-        WHERE device_group_id = #{goupId}
-        ORDER BY scene_sort
+        SELECT
+            groupRel.*,
+            datasets.name AS datasetsName
+        FROM
+            smsb_device_group_rel groupRel
+                LEFT JOIN smsb_datasets_identifier_rel datasetsRel
+                          ON datasetsRel.device_identifier = groupRel.device_identifier
+                LEFT JOIN smsb_dify_datasets datasets
+                          ON datasets.id = datasetsRel.datasets_id
+        WHERE
+            groupRel.device_group_id = #{goupId}
+        ORDER BY
+            groupRel.scene_sort;
     </select>
 
     <select id="getRelListByIdentifier" parameterType="String" resultType="com.inspur.device.domain.vo.SmsbDeviceGroupRelVo">

+ 4 - 4
smsb-plus-ui/src/api/smsb/digital/datasetsIdentifierRel/types.ts

@@ -46,10 +46,10 @@ export interface DatasetsIdentifierRelQuery extends PageQuery {
    */
   deviceIdentifier?: string | number;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
+  /**
+   * 日期范围参数
+   */
+  params?: any;
 }
 
 

+ 6 - 0
smsb-plus-ui/src/api/smsb/digital/deviceGroupRel/types.ts

@@ -34,6 +34,12 @@ export interface DeviceGroupRelVO {
    */
   sceneName: string;
 
+  /**
+   * 知识库名称
+
+   */
+  datasetsName: string;
+
   /**
    * 备注
 

+ 4 - 1
smsb-plus-ui/src/views/smsb/deviceGroup/index.vue

@@ -116,6 +116,7 @@
           <el-table-column label="设备名称" align="left" prop="deviceName" width="200" :show-overflow-tooltip="true"/>
           <el-table-column label="场景名称" align="center" prop="sceneName" width="200" :show-overflow-tooltip="true"/>
           <el-table-column label="场景序号" align="center" prop="sceneSort" width="150"/>
+          <el-table-column label="知识库" align="center" prop="datasetsName" width="150"/>
           <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
             <template #default="scope">
@@ -539,9 +540,11 @@ const submitDatasetsRel = async () => {
   } else {
     await addDatasetsIdentifierRel(datasetsData.form).finally(() => buttonLoading.value = false);
   }
+  const res = await getGroupRelByGroupId(groupId.value);
+  deviceList.value = res.data;
   proxy?.$modal.msgSuccess("操作成功");
   datasetsRelLog.visible = false;
-}
+};
 
 /** 提交按钮 */
 const submitForm = () => {