|
@@ -51,6 +51,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
ProjectApproveMapper projectApproveMapper;
|
|
|
@Resource
|
|
|
PowerMapper powerMapper;
|
|
|
+ @Resource
|
|
|
+ UserCompanyMapper userCompanyMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg addAndUpdateProject(Project project, Integer flag, User user, String userIds,
|
|
@@ -478,26 +480,30 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getUserListByCompanyIds(String companyIds, Integer adminId, Integer projectId) {
|
|
|
+ public HttpRespMsg getUserListByCompanyIds(String companyIds, Integer id, Integer projectId) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ User user = userMapper.selectById(id);
|
|
|
QueryWrapper<User> qw = new QueryWrapper<User>();
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
+ ids.add(-1);
|
|
|
if (!"".equals(companyIds) && companyIds != null) {
|
|
|
- List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(companyIds);
|
|
|
- //该项目的项目经理不能充当参与人
|
|
|
- Integer managerId = -1;
|
|
|
- if (projectId != null) {
|
|
|
- Project project = projectMapper.selectById(projectId);
|
|
|
- if (adminId == project.getManagerId()) {
|
|
|
- //是本项目的项目项目经理需要返回本人
|
|
|
- qw.eq("id", adminId);
|
|
|
- }
|
|
|
+ ids = ListUtil.convertIntegerIdsArrayToList(companyIds);
|
|
|
+ }
|
|
|
+ List<Integer> uids = new ArrayList<>();
|
|
|
+ uids.add(-1);
|
|
|
+ if(Constant.SYS_ID == user.getParentId()){
|
|
|
+ //资产方管理员
|
|
|
+ uids = userCompanyMapper.selectList(new QueryWrapper<UserCompany>().eq("cooperation_company_id", user.getCompanyId()).in("belong_company_id",ids)).stream().map(UserCompany::getUserId).collect(Collectors.toList());
|
|
|
+ }else{
|
|
|
+ //项目经理
|
|
|
+ if(null != projectId){
|
|
|
+ Project pro = projectMapper.selectById(projectId);
|
|
|
+ user = userMapper.selectById(pro.getCreatorId());
|
|
|
+ uids = userCompanyMapper.selectList(new QueryWrapper<UserCompany>().eq("cooperation_company_id", user.getCompanyId()).in("belong_company_id",ids)).stream().map(UserCompany::getUserId).collect(Collectors.toList());
|
|
|
}
|
|
|
- //所选公司下的人
|
|
|
- qw.in("company_id", ids);
|
|
|
- //不包含资产方的系统管理员
|
|
|
- qw.ne("parent_id", Constant.SYS_ID);
|
|
|
- msg.data = userMapper.selectList(qw);
|
|
|
}
|
|
|
+ qw.in("id",uids).ne("id",id);
|
|
|
+ msg.data = userMapper.selectList(qw);
|
|
|
return msg;
|
|
|
}
|
|
|
|