فهرست منبع

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 سال پیش
والد
کامیت
0bbfbe2851

+ 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());
             }
 
             //均满足

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -859,7 +859,7 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperation(value = "填报页单个上报")
     public R<Boolean> taskOne(@RequestBody StartTaskVO startTaskVO) throws IOException {
         //此时的ids是当前节点的primaryKeyId但并不是业务数据ID,需要根据ids和classify去查询具体的业务ID
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()));
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType,1));
 
         //处理上报信息
         if (businessData != null) {

+ 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"));
+    }
+
 }

+ 52 - 50
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -1542,63 +1542,65 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         }
 
         List<Long> longs = Func.toLongList(primaryKeyIds);
-        for (Long id : longs) {
-            //获取添加的表信息
-            TableInfo tableInfo = tableInfoService.getById(id);
-            WbsTreePrivate wbsPrivate = new WbsTreePrivate();
-            Long pKeyId1 = SnowFlakeUtil.getId();
-            wbsPrivate.setPKeyId(pKeyId1);
-            //查询wbs_tree_contract当前项目下是否已存在相同表
-            WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(new LambdaQueryWrapper<WbsTreePrivate>()
-                    .eq(WbsTreePrivate::getProjectId, projectId)
-                    .eq(WbsTreePrivate::getInitTableName, tableInfo.getTabEnName())
-                    .orderByDesc(WbsTreePrivate::getUpdateTime)
-                    .last("limit 1"));
-            //如果存在则复制最新表的配置,调整表单的值
-            if (wbsTreePrivate != null) {
-
-                if (wbsTreePrivate.getExcelId() != null) {
-                    if (StringUtils.isNotEmpty(wbsTreePrivate.getExcelId() + "")) {
-                        wbsPrivate.setExcelId(wbsTreePrivate.getExcelId());
-                    }
-                    if (StringUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl())) {
-                        //复制生成html
-                        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-                        File file_in = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+        if (longs != null && longs.size() > 0) {
+            for (Long id : longs) {
+                //获取添加的表信息
+                TableInfo tableInfo = tableInfoService.getById(id);
+                WbsTreePrivate wbsPrivate = new WbsTreePrivate();
+                Long pKeyId1 = SnowFlakeUtil.getId();
+                wbsPrivate.setPKeyId(pKeyId1);
+                //查询wbs_tree_contract当前项目下是否已存在相同表
+                WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(new LambdaQueryWrapper<WbsTreePrivate>()
+                        .eq(WbsTreePrivate::getProjectId, projectId)
+                        .eq(WbsTreePrivate::getInitTableName, tableInfo.getTabEnName())
+                        .orderByDesc(WbsTreePrivate::getUpdateTime)
+                        .last("limit 1"));
+                //如果存在则复制最新表的配置,调整表单的值
+                if (wbsTreePrivate != null) {
+
+                    if (wbsTreePrivate.getExcelId() != null) {
+                        if (StringUtils.isNotEmpty(wbsTreePrivate.getExcelId() + "")) {
+                            wbsPrivate.setExcelId(wbsTreePrivate.getExcelId());
+                        }
+                        if (StringUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl())) {
+                            //复制生成html
+                            String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+                            File file_in = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
 //                    File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1636553444422582272.html");
-                        String filecode = SnowFlakeUtil.getId() + "";
-                        String thmlUrl = file_path + "/privateUrl/" + filecode + ".html";
+                            String filecode = SnowFlakeUtil.getId() + "";
+                            String thmlUrl = file_path + "/privateUrl/" + filecode + ".html";
 //                    String thmlUrl =  "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\9527.html";
-                        File file_out = ResourceUtil.getFile(thmlUrl);
-                        FileUtil.copy(file_in, file_out);
-                        wbsPrivate.setHtmlUrl(thmlUrl);
-                    }
-                    List<TextdictInfo> list = textDictInfoService.list(new LambdaQueryWrapper<TextdictInfo>()
-                            .eq(TextdictInfo::getTabId, wbsTreePrivate.getPKeyId()));
-                    if (list.size() >= 0) {
-                        list.stream().forEach(l -> {
-                            l.setId(SnowFlakeUtil.getId());
-                            l.setTabId(wbsPrivate.getPKeyId().toString());
-                        });
-                        textDictInfoService.saveBatch(list);
+                            File file_out = ResourceUtil.getFile(thmlUrl);
+                            FileUtil.copy(file_in, file_out);
+                            wbsPrivate.setHtmlUrl(thmlUrl);
+                        }
+                        List<TextdictInfo> list = textDictInfoService.list(new LambdaQueryWrapper<TextdictInfo>()
+                                .eq(TextdictInfo::getTabId, wbsTreePrivate.getPKeyId()));
+                        if (list.size() >= 0) {
+                            list.stream().forEach(l -> {
+                                l.setId(SnowFlakeUtil.getId());
+                                l.setTabId(wbsPrivate.getPKeyId().toString());
+                            });
+                            textDictInfoService.saveBatch(list);
+                        }
                     }
-                }
 
-                wbsPrivate.setTableOwner(tableInfo.getTableOwner());
-                wbsPrivate.setInitTableId(tableInfo.getId() + "");
-                wbsPrivate.setTableType(tableInfo.getTabType());
-                wbsPrivate.setInitTableName(tableInfo.getTabEnName());
-                wbsPrivate.setNodeName(tableInfo.getTabChName());
-                wbsPrivate.setFullName(tableInfo.getTabChName());
-                wbsPrivate.setFillRate(tableInfo.getFillRate());
-                wbsPrivate.setProjectId(projectId);
-                wbsPrivate.setType(10);//带过来的元素信息
-                wbsPrivate.setParentId(-10L);
-                wbsPrivate.setStatus(1);
-                wbsTreePrivateMapper.insert(wbsPrivate);
+                    wbsPrivate.setTableOwner(tableInfo.getTableOwner());
+                    wbsPrivate.setInitTableId(tableInfo.getId() + "");
+                    wbsPrivate.setTableType(tableInfo.getTabType());
+                    wbsPrivate.setInitTableName(tableInfo.getTabEnName());
+                    wbsPrivate.setNodeName(tableInfo.getTabChName());
+                    wbsPrivate.setFullName(tableInfo.getTabChName());
+                    wbsPrivate.setFillRate(tableInfo.getFillRate());
+                    wbsPrivate.setProjectId(projectId);
+                    wbsPrivate.setType(10);//带过来的元素信息
+                    wbsPrivate.setParentId(-10L);
+                    wbsPrivate.setStatus(1);
+                    wbsTreePrivateMapper.insert(wbsPrivate);
            /* }else{
                 return R.success("没有查到主库信息");
             }*/
+                }
             }
             return R.success("添加成功");
         }