This commit is contained in:
hucs
2024-07-04 10:51:26 +08:00
parent 4f4c6fa0d6
commit 08d50c8ad5
12 changed files with 28 additions and 16 deletions

View File

@@ -86,8 +86,9 @@ public interface IPlayPersonnelGroupInfoService extends IService<PlayPersonnelGr
/**
* 筛选所有的组员
*
* @param loginUser 登录用户
* @param loginUser 登录用户
* @param clerkNickName
* @return 组员ID列表
*/
List<String> getValidClerkIdList(LoginUser loginUser);
List<String> getValidClerkIdList(LoginUser loginUser, String clerkNickName);
}

View File

@@ -17,6 +17,7 @@ import com.starry.admin.modules.personnel.module.vo.PlayPersonnelGroupInfoQueryV
import com.starry.admin.modules.personnel.module.vo.PlayPersonnelGroupInfoReturnVo;
import com.starry.admin.modules.personnel.service.IPlayPersonnelGroupInfoService;
import com.starry.common.utils.IdUtils;
import com.starry.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -119,7 +120,7 @@ public class PlayPersonnelGroupInfoServiceImpl extends ServiceImpl<PlayPersonnel
}
@Override
public List<String> getValidClerkIdList(LoginUser loginUser) {
public List<String> getValidClerkIdList(LoginUser loginUser, String clerkNickName) {
List<String> idList;
PlayPersonnelGroupInfoEntity groupInfoEntity = this.selectByUserId(loginUser.getUserId());
if (Objects.nonNull(groupInfoEntity)) {
@@ -134,6 +135,14 @@ public class PlayPersonnelGroupInfoServiceImpl extends ServiceImpl<PlayPersonnel
idList = clerkUserInfoService.list(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).select(PlayClerkUserInfoEntity::getId)).stream().map(PlayClerkUserInfoEntity::getId).collect(Collectors.toList());
}
if (CollectionUtil.isEmpty(idList)) {
idList = Collections.singletonList("-999");
}
// 加入nickName的筛选
if(StringUtils.isNotEmpty(clerkNickName)){
LambdaQueryWrapper<PlayClerkUserInfoEntity> wrapper = Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).in(PlayClerkUserInfoEntity::getId, idList).like(PlayClerkUserInfoEntity::getNickname, clerkNickName).select(PlayClerkUserInfoEntity::getId);
idList = clerkUserInfoService.list(wrapper).stream().map(PlayClerkUserInfoEntity::getId).collect(Collectors.toList());
}
if (CollectionUtil.isEmpty(idList)) {
idList = Collections.singletonList("-999");
}