mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】【org approver】更新删除审批人的绑定
parent
44f420f1c3
commit
de3f518212
|
@ -63,4 +63,16 @@ public class HrOrgApproverController {
|
||||||
return new SuccessResponseData<>();
|
return new SuccessResponseData<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除审批人的绑定
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2022/09/13 23:15
|
||||||
|
*/
|
||||||
|
@PostResource(name = "删除审批人的绑定", path = "/hrOrgApprover/delete")
|
||||||
|
public ResponseData<?> delete(@RequestBody @Validated(HrOrgApproverRequest.delete.class) HrOrgApproverRequest hrOrgApproverRequest) {
|
||||||
|
hrOrgApproverService.del(hrOrgApproverRequest);
|
||||||
|
return new SuccessResponseData<>();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,20 +29,21 @@ public class HrOrgApproverRequest extends BaseRequest {
|
||||||
* 组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员
|
* 组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员
|
||||||
*/
|
*/
|
||||||
@ChineseDescription("组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员")
|
@ChineseDescription("组织审批类型:1-负责人,2-部长,3-体系负责人,4-部门助理,5-资产助理(专员),6-考勤专员,7-HRBP,8-门禁员,9-办公账号员,10-转岗须知员")
|
||||||
@NotNull(message = "组织审批类型不能为空", groups = {add.class})
|
@NotNull(message = "组织审批类型不能为空", groups = {add.class, delete.class})
|
||||||
private Integer orgApproverType;
|
private Integer orgApproverType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织机构id
|
* 组织机构id
|
||||||
*/
|
*/
|
||||||
@ChineseDescription("组织机构id")
|
@ChineseDescription("组织机构id")
|
||||||
@NotNull(message = "组织机构id不能为空", groups = {list.class, add.class})
|
@NotNull(message = "组织机构id不能为空", groups = {list.class, add.class, delete.class})
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
*/
|
*/
|
||||||
@ChineseDescription("用户id")
|
@ChineseDescription("用户id")
|
||||||
|
@NotNull(message = "用户id不能为空", groups = {delete.class})
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package cn.stylefeng.roses.kernel.sys.modular.org.service;
|
package cn.stylefeng.roses.kernel.sys.modular.org.service;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
||||||
import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrgApprover;
|
import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrgApprover;
|
||||||
import cn.stylefeng.roses.kernel.sys.modular.org.pojo.request.HrOrgApproverRequest;
|
import cn.stylefeng.roses.kernel.sys.modular.org.pojo.request.HrOrgApproverRequest;
|
||||||
|
@ -16,15 +15,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2023/06/10 21:23
|
|
||||||
*/
|
|
||||||
void add(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*
|
*
|
||||||
|
@ -34,44 +24,6 @@ public interface HrOrgApproverService extends IService<HrOrgApprover> {
|
||||||
*/
|
*/
|
||||||
void del(HrOrgApproverRequest hrOrgApproverRequest);
|
void del(HrOrgApproverRequest hrOrgApproverRequest);
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2023/06/10 21:23
|
|
||||||
*/
|
|
||||||
void edit(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询详情
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2023/06/10 21:23
|
|
||||||
*/
|
|
||||||
HrOrgApprover detail(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取列表
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @return List<HrOrgApprover> 返回结果
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2023/06/10 21:23
|
|
||||||
*/
|
|
||||||
List<HrOrgApprover> findList(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取列表(带分页)
|
|
||||||
*
|
|
||||||
* @param hrOrgApproverRequest 请求参数
|
|
||||||
* @return PageResult<HrOrgApprover> 返回结果
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2023/06/10 21:23
|
|
||||||
*/
|
|
||||||
PageResult<HrOrgApprover> findPage(HrOrgApproverRequest hrOrgApproverRequest);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有审批人类型列表
|
* 获取所有审批人类型列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package cn.stylefeng.roses.kernel.sys.modular.org.service.impl;
|
package cn.stylefeng.roses.kernel.sys.modular.org.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
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.dict.api.DictApi;
|
import cn.stylefeng.roses.kernel.dict.api.DictApi;
|
||||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
||||||
|
@ -20,7 +16,6 @@ import cn.stylefeng.roses.kernel.sys.modular.org.pojo.response.ApproverBindUserI
|
||||||
import cn.stylefeng.roses.kernel.sys.modular.org.service.HrOrgApproverService;
|
import cn.stylefeng.roses.kernel.sys.modular.org.service.HrOrgApproverService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -44,36 +39,10 @@ public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, H
|
||||||
@Resource
|
@Resource
|
||||||
private DictApi dictApi;
|
private DictApi dictApi;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void add(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
HrOrgApprover hrOrgApprover = new HrOrgApprover();
|
|
||||||
BeanUtil.copyProperties(hrOrgApproverRequest, hrOrgApprover);
|
|
||||||
this.save(hrOrgApprover);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void del(HrOrgApproverRequest hrOrgApproverRequest) {
|
public void del(HrOrgApproverRequest hrOrgApproverRequest) {
|
||||||
HrOrgApprover hrOrgApprover = this.queryHrOrgApprover(hrOrgApproverRequest);
|
LambdaQueryWrapper<HrOrgApprover> wrapper = this.createWrapper(hrOrgApproverRequest);
|
||||||
this.removeById(hrOrgApprover.getOrgApproverId());
|
this.remove(wrapper);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void edit(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
HrOrgApprover hrOrgApprover = this.queryHrOrgApprover(hrOrgApproverRequest);
|
|
||||||
BeanUtil.copyProperties(hrOrgApproverRequest, hrOrgApprover);
|
|
||||||
this.updateById(hrOrgApprover);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HrOrgApprover detail(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
return this.queryHrOrgApprover(hrOrgApproverRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<HrOrgApprover> findPage(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
LambdaQueryWrapper<HrOrgApprover> wrapper = createWrapper(hrOrgApproverRequest);
|
|
||||||
Page<HrOrgApprover> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
|
||||||
return PageResultFactory.createPageResult(sysRolePage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -163,12 +132,6 @@ public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, H
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<HrOrgApprover> findList(HrOrgApproverRequest hrOrgApproverRequest) {
|
|
||||||
LambdaQueryWrapper<HrOrgApprover> wrapper = this.createWrapper(hrOrgApproverRequest);
|
|
||||||
return this.list(wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validateHaveOrgBind(Set<Long> beRemovedOrgIdList) {
|
public void validateHaveOrgBind(Set<Long> beRemovedOrgIdList) {
|
||||||
// none
|
// none
|
||||||
|
@ -212,6 +175,10 @@ public class HrOrgApproverServiceImpl extends ServiceImpl<HrOrgApproverMapper, H
|
||||||
Long orgId = hrOrgApproverRequest.getOrgId();
|
Long orgId = hrOrgApproverRequest.getOrgId();
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(orgId), HrOrgApprover::getOrgId, orgId);
|
queryWrapper.eq(ObjectUtil.isNotNull(orgId), HrOrgApprover::getOrgId, orgId);
|
||||||
|
|
||||||
|
// 根据用户id查询
|
||||||
|
Long userId = hrOrgApproverRequest.getUserId();
|
||||||
|
queryWrapper.eq(ObjectUtil.isNotNull(userId), HrOrgApprover::getUserId, userId);
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue