Browse Source

警务人员管理搜索

master
laishajiang 2 years ago
parent
commit
3d116d847e
  1. 18
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/PoliceUserController.java
  2. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/IPoliceUserService.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java
  4. 87
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java
  5. 2
      mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyCreateValidate.java

18
mailbox-lan/src/main/java/com/biutag/lan/controller/system/PoliceUserController.java

@ -23,6 +23,7 @@ import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@ -134,6 +135,14 @@ public class PoliceUserController {
return AjaxResult.success(iPoliceUserService.listByCurrentDept(name));
}
@NotPower
@GetMapping("/listByCurrentDeptAndDeptPid")
@ApiOperation(value="当前部门人员列表")
public AjaxResult<List<PoliceUser>> listByCurrentDeptAndDeptPid(String name,String departId) {
return AjaxResult.success(iPoliceUserService.listByCurrentDeptAndDeptPid(departId,name));
}
@NotPower
@GetMapping("/listByEmpNo")
@ApiOperation(value="当前人员信息")
@ -141,4 +150,13 @@ public class PoliceUserController {
return AjaxResult.success(iPoliceUserService.getOneByEmpNo(EmpNo));
}
@NotPower
@GetMapping("/listByCurrentEmpNo")
@ApiOperation(value="当前人员信息")
public AjaxResult<List<PoliceUser>> listByCurrentEmpNo(String departId ,String EmpNo) {
return AjaxResult.success(iPoliceUserService.listByCurrentEmpNo(departId,EmpNo));
}
}

2
mailbox-lan/src/main/java/com/biutag/lan/service/IPoliceUserService.java

@ -164,4 +164,6 @@ public interface IPoliceUserService {
List<PoliceUser> listByCurrentDept(String name);
List<PoliceUser> listByCurrentDeptAndDeptPid(String departId ,String name);
List<PoliceUser> listByCurrentEmpNo(String departId ,String EmpNo);
}

2
mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java

@ -212,7 +212,7 @@ public class DutyServiceImpl implements IDutyService {
.last("limit 1"));
Assert.notNull(policeUser, "警员不存在");
model.setPoliceName(policeUser.getName());
model.setMobile(policeUser.getMobile());
model.setMobile(createValidate.getMobile());
model.setEmpNo(createValidate.getEmpNo());
DictData dictData = dictDataMapper.selectOne(new QueryWrapper<DictData>()
.select("id,type_id,name,value,remark,sort,status,create_time,update_time")

87
mailbox-lan/src/main/java/com/biutag/lan/service/impl/PoliceUserServiceImpl.java

@ -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);
}
}
}

2
mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyCreateValidate.java

@ -36,7 +36,7 @@ public class DutyCreateValidate implements Serializable {
@ApiModelProperty(value = "民警姓名")
private String policeName;
@NotNull(message = "手机号参数缺失")
@ApiModelProperty(value = "手机号")
private String mobile;

Loading…
Cancel
Save