7 changed files with 316 additions and 4 deletions
@ -0,0 +1,31 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName GenderEnum |
||||||
|
* @Description 男女枚举类 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/16 14:36 |
||||||
|
*/ |
||||||
|
public enum GenderEnum implements IntegerEnum { |
||||||
|
|
||||||
|
MALE(0, "男"), |
||||||
|
FEMALE(1, "女"); |
||||||
|
|
||||||
|
private final int code; |
||||||
|
private final String desc; |
||||||
|
|
||||||
|
GenderEnum(int code, String desc) { |
||||||
|
this.code = code; |
||||||
|
this.desc = desc; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getDesc() { |
||||||
|
return desc; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,96 @@ |
|||||||
|
package com.biutag.supervision.pojo.param; |
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDate; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SupPoliceQueryParam |
||||||
|
* @Description 警员信息查询实体 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/16 11:05 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "警员信息查询实体") |
||||||
|
public class SupPoliceQueryParam { |
||||||
|
|
||||||
|
@Schema(description = "id") |
||||||
|
private String id; |
||||||
|
|
||||||
|
@Schema(description = "id集合") |
||||||
|
private Set<String> ids; |
||||||
|
|
||||||
|
@Schema(description = "组织机构ID") |
||||||
|
private String orgId; |
||||||
|
|
||||||
|
@Schema(description = "组织机构ID集合") |
||||||
|
private Set<String> orgIds; |
||||||
|
|
||||||
|
@Schema(description = "所属区域ID") |
||||||
|
private String districtId; |
||||||
|
|
||||||
|
@Schema(description = "警号") |
||||||
|
private String empNo; |
||||||
|
|
||||||
|
@Schema(description = "警号集合") |
||||||
|
private Set<String> empNos; |
||||||
|
|
||||||
|
@Schema(description = "姓名(模糊查询)") |
||||||
|
private String name; |
||||||
|
|
||||||
|
@Schema(description = "显示名称(模糊查询)") |
||||||
|
private String displayName; |
||||||
|
|
||||||
|
@Schema(description = "身份证号码(精确查询 / 回车查询)") |
||||||
|
private String idCode; |
||||||
|
|
||||||
|
@Schema(description = "手机号") |
||||||
|
private String mobile; |
||||||
|
|
||||||
|
@Schema(description = "账号") |
||||||
|
private String account; |
||||||
|
|
||||||
|
@Schema(description = "职位") |
||||||
|
private String job; |
||||||
|
|
||||||
|
@Schema(description = "职位类型") |
||||||
|
private String jobType; |
||||||
|
|
||||||
|
@Schema(description = "人员类型 0原始 1协警 2文员 3临时工") |
||||||
|
private String type; |
||||||
|
|
||||||
|
@Schema(description = "人员状态") |
||||||
|
private String personStatus; |
||||||
|
|
||||||
|
@Schema(description = "人员属性") |
||||||
|
private String personType; |
||||||
|
|
||||||
|
/** |
||||||
|
* @see com.biutag.supervision.constants.enums.GenderEnum |
||||||
|
*/ |
||||||
|
@Schema(description = "性别") |
||||||
|
private String gender; |
||||||
|
|
||||||
|
@Schema(description = "婚姻状况") |
||||||
|
private String maritalStatus; |
||||||
|
|
||||||
|
@Schema(description = "是否有子女") |
||||||
|
private Boolean haveChildren; |
||||||
|
|
||||||
|
@Schema(description = "学历") |
||||||
|
private String education; |
||||||
|
|
||||||
|
@Schema(description = "入职日期-开始") |
||||||
|
private LocalDate employmentDateStart; |
||||||
|
|
||||||
|
@Schema(description = "入职日期-结束") |
||||||
|
private LocalDate employmentDateEnd; |
||||||
|
|
||||||
|
@Schema(description = "状态") |
||||||
|
private String status; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,31 @@ |
|||||||
|
package com.biutag.supervision.pojo.request.comfort; |
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.biutag.supervision.aop.ParamChecked; |
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ComfortApply |
||||||
|
* @Description ComfortApplyRequest |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/16 10:50 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "维权申请人请求实体") |
||||||
|
public class ComfortApplyRequest implements ParamChecked { |
||||||
|
|
||||||
|
@Schema(description = "身份证号") |
||||||
|
private String idCode; |
||||||
|
|
||||||
|
@Schema(description = "警号") |
||||||
|
private String empNo; |
||||||
|
@Override |
||||||
|
public void check() { |
||||||
|
if (StrUtil.isAllBlank(idCode, empNo)){ |
||||||
|
throw new RuntimeException("身份证和警号不能同时为空!!"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,40 @@ |
|||||||
|
package com.biutag.supervision.pojo.vo; |
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ComfortApplyVo |
||||||
|
* @Description 维权申请人返回实体 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/16 10:56 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "维权申请人返回实体") |
||||||
|
public class ComfortApplyVo { |
||||||
|
|
||||||
|
@Schema(description = "姓名(模糊查询)") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* @see com.biutag.supervision.constants.enums.GenderEnum |
||||||
|
*/ |
||||||
|
@Schema(description = "性别") |
||||||
|
private String gender; |
||||||
|
|
||||||
|
@Schema(description = "身份证号码") |
||||||
|
private String idCode; |
||||||
|
|
||||||
|
@Schema(description = "组织机构ID") |
||||||
|
private String orgId; |
||||||
|
|
||||||
|
@Schema(description = "警号") |
||||||
|
private String empNo; |
||||||
|
|
||||||
|
@Schema(description = "职位:正职 副职") |
||||||
|
private String position; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,76 @@ |
|||||||
|
package com.biutag.supervision.repository.supPolice; |
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil; |
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.biutag.supervision.mapper.SupPoliceMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.SupPolice; |
||||||
|
import com.biutag.supervision.pojo.param.SupPoliceQueryParam; |
||||||
|
import jakarta.annotation.Resource; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.function.Function; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SupPoliceResourceService |
||||||
|
* @Description SupPoliceResourceService |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/16 11:00 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class SupPoliceResourceService { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private SupPoliceMapper supPoliceMapper; |
||||||
|
|
||||||
|
public Map<String, SupPolice> query(SupPoliceQueryParam param) { |
||||||
|
LambdaQueryWrapper<SupPolice> queryWrapper = new LambdaQueryWrapper<>(); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getId()), SupPolice::getId, param.getId()); |
||||||
|
queryWrapper.in(CollUtil.isNotEmpty(param.getIds()), SupPolice::getId, param.getIds()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getOrgId()), SupPolice::getOrgId, param.getOrgId()); |
||||||
|
queryWrapper.in(CollUtil.isNotEmpty(param.getOrgIds()), SupPolice::getOrgId, param.getOrgIds()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getDistrictId()), SupPolice::getDistrictId, param.getDistrictId()); |
||||||
|
// 警号 精确/集合
|
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getEmpNo()), SupPolice::getEmpNo, param.getEmpNo()); |
||||||
|
queryWrapper.in(CollUtil.isNotEmpty(param.getEmpNos()), SupPolice::getEmpNo, param.getEmpNos()); |
||||||
|
|
||||||
|
// 身份证 / 手机 / 账号
|
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getIdCode()), SupPolice::getIdCode, param.getIdCode()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getMobile()), SupPolice::getMobile, param.getMobile()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getAccount()), SupPolice::getAccount, param.getAccount()); |
||||||
|
|
||||||
|
// 模糊:姓名 / 显示名称
|
||||||
|
queryWrapper.like(StrUtil.isNotBlank(param.getName()), SupPolice::getName, param.getName()); |
||||||
|
queryWrapper.like(StrUtil.isNotBlank(param.getDisplayName()), SupPolice::getDisplayName, param.getDisplayName()); |
||||||
|
|
||||||
|
// 枚举/状态类字段
|
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getJob()), SupPolice::getJob, param.getJob()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getJobType()), SupPolice::getJobType, param.getJobType()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getType()), SupPolice::getType, param.getType()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getPersonStatus()), SupPolice::getPersonStatus, param.getPersonStatus()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getPersonType()), SupPolice::getPersonType, param.getPersonType()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getGender()), SupPolice::getGender, param.getGender()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getMaritalStatus()), SupPolice::getMaritalStatus, param.getMaritalStatus()); |
||||||
|
queryWrapper.eq(param.getHaveChildren() != null, SupPolice::getHaveChildren, param.getHaveChildren()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getEducation()), SupPolice::getEducation, param.getEducation()); |
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(param.getStatus()), SupPolice::getStatus, param.getStatus()); |
||||||
|
|
||||||
|
// 入职日期区间
|
||||||
|
queryWrapper.ge(param.getEmploymentDateStart() != null, SupPolice::getEmploymentDate, param.getEmploymentDateStart()); |
||||||
|
queryWrapper.le(param.getEmploymentDateEnd() != null, SupPolice::getEmploymentDate, param.getEmploymentDateEnd()); |
||||||
|
|
||||||
|
// 排序(你也可以换成 sortId / empNo)
|
||||||
|
queryWrapper.orderByAsc(SupPolice::getSortId).orderByAsc(SupPolice::getEmpNo); |
||||||
|
|
||||||
|
List<SupPolice> list = supPoliceMapper.selectList(queryWrapper); |
||||||
|
if (CollUtil.isEmpty(list)) { |
||||||
|
return Collections.emptyMap(); |
||||||
|
} |
||||||
|
return list.stream().collect(Collectors.toMap(SupPolice::getEmpNo, Function.identity(), (s1, s2) -> s1)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue