|
@@ -8,6 +8,7 @@ import com.huaxu.entity.UserEntity;
|
|
|
import com.huaxu.entity.UserRoleEntity;
|
|
|
import com.huaxu.entity.UserTagEntity;
|
|
|
import com.huaxu.model.LoginUser;
|
|
|
+import com.huaxu.model.ProgramItem;
|
|
|
import com.huaxu.util.UserUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -40,8 +41,19 @@ public class UserService extends ServiceImpl<UserMapper,UserEntity> {
|
|
|
*/
|
|
|
public IPage<UserEntity> findPage(IPage<UserEntity> page, UserEntity userEntity) {
|
|
|
LoginUser currentUser = UserUtil.getCurrentUser();
|
|
|
- userEntity.setTenantId(currentUser.getTenantId());
|
|
|
- Page<UserEntity> userPage = userMapper.findPage(page, userEntity);
|
|
|
+ List<ProgramItem> programItems = new ArrayList<ProgramItem>();
|
|
|
+ Long[] ids = null;
|
|
|
+ if (currentUser != null) {
|
|
|
+ userEntity.setTenantId(currentUser.getTenantId());
|
|
|
+ programItems = currentUser.getProgramItemList();
|
|
|
+ if (programItems!=null &&programItems.size() > 0) {
|
|
|
+ ids = new Long[programItems.size()];
|
|
|
+ for ( int i=0;i< programItems.size();i++) {
|
|
|
+ ids[i]= Long.valueOf(programItems.get(i).getOrgId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Page<UserEntity> userPage = userMapper.findPage(page, userEntity, currentUser.getType(), ids);
|
|
|
return userPage;
|
|
|
}
|
|
|
|