mirror of https://gitee.com/stylefeng/roses
【7.2.5】【org】更新获取组织机构审批人绑定列表接口
parent
cca9194e7a
commit
8ff237fd15
|
@ -0,0 +1,34 @@
|
||||||
|
package cn.stylefeng.roses.kernel.system.api.pojo.organization;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定用户信息详情(用在部门审批人绑定用户)
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2022/9/13 23:47
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BindUserItem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像url
|
||||||
|
*/
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司或部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package cn.stylefeng.roses.kernel.system.modular.organization.controller;
|
package cn.stylefeng.roses.kernel.system.modular.organization.controller;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||||
|
@ -29,6 +28,17 @@ public class HrOrgApproverController {
|
||||||
@Resource
|
@Resource
|
||||||
private HrOrgApproverService hrOrgApproverService;
|
private HrOrgApproverService hrOrgApproverService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取组织机构审批人绑定列表
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2022/09/13 23:15
|
||||||
|
*/
|
||||||
|
@GetResource(name = "获取组织机构审批人绑定列表", path = "/hrOrgApprover/getBindingList")
|
||||||
|
public ResponseData<List<HrOrgApprover>> getBindingList() {
|
||||||
|
return new SuccessResponseData<>(hrOrgApproverService.getBindingList());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
|
@ -53,49 +63,4 @@ public class HrOrgApproverController {
|
||||||
return new SuccessResponseData<>();
|
return new SuccessResponseData<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2022/09/13 23:15
|
|
||||||
*/
|
|
||||||
@PostResource(name = "编辑", path = "/hrOrgApprover/edit")
|
|
||||||
public ResponseData<?> edit(@RequestBody @Validated(HrOrgApproverRequest.edit.class) HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
hrOrgApproverService.edit(hrOrgApproverRequest);
|
|
||||||
return new SuccessResponseData<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看详情
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2022/09/13 23:15
|
|
||||||
*/
|
|
||||||
@GetResource(name = "查看详情", path = "/hrOrgApprover/detail")
|
|
||||||
public ResponseData<HrOrgApprover> detail(@Validated(HrOrgApproverRequest.detail.class) HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
return new SuccessResponseData<>(hrOrgApproverService.detail(hrOrgApproverRequest));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取列表
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2022/09/13 23:15
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取列表", path = "/hrOrgApprover/list")
|
|
||||||
public ResponseData<List<HrOrgApprover>> list(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
return new SuccessResponseData<>(hrOrgApproverService.findList(hrOrgApproverRequest));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取列表(带分页)
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2022/09/13 23:15
|
|
||||||
*/
|
|
||||||
@GetResource(name = "分页查询", path = "/hrOrgApprover/page")
|
|
||||||
public ResponseData<PageResult<HrOrgApprover>> page(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
return new SuccessResponseData<>(hrOrgApproverService.findPage(hrOrgApproverRequest));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@ package cn.stylefeng.roses.kernel.system.modular.organization.entity;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.annotation.EnumFieldFormat;
|
||||||
|
import cn.stylefeng.roses.kernel.system.api.enums.OrgApproverTypeEnum;
|
||||||
|
import cn.stylefeng.roses.kernel.system.api.pojo.organization.BindUserItem;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
@ -9,6 +12,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织机构审批人实例类
|
* 组织机构审批人实例类
|
||||||
*
|
*
|
||||||
|
@ -32,6 +37,7 @@ public class HrOrgApprover extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@TableField("org_approver_type")
|
@TableField("org_approver_type")
|
||||||
@ChineseDescription("组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员")
|
@ChineseDescription("组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员")
|
||||||
|
@EnumFieldFormat(processEnum = OrgApproverTypeEnum.class)
|
||||||
private Integer orgApproverType;
|
private Integer orgApproverType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,4 +54,11 @@ public class HrOrgApprover extends BaseEntity {
|
||||||
@ChineseDescription("用户id")
|
@ChineseDescription("用户id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定人员信息
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ChineseDescription("绑定人员信息")
|
||||||
|
private List<BindUserItem> bindUserItemList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package cn.stylefeng.roses.kernel.system.modular.organization.service;
|
package cn.stylefeng.roses.kernel.system.modular.organization.service;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrgApprover;
|
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrgApprover;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.pojo.request.HrOrgApproverRequest;
|
import cn.stylefeng.roses.kernel.system.modular.organization.pojo.request.HrOrgApproverRequest;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
@ -15,7 +14,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*
|
*
|
||||||
* @param hrOrgApproverRequest 请求参数
|
* @param hrOrgApproverRequest 请求参数
|
||||||
|
@ -24,7 +23,7 @@ public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
*/
|
*/
|
||||||
void add(HrOrgApproverRequest hrOrgApproverRequest);
|
void add(HrOrgApproverRequest hrOrgApproverRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*
|
*
|
||||||
* @param hrOrgApproverRequest 请求参数
|
* @param hrOrgApproverRequest 请求参数
|
||||||
|
@ -33,7 +32,7 @@ public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
*/
|
*/
|
||||||
void del(HrOrgApproverRequest hrOrgApproverRequest);
|
void del(HrOrgApproverRequest hrOrgApproverRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
* @param hrOrgApproverRequest 请求参数
|
* @param hrOrgApproverRequest 请求参数
|
||||||
|
@ -42,7 +41,7 @@ public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
*/
|
*/
|
||||||
void edit(HrOrgApproverRequest hrOrgApproverRequest);
|
void edit(HrOrgApproverRequest hrOrgApproverRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询详情
|
* 查询详情
|
||||||
*
|
*
|
||||||
* @param hrOrgApproverRequest 请求参数
|
* @param hrOrgApproverRequest 请求参数
|
||||||
|
@ -51,24 +50,13 @@ public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
*/
|
*/
|
||||||
HrOrgApprover detail(HrOrgApproverRequest hrOrgApproverRequest);
|
HrOrgApprover detail(HrOrgApproverRequest hrOrgApproverRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取列表
|
* 获取组织机构审批员绑定信息
|
||||||
*
|
*
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @return List<HrOrgApprover> 返回结果
|
* @return List<HrOrgApprover> 返回结果
|
||||||
* @author fengshuonan
|
* @author fengshuonan
|
||||||
* @date 2022/09/13 23:15
|
* @date 2022/09/13 23:15
|
||||||
*/
|
*/
|
||||||
List<HrOrgApprover> findList(HrOrgApproverRequest hrOrgApproverRequest);
|
List<HrOrgApprover> getBindingList();
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取列表(带分页)
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @return PageResult<HrOrgApprover> 返回结果
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2022/09/13 23:15
|
|
||||||
*/
|
|
||||||
PageResult<HrOrgApprover> findPage(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,20 +2,18 @@ package cn.stylefeng.roses.kernel.system.modular.organization.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
|
||||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||||
|
import cn.stylefeng.roses.kernel.system.api.enums.OrgApproverTypeEnum;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrgApprover;
|
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrgApprover;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.enums.HrOrgApproverExceptionEnum;
|
import cn.stylefeng.roses.kernel.system.modular.organization.enums.HrOrgApproverExceptionEnum;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.mapper.HrOrgApproverMapper;
|
import cn.stylefeng.roses.kernel.system.modular.organization.mapper.HrOrgApproverMapper;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.pojo.request.HrOrgApproverRequest;
|
import cn.stylefeng.roses.kernel.system.modular.organization.pojo.request.HrOrgApproverRequest;
|
||||||
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrOrgApproverService;
|
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrOrgApproverService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +25,7 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, HrOrgApprover> implements HrOrgApproverService {
|
public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, HrOrgApprover> implements HrOrgApproverService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(HrOrgApproverRequest hrOrgApproverRequest) {
|
public void add(HrOrgApproverRequest hrOrgApproverRequest) {
|
||||||
HrOrgApprover hrOrgApprover = new HrOrgApprover();
|
HrOrgApprover hrOrgApprover = new HrOrgApprover();
|
||||||
BeanUtil.copyProperties(hrOrgApproverRequest, hrOrgApprover);
|
BeanUtil.copyProperties(hrOrgApproverRequest, hrOrgApprover);
|
||||||
|
@ -53,16 +51,22 @@ public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, H
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<HrOrgApprover> findPage(HrOrgApproverRequest hrOrgApproverRequest) {
|
public List<HrOrgApprover> getBindingList() {
|
||||||
LambdaQueryWrapper<HrOrgApprover> wrapper = createWrapper(hrOrgApproverRequest);
|
|
||||||
Page<HrOrgApprover> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
|
||||||
return PageResultFactory.createPageResult(sysRolePage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// 获取当前系统一共有哪些组织审批人类型
|
||||||
public List<HrOrgApprover> findList(HrOrgApproverRequest hrOrgApproverRequest) {
|
OrgApproverTypeEnum[] values = OrgApproverTypeEnum.values();
|
||||||
LambdaQueryWrapper<HrOrgApprover> wrapper = this.createWrapper(hrOrgApproverRequest);
|
|
||||||
return this.list(wrapper);
|
ArrayList<HrOrgApprover> resultList = new ArrayList<>();
|
||||||
|
for (OrgApproverTypeEnum orgApproverTypeEnum : values) {
|
||||||
|
HrOrgApprover hrOrgApprover = new HrOrgApprover();
|
||||||
|
hrOrgApprover.setOrgApproverType(orgApproverTypeEnum.getCode());
|
||||||
|
resultList.add(hrOrgApprover);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前系统所有的绑定情况 todo
|
||||||
|
List<HrOrgApprover> list = this.list();
|
||||||
|
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue