|
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.biutag.core.AjaxResult; |
|
|
|
|
import com.biutag.core.PageResult; |
|
|
|
|
import com.biutag.entity.system.*; |
|
|
|
|
import com.biutag.enums.RoleEnum; |
|
|
|
|
@ -24,10 +25,7 @@ import com.biutag.lan.validate.system.PoliceUserSearchValidate;
|
|
|
|
|
import com.biutag.lan.validate.system.PoliceUserUpInfoValidate; |
|
|
|
|
import com.biutag.lan.validate.system.PoliceUserUpdateValidate; |
|
|
|
|
import com.biutag.lan.vo.system.*; |
|
|
|
|
import com.biutag.mapper.system.MenuMapper; |
|
|
|
|
import com.biutag.mapper.system.PoliceDepartMapper; |
|
|
|
|
import com.biutag.mapper.system.PolicePositionMapper; |
|
|
|
|
import com.biutag.mapper.system.PoliceRoleMapper; |
|
|
|
|
import com.biutag.mapper.system.*; |
|
|
|
|
import com.biutag.util.StringUtils; |
|
|
|
|
import com.biutag.util.TimeUtils; |
|
|
|
|
import com.biutag.util.ToolUtils; |
|
|
|
|
@ -64,9 +62,11 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
|
|
|
|
|
@Resource |
|
|
|
|
IDeptService deptService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
IPostService iPostService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
DeptMapper deptMapper; |
|
|
|
|
/** |
|
|
|
|
* 管理员列表 |
|
|
|
|
* |
|
|
|
|
@ -538,4 +538,81 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
|
|
|
|
|
return policeUserMapper.selectList(queryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<PoliceUser> listByCurrentDeptAndDeptPid(String departId ,String name) { |
|
|
|
|
if(departId==null||departId.equals("")){ |
|
|
|
|
departId = AdminThreadLocal.getDeptId().toString(); |
|
|
|
|
} |
|
|
|
|
Dept dept = deptMapper.selectById(departId); |
|
|
|
|
if(dept.getLevel()==2){ |
|
|
|
|
QueryWrapper<Dept> DeptQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
DeptQueryWrapper.eq("id",departId).or().eq("pid",departId); |
|
|
|
|
List<Dept> depts = deptMapper.selectList(DeptQueryWrapper); |
|
|
|
|
List<PoliceUser> listPoliceVo = new ArrayList<PoliceUser>(); |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>().like(StringUtils.isNotEmpty(name), PoliceUser::getName, name); |
|
|
|
|
List<PoliceUser> listPolice = policeUserMapper.selectList(queryWrapper); |
|
|
|
|
for (PoliceUser policeUser : listPolice){ |
|
|
|
|
for (Dept dept_item :depts){ |
|
|
|
|
if (policeUser.getDeptIds().equals(dept_item.getId().toString())){ |
|
|
|
|
PoliceUser vo = new PoliceUser(); |
|
|
|
|
BeanUtils.copyProperties(policeUser, vo); |
|
|
|
|
listPoliceVo.add(vo); |
|
|
|
|
System.out.println(vo); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
System.out.println(listPoliceVo); |
|
|
|
|
return listPoliceVo; |
|
|
|
|
}else if (dept.getLevel()==3){ |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>().eq(PoliceUser::getDeptIds, departId) |
|
|
|
|
.like(StringUtils.isNotEmpty(name), PoliceUser::getName, name); |
|
|
|
|
return policeUserMapper.selectList(queryWrapper); |
|
|
|
|
}else{ |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>() |
|
|
|
|
.like(StringUtils.isNotEmpty(name), PoliceUser::getName, name); |
|
|
|
|
return policeUserMapper.selectList(queryWrapper); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<PoliceUser> listByCurrentEmpNo(String departId ,String EmpNo) { |
|
|
|
|
if(departId==null||departId.equals("")){ |
|
|
|
|
departId = AdminThreadLocal.getDeptId().toString(); |
|
|
|
|
} |
|
|
|
|
Dept dept = deptMapper.selectById(departId); |
|
|
|
|
if(dept.getLevel()==2){ |
|
|
|
|
QueryWrapper<Dept> DeptQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
DeptQueryWrapper.eq("id",departId).or().eq("pid",departId); |
|
|
|
|
List<Dept> depts = deptMapper.selectList(DeptQueryWrapper); |
|
|
|
|
List<PoliceUser> listPoliceVo = new ArrayList<PoliceUser>(); |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>().eq(StringUtils.isNotEmpty(EmpNo), PoliceUser::getEmpNo, EmpNo); |
|
|
|
|
List<PoliceUser> listPolice = policeUserMapper.selectList(queryWrapper); |
|
|
|
|
for (PoliceUser policeUser : listPolice){ |
|
|
|
|
for (Dept dept_item :depts){ |
|
|
|
|
if (policeUser.getDeptIds().equals(dept_item.getId().toString())){ |
|
|
|
|
PoliceUser vo = new PoliceUser(); |
|
|
|
|
BeanUtils.copyProperties(policeUser, vo); |
|
|
|
|
listPoliceVo.add(vo); |
|
|
|
|
System.out.println(vo); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
System.out.println(listPoliceVo); |
|
|
|
|
return listPoliceVo; |
|
|
|
|
}else if (dept.getLevel()==3){ |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>().eq(PoliceUser::getDeptIds, departId) |
|
|
|
|
.eq(StringUtils.isNotEmpty(EmpNo), PoliceUser::getEmpNo, EmpNo); |
|
|
|
|
return policeUserMapper.selectList(queryWrapper); |
|
|
|
|
}else{ |
|
|
|
|
LambdaQueryWrapper<PoliceUser> queryWrapper = new LambdaQueryWrapper<PoliceUser>() |
|
|
|
|
.eq(StringUtils.isNotEmpty(EmpNo), PoliceUser::getEmpNo, EmpNo); |
|
|
|
|
return policeUserMapper.selectList(queryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|