From b1a39167ac4e6607cfb0ad51e28bd848b5839af7 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Mon, 27 Apr 2026 11:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E8=A7=92=E8=89=B2=20?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/czg/account/entity/ShopStaff.java | 2 ++ .../service/impl/ShopStaffServiceImpl.java | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cash-common/cash-common-service/src/main/java/com/czg/account/entity/ShopStaff.java b/cash-common/cash-common-service/src/main/java/com/czg/account/entity/ShopStaff.java index 28ca1777d..736d86c42 100644 --- a/cash-common/cash-common-service/src/main/java/com/czg/account/entity/ShopStaff.java +++ b/cash-common/cash-common-service/src/main/java/com/czg/account/entity/ShopStaff.java @@ -89,6 +89,8 @@ public class ShopStaff implements Serializable { @Column(ignore = true) private Long roleId; @Column(ignore = true) + private String roleName; + @Column(ignore = true) private String accountName; @Column(ignore = true) private String accountPwd; diff --git a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopStaffServiceImpl.java b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopStaffServiceImpl.java index 4cecc690b..df5b97833 100644 --- a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopStaffServiceImpl.java +++ b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopStaffServiceImpl.java @@ -17,7 +17,6 @@ import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; import jakarta.annotation.Resource; import org.apache.dubbo.config.annotation.DubboService; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; @@ -48,7 +47,7 @@ public class ShopStaffServiceImpl extends ServiceImpl page = page(PageUtil.buildPage(), queryWrapper); + for (ShopStaff record : page.getRecords()) { + SysUsersRoles sysUsersRoles = sysUsersRolesService.getOne(new QueryWrapper().eq(SysUsersRoles::getUserId, record.getId())); + if (sysUsersRoles != null) { + record.setRoleId(sysUsersRoles.getRoleId()); + SysRole role = sysRoleService.getById(sysUsersRoles.getRoleId()); + record.setRoleName(role == null ? "" : role.getName()); + } + } + return page; } @Override