|
@@ -58,6 +58,52 @@ public class EVisaTaskCheckController {
|
|
|
|
|
|
private final IFixedFlowService fixedFlowService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
+ */
|
|
|
+ @PostMapping("/checkCustomFlowUserIsEVisaPermissions")
|
|
|
+ @ApiOperation(value = "检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "customFlowUserList", value = "所选的任务人集合,集合形式", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "privatePKeyId", value = "表单列表中的isTypePrivatePid字段,集合形式"),
|
|
|
+ @ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
|
|
|
+ @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
|
|
|
+ })
|
|
|
+ public R<Boolean> checkCustomFlowUserIsEVisaPermissions(@RequestBody JSONObject json){
|
|
|
+ if(json.containsKey("customFlowUserList") && !json.getJSONArray("customFlowUserList").isEmpty()){
|
|
|
+ //获取审批人
|
|
|
+ List<Long> customFlowUserList = json.getJSONArray("customFlowUserList").toJavaList(Long.class);
|
|
|
+ //获取这些审批人在当前合同段的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, json.getString("contractId"));
|
|
|
+ if(userRoleList == null || userRoleList.size() <= 0){
|
|
|
+ return R.data(300, null, "所选审批人均未找到对应权限,请联系服务人员处理");
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取电签配置
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
|
|
|
+ if(jsonList == null){
|
|
|
+ return R.data(300, null, "未找到符合电签配置的相关流程,请联系服务人员处理");
|
|
|
+ }
|
|
|
+
|
|
|
+ //汇总电签配置的审批角色
|
|
|
+ List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
|
|
|
+ //检查
|
|
|
+ //循环审批人的角色集合,并判断电签配置中是否含有这个角色
|
|
|
+ for(JSONObject userRole : userRoleList){
|
|
|
+ if(!eVisaRoleList.contains(userRole.getString("roleId"))){
|
|
|
+ User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
|
|
|
+ return R.data(300, false, "所选中的用户【" + user.getRealName() + "】不具有相关审批权限,请联系维护人员处理或更换审批人员");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //均满足
|
|
|
+ return R.data(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(300, false, "未选择审批人!!!");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
*/
|
|
@@ -65,7 +111,6 @@ public class EVisaTaskCheckController {
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "flowId", value = "所选的流程ID", required = true),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
@ApiImplicitParam(name = "privatePKeyId", value = "表单列表中的isTypePrivatePid字段,集合形式"),
|
|
|
@ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
|
|
@@ -77,6 +122,7 @@ public class EVisaTaskCheckController {
|
|
|
vo.setCurrent(1);
|
|
|
vo.setSize(100);
|
|
|
vo.setContractId(json.getLong("contractId"));
|
|
|
+ vo.setProjectId(json.getLong("projectId"));
|
|
|
|
|
|
IPage<FixedFlowVO> flowPage = this.fixedFlowService.selectFixedFlowPage(vo);
|
|
|
List<FixedFlowVO> flowList = flowPage.getRecords();
|
|
@@ -94,7 +140,7 @@ public class EVisaTaskCheckController {
|
|
|
//校验这些预设流程哪些是符合条件的
|
|
|
for(FixedFlowVO next : flowList){
|
|
|
//先将流程设置为可选
|
|
|
- next.setDisabled(true);
|
|
|
+ next.setDisabled(false);
|
|
|
|
|
|
//首先找到对应流程下的审批人组
|
|
|
List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(next.getId().toString());
|
|
@@ -102,15 +148,27 @@ public class EVisaTaskCheckController {
|
|
|
//获取这些人当前合同段下的权限
|
|
|
List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), json.getString("contractId"));
|
|
|
if(userRoleList == null){
|
|
|
- next.setDisabled(false);
|
|
|
+ next.setDisabled(true);
|
|
|
} else {
|
|
|
//校验流程
|
|
|
- //循环审批人的角色集合,并判断电签配置中是否含有这个角色
|
|
|
- for(JSONObject userRole : userRoleList){
|
|
|
- if(!eVisaRoleList.contains(userRole.getString("roleId"))){
|
|
|
- //但凡有个不符合条件,删除
|
|
|
- next.setDisabled(false);
|
|
|
- break;
|
|
|
+ if(eVisaRoleList.size() >= userRoleList.size()){
|
|
|
+ //循环审批人的角色集合,并判断电签配置中是否含有这个角色
|
|
|
+ for(JSONObject userRole : userRoleList){
|
|
|
+ if(!eVisaRoleList.contains(userRole.getString("roleId"))){
|
|
|
+ //但凡有个不符合条件,禁选
|
|
|
+ next.setDisabled(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //小于,反向判断
|
|
|
+ List<String> userRoleIds = userRoleList.stream().map(jsonObject -> jsonObject.getString("roleId")).distinct().collect(Collectors.toList());
|
|
|
+ for(String eVisaRole : eVisaRoleList){
|
|
|
+ if(!userRoleIds.contains(eVisaRole)){
|
|
|
+ //但凡有个不符合条件,禁选
|
|
|
+ next.setDisabled(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -287,7 +345,7 @@ public class EVisaTaskCheckController {
|
|
|
//首件,先获取记录
|
|
|
InformationQuery query = this.informationQueryService.getById(json.getLong("firstId"));
|
|
|
if(query != null){
|
|
|
- jsonList = this.queryTableEVisaConfig(Func.toStrList(query.getTableId()));
|
|
|
+ jsonList = this.queryTableEVisaConfig(Func.toStrList(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(query.getTableId()).getIsTypePrivatePid().toString()));
|
|
|
} else {
|
|
|
jsonList = null;
|
|
|
}
|