From 618020de3aabe32d81ec4b3c9f453c01c050db66 Mon Sep 17 00:00:00 2001 From: hejiayang <296714699@qq.com> Date: Mon, 16 Mar 2026 18:09:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(watch):=20=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=88=97=E8=A1=A8bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WatchMqttNoticeController.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchMqttNoticeController.java b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchMqttNoticeController.java index 280cb07..01cb50b 100644 --- a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchMqttNoticeController.java +++ b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/controller/WatchMqttNoticeController.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.renkang.watch.constant.WatchConstants; import com.renkang.watch.entity.WatchMqttNotice; @@ -90,15 +91,17 @@ public class WatchMqttNoticeController extends JeecgController nameList = new ArrayList<>(); - for (String userId : userIds) { - String name = userMap.get(userId); - if (StrUtil.isNotEmpty(name)) { - nameList.add(name); + if(StringUtils.isNotEmpty(mn.getUserId())){ + String[] userIds = mn.getUserId().split(","); + List nameList = new ArrayList<>(); + for (String userId : userIds) { + String name = userMap.get(userId); + if (StrUtil.isNotEmpty(name)) { + nameList.add(name); + } } + mn.setUserName(StrUtil.join(",", nameList)); } - mn.setUserName(StrUtil.join(",", nameList)); } } return Result.OK(pageList);