Commit f0949fee by 翁国栋

8小时后台--

增加一个可以设置审批人的权限
parent c8ad6cff
...@@ -854,14 +854,14 @@ public class LoginController { ...@@ -854,14 +854,14 @@ public class LoginController {
QyzxAdminColour cdys = QyzxAdminColour.builder().build().selectOne(new QueryWrapper<QyzxAdminColour>().lambda().eq(QyzxAdminColour::getOrgCode, qyzxEmpLogin1.getOrgId())); QyzxAdminColour cdys = QyzxAdminColour.builder().build().selectOne(new QueryWrapper<QyzxAdminColour>().lambda().eq(QyzxAdminColour::getOrgCode, qyzxEmpLogin1.getOrgId()));
qyzxEmpLogin1.setZdyys(cdys); qyzxEmpLogin1.setZdyys(cdys);
/*不知为何去掉了权限所以只能写死权限,设置审核人的权限路径为/ApprovalSummaryshenpi020102*/ // /*不知为何去掉了权限所以只能写死权限,设置审核人的权限路径为/ApprovalSummaryshenpi020102*/
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getMenuId,"/ApprovalSummaryshenpi020102") // ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getMenuId,"/ApprovalSummaryshenpi020102")
.eq(ZzglAuth::getOrgCode,qyzxEmpLogin1.getOrgId()).eq(ZzglAuth::getBmgwId,qyzxEmpLogin1.getYgglMainEmp().getBmgwId())); // .eq(ZzglAuth::getOrgCode,qyzxEmpLogin1.getOrgId()).eq(ZzglAuth::getBmgwId,qyzxEmpLogin1.getYgglMainEmp().getBmgwId()));
if(zzglAuth!=null){ // if(zzglAuth!=null){
List menus = Lists.newArrayList(); // List menus = Lists.newArrayList();
menus.add(zzglAuth.getMenuId()); // menus.add(zzglAuth.getMenuId());
qyzxEmpLogin1.setMenus(menus); // qyzxEmpLogin1.setMenus(menus);
} // }
// 可操作企业 // 可操作企业
......
...@@ -2,13 +2,10 @@ package cn.timer.api.controller.spmk; ...@@ -2,13 +2,10 @@ package cn.timer.api.controller.spmk;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import cn.timer.api.bean.spmk.*; import cn.timer.api.bean.spmk.*;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.dao.spmk.*; import cn.timer.api.dao.spmk.*;
import cn.timer.api.dto.spmk.*; import cn.timer.api.dto.spmk.*;
import cn.timer.api.utils.redis.RedisUtil; import cn.timer.api.utils.redis.RedisUtil;
...@@ -441,7 +438,7 @@ public class SpmkController { ...@@ -441,7 +438,7 @@ public class SpmkController {
@ApiOperation(value = "15.id查询-自定义审批", httpMethod = "GET", notes = "id查询-自定义审批") @ApiOperation(value = "15.id查询-自定义审批", httpMethod = "GET", notes = "id查询-自定义审批")
@ApiOperationSupport(order = 15) @ApiOperationSupport(order = 15)
public Result<Object> selectCaById(@PathVariable int id){ public Result<Object> selectCaById(@PathVariable int id){
SpmkCustomApproval ca = SpmkCustomApproval.builder().id(id).build().selectById(); SpmkCustomApproval ca = SpmkCustomApproval.builder().id(id).build().selectById();
List<SpmkInitiatorConfig> listIc = SpmkInitiatorConfig.builder().build().selectList(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)); List<SpmkInitiatorConfig> listIc = SpmkInitiatorConfig.builder().build().selectList(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id));
SpmkCustomApprovalDto caD = SpmkCustomApprovalDto.builder() SpmkCustomApprovalDto caD = SpmkCustomApprovalDto.builder()
.froms(ObjectUtil.deserialize(ca.getFroms())) .froms(ObjectUtil.deserialize(ca.getFroms()))
...@@ -531,8 +528,20 @@ public class SpmkController { ...@@ -531,8 +528,20 @@ public class SpmkController {
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean); // List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
Router router = spmkApproveSummaryDto.getRouter(); Router router = spmkApproveSummaryDto.getRouter();
List<Router> routers = router.getChildren();
// routers = RouterUtils.clearRouters(routers); // routers = RouterUtils.clearRouters(routers);
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId,userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId,"/Approvalcustomshenpi020101"));
/*如果没有该权限*/
if(zzglAuth==null){
SpmkCustomApproval ca = SpmkCustomApproval.builder().build().selectOne(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName,spmkApproveSummaryDto.getApproveName()).eq(SpmkCustomApproval::getOrgCode,userBean.getOrgCode()));
Router oldRouter=ObjectUtil.deserialize(ca.getRouter());
if(isTrue(router.getChildren(),oldRouter.getChildren())){
return ResultUtil.error("你没有设置审批人的权限");
}
}
List<Router> routers = router.getChildren();
if(routers==null){ if(routers==null){
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
...@@ -743,6 +752,14 @@ public class SpmkController { ...@@ -743,6 +752,14 @@ public class SpmkController {
@Log(title = "审批-审批流程", businessType = BusinessType.UPDATE) @Log(title = "审批-审批流程", businessType = BusinessType.UPDATE)
// @BindingResultCtrol(title = "审批人审批") // @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception { public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception {
/*判断是否有权限转派*/
/*ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId,userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId,"/Approvalcustomshenpi020101"));
if(zzglAuth==null){
return ResultUtil.error("你没有转派审批人的权限");
}*/
Integer asId = approvingDto.getAsId(); Integer asId = approvingDto.getAsId();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行 //查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer approStatus=Integer.parseInt(redisUtil.get(asId.toString())==null?"0":redisUtil.get(asId.toString()).toString()); Integer approStatus=Integer.parseInt(redisUtil.get(asId.toString())==null?"0":redisUtil.get(asId.toString()).toString());
...@@ -1086,4 +1103,24 @@ public class SpmkController { ...@@ -1086,4 +1103,24 @@ public class SpmkController {
public String addApproveDetail(){ public String addApproveDetail(){
return spmkService.addApproveDetail(); return spmkService.addApproveDetail();
} }
/**
* 判断人员是否一致
* @param olist
* @param list
* @return
*/
private boolean isTrue(List<Router>olist ,List<Router> list){
if(list.get(0).getClassName().equals("audit")&&list.get(0).getName().equals("审批人")){
if(list.get(0).getRelation().get(0).getType().equals("executive")&&list.get(0).getRelation().get(0).getName().equals("主管")){
return isTrue(olist.get(0).getChildren(),list.get(0).getChildren());
}
if(list.get(0).getRelation().get(0).getUsers().size()!=olist.get(0).getRelation().get(0).getUsers().size()){
return true;
}else{
return isTrue(olist.get(0).getChildren(),list.get(0).getChildren());
}
}
return false;
}
} }
...@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull; ...@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.ValidationMsg; import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor; ...@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class SpmkApproveSummaryDto{ public class SpmkApproveSummaryDto{
@NotBlank(message = ValidationMsg.NOTBLANK) @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "标题 ", example = "标题", required = true) @ApiModelProperty(value = "标题 ", example = "标题", required = true)
private String title; private String title;
...@@ -34,17 +36,17 @@ public class SpmkApproveSummaryDto{ ...@@ -34,17 +36,17 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty(value = "摘要", example = "摘要", required = true) @ApiModelProperty(value = "摘要", example = "摘要", required = true)
private String digest; private String digest;
@NotBlank(message = ValidationMsg.NOTBLANK) @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true) @ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true)
private String initiator; private String initiator;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@DecimalMax(value = "9",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMax(value = "9",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡", example = "1") @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType; private Integer assoType;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true) @ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true)
private JSONObject requestData; private JSONObject requestData;
......
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