fix 管理员看不到订单
Some checks failed
Build and Push Backend / docker (push) Failing after 6s

This commit is contained in:
irving
2025-10-31 23:59:52 -04:00
parent b6f89045ab
commit fb2bd510b1
2 changed files with 64 additions and 2 deletions

View File

@@ -10,18 +10,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.starry.admin.common.domain.LoginUser;
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
import com.starry.admin.modules.clerk.module.enums.ClerkRoleStatus;
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
import com.starry.admin.modules.personnel.mapper.PlayPersonnelGroupInfoMapper;
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelGroupInfoEntity;
import com.starry.admin.modules.personnel.module.vo.PlayPersonnelGroupInfoQueryVo;
import com.starry.admin.modules.personnel.module.vo.PlayPersonnelGroupInfoReturnVo;
import com.starry.admin.modules.personnel.service.IPlayPersonnelGroupInfoService;
import com.starry.common.enums.TenantRoleEnum;
import com.starry.common.utils.IdUtils;
import com.starry.common.utils.StringUtils;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
@@ -130,7 +133,13 @@ public class PlayPersonnelGroupInfoServiceImpl
@Override
public List<String> getValidClerkIdList(LoginUser loginUser, String clerkNickName) {
List<String> idList;
PlayPersonnelGroupInfoEntity groupInfoEntity = this.selectByUserId(loginUser.getUserId());
Set<String> roleKeys = loginUser != null && loginUser.getRoles() != null ? loginUser.getRoles()
: Collections.emptySet();
boolean hasOperatorRole = TenantRoleEnum.contains(roleKeys, TenantRoleEnum.OPERATOR);
PlayPersonnelGroupInfoEntity groupInfoEntity = null;
if (!hasOperatorRole && loginUser != null) {
groupInfoEntity = this.selectByUserId(loginUser.getUserId());
}
if (Objects.nonNull(groupInfoEntity)) {
List<PlayClerkUserInfoEntity> list = clerkUserInfoService
.list(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class)
@@ -147,7 +156,7 @@ public class PlayPersonnelGroupInfoServiceImpl
// 返回所有的clerkId
idList = clerkUserInfoService
.list(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).select(PlayClerkUserInfoEntity::getId)
.eq(PlayClerkUserInfoEntity::getClerkState, "1"))
.eq(PlayClerkUserInfoEntity::getClerkState, ClerkRoleStatus.CLERK.getCode()))
.stream().map(PlayClerkUserInfoEntity::getId).collect(Collectors.toList());
}