소스 검색

feat:1、问答记录统计功能开发2、人流量统计功能开发

lihao16 4 달 전
부모
커밋
1c339af51b
18개의 변경된 파일519개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/controller/SmsbDeviceChatRecordController.java
  2. 10 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/controller/SmsbVisitorsFlowRateController.java
  3. 30 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbDeviceChatCountVo.java
  4. 30 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbVisitorsFlowRateCountVo.java
  5. 11 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbDeviceChatRecordMapper.java
  6. 11 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbVisitorsFlowRateMapper.java
  7. 9 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/service/ISmsbDeviceChatRecordService.java
  8. 9 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/service/ISmsbVisitorsFlowRateService.java
  9. 6 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbDeviceChatRecordServiceImpl.java
  10. 7 0
      smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbVisitorsFlowRateServiceImpl.java
  11. 36 1
      smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbDeviceChatRecordMapper.xml
  12. 37 1
      smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbVisitorsFlowRateMapper.xml
  13. 8 0
      smsb-plus-ui/src/api/smsb/device/device_chat_record.ts
  14. 9 0
      smsb-plus-ui/src/api/smsb/device/visitors_flow_rate.ts
  15. 148 0
      smsb-plus-ui/src/views/smsb/deviceChatRecord/chatCount.vue
  16. 2 1
      smsb-plus-ui/src/views/smsb/deviceChatRecord/index.vue
  17. 2 1
      smsb-plus-ui/src/views/smsb/visitorsFlowRate/index.vue
  18. 144 0
      smsb-plus-ui/src/views/smsb/visitorsFlowRate/rateCount.vue

+ 10 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/controller/SmsbDeviceChatRecordController.java

@@ -3,6 +3,7 @@ package com.inspur.device.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.inspur.device.domain.SmsbDeviceChatDetail;
 import com.inspur.device.domain.bo.SmsbDeviceChatRecordBo;
+import com.inspur.device.domain.vo.SmsbDeviceChatCountVo;
 import com.inspur.device.domain.vo.SmsbDeviceChatDetailVo;
 import com.inspur.device.domain.vo.SmsbDeviceChatRecordVo;
 import com.inspur.device.service.ISmsbDeviceChatRecordService;
@@ -48,6 +49,15 @@ public class SmsbDeviceChatRecordController extends BaseController {
         return smsbDeviceChatRecordService.queryPageList(bo, pageQuery);
     }
 
+    /**
+     * 查询每个设备的对话统计列表
+     */
+    @SaCheckPermission("device:chatRecord:count")
+    @GetMapping("/count")
+    public TableDataInfo<SmsbDeviceChatCountVo> chatCountList(SmsbDeviceChatRecordBo bo, PageQuery pageQuery) {
+        return smsbDeviceChatRecordService.chatCountList(bo, pageQuery);
+    }
+
     /**
      * 查询问答记录列表
      */

+ 10 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/controller/SmsbVisitorsFlowRateController.java

@@ -2,6 +2,7 @@ package com.inspur.device.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.inspur.device.domain.bo.SmsbVisitorsFlowRateBo;
+import com.inspur.device.domain.vo.SmsbVisitorsFlowRateCountVo;
 import com.inspur.device.domain.vo.SmsbVisitorsFlowRateVo;
 import com.inspur.device.service.ISmsbVisitorsFlowRateService;
 import jakarta.servlet.http.HttpServletResponse;
@@ -46,6 +47,15 @@ public class SmsbVisitorsFlowRateController extends BaseController {
         return smsbVisitorsFlowRateService.queryPageList(bo, pageQuery);
     }
 
+    /**
+     * 查询人流记录 统计
+     */
+    @SaCheckPermission("device:visitorsFlowRate:count")
+    @GetMapping("/count")
+    public TableDataInfo<SmsbVisitorsFlowRateCountVo> flowRateCount(SmsbVisitorsFlowRateBo bo, PageQuery pageQuery) {
+        return smsbVisitorsFlowRateService.flowRateCount(bo, pageQuery);
+    }
+
     /**
      * 导出人流记录列表
      */

+ 30 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbDeviceChatCountVo.java

