Commit 1a77e4f5 by tangzhaoqian Committed by chenzg

审批权限优化,8个模板数据调用封装

parent e7db313e
......@@ -43,6 +43,7 @@ import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.spmk.SpmkApprovalGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateMapper;
......@@ -92,6 +93,11 @@ public class SpmkServiceImpl {
@Autowired
private SpmkCustomApprovalMapper spmkCustomApprovalMapper;
@Autowired
private ZzglBmgwMService zzglBmgwMService;
//TODO 审批模板组
/**
* 新增或编辑-审批模板组
......@@ -247,8 +253,9 @@ public class SpmkServiceImpl {
@ApiOperationSupport(order = 11)
public Result<Object> selectListAg(@CurrentUser UserBean userBean){
// ZzglController.
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum(), null),"操作成功!");
List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum());
System.out.println(depts);
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum(), depts),"操作成功!");
}
......@@ -472,7 +479,7 @@ public class SpmkServiceImpl {
empNums.add(ygglMainEmp.getEmpNum());
}
summaryQueryDto.setEmpNums(empNums);
// 缺-部门id 搜索
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQuery(page, summaryQueryDto);
......
......@@ -189,37 +189,6 @@ public class ZzglController {
}
//根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组
public List<Integer> empNumupdept(Integer orgCode,Integer empNum) {
Set<Integer> lanzi = new HashSet<Integer>();
//所有部门岗位
List<ZzglBmgwM> bmgws = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list();
//个人岗位
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
Integer getId = one.getBmgwId();
Set<Integer> all = empNumupdept2(lanzi, bmgws, getId);
return ListUtil.toList(all);
}
//遍历
public Set<Integer> empNumupdept2(Set<Integer> lanzi,List<ZzglBmgwM> bmgws,Integer getId) {
for (ZzglBmgwM z : bmgws) {
if (getId.equals(z.getId())) {
lanzi.add(getId);
if (z.getUpId()==null || z.getUpId() == 0) {
return lanzi;
}
getId = z.getUpId();
empNumupdept2(lanzi, bmgws, getId);
}
}
return lanzi;
}
/**
* 删除部门岗位
*
......
package cn.timer.api.controller.zzgl.service;
import java.util.List;
/**
* 部门岗位 服务层
*
* @author Tang
*/
public interface ZzglBmgwMService {
public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum);
}
package cn.timer.api.controller.zzgl.service;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import cn.hutool.core.collection.ListUtil;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
/**
* 部门岗位 服务逻辑层
*
* @author Tang
*/
@Service
public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
//根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组
@Override
public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum) {
Set<Integer> lanzi = new HashSet<Integer>();
//所有部门岗位
List<ZzglBmgwM> bmgws = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list();
//个人岗位
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
Integer getId = one.getBmgwId();
System.out.println(getId);
Set<Integer> all = empNumupdept2(lanzi, bmgws, getId);
all.add(getId);
return ListUtil.toList(all);
}
//遍历
public Set<Integer> empNumupdept2(Set<Integer> lanzi,List<ZzglBmgwM> bmgws,Integer getId) {
for (ZzglBmgwM z : bmgws) {
if (getId.equals(z.getId())) {
lanzi.add(getId);
if (z.getUpId()==null || z.getUpId() == 0) {
return lanzi;
}
getId = z.getUpId();
empNumupdept2(lanzi, bmgws, getId);
}
}
return lanzi;
}
}
......@@ -17,17 +17,11 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue();
// 发起人id
String id = jsonObj.get("id",FromData.class).getValue();
// 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue();
// 申请人名称
String applicant = jsonObj.get("__applicant",FromData.class).getValue();
// 实际转正时间
String newConfirmationTime = jsonObj.get("__newConfirmationTime",FromData.class).getValue();
// 备注
String Remarks = jsonObj.get("Remarks",FromData.class).getValue();
// 试用期内主要工作和成绩
String WorkAndAchievement = jsonObj.get("WorkAndAchievement",FromData.class).getValue();
// 存在问题及改进意见
......@@ -35,6 +29,17 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
// 上传文件
String file = jsonObj.get("file",FromData.class).getValue();
// 发起人id
String id = jsonObj.get("id",FromData.class).getValue();
// 实际转正时间
String newConfirmationTime = jsonObj.get("__newConfirmationTime",FromData.class).getValue();
// 备注
String Remarks = jsonObj.get("Remarks",FromData.class).getValue();
// 调 员工管理 业务
}
......
......@@ -78,12 +78,20 @@
<if test="deptIds != null and deptIds.size() > 0">
UNION
SELECT custom_approval_id FROM spmk_initiator_config WHERE
asso_id IN
(
<foreach item="it" index="index" collection="deptIds" separator="," close="" >
#{it}
</foreach>
) AND type IN (2,3) GROUP BY custom_approval_id
<choose>
<when test="deptIds.size() > 1">
asso_id IN
(
<foreach item="it" index="index" collection="deptIds" separator="," close="" >
#{it}
</foreach>
)
</when>
<otherwise>
asso_id = #{deptIds[0]}
</otherwise>
</choose>
AND type IN (2,3) GROUP BY custom_approval_id
</if>
) OR b.is_allvisible = 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment