| | |
| | | //设置范围 0直属部门员工 1部门及其下级布恩员工 2指定人员 |
| | | if(Constants.equalsInteger(managers.getIsMember(),Constants.ZERO) || Constants.equalsInteger(managers.getIsMember(),Constants.ONE)){ |
| | | //直属部门 或 部门及其子部门 |
| | | if(managers.getCompanyId() ==null ){ |
| | | /* if(managers.getCompanyId() ==null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Company company = companyMapper.selectById(managers.getCompanyId()); |
| | | if(company == null || Constants.equalsInteger(company.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,部门信息不存在,请刷新页面重试!"); |
| | | }*/ |
| | | if(managers.getCompanyIds() ==null || managers.getCompanyIds().size() ==0 ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | memberList =memberMapper.selectJoinList(Member.class,new MPJLambdaWrapper<Member>() |
| | | .selectAll(Member.class) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ZERO),"select (cm.id) from company_member cm where cm.company_id='"+company.getId()+"' and cm.member_id=t.id") |
| | | .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ONE),"select (cm.id) from company_member cm where cm.company_id_path like '"+company.getIdPath()+"%' and cm.member_id=t.id")); |
| | | .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ZERO),"select (cm.id) from company_member cm where cm.company_id in ("+String.join(",",managers.getCompanyIds())+" ) and cm.member_id=t.id") |
| | | // .exists(Constants.equalsInteger(managers.getIsMember(),Constants.ONE),"select (cm.id) from company_member cm where cm.company_id_path like '"+company.getIdPath()+"%' and cm.member_id=t.id") |
| | | ); |
| | | }else{ |
| | | if(managers.getMemberIds()==null || managers.getMemberIds().size()==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按要求选择指定员工信息!"); |