feat(REQ-3282): 岗位接口参数支持查询身份id和岗位名模糊条件
This commit is contained in:
parent
abf4d345f0
commit
7faac00411
@ -73,4 +73,19 @@ public class PageOrgJobReq extends PageReqV2 {
|
||||
*/
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 岗位名称 模糊查询
|
||||
*/
|
||||
private String jobNameLike;
|
||||
|
||||
/**
|
||||
* 关联身份类型 1工人 2班组长 3从业人员 5运营人员
|
||||
*/
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
* 查询返回数据包含,逻辑删除数据,即查询未删除和已删除的数据。
|
||||
*/
|
||||
private Boolean includeDeleted;
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package cn.axzo.orgmanax.infra.dao.orgjob.entity;
|
||||
|
||||
import cn.axzo.orgmanax.dto.job.enums.OrgJobFlagEnum;
|
||||
import cn.axzo.orgmanax.dto.job.enums.OrgJobTypeEnum;
|
||||
import cn.axzo.orgmanax.dto.job.enums.VisibilityEnum;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -59,7 +62,7 @@ public class OrgJob implements Serializable {
|
||||
/**
|
||||
* 可见性: SHOW-可见,HIDE-隐藏
|
||||
*/
|
||||
private String visible;
|
||||
private VisibilityEnum visible;
|
||||
|
||||
/**
|
||||
* 是否为默认岗的标识: 0-非默认,1-默认
|
||||
@ -74,12 +77,12 @@ public class OrgJob implements Serializable {
|
||||
/**
|
||||
* 岗位类型:SYSTEM - 系统,CUSTOM - 自定义
|
||||
*/
|
||||
private String type;
|
||||
private OrgJobTypeEnum type;
|
||||
|
||||
/**
|
||||
* 岗位标签:SYSTEM - 系统岗,BUSINESS - 业务岗
|
||||
*/
|
||||
private String flag;
|
||||
private OrgJobFlagEnum flag;
|
||||
|
||||
/**
|
||||
* 单位id,自定义类型时该值才有意义
|
||||
@ -99,6 +102,7 @@ public class OrgJob implements Serializable {
|
||||
/**
|
||||
* 关联身份类型 1-工人,2-班组长,3-从业人员,5-运营人员
|
||||
*/
|
||||
@TableField("identity_type")
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
@ -139,7 +143,5 @@ public class OrgJob implements Serializable {
|
||||
*/
|
||||
private Long isDelete;
|
||||
|
||||
// public static class LongListTypeHandler<Long> extends BaseListTypeHandler<Long> {
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +69,17 @@ public interface OrgJobQueryRepository {
|
||||
@CriteriaField(field = "name", operator = Operator.LIKE)
|
||||
private String nameLike;
|
||||
|
||||
/**
|
||||
* 关联身份类型 1工人 2班组长 3从业人员 5运营人员
|
||||
*/
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
* 查询返回数据包含,逻辑删除数据,即查询未删除和已删除的数据。
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
private Boolean includeDeleted;
|
||||
|
||||
}
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@ -11,6 +11,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@ -32,6 +33,9 @@ public class OrgJobQueryRepositoryImpl implements OrgJobQueryRepository {
|
||||
.or()
|
||||
.like("alias", req.getKeyword()));
|
||||
}
|
||||
if (BooleanUtils.isNotTrue(req.getIncludeDeleted())) {
|
||||
wrapper.eq("is_delete", 0);
|
||||
}
|
||||
if (wrapper.isEmptyOfWhere()) {
|
||||
return PageResp.<JobResp>builder().build();
|
||||
}
|
||||
|
||||
@ -77,8 +77,6 @@ public class OrgJobPageParam extends PageReqV2 {
|
||||
*/
|
||||
private Boolean readonly;
|
||||
|
||||
// workspace和unitId 只有自定义类型使用
|
||||
|
||||
/**
|
||||
* 单位/团队 ID.
|
||||
*/
|
||||
@ -89,6 +87,16 @@ public class OrgJobPageParam extends PageReqV2 {
|
||||
*/
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 关联身份类型 1工人 2班组长 3从业人员 5运营人员
|
||||
*/
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
* 查询返回数据包含,逻辑删除数据,即查询未删除和已删除的数据。
|
||||
*/
|
||||
private Boolean includeDeleted;
|
||||
|
||||
public Set<Integer> fetchTypes() {
|
||||
if (CollUtil.isNotEmpty(cooperateTypes)) {
|
||||
return Sets.newHashSet(cooperateTypes);
|
||||
|
||||
@ -94,8 +94,10 @@ public class OrgJobServiceImpl implements OrgJobService {
|
||||
|
||||
@Override
|
||||
public PageResp<OrgJobDTO> page(OrgJobPageParam param) {
|
||||
log.info("org job page request param: [{}]", JSONUtil.toJsonStr(param));
|
||||
resolveCooperateTypes(param);
|
||||
OrgJobPageParam orgJobPageParam = resolveJobPageParam(param);
|
||||
log.info("org job page actual param: [{}]", JSONUtil.toJsonStr(param));
|
||||
PageResp<OrgJobDTO> orgJobs = foundationService.page(param);
|
||||
if (CollUtil.isEmpty(orgJobs.getData())) {
|
||||
log.info("org job page there is not any job. param:{}", JSONUtil.toJsonStr(orgJobPageParam));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user