|
@@ -235,6 +235,95 @@ public class EVisaTaskCheckController {
|
|
|
return R.data(300, false, "未选择审批人!!!");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 检查自选的任务人是否存在电签信息,日志,首件使用
|
|
|
+ */
|
|
|
+ @PostMapping("/checkCustomFlowUserIsEVisaPermissions3")
|
|
|
+ @ApiOperation(value = "检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @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> checkCustomFlowUserIsEVisaPermissions3(@RequestBody JSONObject json) {
|
|
|
+ if (json.containsKey("customFlowUserList") && !json.getJSONArray("customFlowUserList").isEmpty()) {
|
|
|
+ Long cId = json.getLong("contractId");
|
|
|
+ //获取对应表格的所有电签配置
|
|
|
+ String logIds = json.getString("theLogPrimaryKeyId");
|
|
|
+ String firstIds = json.getString("firstId");
|
|
|
+ List<Long> longs = new ArrayList<>();
|
|
|
+ String pdfUrl = "";
|
|
|
+ if (StringUtils.isNotBlank(logIds)) {
|
|
|
+ longs = Func.toLongList(logIds);
|
|
|
+ ContractLog log = logService.getById(longs.get(0));
|
|
|
+ if (log == null || StringUtils.isBlank(log.getPdfUrl())) {
|
|
|
+ return R.fail(300, "当前日志还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ pdfUrl = log.getPdfUrl();
|
|
|
+ }else if (StringUtils.isNotBlank(firstIds)){
|
|
|
+ longs = Func.toLongList(firstIds);
|
|
|
+ InformationQuery query = informationQueryService.getById(longs.get(0));
|
|
|
+ if (query == null || StringUtils.isBlank(query.getPdfUrl())) {
|
|
|
+ return R.fail(300, "当前首件还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ pdfUrl = query.getPdfUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(pdfUrl)) {
|
|
|
+ return R.fail(300, "当前节点还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ //获取审批人
|
|
|
+ List<Long> customFlowUserList = json.getJSONArray("customFlowUserList").toJavaList(Long.class);
|
|
|
+ //获取这些审批人在资料合同段的权限
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, cId + "");
|
|
|
+ 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 = " + cId + ")", Long.class);
|
|
|
+ if (contractId == null) {
|
|
|
+ return R.data(300, false, "所选审批人均未找到当前表格所需要的签字岗位,请联系服务人员处理");
|
|
|
+ }
|
|
|
+ userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, contractId + "");
|
|
|
+ if (userRoleList == null || userRoleList.size() <= 0) {
|
|
|
+ return R.data(300, false, "所选审批人均未找到当前表格所需要的签字岗位,请联系服务人员处理");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取电签配置
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json, pdfUrl);
|
|
|
+ if (jsonList == null) {
|
|
|
+ return R.data(300, false, "未找到符合电签配置的相关流程,请重新保存后上报");
|
|
|
+ }
|
|
|
+
|
|
|
+ //汇总电签配置的审批角色
|
|
|
+ List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ //检查
|
|
|
+ //循环审批人的角色集合,并判断电签配置中是否含有这个角色
|
|
|
+ List<String> userNameFail = new ArrayList<>();
|
|
|
+ for (JSONObject userRole : userRoleList) {
|
|
|
+ if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
|
|
|
+ User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
|
|
|
+ userNameFail.add(user.getRealName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //批量提示
|
|
|
+ if (userNameFail.size() > 0) {
|
|
|
+ return R.data(300, false, "所选中的用户【" + StringUtils.join(userNameFail, ",") + "】不具备当前表格所需要的签字岗位,请联系维护人员处理或更换审批人员");
|
|
|
+ }
|
|
|
+
|
|
|
+ //均满足
|
|
|
+ return R.data(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(300, false, "未选择审批人!!!");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)
|
|
|
*/
|
|
@@ -443,20 +532,38 @@ public class EVisaTaskCheckController {
|
|
|
FixedFlowVO vo = new FixedFlowVO();
|
|
|
vo.setCurrent(1);
|
|
|
vo.setSize(100);
|
|
|
- vo.setContractId(json.getLong("contractId"));
|
|
|
+ Long contractId = json.getLong("contractId");
|
|
|
+ vo.setContractId(contractId);
|
|
|
vo.setProjectId(json.getLong("projectId"));
|
|
|
|
|
|
IPage<FixedFlowVO> flowPage = this.fixedFlowService.selectFixedFlowPage(vo);
|
|
|
List<FixedFlowVO> flowList = flowPage.getRecords();
|
|
|
|
|
|
//获取对应表格的所有电签配置
|
|
|
- String logIds = json.getString("nodeId");
|
|
|
- List<Long> longs = Func.toLongList(logIds);
|
|
|
- ContractLog log = logService.getById(longs.get(0));
|
|
|
- if (log == null || StringUtils.isBlank(log.getPdfUrl())) {
|
|
|
+ String logIds = json.getString("theLogPrimaryKeyId");
|
|
|
+ String firstIds = json.getString("firstId");
|
|
|
+ List<Long> longs = new ArrayList<>();
|
|
|
+ String pdfUrl = "";
|
|
|
+ if (StringUtils.isNotBlank(logIds)) {
|
|
|
+ longs = Func.toLongList(logIds);
|
|
|
+ ContractLog log = logService.getById(longs.get(0));
|
|
|
+ if (log == null || StringUtils.isBlank(log.getPdfUrl())) {
|
|
|
+ return R.fail(300, "当前日志还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ pdfUrl = log.getPdfUrl();
|
|
|
+ }else if (StringUtils.isNotBlank(firstIds)){
|
|
|
+ longs = Func.toLongList(firstIds);
|
|
|
+ InformationQuery query = informationQueryService.getById(longs.get(0));
|
|
|
+ if (query == null || StringUtils.isBlank(query.getPdfUrl())) {
|
|
|
+ return R.fail(300, "当前首件还未生成PDF,不能上报");
|
|
|
+ }
|
|
|
+ pdfUrl = query.getPdfUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(pdfUrl)) {
|
|
|
return R.fail(300, "当前节点还未生成PDF,不能上报");
|
|
|
}
|
|
|
- List<JSONObject> jsonList = this.queryTableEVisaConfig(json, log.getPdfUrl());
|
|
|
+ List<JSONObject> jsonList = this.queryTableEVisaConfig(json, pdfUrl);
|
|
|
|
|
|
if (jsonList == null || jsonList.size() == 0) {
|
|
|
return R.fail(300, "未找到符合电签配置的相关流程,请重新保存再上报");
|
|
@@ -476,10 +583,10 @@ 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()), log.getContractId() + "");
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), contractId + "");
|
|
|
if (userRoleList == null || userRoleList.size() <= 0) {
|
|
|
//查看当前项目下是否有监理合同段关联此合同段
|
|
|
- String sql = "SELECT id from m_contract_info mci WHERE contract_type = 2 and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + log.getContractId() + ")";
|
|
|
+ String sql = "SELECT id from m_contract_info mci WHERE contract_type = 2 and id in (SELECT contract_id_jlyz FROM m_contract_relation_jlyz WHERE contract_id_sg = " + contractId + ")";
|
|
|
ContractInfo contractInfo = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
|
|
|
if (contractInfo != null) {
|
|
|
userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(ids, contractInfo.getId() + "");
|
|
@@ -693,20 +800,20 @@ public class EVisaTaskCheckController {
|
|
|
*/
|
|
|
private List<JSONObject> queryTableEVisaConfig(JSONObject json, String eVisaPDFUrl) {
|
|
|
List<JSONObject> jsonList;
|
|
|
- if (json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))) {
|
|
|
- //日志,需要先获取对应的表格
|
|
|
- jsonList = this.queryTableEVisaConfig(Func.toStrList(json.getString("theLogPrimaryKeyId")));
|
|
|
-
|
|
|
- } else if (json.containsKey("firstId") && StringUtils.isNotEmpty(json.getString("firstId"))) {
|
|
|
- //首件,先获取记录
|
|
|
- InformationQuery query = this.informationQueryService.getById(json.getLong("firstId"));
|
|
|
- if (query != null) {
|
|
|
- jsonList = this.queryTableEVisaConfig(Func.toStrList(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(query.getTableId()).getIsTypePrivatePid().toString()));
|
|
|
- } else {
|
|
|
- jsonList = null;
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
+// if (json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))) {
|
|
|
+// //日志,需要先获取对应的表格
|
|
|
+// jsonList = this.queryTableEVisaConfig(Func.toStrList(json.getString("theLogPrimaryKeyId")));
|
|
|
+//
|
|
|
+// } else if (json.containsKey("firstId") && StringUtils.isNotEmpty(json.getString("firstId"))) {
|
|
|
+// //首件,先获取记录
|
|
|
+// InformationQuery query = this.informationQueryService.getById(json.getLong("firstId"));
|
|
|
+// if (query != null) {
|
|
|
+// jsonList = this.queryTableEVisaConfig(Func.toStrList(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(query.getTableId()).getIsTypePrivatePid().toString()));
|
|
|
+// } else {
|
|
|
+// jsonList = null;
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
//资料填报
|
|
|
List<String> ids = PDFUtil.getPdfSignIds(eVisaPDFUrl);
|
|
|
if (ids == null || ids.size() == 0) {
|
|
@@ -715,7 +822,7 @@ public class EVisaTaskCheckController {
|
|
|
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);
|
|
|
- }
|
|
|
+// }
|
|
|
return jsonList;
|
|
|
}
|
|
|
|