|
@@ -3,6 +3,7 @@ package org.springblade.business.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -17,6 +18,8 @@ import org.springblade.business.entity.InformationQuery;
|
|
|
import org.springblade.business.service.IFixedFlowLinkService;
|
|
|
import org.springblade.business.service.IFixedFlowService;
|
|
|
import org.springblade.business.service.IInformationQueryService;
|
|
|
+import org.springblade.business.utils.PDFUtil;
|
|
|
+import org.springblade.business.vo.AddContractTreeNodeVO;
|
|
|
import org.springblade.business.vo.FixedFlowVO;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -71,20 +74,34 @@ public class EVisaTaskCheckController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "customFlowUserList", value = "所选的任务人集合,集合形式", required = true),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeId", value = "当前节点的PkeyId", 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()) {
|
|
|
+ //获取对应表格的所有电签配置
|
|
|
+ String tableOwner = json.getString("tableOwner");
|
|
|
+ if (StringUtils.isBlank(tableOwner)){
|
|
|
+ tableOwner = json.getString("classifyType");
|
|
|
+ }
|
|
|
+ //查询当前节点的PDF
|
|
|
+ InformationQuery node = informationQueryService.getOne(new LambdaQueryWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getWbsId,json.getString("nodeId"))
|
|
|
+ .eq(InformationQuery::getClassify,tableOwner));
|
|
|
+
|
|
|
+ if (node == null || StringUtils.isBlank(node.getPdfUrl())){
|
|
|
+ return R.fail(300, "当前节点还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
//获取审批人
|
|
|
List<Long> customFlowUserList = json.getJSONArray("customFlowUserList").toJavaList(Long.class);
|
|
|
- //获取这些审批人在当前合同段的权限
|
|
|
- List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, json.getString("contractId"));
|
|
|
+ //获取这些审批人在资料合同段的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, node.getContractId()+"");
|
|
|
if (userRoleList == null || userRoleList.size() <= 0) {
|
|
|
- //查看当前项目下是否有监理合同段关联此合同段
|
|
|
+ //查看项目下是否有监理合同段关联资料合同段
|
|
|
Long contractId = jdbcTemplate.queryForObject("SELECT id from m_contract_info mci WHERE contract_type = 2 \n" +
|
|
|
- "and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + json.getString("contractId")+")",Long.class);
|
|
|
+ "and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + node.getContractId()+")",Long.class);
|
|
|
if (contractId == null) {
|
|
|
return R.data(300, false, "所选审批人均未找到当前表格所需要的签字岗位,请联系服务人员处理");
|
|
|
}
|
|
@@ -95,9 +112,9 @@ public class EVisaTaskCheckController {
|
|
|
}
|
|
|
|
|
|
//获取电签配置
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json,node.getPdfUrl());
|
|
|
if (jsonList == null) {
|
|
|
- return R.data(300, false, "未找到符合电签配置的相关流程,请联系服务人员处理");
|
|
|
+ return R.data(300, false, "未找到符合电签配置的相关流程,请重新保存后上报");
|
|
|
}
|
|
|
|
|
|
//汇总电签配置的审批角色
|
|
@@ -140,12 +157,23 @@ public class EVisaTaskCheckController {
|
|
|
})
|
|
|
public R<Boolean> batchCheckCustomFlowUserIsEVisaPermissions2(@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"));
|
|
|
+ //获取电签配置,先获取所有节点的infoIds
|
|
|
+ List<Long> list = Func.toLongList( json.getString("infoIds"));
|
|
|
+ if (list == null || list.size() <= 0){
|
|
|
+ return R.data(300, null, "请选择一条数据");
|
|
|
+ }
|
|
|
+ List<InformationQuery> infoList = informationQueryService.list(new LambdaQueryWrapper<InformationQuery>()
|
|
|
+ .in(InformationQuery::getId, list));
|
|
|
+ if (infoList == null || infoList.size() <= 0){
|
|
|
+ return R.data(300, null, "没有获取到当前所有资料的上报信息");
|
|
|
+ }
|
|
|
+ //获取这些审批人在资料合同段的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, infoList.get(0).getContractId()+"");
|
|
|
if (userRoleList == null || userRoleList.size() <= 0) {
|
|
|
- //查看当前项目下是否有监理合同段关联此合同段
|
|
|
+ //查看当前项目下是否有监理合同段关联资料合同段
|
|
|
Long contractId = jdbcTemplate.queryForObject("SELECT id from m_contract_info mci WHERE contract_type = 2 \n" +
|
|
|
"and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + json.getString("contractId")+")",Long.class);
|
|
|
if (contractId == null) {
|
|
@@ -157,38 +185,11 @@ public class EVisaTaskCheckController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //获取电签配置
|
|
|
- List<String> list = json.getJSONArray("privatePKeyId").toJavaList(String.class);
|
|
|
Map<String, Set<String>> userNameFail = new HashMap<>();
|
|
|
- for (String nodeId : list) {
|
|
|
- //获取节点信息
|
|
|
- WbsTreeContract contract = wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(nodeId));
|
|
|
- //获取节点下每个填报表
|
|
|
- List<WbsTreeContract> node = wbsTreeContractClient.queryChildByParentId(contract, "", "");
|
|
|
- Set<Long> ids = new HashSet<>();
|
|
|
- //获取每个填报表对应的wbs_tree_private的id
|
|
|
-// for (WbsTreeContract treeContract : node) {
|
|
|
-// WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(treeContract.getProjectId(), treeContract.getId());
|
|
|
-// ids.add(wbsTreePrivate.getPKeyId());
|
|
|
-//// if (StringUtils.isNotBlank(treeContract.getIsTypePrivatePid()+"")){
|
|
|
-//// ids.add(treeContract.getIsTypePrivatePid());
|
|
|
-//// }
|
|
|
-// }
|
|
|
- if (node != null && node.size() > 0){
|
|
|
- List<Long> setIds = node.stream().map(l -> l.getId()).collect(Collectors.toList());
|
|
|
- Set<Long> setPIds = node.stream().map(l -> l.getIsTypePrivatePid()).collect(Collectors.toSet());
|
|
|
- ids.addAll(setPIds);
|
|
|
- Set<Long> tableIds = wbsTreePrivateClient.getAllPrivateTableByIds(Long.parseLong(contract.getProjectId()), setIds);
|
|
|
- if (tableIds != null && tableIds.size() > 0) {
|
|
|
- ids.addAll(tableIds);
|
|
|
- }
|
|
|
- ids.addAll(tableIds);
|
|
|
- }
|
|
|
- JSONObject object = new JSONObject();
|
|
|
- object.put("privatePKeyId", ids);
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(object);
|
|
|
+ for (InformationQuery info : infoList) {
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json,info.getPdfUrl());
|
|
|
if (jsonList == null || jsonList.size() <= 0) {
|
|
|
- return R.data(300, false, contract.getNodeName() + ":未找到符合电签配置的相关流程,请联系服务人员处理");
|
|
|
+ return R.data(300, false, info.getName() + ":未找到电签配置");
|
|
|
}
|
|
|
|
|
|
//汇总电签配置的审批角色
|
|
@@ -199,7 +200,6 @@ public class EVisaTaskCheckController {
|
|
|
for (JSONObject userRole : userRoleList) {
|
|
|
if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
|
|
|
User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
|
|
|
- InformationQuery info = informationQueryService.getInfoByWbsId(nodeId);
|
|
|
if (userNameFail.containsKey(user.getRealName())) {
|
|
|
Set<String> set = userNameFail.get(user.getRealName());
|
|
|
set.add(info.getName());
|
|
@@ -237,6 +237,7 @@ public class EVisaTaskCheckController {
|
|
|
@ApiOperation(value = "获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeId", value = "当前节点PkeyId", required = true),
|
|
|
@ApiImplicitParam(name = "privatePKeyId", value = "表单列表中的isTypePrivatePid字段,集合形式"),
|
|
|
@ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
|
|
|
@ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
|
|
@@ -253,10 +254,22 @@ public class EVisaTaskCheckController {
|
|
|
List<FixedFlowVO> flowList = flowPage.getRecords();
|
|
|
|
|
|
//获取对应表格的所有电签配置
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
|
|
|
+ String tableOwner = json.getString("tableOwner");
|
|
|
+ if (StringUtils.isBlank(tableOwner)){
|
|
|
+ tableOwner = json.getString("classifyType");
|
|
|
+ }
|
|
|
+ //查询当前节点的PDF
|
|
|
+ InformationQuery node = informationQueryService.getOne(new LambdaQueryWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getWbsId,json.getString("nodeId"))
|
|
|
+ .eq(InformationQuery::getClassify,tableOwner));
|
|
|
+
|
|
|
+ if (node == null || StringUtils.isBlank(node.getPdfUrl())){
|
|
|
+ return R.fail(300, "当前节点还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json,node.getPdfUrl());
|
|
|
|
|
|
- if (jsonList == null) {
|
|
|
- return R.fail(300, "未找到符合电签配置的相关流程,请联系服务人员处理");
|
|
|
+ if (jsonList == null || jsonList.size() == 0) {
|
|
|
+ return R.fail(300, "未找到符合电签配置的相关流程,请重新保存再上报");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -271,8 +284,8 @@ public class EVisaTaskCheckController {
|
|
|
//首先找到对应流程下的审批人组
|
|
|
List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(next.getId().toString());
|
|
|
|
|
|
- //获取这些人当前合同段下的权限
|
|
|
- List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), json.getString("contractId"));
|
|
|
+ //获取这些人资料合同段下的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), node.getContractId()+"");
|
|
|
if (userRoleList == null) {
|
|
|
next.setDisabled(true);
|
|
|
} else {
|
|
@@ -330,39 +343,23 @@ public class EVisaTaskCheckController {
|
|
|
//每个自定义流程
|
|
|
List<FixedFlowVO> flowList = flowPage.getRecords();
|
|
|
|
|
|
- //获取电签配置
|
|
|
- List<String> list = json.getJSONArray("privatePKeyId").toJavaList(String.class);
|
|
|
+ //获取电签配置,先获取所有节点的infoIds
|
|
|
+ List<Long> list = Func.toLongList( json.getString("infoIds"));
|
|
|
+ if (list == null || list.size() <= 0){
|
|
|
+ return R.data(300, null, "请选择一条数据");
|
|
|
+ }
|
|
|
+ List<InformationQuery> infoList = informationQueryService.list(new LambdaQueryWrapper<InformationQuery>()
|
|
|
+ .in(InformationQuery::getId, list));
|
|
|
Map<String,List<String>> map = new HashMap<>();
|
|
|
- for (String nodeId : list) {
|
|
|
- //获取节点信息
|
|
|
- WbsTreeContract contract = wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(nodeId));
|
|
|
- //获取节点下每个填报表
|
|
|
- List<WbsTreeContract> node = wbsTreeContractClient.queryChildByParentId(contract, "", "");
|
|
|
- Set<Long> ids = new HashSet<>();
|
|
|
- //获取每个填报表对应的wbs_tree_private的id
|
|
|
-// for (WbsTreeContract treeContract : node) {
|
|
|
-// WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(treeContract.getProjectId(), treeContract.getId());
|
|
|
-// ids.add(wbsTreePrivate.getPKeyId());
|
|
|
-// }
|
|
|
- if (node != null && node.size() > 0){
|
|
|
- List<Long> setIds = node.stream().map(l -> l.getId()).collect(Collectors.toList());
|
|
|
- Set<Long> setPIds = node.stream().map(l -> l.getIsTypePrivatePid()).collect(Collectors.toSet());
|
|
|
- ids.addAll(setPIds);
|
|
|
- Set<Long> tableIds = wbsTreePrivateClient.getAllPrivateTableByIds(Long.parseLong(contract.getProjectId()), setIds);
|
|
|
- if (tableIds != null && tableIds.size() > 0) {
|
|
|
- ids.addAll(tableIds);
|
|
|
- }
|
|
|
- }
|
|
|
- JSONObject object = new JSONObject();
|
|
|
- object.put("privatePKeyId", ids);
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(object);
|
|
|
+ for (InformationQuery info : infoList) {
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json,info.getPdfUrl());
|
|
|
if (jsonList == null || jsonList.size() <= 0) {
|
|
|
- return R.data(300, null, contract.getNodeName() + ":有节点下所有表单都没配置电签,请联系服务人员处理");
|
|
|
+ return R.data(300, null, info.getName() + ":没有配置电签,请尝试重新保存再上报");
|
|
|
}
|
|
|
|
|
|
//汇总电签配置的审批角色
|
|
|
List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
|
|
|
- map.put(nodeId,eVisaRoleList);
|
|
|
+ map.put(info.getWbsId()+"",eVisaRoleList);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -376,12 +373,12 @@ public class EVisaTaskCheckController {
|
|
|
List<Long> ids = flowLink.stream().map(l -> l.getFixedFlowLinkUser()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
- //获取这些人当前合同段下的权限
|
|
|
- List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), json.getString("contractId"));
|
|
|
+ //获取这些人资料合同段下的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()),infoList.get(0).getContractId()+"" );
|
|
|
if (userRoleList == null || userRoleList.size() <= 0) {
|
|
|
//查看当前项目下是否有监理合同段关联此合同段
|
|
|
Long contractId = jdbcTemplate.queryForObject("SELECT id from m_contract_info mci WHERE contract_type = 2 \n" +
|
|
|
- "and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + json.getString("contractId")+")",Long.class);
|
|
|
+ "and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + infoList.get(0).getContractId()+")",Long.class);
|
|
|
if (contractId != null) {
|
|
|
userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(ids, contractId+"");
|
|
|
}
|
|
@@ -517,55 +514,55 @@ public class EVisaTaskCheckController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
- */
|
|
|
- @PostMapping("/checkFlowUserIsEVisaPermissions")
|
|
|
- @ApiOperation(value = "检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
- @ApiOperationSupport(order = 2)
|
|
|
- @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"),
|
|
|
- @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
|
|
|
- })
|
|
|
- public R<Boolean> checkFlowUserIsEVisaPermissions(@RequestBody JSONObject json) {
|
|
|
- if (json.containsKey("flowId")) {
|
|
|
- //首先找到对应流程下的审批人组
|
|
|
- List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(json.getString("flowId"));
|
|
|
-
|
|
|
- //获取这些人当前合同段下的权限
|
|
|
- List<Long> linkUserList = flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList());
|
|
|
- List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(linkUserList, json.getString("contractId"));
|
|
|
-
|
|
|
- //获取对应表格的所有电签配置
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
|
|
|
-
|
|
|
- if (jsonList == null) {
|
|
|
- return R.data(300, false, "当前表格均未配置电签关键字,请联系维护人员处理");
|
|
|
- }
|
|
|
- //汇总电签配置的审批角色
|
|
|
- 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(200, true, "满足上报条件");
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(300, false, "未找到对应流程,请重新选择");
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
+// */
|
|
|
+// @PostMapping("/checkFlowUserIsEVisaPermissions")
|
|
|
+// @ApiOperation(value = "检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
+// @ApiOperationSupport(order = 2)
|
|
|
+// @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"),
|
|
|
+// @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
|
|
|
+// })
|
|
|
+// public R<Boolean> checkFlowUserIsEVisaPermissions(@RequestBody JSONObject json) {
|
|
|
+// if (json.containsKey("flowId")) {
|
|
|
+// //首先找到对应流程下的审批人组
|
|
|
+// List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(json.getString("flowId"));
|
|
|
+//
|
|
|
+// //获取这些人当前合同段下的权限
|
|
|
+// List<Long> linkUserList = flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList());
|
|
|
+// List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(linkUserList, json.getString("contractId"));
|
|
|
+//
|
|
|
+// //获取对应表格的所有电签配置
|
|
|
+// List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
|
|
|
+//
|
|
|
+// if (jsonList == null) {
|
|
|
+// return R.data(300, false, "当前表格均未配置电签关键字,请联系维护人员处理");
|
|
|
+// }
|
|
|
+// //汇总电签配置的审批角色
|
|
|
+// 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(200, true, "满足上报条件");
|
|
|
+// }
|
|
|
+//
|
|
|
+// return R.data(300, false, "未找到对应流程,请重新选择");
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取表格的电签配置
|
|
|
*/
|
|
|
- private List<JSONObject> queryTableEVisaConfig(JSONObject json) {
|
|
|
+ private List<JSONObject> queryTableEVisaConfig(JSONObject json,String eVisaPDFUrl) {
|
|
|
List<JSONObject> jsonList;
|
|
|
if (json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))) {
|
|
|
//日志,需要先获取对应的表格
|
|
@@ -582,12 +579,8 @@ public class EVisaTaskCheckController {
|
|
|
|
|
|
} else {
|
|
|
//资料填报
|
|
|
- //jsonList = this.eVisaConfigClient.queryEVisaConfigAllByTableIds(json.getJSONArray("privatePKeyId").toJavaList(String.class));
|
|
|
- List<String> ids = json.getJSONArray("privatePKeyId").toJavaList(String.class);
|
|
|
- //指向项目级的ID有可能为null
|
|
|
- ids = ids.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
-
|
|
|
- String sql = "select * from m_textdict_info where tab_id in(" + StringUtils.join(ids, ",") + ") or excel_id in (SELECT excel_id from m_wbs_tree_private where p_key_id in(" + StringUtils.join(ids, ",") + "))";
|
|
|
+ List<String> ids = PDFUtil.getPdfSignIds(eVisaPDFUrl);
|
|
|
+ String sql = "select * from m_textdict_info where id in(" + StringUtils.join(ids, ",") + ") ";
|
|
|
List<TextdictInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
jsonList = JSONArray.parseArray(JSONObject.toJSONString(query), JSONObject.class);
|
|
|
}
|