@@ -0,0 +1,30 @@
+package com.inspur.device.domain.vo;
+
+import lombok.Data;
+
+/**
+ * 设备聊天记录统计
+ * @author lihao16
+ */
+@Data
+public class SmsbDeviceChatCountVo {
+
+    private Long deviceId;
+
+    private String deviceName;
+
+    private String deviceSn;
+
+    private String deviceMac;
+
+    private Integer todayNum;
+
+    private Integer yesterdayNum;
+
+    private Integer weekNum;
+
+    private Integer monthNum;
+
+    private Integer totalNum;
+
+}

+ 30 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbVisitorsFlowRateCountVo.java

@@ -0,0 +1,30 @@
+package com.inspur.device.domain.vo;
+
+import lombok.Data;
+
+/**
+ * 人流记录统计
+ * @author lihao16
+ */
+@Data
+public class SmsbVisitorsFlowRateCountVo {
+
+    private Long deviceId;
+
+    private String deviceName;
+
+    private String deviceSn;
+
+    private String deviceMac;
+
+    private Integer todayNum;
+
+    private Integer yesterdayNum;
+
+    private Integer weekNum;
+
+    private Integer monthNum;
+
+    private Integer totalNum;
+
+}

+ 11 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbDeviceChatRecordMapper.java

@@ -1,7 +1,11 @@
 package com.inspur.device.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.inspur.device.domain.SmsbDeviceChatRecord;
+import com.inspur.device.domain.bo.SmsbDeviceChatRecordBo;
+import com.inspur.device.domain.vo.SmsbDeviceChatCountVo;
 import com.inspur.device.domain.vo.SmsbDeviceChatRecordVo;
+import org.apache.ibatis.annotations.Param;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 
 /**
@@ -12,4 +16,11 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
  */
 public interface SmsbDeviceChatRecordMapper extends BaseMapperPlus<SmsbDeviceChatRecord, SmsbDeviceChatRecordVo> {
 
+    /**
+     * 查询每个设备的对话统计列表
+     * @param page
+     * @param bo
+     * @return
+     */
+    Page<SmsbDeviceChatCountVo> selectChatCountList(@Param("page") Page<SmsbDeviceChatCountVo> page, @Param("bo") SmsbDeviceChatRecordBo bo);
 }

+ 11 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/mapper/SmsbVisitorsFlowRateMapper.java

@@ -1,7 +1,11 @@
 package com.inspur.device.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.inspur.device.domain.SmsbVisitorsFlowRate;
+import com.inspur.device.domain.bo.SmsbVisitorsFlowRateBo;
+import com.inspur.device.domain.vo.SmsbVisitorsFlowRateCountVo;
 import com.inspur.device.domain.vo.SmsbVisitorsFlowRateVo;
+import org.apache.ibatis.annotations.Param;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 
 /**
@@ -12,4 +16,11 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
  */
 public interface SmsbVisitorsFlowRateMapper extends BaseMapperPlus<SmsbVisitorsFlowRate, SmsbVisitorsFlowRateVo> {
 
+    /**
+     * 查询人流记录 统计
+     * @param page
+     * @param bo
+     * @return
+     */
+    Page<SmsbVisitorsFlowRateCountVo> selectFlowRateCountList(@Param("page") Page<SmsbVisitorsFlowRateCountVo> page, SmsbVisitorsFlowRateBo bo);
 }

+ 9 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/ISmsbDeviceChatRecordService.java

@@ -1,6 +1,7 @@
 package com.inspur.device.service;
 
 import com.inspur.device.domain.bo.SmsbDeviceChatRecordBo;
+import com.inspur.device.domain.vo.SmsbDeviceChatCountVo;
 import com.inspur.device.domain.vo.SmsbDeviceChatDetailVo;
 import com.inspur.device.domain.vo.SmsbDeviceChatRecordVo;
 import org.dromara.common.mybatis.core.page.PageQuery;
@@ -79,4 +80,12 @@ public interface ISmsbDeviceChatRecordService {
      * @return
      */
     List<SmsbDeviceChatDetailVo> listDetail(String conversationId);
+
+    /**
+     * 查询每个设备的对话统计列表
+     * @param pageQuery
+     * @param bo
+     * @return
+     */
+    TableDataInfo<SmsbDeviceChatCountVo> chatCountList(SmsbDeviceChatRecordBo bo, PageQuery pageQuery);
 }

