Browse Source

资料查看,权限提示文件名称

qianxb 2 years ago
parent
commit
e093820213

+ 19 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java

@@ -139,11 +139,14 @@ public class EVisaTaskCheckController {
 
             //获取电签配置
             List<String> list = json.getJSONArray("privatePKeyId").toJavaList(String.class);
-            Set<String> userNameFail = new HashSet<>();
+            Map<String, Set<String>> userNameFail = new HashMap<>();
             for (String nodeId : list) {
+                //获取节点信息
                 WbsTreeContract contract = wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(nodeId));
+                //获取节点下每个填报表
                 List<WbsTreeContract> node = wbsTreeContractClient.queryChildByParentId(contract,"", "");
                 List<Long> ids = new ArrayList<>();
+                //获取每个填报表对应的wbs_tree_private的id
                 for (WbsTreeContract treeContract : node) {
 //                    WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(treeContract.getProjectId(), treeContract.getId());
 //                    ids.add(wbsTreePrivate.getPKeyId());
@@ -166,14 +169,27 @@ public class EVisaTaskCheckController {
                 for (JSONObject userRole : userRoleList) {
                     if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
                         User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
-                        userNameFail.add(user.getRealName());
+                        InformationQuery info = informationQueryService.getInfoByWbsId(nodeId);
+                        if (userNameFail.containsKey(user.getRealName())){
+                            Set<String> set = userNameFail.get(user.getRealName());
+                            set.add(info.getName());
+                            userNameFail.put(user.getRealName(),set);
+                        }else {
+                            Set<String> set = new HashSet<>();
+                            set.add(info.getName());
+                            userNameFail.put(user.getRealName(),set);
+                        }
                     }
                 }
 
             }
             //批量提示
             if (userNameFail.size() > 0) {
-                return R.data(300, false, "所选中的用户【" + StringUtils.join(userNameFail, ",") + "】不具备当前表格所需要的签字岗位,请联系维护人员处理或更换审批人员");
+                StringBuilder stringBuilder = new StringBuilder();
+                for (String key : userNameFail.keySet()) {
+                    stringBuilder.append("所选中的用户【" +key+ "】不具备【"+ StringUtils.join(userNameFail.get(key),",")+"】表格所需要的签字岗位,请联系维护人员处理或更换审批人员");
+                }
+                return R.data(300, false, stringBuilder.toString());
             }
 
             //均满足

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -138,4 +138,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
     //删除变更节点
     void  delAsyncWbsTree(String contractId);
 
+    //根据节点获取数据
+    InformationQuery getInfoByWbsId(String wbsId);
+
 }

+ 6 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -3,6 +3,7 @@ package org.springblade.business.service.impl;
 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.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
@@ -738,4 +739,9 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         }
     }
 
+    @Override
+    public InformationQuery getInfoByWbsId(String wbsId) {
+        return this.getOne(new LambdaQueryWrapper<InformationQuery>().eq(InformationQuery::getWbsId,wbsId).eq(InformationQuery::getStatus,0).last("limit 1"));
+    }
+
 }