ソースを参照

新增:人流统计备注连通数据库,与设备管理共享备注
优化:删除部分开发时期注释,修复部分界面搜索框回车刷新的问题

范志成 3 ヶ月 前
コミット
9d8d9e9958

+ 0 - 1
smsb-modules/smsb-device/src/main/java/com/inspur/device/controller/SmsbDeviceAuthController.java

@@ -59,7 +59,6 @@ public class SmsbDeviceAuthController extends BaseController {
 //    /**
 //     * 导出设备鉴权列表
 //     */
-////    test for fan 这里是导出设备鉴权列表
 //    @SaCheckPermission("device:auth:export")
 //    @Log(title = "设备鉴权", businessType = BusinessType.EXPORT)
 //    @PostMapping("/export")

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

@@ -29,4 +29,6 @@ public class SmsbVisitorsFlowRateCountVo {
 
     private Integer totalNum;
 
+    private String remark;
+
 }

+ 0 - 2
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/ISmsbDeviceAuthService.java

@@ -75,7 +75,6 @@ public interface ISmsbDeviceAuthService {
      * @param requestParam
      * @return
      */
-//    test for fan 设备鉴权
     R<String> deviceAuth(HttpHeartbeatReq requestParam);
 
     /**
@@ -83,6 +82,5 @@ public interface ISmsbDeviceAuthService {
      * @param requestParam
      * @return
      */
-//    test for fan 智能体设备鉴权
     R<AgentAuthRes> deviceAgentAuth(HttpHeartbeatReq requestParam);
 }

+ 0 - 2
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbDeviceAuthServiceImpl.java

@@ -151,7 +151,6 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
         insert.setDeviceIp(deviceIp);
         String encryptCode = requestParam.getEncryptCode();
         insert.setEncryptCode(encryptCode);
-        // test for fan 设备mac加密出来的设备表示,
         String identifier = requestParam.getIdentifier();
         SmsbDeviceVo smsbDeviceVo = smsbDeviceService.getDeviceByIdentifier(identifier);
         if (null != smsbDeviceVo) {
@@ -210,7 +209,6 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
         insert.setDeviceIp(deviceIp);
         String encryptCode = requestParam.getEncryptCode();
         insert.setEncryptCode(encryptCode);
-        // test for fan 设备mac加密出来的设备表示,
         String identifier = requestParam.getIdentifier();
         SmsbDeviceVo smsbDeviceVo = smsbDeviceService.getDeviceByIdentifier(identifier);
         if (null != smsbDeviceVo) {

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

@@ -10,6 +10,7 @@
             sd.mac AS deviceMac,
             sd.id AS deviceId,
             sd.`name` AS deviceName,
+            sd.remark AS remark,
             IFNULL(rate.totalNum,0) AS totalNum,
             IFNULL(rate.todayNum,0) AS todayNum,
             IFNULL(rate.yesterdayNum,0) AS yesterdayNum,

+ 1 - 5
smsb-modules/smsb-source/src/main/java/com/inspur/source/controller/SmsbFrontController.java

@@ -66,7 +66,7 @@ public class SmsbFrontController {
 
     @SaIgnore
     @GetMapping("/itemSource/{itemId}")
-    public R<List<FrontItemSourceVO>> getItemSourceList(@NotNull(message = "identifier不能为空") @PathVariable Long itemId) {
+    public R<List<FrontItemSourceVO>> getItemSourceList(@NotNull(message = "itemId不能为空") @PathVariable Long itemId) {
         return smsbItemPushService.getItemSourceList(itemId);
     }
 
@@ -136,7 +136,6 @@ public class SmsbFrontController {
      *
      * @param requestParam 主键
      */
-//    test for fan 前端鉴权
     @SaIgnore
     @PostMapping("/auth")
     public R<String> deviceAuth(@RequestBody HttpHeartbeatReq requestParam) {
@@ -148,11 +147,8 @@ public class SmsbFrontController {
      *
      * @param requestParam 主键
      */
-//    test for fan 前端鉴权
     @SaIgnore
     @PostMapping("/agentAuth")
-////    这里返回设备组mac list(8位 第一位错误码标识,后面是mac地址)
-////    test for fan 这里我需要有个表维护设备组信息 结构:设备组id,设备组名称,设备组描述
     public R<AgentAuthRes> deviceAgentAuth(@RequestBody HttpHeartbeatReq requestParam) {
         return smsbDeviceAuthService.deviceAgentAuth(requestParam);
     }

+ 5 - 0
smsb-plus-ui/src/api/smsb/device/visitors_flow_rate_types.ts

@@ -65,6 +65,11 @@ export interface VisitorsFlowRateForm extends BaseEntity {
    */
   createTime?: string;
 
+  /**
+   * 备注
+   */
+  remark?: string;
+
 }
 
 export interface VisitorsFlowRateQuery extends PageQuery {

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

@@ -4,7 +4,7 @@
                 :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 ref="queryFormRef" :model="queryParams" :inline="true" @submit.native.prevent label-width="70px">
             <el-form-item label="设备名称" prop="deviceName">
               <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable
                         @keyup.enter="handleQuery"/>

+ 75 - 6
smsb-plus-ui/src/views/smsb/visitorsFlowRate/rateCount.vue

@@ -4,7 +4,7 @@
                 :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 ref="queryFormRef" :model="queryParams" :inline="true" @submit.native.prevent label-width="70px">
             <el-form-item label="设备名称" prop="deviceName">
               <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery"/>
             </el-form-item>
@@ -32,7 +32,7 @@
           <el-table-column label="本周" align="center" prop="weekNum" width="80"/>
           <el-table-column label="本月" align="center" prop="monthNum" width="80"/>
           <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
-          <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
+          <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
             <template #default="scope">
               <el-tooltip content="30天人流记录" placement="top">
                 <el-button link type="primary" icon="View" @click="handleMonthInfo(scope.row)"
@@ -42,6 +42,10 @@
                 <el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
                            v-hasPermi="['device:visitorsFlowRate:query']"></el-button>
               </el-tooltip>
+              <el-tooltip content="修改备注" placement="top">
+                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
+                           v-hasPermi="['device:visitorsFlowRate:edit']"></el-button>
+              </el-tooltip>
             </template>
           </el-table-column>
         </el-table>
@@ -59,6 +63,20 @@
         </div>
       </template>
     </el-dialog>
+
+    <el-dialog :title="remark.title" v-model="remark.visible" width="800px" append-to-body>
+      <el-form ref="chatRecordFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitFormRemark">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -68,6 +86,8 @@ import {VisitorsFlowRateVO,VisitorsFlowRateForm,VisitorsFlowRateQuery} from "@/a
 import {ref} from "vue";
 import {ChatRecordVO} from "@/api/smsb/device/device_chat_record_type";
 import * as echarts from "echarts";
+import {getDevice, updateDevice} from "@/api/smsb/device/device";
+import {DeviceForm} from "@/api/smsb/device/device_type";
 
 const {proxy} = getCurrentInstance() as ComponentInternalInstance;
 
@@ -93,23 +113,72 @@ const initFormData: VisitorsFlowRateForm = {
   id: undefined,
   deviceId: undefined,
   deviceName: undefined,
+  personNum: undefined,
+  createTime: undefined,
+  remark: undefined,
 }
 const data = reactive<PageData<VisitorsFlowRateForm, VisitorsFlowRateQuery>>({
   form: {...initFormData},
   queryParams: {
     pageNum: 1,
     pageSize: 10,
-    difyId: undefined,
-    name: undefined,
-    deviceId: undefined,
     deviceName: undefined,
     params: {}
   },
-  rules: {}
+  rules: {
+    id: [
+      {required: true, message: "主键ID不能为空", trigger: "blur"}
+    ],
+    deviceId: [
+      {required: false, message: "设备ID不能为空", trigger: "blur"}
+    ],
+    deviceName: [
+      {required: false, message: "设备名称不能为空", trigger: "blur"}
+    ],
+    personNum: [
+      {required: false, message: "人数不能为空", trigger: "blur"}
+    ],
+    createTime: [
+      {required: false, message: "创建时间不能为空", trigger: "blur"}
+    ],
+    remark: [
+      {required: false, message: "备注不能为空", trigger: "blur"}
+    ]
+  }
+});
+
+const handleUpdate = async (row?: ChatRecordVO) => {
+  reset();
+  const _id = row?.id || ids.value[0]
+  Object.assign(form.value, row);
+  remark.visible = true;
+  remark.title = "修改备注";
+}
+
+const remark = reactive<DialogOption>({
+  visible: false,
+  title: ''
 });
 
 const {queryParams, form, rules} = toRefs(data);
 
+/** 提交备注 */
+const submitFormRemark = () => {
+  chatRecordFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      let res = await getDevice(form.value.deviceId);
+      let deviceForm: DeviceForm = {}
+      Object.assign(deviceForm, res.data);
+      deviceForm.remark = form.value.remark;
+      await updateDevice(deviceForm).finally(() => buttonLoading.value = false);
+      proxy?.$modal.msgSuccess("操作成功");
+      remark.visible = false;
+      await getList();
+    }
+  });
+}
+
 /** 查询问答记录列表 */
 const getList = async () => {
   loading.value = true;