+ 9 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/ISmsbVisitorsFlowRateService.java

@@ -1,6 +1,7 @@
 package com.inspur.device.service;
 
 import com.inspur.device.domain.bo.SmsbVisitorsFlowRateBo;
+import com.inspur.device.domain.vo.SmsbVisitorsFlowRateCountVo;
 import com.inspur.device.domain.vo.SmsbVisitorsFlowRateVo;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
@@ -74,4 +75,12 @@ public interface ISmsbVisitorsFlowRateService {
      * @return
      */
     R<Void> visitorsUpload(String identifier, Integer personNum);
+
+    /**
+     * 人流量统计
+     * @param bo
+     * @param pageQuery
+     * @return
+     */
+    TableDataInfo<SmsbVisitorsFlowRateCountVo> flowRateCount(SmsbVisitorsFlowRateBo bo, PageQuery pageQuery);
 }

+ 6 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbDeviceChatRecordServiceImpl.java

@@ -218,6 +218,12 @@ public class SmsbDeviceChatRecordServiceImpl implements ISmsbDeviceChatRecordSer
             .orderByDesc(SmsbDeviceChatDetail::getId));
     }
 
+    @Override
+    public TableDataInfo<SmsbDeviceChatCountVo> chatCountList(SmsbDeviceChatRecordBo bo, PageQuery pageQuery) {
+        Page<SmsbDeviceChatCountVo> result = baseMapper.selectChatCountList(pageQuery.build(), bo);
+        return TableDataInfo.build(result);
+    }
+
     private void createNewAddDetail(SmsbDeviceChatDetail addDetail, DifyChatDetailRspData detailRspData,String tenantId) {
         addDetail.setConversationId(detailRspData.getConversation_id());
         addDetail.setDifyId(detailRspData.getId());

+ 7 - 0
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbVisitorsFlowRateServiceImpl.java

@@ -7,6 +7,7 @@ import com.inspur.device.domain.SmsbDevice;
 import com.inspur.device.domain.SmsbVisitorsFlowRate;
 import com.inspur.device.domain.bo.SmsbVisitorsFlowRateBo;
 import com.inspur.device.domain.vo.SmsbDeviceVo;
+import com.inspur.device.domain.vo.SmsbVisitorsFlowRateCountVo;
 import com.inspur.device.domain.vo.SmsbVisitorsFlowRateVo;
 import com.inspur.device.mapper.SmsbDeviceMapper;
 import com.inspur.device.mapper.SmsbVisitorsFlowRateMapper;
@@ -154,4 +155,10 @@ public class SmsbVisitorsFlowRateServiceImpl implements ISmsbVisitorsFlowRateSer
         baseMapper.insert(add);
         return R.ok();
     }
+
+    @Override
+    public TableDataInfo<SmsbVisitorsFlowRateCountVo> flowRateCount(SmsbVisitorsFlowRateBo bo, PageQuery pageQuery) {
+        Page<SmsbVisitorsFlowRateCountVo> result = baseMapper.selectFlowRateCountList(pageQuery.build(), bo);
+        return TableDataInfo.build(result);
+    }
 }

+ 36 - 1
smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbDeviceChatRecordMapper.xml

@@ -3,5 +3,40 @@
     PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.inspur.device.mapper.SmsbDeviceChatRecordMapper">
