From 2d194cfd72bd445986634c2078205bef4cf0e71e Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 22 七月 2026 10:23:07 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/fangkeji
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java | 1 -
ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml | 27 +++++++++++++++++++++------
ruoyi-applet/src/main/resources/application-test.yml | 6 ++++++
3 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/ruoyi-applet/src/main/resources/application-test.yml b/ruoyi-applet/src/main/resources/application-test.yml
index 98efa96..b92c9e3 100644
--- a/ruoyi-applet/src/main/resources/application-test.yml
+++ b/ruoyi-applet/src/main/resources/application-test.yml
@@ -32,6 +32,12 @@
# Tomcat启动初始化的线程数,默认值10
min-spare: 100
+# 访客登记同步配置
+visitor:
+ sync:
+ enabled: false # 是否启用同步
+ url: http://对方服务器IP:端口/event-center/security-protection/visitor-register
+
# 日志配置
logging:
level:
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java
index c32aef7..cc3d2da 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysVisitorMachineServiceImpl.java
@@ -176,7 +176,6 @@
update.setOnlineStatus("ONLINE"); // 或 "ACTIVATED",根据你的枚举定义
update.setUpdateTime(new Date());
update.setFingerprint(fingerprint);
-
return visitorMachineMapper.updateMachine(update);
}
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
index 917ff20..ee17fa0 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysVisitorMachineMapper.xml
@@ -141,14 +141,29 @@
<update id="updateMachine" parameterType="SysVisitorMachine">
update t_visitor_machine
- set area_id = #{areaId},
- device_name = #{deviceName},
- brand = #{brand},
- device_id = #{deviceId},
- enabled = #{enabled},
- remark = #{remark},
+ <set>
+ <if test="areaId != null and areaId != ''">
+ area_id = #{areaId},
+ </if>
+ <if test="deviceName != null and deviceName != ''">
+ device_name = #{deviceName},
+ </if>
+ <if test="brand != null and brand != ''">
+ brand = #{brand},
+ </if>
+ <if test="deviceId != null and deviceId != ''">
+ device_id = #{deviceId},
+ </if>
+ <if test="enabled != null">
+ enabled = #{enabled}, <!-- 注意:enabled 可能是 Boolean 或 Integer,若允许 false 或 0,则只判 null -->
+ </if>
+ <if test="remark != null and remark != ''">
+ remark = #{remark},
+ </if>
+ <!-- 以下两个字段始终更新,不加 if -->
update_by = #{updateBy},
update_time = sysdate()
+ </set>
where machine_id = #{machineId}
and del_flag = '0'
</update>
--
Gitblit v1.7.1