更新获取运维人员分页数据
This commit is contained in:
parent
13d082727d
commit
8a128c37e9
@ -22,7 +22,6 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
@ -92,15 +91,20 @@ public class WorkUserServiceImpl implements WorkUserService {
|
||||
public List<XhpcWorkUserDomain> getPage(Map<String, Object> params){
|
||||
Map<String, Object> deptParams = new HashMap<>();
|
||||
deptParams.put("tenantId", params.get("tenantId"));
|
||||
|
||||
String deptIds = params.get("deptId") + "";
|
||||
for(int i=0; i< 3;i++){
|
||||
deptParams.put("parentDeptIds", params.get("deptId"));
|
||||
List<XhpcWorkDeptDomain> deptDomainList = deptMapper.selectListByParams(deptParams);
|
||||
deptIds = deptDomainList.stream().map(dept->dept.getWorkDeptId().toString()).collect(Collectors.joining(","));
|
||||
if (params.get("deptId") != null){
|
||||
String deptIds = params.get("deptId") + "";
|
||||
for(int i=0; i< 3;i++){
|
||||
deptParams.put("parentDeptIds", deptIds);
|
||||
List<XhpcWorkDeptDomain> deptDomainList = deptMapper.selectListByParams(deptParams);
|
||||
for(XhpcWorkDeptDomain workDeptDomain: deptDomainList){
|
||||
deptIds = deptIds + "," + workDeptDomain.getWorkDeptId();
|
||||
}
|
||||
}
|
||||
params.put("deptIds", deptIds);
|
||||
}
|
||||
if(params.get("deptIds") != null){
|
||||
params.put("deptId", null);
|
||||
}
|
||||
|
||||
params.put("deptIds", deptIds);
|
||||
return workUserMapper.selectPage(params);
|
||||
}
|
||||
|
||||
@ -167,10 +171,10 @@ public class WorkUserServiceImpl implements WorkUserService {
|
||||
public Boolean updateDomain(XhpcWorkUserDomain domain){
|
||||
|
||||
SysUser user = userMapper.selectUserByUserName(domain.getLoginName(), domain.getTenantId());
|
||||
SysUser sysUser = userMapper.checkPhoneUnique(domain.getPhone(), domain.getTenantId());
|
||||
if(StringUtils.isNotNull(sysUser)){
|
||||
throw new CustomException("更新用户'" + domain.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
// SysUser sysUser = userMapper.checkPhoneUnique(domain.getPhone(), domain.getTenantId());
|
||||
// if(StringUtils.isNotNull(sysUser)){
|
||||
// throw new CustomException("更新用户'" + domain.getUserName() + "'失败,手机号码已存在");
|
||||
// }
|
||||
|
||||
user.setPhonenumber(domain.getPhone());
|
||||
user.setEmail(domain.getEmail());
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
left join xhpc_work_dept d on u.dept_id=d.work_dept_id
|
||||
left join sys_user su on su.phonenumber = u.phone
|
||||
where u.del_flag=0 and d.del_flag=0
|
||||
<if test="params.deptId!=null">
|
||||
<if test="params.deptId!=null and params.deptId!=''">
|
||||
and (d.work_dept_id=#{params.deptId} or d.parent_dept_id=#{params.deptId})
|
||||
</if>
|
||||
<if test="params.type!=null and params.type!=''">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user