-
+    <select id="selectChatCountList" resultType="com.inspur.device.domain.vo.SmsbDeviceChatCountVo" parameterType="com.inspur.device.domain.bo.SmsbDeviceChatRecordBo">
+        SELECT
+            sd.serial_number as deviceSn,
+            sd.mac AS deviceMac,
+            sd.id AS deviceId,
+            sd.`name` AS deviceName,
+            IFNULL(chat.totalNum,0) AS totalNum,
+            IFNULL(chat.todayNum,0) AS todayNum,
+            IFNULL(chat.yesterdayNum,0) AS yesterdayNum,
+            IFNULL(chat.weekNum,0) AS weekNum,
+            IFNULL(chat.monthNum,0) AS monthNum
+        FROM
+            smsb_device sd
+        LEFT JOIN
+             (
+                 SELECT
+                     device_id AS deviceId,
+                     COUNT(*) AS totalNum,
+                     SUM(IF(DATE(create_time) = CURDATE(), 1, 0)) AS todayNum,
+                     SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, 1, 0)) AS yesterdayNum,
+                     SUM(IF(YEARWEEK(create_time, 1) = YEARWEEK(CURDATE(), 1), 1, 0)) AS weekNum,
+                     SUM(IF(MONTH(create_time) = MONTH(CURDATE()) AND YEAR(create_time) = YEAR(CURDATE()), 1, 0)) AS monthNum
+                 FROM
+                     smsb_device_chat_record
+                 GROUP BY
+                     device_id
+                 ORDER BY
+                    totalNum desc
+             ) chat
+        on chat.deviceId = sd.id
+        WHERE 1 = 1
+        <if test="bo.deviceName != null and bo.deviceName != ''">
+            AND sd.name like concat('%',#{bo.deviceName},'%')
+        </if>
+        ORDER BY totalNum desc
+    </select>
 </mapper>

+ 37 - 1
smsb-modules/smsb-device/src/main/resources/mapper/device/SmsbVisitorsFlowRateMapper.xml

@@ -3,5 +3,41 @@
     PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.inspur.device.mapper.SmsbVisitorsFlowRateMapper">
-
+    <select id="selectFlowRateCountList" parameterType="com.inspur.device.domain.bo.SmsbVisitorsFlowRateBo"
+            resultType="com.inspur.device.domain.vo.SmsbVisitorsFlowRateCountVo">
+        SELECT
+            sd.serial_number AS deviceSn,
+            sd.mac AS deviceMac,
+            sd.id AS deviceId,
+            sd.`name` AS deviceName,
+            IFNULL(rate.totalNum,0) AS totalNum,
+            IFNULL(rate.todayNum,0) AS todayNum,
+            IFNULL(rate.yesterdayNum,0) AS yesterdayNum,
+            IFNULL(rate.weekNum,0) AS weekNum,
+            IFNULL(rate.monthNum,0) AS monthNum
+        FROM
+            smsb_device sd
+        LEFT JOIN
+            (
+            SELECT
+                device_id AS deviceId,
+                SUM(person_num) AS totalNum,
+                SUM(CASE WHEN DATE(create_time) = CURDATE() THEN person_num ELSE 0 END) AS todayNum,
+                SUM(CASE WHEN DATE(create_time) = CURDATE() - INTERVAL 1 DAY THEN person_num ELSE 0 END) AS yesterdayNum,
+                SUM(CASE WHEN YEARWEEK(create_time, 1) = YEARWEEK(CURDATE(), 1) THEN person_num ELSE 0 END) AS weekNum,
+                SUM(CASE WHEN MONTH(create_time) = MONTH(CURDATE()) AND YEAR(create_time) = YEAR(CURDATE()) THEN person_num ELSE 0 END) AS monthNum
+            FROM
+                smsb_visitors_flow_rate
+            GROUP BY
+                device_id
+            ORDER BY
+                totalNum DESC
+            ) rate
+        ON rate.deviceId = sd.id
+        WHERE 1 = 1
+        <if test="bo.deviceName != null and bo.deviceName != ''">
+            AND sd.name LIKE concat('%',#{bo.deviceName},'%')
+        </if>
+        ORDER BY totalNum DESC
+    </select>
 </mapper>

+ 8 - 0
smsb-plus-ui/src/api/smsb/device/device_chat_record.ts

@@ -16,6 +16,14 @@ export const listChatRecord = (query?: ChatRecordQuery): AxiosPromise<ChatRecord
   });
 };
 
