|
|
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
@ -27,6 +28,9 @@ public class MatrixUserService { |
|
|
|
@Autowired |
|
|
|
private MatrixAppMapper appMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminService adminService; |
|
|
|
|
|
|
|
public PageResult<UserBo> list(UserQuery query) { |
|
|
|
MatrixApp app = appMapper.queryByCode(query.appCode); |
|
|
|
LambdaQueryWrapper<MatrixUser> wrapper = new LambdaQueryWrapper<>(); |
|
|
@ -51,4 +55,11 @@ public class MatrixUserService { |
|
|
|
List<MatrixUser> list = userMapper.selectList(wrapper); |
|
|
|
return list.stream().collect(Collectors.toMap(MatrixUser::getId, x -> x)); |
|
|
|
} |
|
|
|
|
|
|
|
public void changeStatus(Integer adminId, Integer userId, Integer status) { |
|
|
|
MatrixUser u = userMapper.selectById(userId); |
|
|
|
List<Integer> appIds = adminService.getAdminAppIds(adminId); |
|
|
|
Assert.isTrue(appIds.contains(u.getAppId()), "非法请求"); |
|
|
|
userMapper.updateStatus(userId, status); |
|
|
|
} |
|
|
|
} |
|
|
|