+export const listChatRecordCount = (query?: ChatRecordQuery): AxiosPromise<ChatRecordVO[]> => {
+  return request({
+    url: '/device/chatRecord/count',
+    method: 'get',
+    params: query
+  });
+};
+
 export const listChatDetail = (conversationId: string | number): AxiosPromise<ChatDetailVO[]> => {
   return request({
     url: '/device/chatRecord/list/detail/' + conversationId,

+ 9 - 0
smsb-plus-ui/src/api/smsb/device/visitors_flow_rate.ts

@@ -1,6 +1,7 @@
 import request from '@/utils/request';
 import { AxiosPromise } from 'axios';
 import { VisitorsFlowRateVO, VisitorsFlowRateForm, VisitorsFlowRateQuery } from '@/api/smsb/device/visitors_flow_rate_types';
+import {ChatRecordQuery, ChatRecordVO} from "@/api/smsb/device/device_chat_record_type";
 
 /**
  * 查询人流记录列表
@@ -16,6 +17,14 @@ export const listVisitorsFlowRate = (query?: VisitorsFlowRateQuery): AxiosPromis
   });
 };
 
+export const listVisitorsFlowRateCount = (query?: VisitorsFlowRateQuery): AxiosPromise<VisitorsFlowRateVO[]> => {
+  return request({
+    url: '/device/visitorsFlowRate/count',
+    method: 'get',
+    params: query
+  });
+};
+
 /**
  * 查询人流记录详细
  * @param id

+ 148 - 0
smsb-plus-ui/src/views/smsb/deviceChatRecord/chatCount.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
+                :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
+            <el-form-item label="设备名称" prop="deviceName">
+              <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery"/>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <div class="table-content">
+        <el-table v-loading="loading" :data="chatRecordList" @selection-change="handleSelectionChange">
+          <el-table-column label="" align="left" prop="" width="10"/>
+          <el-table-column label="设备ID" align="left" prop="deviceId" width="180"/>
+          <el-table-column label="设备名称" align="left" prop="deviceName" :show-overflow-tooltip="true"/>
+          <el-table-column label="设备SN" align="left" prop="deviceSn" width="250"/>
+          <el-table-column label="设备MAC" align="left" prop="deviceMac" width="180"/>
+          <el-table-column label="总对话" align="center" prop="totalNum" width="120"/>
+          <el-table-column label="今日对话" align="center" prop="todayNum" width="120"/>
+          <el-table-column label="昨日对话" align="center" prop="yesterdayNum" width="120"/>
+          <el-table-column label="本周对话" align="center" prop="weekNum" width="120"/>
+          <el-table-column label="本月对话" align="center" prop="monthNum" width="120"/>
+          <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
+            <template #default="scope">
+              <el-tooltip content="问答列表" placement="top">
+                <el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
+                           v-hasPermi="['device:chatRecord:query']"></el-button>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                  v-model:limit="queryParams.pageSize" @pagination="getList"/>
+    </el-card>
+  </div>
+</template>
+
+<script setup name="ChatRecord" lang="ts">
+import {listChatRecordCount,} from '@/api/smsb/device/device_chat_record';
+import {ChatRecordForm, ChatRecordQuery, ChatRecordVO} from '@/api/smsb/device/device_chat_record_type';
+
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
+
+const chatRecordList = ref<ChatRecordVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const chatRecordFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: ChatRecordForm = {
+  id: undefined,
+  difyId: undefined,
+  name: undefined,
+  createdAt: undefined,
+  updatedAt: undefined,
+  deviceId: undefined,
+  deviceName: undefined,
+}
+const data = reactive<PageData<ChatRecordForm, ChatRecordQuery>>({
+  form: {...initFormData},
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    difyId: undefined,
+    name: undefined,
+    deviceId: undefined,
+    deviceName: undefined,
+    params: {}
+  },
+  rules: {}
+});
+
+const {queryParams, form, rules} = toRefs(data);
+
+/** 查询问答记录列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listChatRecordCount(queryParams.value);
+  chatRecordList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+}
+const handleInfo = async (row?: ChatRecordVO) => {
+  const deviceName = row.deviceName;
+  // 跳转页面 /source/push/review?id=1898991996092481537&type=approval&taskId=1898992031169445891
+  proxy.$router.push('/device/QA/chatRecord?deviceName=' + deviceName);
+}
+
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+}
+
+/** 表单重置 */
+const reset = () => {
+  form.value = {...initFormData};
+  chatRecordFormRef.value?.resetFields();
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+}
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: ChatRecordVO[]) => {
+  ids.value = selection.map(item => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 2 - 1
smsb-plus-ui/src/views/smsb/deviceChatRecord/index.vue

@@ -75,7 +75,7 @@ import {
 import {ChatDetailVO, ChatRecordForm, ChatRecordQuery, ChatRecordVO} from '@/api/smsb/device/device_chat_record_type';
 
 const {proxy} = getCurrentInstance() as ComponentInternalInstance;
-
+const route = useRoute();
 const chatRecordList = ref<ChatRecordVO[]>([]);
 const chatDetailList = ref<ChatDetailVO[]>([]);
 const buttonLoading = ref(false);
@@ -229,6 +229,7 @@ const handleExport = () => {
 }
 
 onMounted(() => {
+  queryParams.value.deviceName = route.query && (route.query.deviceName as string)
   getList();
 });
 </script>

+ 2 - 1
smsb-plus-ui/src/views/smsb/visitorsFlowRate/index.vue

@@ -213,8 +213,9 @@ const handleExport = () => {
     ...queryParams.value
   }, `visitorsFlowRate_${new Date().getTime()}.xlsx`)
 }
-
+const route = useRoute();
 onMounted(() => {
+  queryParams.value.deviceName = route.query && (route.query.deviceName as string)
   getList();
 });
 </script>

+ 144 - 0
smsb-plus-ui/src/views/smsb/visitorsFlowRate/rateCount.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
+                :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
+            <el-form-item label="设备名称" prop="deviceName">
+              <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery"/>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <div class="table-content">
+        <el-table v-loading="loading" :data="flowRateList" @selection-change="handleSelectionChange">
+          <el-table-column label="" align="left" prop="" width="10"/>
+          <el-table-column label="设备ID" align="left" prop="deviceId" width="180"/>
+          <el-table-column label="设备名称" align="left" prop="deviceName" :show-overflow-tooltip="true"/>
+          <el-table-column label="设备SN" align="left" prop="deviceSn" width="250"/>
+          <el-table-column label="设备MAC" align="left" prop="deviceMac" width="180"/>
+          <el-table-column label="总人数" align="center" prop="totalNum" width="120"/>
+          <el-table-column label="今日人数" align="center" prop="todayNum" width="120"/>
+          <el-table-column label="昨日人数" align="center" prop="yesterdayNum" width="120"/>
+          <el-table-column label="本周人数" align="center" prop="weekNum" width="120"/>
+          <el-table-column label="本月人数" align="center" prop="monthNum" width="120"/>
+          <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
+            <template #default="scope">
+              <el-tooltip content="人流列表" placement="top">
+                <el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
+                           v-hasPermi="['device:visitorsFlowRate:query']"></el-button>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                  v-model:limit="queryParams.pageSize" @pagination="getList"/>
+    </el-card>
+  </div>
+</template>
+
+<script setup name="ChatRecord" lang="ts">
+import {listVisitorsFlowRateCount,} from '@/api/smsb/device/visitors_flow_rate';
+import {VisitorsFlowRateVO,VisitorsFlowRateForm,VisitorsFlowRateQuery} from "@/api/smsb/device/visitors_flow_rate_types";
+
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
+
+const flowRateList = ref<VisitorsFlowRateVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const chatRecordFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: VisitorsFlowRateForm = {
+  id: undefined,
+  deviceId: undefined,
+  deviceName: undefined,
+}
+const data = reactive<PageData<VisitorsFlowRateForm, VisitorsFlowRateQuery>>({
+  form: {...initFormData},
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    difyId: undefined,
+    name: undefined,
+    deviceId: undefined,
+    deviceName: undefined,
+    params: {}
+  },
+  rules: {}
+});
+
+const {queryParams, form, rules} = toRefs(data);
+
+/** 查询问答记录列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listVisitorsFlowRateCount(queryParams.value);
+  flowRateList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+}
+const handleInfo = async (row?: VisitorsFlowRateVO) => {
+  const deviceName = row.deviceName;
+  // 跳转页面 /source/push/review?id=1898991996092481537&type=approval&taskId=1898992031169445891
+  proxy.$router.push('/device/pc/visitorsFlowRate?deviceName=' + deviceName);
+}
+
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+}
+
+/** 表单重置 */
+const reset = () => {
+  form.value = {...initFormData};
+  chatRecordFormRef.value?.resetFields();
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+}
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: VisitorsFlowRateVO[]) => {
+  ids.value = selection.map(item => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+
+
+onMounted(() => {
+  getList();
+});
+</script>