ソースを参照

Merge remote-tracking branch 'origin/master' into master

yangyj 2 年 前
コミット
229c6b358f
24 ファイル変更696 行追加426 行削除
  1. 9 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  2. 15 8
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsParam.java
  3. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractVO.java
  4. 16 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  5. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  6. 6 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  7. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  8. 4 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java
  9. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  10. 73 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  11. 1 44
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  12. 87 74
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  13. 15 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java
  14. 15 17
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java
  15. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  16. 4 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  17. 8 7
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsParamMapper.xml
  18. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml
  19. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java
  20. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  21. 17 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java
  22. 29 14
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  23. 287 190
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java
  24. 93 57
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

+ 9 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
+import java.util.Map;
 
 @FeignClient(value =
         BusinessConstant.APPLICATION_WEATHER_NAME
@@ -25,6 +26,14 @@ public interface InformationQueryClient {
     @PostMapping(API_PREFIX + "/queryFirstBusinessDataByFirstId")
     JSONObject queryFirstBusinessDataByFirstId(@RequestParam String firstId);
 
+    /**
+     * 获取当前合同树和所有已填报表信息
+     * @param contractId
+     * @return
+     */
+    @PostMapping(API_PREFIX + "/getTreeAllTable")
+    Map<String,Long> getTreeAllTable(@RequestParam String contractId);
+
     /**
      * 保存填报时新增或修改填报资料记录表数据
      *

+ 15 - 8
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsParam.java

@@ -13,15 +13,22 @@ import org.springblade.core.mp.base.BaseEntity;
 @EqualsAndHashCode(callSuper = true)
 @Data
 @TableName("m_wbs_param")
-public class WbsParam  extends BaseEntity {
+public class WbsParam extends BaseEntity {
     private static final long serialVersionUID = 1L;
-    private  String name;
-    private  String k;
-    private  String v;
-    private  String remark;
-    private  Integer type;
+    private String name;
+    private String k;
+    private String v;
+    private String remark;
+    private Integer type;
+
     /**
      * WBS树节点Id
-     * */
-    private  Long nodeId;
+     */
+    private Long nodeId;
+
+    /**
+     * 项目id,同步节点参数使用
+     */
+    private Long projectId;
+
 }

+ 2 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractVO.java

@@ -62,6 +62,8 @@ public class WbsTreeContractVO extends WbsTreeContract implements INode<WbsTreeC
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     private Boolean hasChildren;
 
+    private Long submitCounts;
+
     public WbsTreeContractVO() {
     }
 

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

@@ -428,7 +428,7 @@ public class InformationWriteQueryController extends BladeController {
                     List<InformationQuery> query = jdbcTemplate.query(sqlSb, new BeanPropertyRowMapper<>(InformationQuery.class));
                     if (query.size() > 0) {
                         for (InformationQuery informationQuery : query) {
-                            taskStatusMap.put((new Integer(1)).equals(informationQuery.getClassify()) ? "施工" : "监理", selectNode.getNodeName());
+                            taskStatusMap.put((new Integer(1)).equals(informationQuery.getClassify()) ? "施工" : "监理", selectNode.getFullName());
                         }
                         continue;
                     }
@@ -1958,9 +1958,16 @@ public class InformationWriteQueryController extends BladeController {
     @NotNull
     private R<Boolean> saveOrCopyNodeTree(List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer operationType, WbsTreeContract currentNode) {
         if (saveList.size() > 0) {
+            StringBuilder str = new StringBuilder();
             //保存施工日志
             if (saveLedger.size() > 0) {
                 this.constructionLedgerService.saveBatch(saveLedger, 1000);
+                str.append("-[");
+                for (ConstructionLedger ledger : saveLedger) {
+                    str.append(ledger.getSite()+",");
+                }
+                str.deleteCharAt(str.length()-1);
+                str.append("]");
             }
 
             try {
@@ -1973,7 +1980,7 @@ public class InformationWriteQueryController extends BladeController {
                     WbsTreeContract node = result.get(result.size() - i);
                     pathName.append("-").append(StringUtils.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
                 }
-
+                pathName.append(str);
                 JSONObject json = new JSONObject();
                 json.put("operationObjIds", JSONArray.parseArray(JSONObject.toJSONString(saveList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList())), String.class));
                 json.put("operationObjName", pathName.substring(1));
@@ -2326,6 +2333,7 @@ public class InformationWriteQueryController extends BladeController {
 
         //获取合同段,检查是否是监理合同段
         ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
+
         if (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())) {
             //监理/业主合同段,需要获取关联的施工方合同段根节点数据
             List<String> contractIds = new ArrayList<>();
@@ -2335,6 +2343,12 @@ public class InformationWriteQueryController extends BladeController {
                 contractIds.add(contractIdRelation);
             }
             if (contractIds.size() > 0) {
+
+                //监理复制加载树问题
+                if (StringUtils.isEmpty(classifyType)){
+                    classifyType = "2";
+                }
+
                 if (StringUtils.isNotEmpty(parentId)) {
                     //子节点
                     rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, parentId, Integer.parseInt(classifyType));

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -578,12 +578,19 @@ public class TaskController extends BladeController {
 			taskBatch.setCreateTime(new Date());
 			this.taskBatchService.save(taskBatch);
 
+			//修改试验填报状态 TODO 暂时不清楚该接口是否需要
+			this.iTrialSelfInspectionRecordService.updateTrialSelfInspectionRecordStatus(taskApprovalVOS);
+
 			return R.data(true, "当前等待电签的批次较多,请等待几分钟后刷新页面查看........");
 		} else {
 			//生成等待批次,任务完成后删除
 			List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
 			taskApprovalVOS.add(taskApprovalVO);
 			this.taskService.batchCompleteApprovalTask(taskApprovalVOS,AuthUtil.getUserId());
+
+			//修改试验填报状态 TODO 暂时不清楚该接口是否需要
+			this.iTrialSelfInspectionRecordService.updateTrialSelfInspectionRecordStatus(taskApprovalVOS);
+
 			return R.data(true, "提交成功");
 		}
 	}

+ 6 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -13,6 +13,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @AllArgsConstructor
@@ -36,6 +37,11 @@ public class InformationQueryClientImpl implements InformationQueryClient {
 
         return null;
     }
+    //获取当前合同树和所有已填报表信息
+    @Override
+    public Map<String, Long> getTreeAllTable(String contractId) {
+        return iInformationQueryService.getTreeAllTable(contractId);
+    }
 
     @Override
     public String saveOrUpdateInformationQueryData(String wbsId, String tableId,

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -397,7 +397,8 @@
                 iq.id,
                 (case iq.STATUS when 0 THEN null else t.batch end) as report_number,
                 date_format(iq.create_time,'%Y-%m-%d') as createTimes
-                from u_information_query iq left join (select  * from u_task k where k.status!=3 and k.contract_id = #{query.contractId}) t on iq.id = t.form_data_id  and t.is_deleted = 0
+                from u_information_query iq left join (select  * from u_task k where k.status!=3 and k.contract_id = #{query.contractId} group by
+        form_data_id) t on iq.id = t.form_data_id  and t.is_deleted = 0
                 where
                 iq.is_deleted = 0
                 and iq.classify = #{query.classify}

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

@@ -27,6 +27,7 @@ import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  *  服务类
@@ -109,4 +110,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
 
     void updateBatchByPKeyId(List<WbsTreeContract> result);
 
+    //获取当前合同所有填报表
+	public Map<String, Long> getTreeAllTable(String contractId);
+
 }

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

@@ -34,7 +34,7 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
     String selfPrintNullPdf(String ids) throws Exception;
 
     @Async
-    void updateTrialSelfInspectionRecordStatus(List<TaskApprovalVO> obj) throws FileNotFoundException;
+    void updateTrialSelfInspectionRecordStatus(List<TaskApprovalVO> obj);
 
     String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception;
 

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

@@ -22,7 +22,9 @@ import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.resource.feign.NewIOSSClient;
@@ -61,6 +63,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
     private final IContractLogService contractLogService;
 
+    private final ContractClient contractClient;
+
     @Override
     public List<String> queryBusinessTableData(String formDataId) {
         //获取具体业务数据
@@ -547,4 +551,73 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         linkList.forEach(link -> vo.setWaitingUserList(link.getTaskUserName(), new Integer("999").equals(link.getEVisaStatus()) ? 999 : new Integer("2").equals(link.getStatus()) ? 2 : new Integer("3").equals(link.getStatus()) && new Integer("1").equals(link.getInitiative()) ? 3 : 1));
     }
 
+    /**
+     * 获取当前合同所有填报表
+     */
+    public Map<String, Long> getTreeAllTable(String contractId){
+        //总数据
+        List<WbsTreeContractTreeVOS> list = new ArrayList<>();
+        this.getAllTable("",contractId,list);
+        Map<String,Long> map = new HashMap<>();
+        list.stream().forEach(li->map.put(li.getId()+"",li.getSubmitCounts()));
+        return map;
+    }
+    /**
+     * 递归调用获取合同所有填报表
+     */
+    public void getAllTable(String parentId,String contractId, List<WbsTreeContractTreeVOS> list){
+        List<WbsTreeContractTreeVOS> vos = this.queryContractTree(parentId, contractId, "", "1");
+        if (vos != null && vos.size() > 0){
+            vos = vos.stream().filter(vo->vo.getSubmitCounts()!=0).collect(Collectors.toList());
+            list.addAll(vos);
+            for (WbsTreeContractTreeVOS vo : vos) {
+                this.getAllTable(vo.getId()+"",contractId,list);
+            }
+        }
+    }
+    /**
+     * 查询合同段划分树公共代码
+     */
+    private List<WbsTreeContractTreeVOS> queryContractTree(String parentId, String contractId, String contractIdRelation, String classifyType) {
+        List<WbsTreeContractTreeVOS> rootTreeNode;
+
+        //获取合同段,检查是否是监理合同段
+        ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
+        if (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())) {
+            //监理/业主合同段,需要获取关联的施工方合同段根节点数据
+            List<String> contractIds = new ArrayList<>();
+            if (StringUtils.isEmpty(parentId)) {
+                contractIds = this.contractClient.getProcessContractByJLContractId(contractId);
+            } else {
+                contractIds.add(contractIdRelation);
+            }
+            if (contractIds.size() > 0) {
+                if (StringUtils.isNotEmpty(parentId)) {
+                    //子节点
+                    rootTreeNode = this.queryContractTreeSupervision(contractIds, parentId, Integer.parseInt(classifyType));
+                } else {
+                    //根节点
+                    rootTreeNode = this.queryContractTreeSupervision(contractIds, "0", Integer.parseInt(classifyType));
+
+                    //设置根节点数量统计
+                    for (WbsTreeContractTreeVOS root : rootTreeNode) {
+                        List<WbsTreeContractTreeVOS> rootZi = this.queryContractTreeSupervision(Func.toStrList(root.getContractIdRelation()), root.getId().toString(), Integer.parseInt(classifyType));
+                        List<Long> collect = rootZi.stream().map(WbsTreeContractTreeVOS::getSubmitCounts).collect(Collectors.toList());
+                        Long reduce = collect.stream().reduce(0L, Long::sum);
+                        root.setSubmitCounts(reduce);
+                    }
+                }
+
+            } else {
+                rootTreeNode = new ArrayList<>();
+            }
+
+        } else {
+            //施工合同段
+            rootTreeNode = this.queryContractTree(contractId, StringUtils.isNotEmpty(parentId) ? parentId : "0", 1);
+        }
+
+        return rootTreeNode;
+    }
+
 }

+ 1 - 44
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -454,7 +454,7 @@ public class TrialSelfInspectionRecordServiceImpl
     }
 
     @Override
-    public void updateTrialSelfInspectionRecordStatus(List<TaskApprovalVO> obj) throws FileNotFoundException {
+    public void updateTrialSelfInspectionRecordStatus(List<TaskApprovalVO> obj){
         for (TaskApprovalVO taskApprovalVO : obj) {
             if (ObjectUtil.isNotEmpty(taskApprovalVO.getParallelProcessInstanceId())) {
                 String sql = "select process_instance_id from u_task_parallel where parallel_process_instance_id = '" + taskApprovalVO.getParallelProcessInstanceId() + "'";
@@ -467,49 +467,6 @@ public class TrialSelfInspectionRecordServiceImpl
                                 .set(TrialSelfInspectionRecord::getTaskStatus, "OK".equals(taskApprovalVO.getFlag()) ? "已审批" : "已废除")
                                 .eq(TrialSelfInspectionRecord::getId, trialSelfInspectionRecordId)
                         );
-
-                        /*TrialSelfInspectionRecord entity = this.baseMapper.selectById(trialSelfInspectionRecordId);
-                        //把当前试验的PDF合并关联到质检树节点下
-                        if (ObjectUtil.isNotEmpty(entity) && ("已审批").equals(entity.getTaskStatus())) {
-                            List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(trialSelfInspectionRecordId);
-
-                            for (String id : contractNodePKeyIds) {
-                                if (StringUtils.isEmpty(entity.getPdfUrl())) {
-                                    continue;
-                                }
-
-                                WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(id);
-                                if (wbsTreeContract != null) {
-                                    List<String> pdfUrlList = new ArrayList<>();
-                                    String classify;
-                                    if (wbsTreeContract.getTableOwner().contains("1") || wbsTreeContract.getTableOwner().contains("2") || wbsTreeContract.getTableOwner().contains("3")) {
-                                        classify = "1";
-                                    } else {
-                                        classify = "2";
-                                    }
-                                    String pdfUrlAll = baseMapper.selectInformationQuery(id, wbsTreeContract.getContractId(), classify);
-                                    //质检节点合并pdfUrl
-                                    pdfUrlList.add(pdfUrlAll);
-                                    //试验pdfUrl
-                                    pdfUrlList.add(entity.getPdfUrl());
-
-                                    //合并PDF
-                                    String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-                                    String listPdf = filePath + "/pdf/" + id + ".pdf";
-                                    File tabPDF = ResourceUtil.getFile(listPdf);
-                                    if (tabPDF.exists()) {
-                                        tabPDF.delete();
-                                    }
-                                    FileUtils.mergePdfPublicMethods(pdfUrlList, listPdf);
-                                    BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", listPdf);
-                                    if (bladeFile != null) {
-                                        //修改质检合并pdfURL
-                                        baseMapper.updateInformationQuery(trialSelfInspectionRecordId, wbsTreeContract.getContractId(), classify, bladeFile.getLink());
-                                    }
-                                }
-                            }
-                        }*/
-
                     }
                 }
             }

+ 87 - 74
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -762,8 +762,8 @@ public class ExcelTabController extends BladeController {
             return R.fail("请上传清表!");
         }
 
-        File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
-//        File file1 = ResourceUtil.getFile("D:\\develop\\1613737889349238784.html");
+//        File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+        File file1 = ResourceUtil.getFile("D:\\develop\\1633308933835718656.html");
         FileInputStream fileInputStream = new FileInputStream(file1);
         String htmlString = IoUtil.readToString(fileInputStream);
         // 解析 style
@@ -1076,7 +1076,7 @@ public class ExcelTabController extends BladeController {
                         ExctabCell exctabCell = new ExctabCell();
                         if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
                             if (inputText.indexOf("日期") >= 0) {
-                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
+                                data.empty().append("<el-date-picker type='date' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
                             } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
                                 if (inputText.indexOf("专业监理工程师") >= 0) {
                                     inputText = "专业监理工程师_年月日";
@@ -1086,7 +1086,7 @@ public class ExcelTabController extends BladeController {
                                     inputText = "年月日";
                                 }
                             }
-                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            data.empty().append("<el-date-picker  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
                             exctabCell.setTextInfo(inputText);
                             exctabCell.setExctabId(excelId);
                             exctabCell.setIsDeleted(0);
@@ -1123,32 +1123,32 @@ public class ExcelTabController extends BladeController {
                                 objs.add(jsonObject);
                             }
 
-                            String checkbox = "<hc-form-checkbox-group :objs='" + objs + "'  @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
+                            String checkbox = "<hc-form-checkbox-group @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' :objs='" + objs + "'  @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
                             data.empty().append(checkbox);
 
                         } else {
                             if (index_state) { // 区域内
                                 if (rowspan >= 1) {
-                                    data.empty().append("<el-input type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                    data.empty().append("<el-input type='textarea' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft'  @keyup.shift.right='keyupShiftRight'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                 } else {
-                                    data.empty().append("<el-input type='text'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                    data.empty().append("<el-input type='text' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft'  @keyup.shift.right='keyupShiftRight'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                                 }
                             } else { // 区域外
                                 if (j == 0) {
                                     if (colspan == maxCol && i >= 1) {
                                         if (rowspan >= 1) {
-                                            data.empty().append("<el-input type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                            data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                         } else {
-                                            data.empty().append("<el-input type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                            data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                                         }
                                     }
                                 } else {
                                     Element bforData = tds.get(j - 1);
                                     if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group")>=0) {
                                         if (rowspan >= 1) {
-                                            data.empty().append("<el-input type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                            data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                         } else {
-                                            data.empty().append("<el-input  type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                            data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft'  @keyup.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                                         }
                                     }
                                 }
@@ -1696,8 +1696,8 @@ public class ExcelTabController extends BladeController {
                 Worksheet sheet = wb.getWorksheets().get(0);
                 // 数据不为空 &&
                 if (StringUtils.isNotEmpty(tableNode.getHtmlUrl())) {
-                    File htmlFile = ResourceUtil.getFile(tableNode.getHtmlUrl());
-//                    File htmlFile = ResourceUtil.getFile("D:\\develop\\1613737889349238784.html");
+//                    File htmlFile = ResourceUtil.getFile(tableNode.getHtmlUrl());
+                    File htmlFile = ResourceUtil.getFile("D:\\develop\\1633344465559093248.html");
                     if (htmlFile.exists()) {
                         String htmlString = IoUtil.readToString(new FileInputStream(htmlFile));
                         Document doc = Jsoup.parse(htmlString);
@@ -1720,61 +1720,67 @@ public class ExcelTabController extends BladeController {
                                 if (val.indexOf("__") >= 0) {
                                     String[] DataVal = val.split("__");
                                     String[] xy = DataVal[1].split("_");
-                                    Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
-
-                                    if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 0) {
-                                        int x1, y1;
-
-                                        if (data.html().indexOf("el-tooltip") >= 0) {
-                                            x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
-                                            y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
-                                        } else {
-                                            x1 = Integer.parseInt(data.children().get(0).attr("x1"));
-                                            y1 = Integer.parseInt(data.children().get(0).attr("y1"));
-                                        }
-                                        if (x1 == 0) {
-                                            x1 = 1;
-                                        }
-                                        String myData = dataMap.get(val) + "";
-                                        if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
-                                            if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
-                                                myData = myData.replace("[", "").replace("]", "");
-                                                String[] dataVal = myData.split(",");
-                                                String[] Start_dataStr = dataVal[0].split("T")[0].split("-");
-                                                String StartDate = StringUtil.format("{}年{}月{}日", Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1);
-
-                                                String[] end_dataStr = dataVal[1].split("T")[0].split("-");
-                                                String endDate = StringUtil.format("{}年{}月{}日", end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1);
-
-                                                if (StartDate.equals(endDate)) {
-                                                    myData = StartDate;
+                                    if (trs.size() <= (Integer.parseInt(xy[0])-1)) {
+                                        Element trData = trs.get(Integer.parseInt(xy[0]));
+                                        Elements tdDatas = trData.select("td");
+                                        if (tdDatas.size() <= (Integer.parseInt(xy[0]) - 1)) {
+                                            Element data = tdDatas.get(Integer.parseInt(xy[1]));
+
+                                            if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 0) {
+                                                int x1, y1;
+
+                                                if (data.html().indexOf("el-tooltip") >= 0) {
+                                                    x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
+                                                    y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
                                                 } else {
-                                                    myData = StartDate + "-" + endDate;
+                                                    x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                                    y1 = Integer.parseInt(data.children().get(0).attr("y1"));
                                                 }
-                                            } else {
-                                                String[] dataStr = myData.split("T")[0].split("-");
-                                                myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
-                                            }
-                                        }
-
-                                        if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
-                                            Element element = trs.get(y1).select("td").get(x1);
-                                            String[] styles = element.attr("style").split(";");
-                                            int Height = 0;
-                                            for (String sty : styles) {
-                                                if (sty.indexOf("height:") >= 0) {
-                                                    Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
+                                                if (x1 == 0) {
+                                                    x1 = 1;
                                                 }
-                                            }
+                                                String myData = dataMap.get(val) + "";
+                                                if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
+                                                    if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
+                                                        myData = myData.replace("[", "").replace("]", "");
+                                                        String[] dataVal = myData.split(",");
+                                                        String[] Start_dataStr = dataVal[0].split("T")[0].split("-");
+                                                        String StartDate = StringUtil.format("{}年{}月{}日", Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1);
+
+                                                        String[] end_dataStr = dataVal[1].split("T")[0].split("-");
+                                                        String endDate = StringUtil.format("{}年{}月{}日", end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1);
+
+                                                        if (StartDate.equals(endDate)) {
+                                                            myData = StartDate;
+                                                        } else {
+                                                            myData = StartDate + "-" + endDate;
+                                                        }
+                                                    } else {
+                                                        String[] dataStr = myData.split("T")[0].split("-");
+                                                        myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
+                                                    }
+                                                }
+
+                                                if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
+                                                    Element element = trs.get(y1).select("td").get(x1);
+                                                    String[] styles = element.attr("style").split(";");
+                                                    int Height = 0;
+                                                    for (String sty : styles) {
+                                                        if (sty.indexOf("height:") >= 0) {
+                                                            Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
+                                                        }
+                                                    }
 
-                                            BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
-                                            ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
-                                            pic.setHeight(Height);
-                                            sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
+                                                    BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
+                                                    ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
+                                                    pic.setHeight(Height);
+                                                    sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
 
-                                        } else {
-                                            final CellRange cellRange = sheet.getCellRange(y1, x1);
-                                            cellRange.setText(myData);
+                                                } else {
+                                                    final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                                    cellRange.setText(myData);
+                                                }
+                                            }
                                         }
                                     }
                                 }
@@ -1791,26 +1797,33 @@ public class ExcelTabController extends BladeController {
                                 String key = e.getColKey();
                                 String[] keys = key.split("__");
                                 String[] trtd = keys[1].split("_");
-                                Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
-                                int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
-                                if (x1 == 0) {
-                                    x1 = 1;
-                                }
-                                int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+                                if (trs.size() <= (Integer.parseInt(trtd[0])-1)) {
+                                    Element trData = trs.get(Integer.parseInt(trtd[0]));
+                                    Elements tdDatas = trData.select("td");
+                                    if (tdDatas.size() <= (Integer.parseInt(trtd[0]) - 1)) {
+                                        Element data = tdDatas.get(Integer.parseInt(trtd[1]));
+//                                Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
+
+                                        int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                        if (x1 == 0) {
+                                            x1 = 1;
+                                        }
+                                        int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
 
-                                final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                        final CellRange cellRange = sheet.getCellRange(y1, x1);
 
-                                cellRange.setText(e.getId() + "");
-                                cellRange.getCellStyle().getFont().setColor(Color.white);
+                                        cellRange.setText(e.getId() + "");
+                                        cellRange.getCellStyle().getFont().setColor(Color.white);
+                                    }
 
-                            });
+                            }});
                         }
                     }
                 }
 
                 Long fileName = SnowFlakeUtil.getId();
                 String onePdfPath = file_path + "/pdf//" + fileName + ".pdf";
-//                wb.saveToFile("d://123123.xls", ExcelVersion.Version2010);
+                wb.saveToFile("d://777.xls", ExcelVersion.Version2010);
                 sheet.saveToPdf(onePdfPath);
 
                 BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName + ".pdf", onePdfPath);

+ 15 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java

@@ -1,12 +1,14 @@
 package org.springblade.manager.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.google.common.collect.Lists;
 import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 
 import javax.validation.Valid;
 
+import org.apache.commons.lang.StringUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -19,6 +21,7 @@ import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.*;
 import org.springblade.manager.vo.*;
+import org.springframework.context.annotation.Bean;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -30,6 +33,7 @@ import org.springblade.core.boot.ctrl.BladeController;
 import java.rmi.ServerException;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @RestController
 @AllArgsConstructor
@@ -139,7 +143,7 @@ public class ProjectInfoController extends BladeController {
 
 
     /**
-     * 删除 客户级项目
+     * 删除 客户级项目
      */
     @PostMapping("/remove")
     @ApiOperationSupport(order = 8)
@@ -158,7 +162,16 @@ public class ProjectInfoController extends BladeController {
         if (count2 > 0) {
             return R.fail("当前项目被用户关联中,删除失败");
         }
-        return R.status(projectInfoService.deleteLogic(Func.toLongList(ids)));
+
+        //删除当前项目的节点参数
+        String sqlDel = "delete from m_wbs_param where project_id = " + ids;
+        jdbcTemplate.execute(sqlDel);
+
+        //删除项目
+        String sqlDel2 = "delete from m_project_info where id = " + ids;
+        jdbcTemplate.execute(sqlDel2);
+
+        return R.status(true);
     }
 
     /**

+ 15 - 17
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -257,12 +257,12 @@ public class TextdictInfoController extends BladeController {
 
         String vmode = "formData." + keyname;
         if (textdictInfo.getTextId().equals("input")) { // 文本框
-            element.empty().append("<el-input type='text' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
+            element.empty().append("<el-input type='text' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
         } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
             int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
-            element.empty().append("<el-input :rows=" + rowspan * 2 + "  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'  > </el-input>");
+            element.empty().append("<el-input :rows=" + rowspan * 2 + "  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'  > </el-input>");
         } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
-            String selectText = " <el-select v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
+            String selectText = " <el-select v-model=" + vmode + " @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
@@ -272,7 +272,7 @@ public class TextdictInfoController extends BladeController {
             element.empty().append(selectText);
         } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
 
-            String radioText = "<el-radio-group  v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
+            String radioText = "<el-radio-group @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
@@ -290,32 +290,32 @@ public class TextdictInfoController extends BladeController {
                     jsonObject.put("name", optionList.get(i).getDictValue());
                     objs.add(jsonObject);
                 }
-                String checkbox = "<hc-form-checkbox-group :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
+                String checkbox = "<hc-form-checkbox-group  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
                 element.empty().append(checkbox);
             }
         } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 hh:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 hh:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
         } else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
         } else if (textdictInfo.getTextId().equals("dateHMS")) { // 日期--时分秒
-            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+            element.empty().append("<el-time-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         } else if (textdictInfo.getTextId().equals("dateSM")) { // 日期--时分
-            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+            element.empty().append("<el-time-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         } else if (textdictInfo.getTextId().equals("dateMDHM")) { // 日期--月日时分
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM月DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM月DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         } else if (textdictInfo.getTextId().equals("dateDHM")) { // 日期--日时分
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         } else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
-            element.empty().append("<el-date-picker  v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
             element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
         } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
-            element.empty().append("<el-date-picker  v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
             element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
 
         } else if (textdictInfo.getTextId().equals("img")) {
-            element.empty().append("<hc-table-form-upload :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
+            element.empty().append("<hc-table-form-upload @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
         } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
-            element.empty().append("<hc-form-select-search type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
+            element.empty().append("<hc-form-select-search @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
         }
         element.attr("@click", "getInformation(" + oncklickText + ")");
         File writefile = new File(wbsTreePrivate.getHtmlUrl());
@@ -330,8 +330,6 @@ public class TextdictInfoController extends BladeController {
             String clarSql = "update  " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
             jdbcTemplate.execute(clarSql);
         }
-
-        //
         return R.success("操作成功");
     }
 

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -594,7 +594,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @GetMapping("/search-node-tables")
     @ApiOperationSupport(order = 22)
-    @ApiOperation(value = "试验-根据所属方查询当前节点表信息", notes = "传入节点primaryKeyId、所属方type=1施工,=2监理 ;表单类型tableType=1记录表,=2报告单; 合同段id、项目id、isAdd=是否新增、记录id")
+    @ApiOperation(value = "试验-根据所属方查询当前节点表信息", notes = "传入节点primaryKeyId;所属方type=1施工,=2监理 ;表单类型tableType=1记录表、=2报告单; 合同段id;项目id;isAdd=是否新增;记录id")
     public R<List<WbsTreePrivate>> searchNodeAllTable(String primaryKeyId, String type, String tableType, String contractId, String projectId, Integer isAdd, Long id) {
         return R.data(wbsTreePrivateService.searchNodeAllTable(primaryKeyId, type, tableType, contractId, projectId, isAdd, id));
     }

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -73,7 +73,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                 excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id);
 
                 //重新合并pdf
-                String sql = "select * from u_trial_self_data_record where record_id = " + id;
+                String sql = "select pdf_url from u_trial_self_data_record where record_id = " + id;
                 List<TrialSelfDataRecord> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
                 List<String> pdfList = query.stream().map(TrialSelfDataRecord::getPdfUrl).collect(Collectors.toList());
 
@@ -94,7 +94,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                 TrialSelfInspectionRecord obj = jdbcTemplate.query(sql2, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
                 assert obj != null;
                 //重新合并pdf集合(解决单表保存后上报找不到题名问题)
-                String querySql = "select * from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
+                String querySql = "select id from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
                 List<InformationQuery> query2 = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
                 if (query2.size() > 0) {
                     String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + obj.getTrialProjectName() + "'  where classify='" + type + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
@@ -104,7 +104,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                 }
 
                 //修改原材料检测报告原始pdfUrl
-                String sql3 = "select * from u_trial_raw_material_self_record where self_record_id =" + id;
+                String sql3 = "select id from u_trial_raw_material_self_record where self_record_id =" + id;
                 TrialRawMaterialSelfRecord record = jdbcTemplate.query(sql3, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
                 if (ObjectUtil.isNotEmpty(record)) {
                     String sqlUpdate2 = "update u_trial_raw_material_self_record set old_pdf_url = '" + bladeFile.getLink() + "' where self_record_id =" + id;
@@ -124,7 +124,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
             );
 
             //修改原材料检测报告原始pdfUrl
-            String sql = "select * from u_trial_raw_material_self_record where self_record_id =" + id;
+            String sql = "select id from u_trial_raw_material_self_record where self_record_id =" + id;
             TrialRawMaterialSelfRecord record = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
             if (ObjectUtil.isNotEmpty(record)) {
                 String sqlUpdate = "update u_trial_raw_material_self_record set old_pdf_url = '" + pdfUrl + "' where self_record_id =" + id;

+ 8 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsParamMapper.xml

@@ -3,19 +3,20 @@
 <mapper namespace="org.springblade.manager.mapper.WbsParamMapper">
     <resultMap id="ResultMap" type="org.springblade.manager.entity.WbsParam">
         <result column="id" property="id"/>
-        <result column="createUser" property="create_user"/>
-        <result column="createDept" property="create_dept"/>
-        <result column="createTime" property="create_time"/>
-        <result column="updateUser" property="update_user"/>
-        <result column="updateTime" property="update_time"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
         <result column="status" property="status"/>
-        <result column="isDeleted" property="is_deleted"/>
+        <result column="is_deleted" property="isDeleted"/>
         <result column="name" property="name"/>
         <result column="k" property="k"/>
         <result column="v" property="v"/>
-        <result column="nodeId" property="node_id"/>
+        <result column="node_id" property="nodeId"/>
         <result column="remark" property="remark"/>
         <result column="type" property="type"/>
+        <result column="project_id" property="projectId"/>
     </resultMap>
 
 </mapper>

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -627,7 +627,7 @@
     </select>
 
     <select id="selectContractList" resultType="org.springblade.manager.entity.WbsTreeContract">
-        SELECT * FROM m_wbs_tree_contract WHERE id in
+        SELECT contract_id FROM m_wbs_tree_contract WHERE id in
         <foreach item="ids" collection="ids" open="(" close=")" separator=",">
             #{ids}
         </foreach>

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java

@@ -86,7 +86,7 @@ public interface WbsTreePrivateMapper extends EasyBaseMapper<WbsTreePrivate> {
 
     void delTabProjectById(String pKeyId,String projectId);
 
-    List<WbsTreePrivate> selectWbsTreeContractList(List<String> tableOwnerNumbers,String tableType, String projectId, String wbsId, Long parentId, List<String> tableOwnerList);
+    List<WbsTreePrivate> selectWbsTreeContractList(List<String> roleAndTabOwners,String tableType, String projectId, String wbsId, Long parentId, List<String> tableOwnerList);
 
     //删除表单信息
     void delTableById(String pKeyId);

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -692,8 +692,8 @@
         AND parent_id = #{parentId}
         AND table_type = #{tableType}
         AND table_owner in
-        <foreach item="tableOwnerNumbers" collection="tableOwnerNumbers" open="(" close=")" separator=",">
-            #{tableOwnerNumbers}
+        <foreach item="roleAndTabOwners" collection="roleAndTabOwners" open="(" close=")" separator=",">
+            #{roleAndTabOwners}
         </foreach>
         AND type = 2
         AND status = 1

+ 17 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
+import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.common.utils.BaiduApiUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
@@ -51,6 +52,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     private final WbsTreeContractMapper wbsTreeContractMapper;
     private final JdbcTemplate jdbcTemplate;
     private final IUserClient iUserClient;
+    private final InformationQueryClient informationQueryClient;
 
     @Override
     public List<String> getProcessContractByJLContractId(String contractId) {
@@ -131,6 +133,21 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     @Override
     public List<WbsTreeContractVO> tree3(String wbsId, String projectId, String contractId) {
         List<WbsTreeContractVO> wbsTreeContractVOS = baseMapper.tree5(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
+        //获取所有已填报信息
+        Map<String, Long> allTable = informationQueryClient.getTreeAllTable(contractId);
+        Set<String> keySet = allTable.keySet();
+        for (String key : keySet) {
+            for (WbsTreeContractVO vo : wbsTreeContractVOS) {
+                if (key.equals(vo.getId()+"")){
+                    vo.setSubmitCounts(allTable.get(key));
+                }
+            }
+        }
+        wbsTreeContractVOS.stream().forEach(wtc->{
+            if (wtc.getSubmitCounts() == null){
+                wtc.setSubmitCounts(0L);
+            }
+        });
         return buildWbsTreeByStream(wbsTreeContractVOS);
     }
 

+ 29 - 14
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1316,7 +1316,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-       // String file_path = "/Users/hongchuangyanfa/Desktop/";
+        //String file_path = "/Users/hongchuangyanfa/Desktop/";
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();
@@ -1701,7 +1701,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             BladeFile bladeFile2 = newIOSSClient.uploadFile(pkeyId + "2.pdf", pdfPath2);
 
             //查询是否存在关系
-            String sqlQuery = "select * from u_trial_self_data_record where record_id = " + id + " and tab_id = " + pkeyId;
+            String sqlQuery = "select id from u_trial_self_data_record where record_id = " + id + " and tab_id = " + pkeyId;
             List<TrialSelfDataRecord> query = jdbcTemplate.query(sqlQuery, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
             String sql;
             if (query.size() == 0) {
@@ -1728,24 +1728,39 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //获取有权限的节点信息
-        String sql = "select * from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";
+        String sql = "select p_key_id,html_url,table_type from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";
         List<WbsTreePrivate> queryList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-
+        //合并pdfUrlsList,报告单在前记录表在后
         List<String> dataPdfUrls = new ArrayList<>();
+        //报告单
+        List<WbsTreePrivate> reportTable = queryList.stream().filter(f -> f.getTableType() == 2).collect(Collectors.toList());
+        //记录表
+        List<WbsTreePrivate> recordTable = queryList.stream().filter(f -> f.getTableType() == 1).collect(Collectors.toList());
         if (queryList.size() > 0) {
-            for (WbsTreePrivate record : queryList) {
-                //生成pdf
-                String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id);
-                if (StringUtils.isNotEmpty(bussPdfInfo)) {
-                    dataPdfUrls.add(bussPdfInfo);
+            for (WbsTreePrivate report : reportTable) {
+                if (StringUtils.isNotEmpty(report.getHtmlUrl())) { //没有excel表单的不生成pdf
+                    //生成报告单pdf
+                    String bussPdfInfo = this.getBussPDFTrial(report.getPKeyId(), contractId, id);
+                    if (StringUtils.isNotEmpty(bussPdfInfo)) {
+                        dataPdfUrls.add(bussPdfInfo);
+                    }
+                }
+            }
+            for (WbsTreePrivate record : recordTable) {
+                if (StringUtils.isNotEmpty(record.getHtmlUrl())) { //没有excel表单的不生成pdf
+                    //生成记录表pdf
+                    String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id);
+                    if (StringUtils.isNotEmpty(bussPdfInfo)) {
+                        dataPdfUrls.add(bussPdfInfo);
+                    }
                 }
             }
         }
 
         String listPdf = file_path + "/pdf/" + nodeId + ".pdf";
-        File tabPdf2 = ResourceUtil.getFile(listPdf);
-        if (tabPdf2.exists()) {
-            tabPdf2.delete();
+        File tabPdf = ResourceUtil.getFile(listPdf);
+        if (tabPdf.exists()) {
+            tabPdf.delete();
         }
         FileUtils.mergePdfPublicMethods(dataPdfUrls, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
@@ -1753,8 +1768,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         //获取试验记录id的试验项目名称
         String trialProjectName = baseMapper.selectTrialRecordOne(id);
 
-        //合并PDF集合
-        String querySql = "select * from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
+        //修改合并后的pdf路径
+        String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
         List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
         if (query.size() > 0) {
             String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + trialProjectName + "'  where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";

+ 287 - 190
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -574,57 +574,110 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
     public boolean syncNodeParam(String projectId) {
         if (StringUtils.isNotEmpty(projectId)) {
             //获取项目节点树
-            List<WbsTreePrivate> wbsTreePrivateAllNow = baseMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1));
+            List<WbsTreePrivate> wbsTreePrivateAllNow = baseMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
+                    .select(WbsTreePrivate::getPKeyId, WbsTreePrivate::getId, WbsTreePrivate::getWbsId)
+                    .eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1));
             String wbsId = wbsTreePrivateAllNow.stream().map(WbsTreePrivate::getWbsId).findAny().orElse(null);
             if (StringUtils.isNotEmpty(wbsId)) {
-
                 List<WbsParamVO> paramListData = new ArrayList<>();
                 //获取公有树
-                List<WbsTree> treePublicNodeAll = wbsTreeMapper.selectList(Wrappers.<WbsTree>query().lambda().eq(WbsTree::getWbsId, wbsId).eq(WbsTree::getStatus, 1).eq(WbsTree::getType, 1));
+                Map<Long, WbsTree> treePublicNodeAll = wbsTreeMapper.selectList(Wrappers.<WbsTree>query().lambda()
+                        .select(WbsTree::getId)
+                        .eq(WbsTree::getWbsId, wbsId).eq(WbsTree::getStatus, 1)
+                        .eq(WbsTree::getType, 1))
+                        .stream().collect(Collectors.toMap(WbsTree::getId, Function.identity()));
 
                 if (treePublicNodeAll.size() > 0) {
-                    //公有引用
+                    //TODO ---------公有引用同步---------
+                    Map<String, Long> map = new HashMap<>();
                     for (WbsTreePrivate wbsTreePrivate : wbsTreePrivateAllNow) {
-                        for (WbsTree wbsTree : treePublicNodeAll) {
-                            if (wbsTree.getId().equals(wbsTreePrivate.getId())) {
-                                String sql = "select * from m_wbs_param where node_id = " + wbsTree.getId();
-                                List<WbsParam> wbsParamList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsParam.class));
-                                //获取公有节点参数
-                                if (wbsParamList.size() > 0) {
-                                    for (WbsParam wbsParam : wbsParamList) {
-                                        WbsParamVO param = BeanUtil.copyProperties(wbsParam, WbsParamVO.class);
-                                        if (param != null) {
-                                            param.setOldId(wbsParam.getId());
-                                            param.setNodeId(wbsTreePrivate.getPKeyId());
-                                            param.setId(SnowFlakeUtil.getId());
-                                            paramListData.add(param);
-                                        }
-                                    }
+                        WbsTree wbsTree = treePublicNodeAll.get(wbsTreePrivate.getId());
+                        if (wbsTree != null) {
+                            map.put(wbsTreePrivate.getPKeyId() + "," + wbsTree.getId(), wbsTree.getId());
+                        }
+                    }
+
+                    Set<String> keyIds = map.keySet();
+                    List<Long> wbsTreeIds = new ArrayList<>(map.values());
+                    List<WbsParam> wbsParamList = new ArrayList<>();
+                    //分组查询
+                    List<List<Long>> partition = Lists.partition(wbsTreeIds, 1000);
+                    for (List<Long> ids : partition) {
+                        String sql = "select id,name,k,v,node_id,remark from m_wbs_param where node_id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+                        List<WbsParam> wbsParams = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsParam.class));
+                        wbsParamList.addAll(wbsParams);
+                    }
+
+                    for (String ids : keyIds) {
+                        String nodePKeyIdNow = ids.split(",")[0];
+                        String nodeIdOld = ids.split(",")[1];
+                        List<WbsParam> wbsParams = wbsParamList.stream().filter(f -> ObjectUtils.isNotEmpty(f.getNodeId()) && f.getNodeId().toString().equals(nodeIdOld)).collect(Collectors.toList());
+                        //获取引用的节点参数
+                        if (wbsParams.size() > 0) {
+                            for (WbsParam wbsParam : wbsParams) {
+                                WbsParamVO param = BeanUtil.copyProperties(wbsParam, WbsParamVO.class);
+                                if (param != null) {
+                                    param.setProjectId(Long.parseLong(projectId));
+                                    param.setId(SnowFlakeUtil.getId());
+                                    param.setNodeId(Long.parseLong(nodePKeyIdNow));
+                                    param.setOldId(wbsParam.getId());
+                                    param.setType(1);
+                                    param.setStatus(1);
+                                    param.setIsDeleted(0);
+                                    paramListData.add(param);
                                 }
                             }
                         }
                     }
 
+
                 } else {
-                    //私有引用 - 获取原始引用私有树
-                    WbsTreePrivate treePrivateRootNode = baseMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getPKeyId, wbsId).eq(WbsTreePrivate::getParentId, 0L).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1));
-                    List<WbsTreePrivate> treePrivateNodeAll = baseMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getWbsId, treePrivateRootNode.getWbsId()).eq(WbsTreePrivate::getProjectId, treePrivateRootNode.getProjectId()).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1));
+                    //TODO ---------私有引用同步---------
+                    Map<String, Long> map = new HashMap<>();
+                    WbsTreePrivate treePrivateRootNode = baseMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                            .select(WbsTreePrivate::getWbsId, WbsTreePrivate::getProjectId)
+                            .eq(WbsTreePrivate::getPKeyId, wbsId).eq(WbsTreePrivate::getParentId, 0L).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1));
+
+                    Map<Long, WbsTreePrivate> treePrivateNodeAll = baseMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
+                            .select(WbsTreePrivate::getPKeyId, WbsTreePrivate::getId)
+                            .eq(WbsTreePrivate::getWbsId, treePrivateRootNode.getWbsId()).eq(WbsTreePrivate::getProjectId, treePrivateRootNode.getProjectId())
+                            .eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getType, 1)).stream().collect(Collectors.toMap(WbsTreePrivate::getId, Function.identity()));
 
                     for (WbsTreePrivate wbsTreePrivate : wbsTreePrivateAllNow) {
-                        for (WbsTreePrivate wbsTreePrivateYS : treePrivateNodeAll) {
-                            if (wbsTreePrivateYS.getId().equals(wbsTreePrivate.getId())) {
-                                String sql = "select * from m_wbs_param where node_id = " + wbsTreePrivateYS.getPKeyId();
-                                List<WbsParam> wbsParamList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsParam.class));
-                                if (wbsParamList.size() > 0) {
-                                    for (WbsParam wbsParam : wbsParamList) {
-                                        WbsParamVO param = BeanUtil.copyProperties(wbsParam, WbsParamVO.class);
-                                        if (param != null) {
-                                            param.setOldId(wbsParam.getId());
-                                            param.setNodeId(wbsTreePrivate.getPKeyId());
-                                            param.setId(SnowFlakeUtil.getId());
-                                            paramListData.add(param);
-                                        }
-                                    }
+                        WbsTreePrivate wbsTreePrivateYS = treePrivateNodeAll.get(wbsTreePrivate.getId());
+                        if (wbsTreePrivateYS != null) {
+                            map.put(wbsTreePrivate.getPKeyId() + "," + wbsTreePrivateYS.getPKeyId(), wbsTreePrivateYS.getPKeyId());
+                        }
+                    }
+
+                    Set<String> keyIds = map.keySet();
+                    List<Long> wbsTreeIds = new ArrayList<>(map.values());
+                    List<WbsParam> wbsParamList = new ArrayList<>();
+                    //分组查询
+                    List<List<Long>> partition = Lists.partition(wbsTreeIds, 1000);
+                    for (List<Long> ids : partition) {
+                        String sql = "select id,name,k,v,node_id,remark from m_wbs_param where node_id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+                        List<WbsParam> wbsParams = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsParam.class));
+                        wbsParamList.addAll(wbsParams);
+                    }
+
+                    for (String ids : keyIds) {
+                        String nodePKeyIdNow = ids.split(",")[0];
+                        String nodePKeyIdYs = ids.split(",")[1];
+                        List<WbsParam> wbsParams = wbsParamList.stream().filter(f -> ObjectUtils.isNotEmpty(f.getNodeId()) && f.getNodeId().toString().equals(nodePKeyIdYs)).collect(Collectors.toList());
+                        //获取引用的节点参数
+                        if (wbsParams.size() > 0) {
+                            for (WbsParam wbsParam : wbsParams) {
+                                WbsParamVO param = BeanUtil.copyProperties(wbsParam, WbsParamVO.class);
+                                if (param != null) {
+                                    param.setProjectId(Long.parseLong(projectId));
+                                    param.setId(SnowFlakeUtil.getId());
+                                    param.setNodeId(Long.parseLong(nodePKeyIdNow));
+                                    param.setOldId(wbsParam.getId());
+                                    param.setType(1);
+                                    param.setStatus(1);
+                                    param.setIsDeleted(0);
+                                    paramListData.add(param);
                                 }
                             }
                         }
@@ -633,18 +686,39 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
 
                 List<WbsParam> updateList = new ArrayList<>();
                 List<WbsParam> insertList = new ArrayList<>();
+                List<WbsParam> paramListOldAll = new ArrayList<>();
+
+                List<Long> oldIds = paramListData.stream().map(WbsParamVO::getOldId).distinct().collect(Collectors.toList());
+                //分组查询
+                List<List<Long>> partition = Lists.partition(oldIds, 1000);
+                for (List<Long> ids : partition) {
+                    String sql1 = "select id,name,k,v,node_id,remark from m_wbs_param where id in( " + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+                    List<WbsParam> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(WbsParam.class));
+                    paramListOldAll.addAll(query);
+                }
+
+                //转换为map
+                Map<Long, WbsParam> mapOld = paramListOldAll.stream().collect(Collectors.toMap(WbsParam::getId, Function.identity()));
+
+                //获取当前项目的节点参数
+                List<WbsParam> paramListNow = wbsParamMapper.selectList(Wrappers.<WbsParam>lambdaQuery()
+                        .select(WbsParam::getK, WbsParam::getV, WbsParam::getName, WbsParam::getId, WbsParam::getRemark, WbsParam::getNodeId)
+                        .eq(WbsParam::getProjectId, Long.parseLong(projectId)));
+
                 //判断是否存在
                 Iterator<WbsParamVO> iterator = paramListData.iterator();
                 while (iterator.hasNext()) {
                     WbsParamVO next = iterator.next();
 
                     //获取引用的节点上的源参数信息
-                    String sql1 = "select * from m_wbs_param where id = " + next.getOldId();
-                    WbsParam oldObj = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(WbsParam.class)).stream().findAny().orElse(null);
-
+                    WbsParam oldObj = mapOld.get(next.getOldId());
                     //获取被引用的节点上的现参数信息
-                    String sql2 = "select * from m_wbs_param where name = '" + next.getName() + "' and k = '" + next.getK() + "' and v = '" + next.getV() + "' and node_id = " + next.getNodeId() + " and remark = '" + next.getRemark() + "' and is_deleted = 0 and status = 1";
-                    WbsParam newObj = jdbcTemplate.query(sql2, new BeanPropertyRowMapper<>(WbsParam.class)).stream().findAny().orElse(null);
+                    WbsParam newObj = paramListNow.stream().filter(f -> f.getK().equals(next.getK())
+                            && f.getV().equals(next.getV())
+                            && f.getName().equals(next.getName())
+                            && f.getRemark().equals(next.getRemark())
+                            && f.getNodeId().equals(next.getNodeId())
+                    ).findAny().orElse(null);
 
                     if (oldObj != null && newObj != null) {
                         //如果源节点参数与现节点参数名称、K、V、备注一致,那么就跳过
@@ -653,10 +727,14 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
 
                             //如果源节点参数与现节点参数名称、K一致,V、备注不一致,那么就修改当前名称下的节点参数
                         } else if (oldObj.getName().equals(newObj.getName()) && oldObj.getK().equals(newObj.getK()) && (!oldObj.getV().equals(newObj.getV()) || !oldObj.getRemark().equals(newObj.getRemark()))) {
+                            newObj.setProjectId(Long.parseLong(projectId));
                             newObj.setName(oldObj.getName());
                             newObj.setK(oldObj.getK());
                             newObj.setV(oldObj.getV());
                             newObj.setRemark(oldObj.getRemark());
+                            newObj.setType(1);
+                            newObj.setStatus(1);
+                            newObj.setIsDeleted(0);
                             updateList.add(newObj);
 
                             //如果源节点参数与现节点参数名称不一致,那么新增
@@ -666,16 +744,22 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
 
                     } else if (oldObj != null) {
                         //二次过滤,节点名称、节点id相同,修改
-                        String sql3 = "select * from m_wbs_param where name = '" + next.getName() + "' and node_id = " + next.getNodeId() + " and is_deleted = 0 and status = 1";
-                        List<WbsParam> query = jdbcTemplate.query(sql3, new BeanPropertyRowMapper<>(WbsParam.class));
+                        List<WbsParam> query = paramListNow.stream().filter(f -> f.getName().equals(next.getName())
+                                && f.getNodeId().equals(next.getNodeId())
+                        ).collect(Collectors.toList());
+
                         if (query.size() > 0) {
                             for (WbsParam wbsParam : query) {
                                 if (oldObj.getName().equals(wbsParam.getName())) {
                                     //修改
+                                    wbsParam.setProjectId(Long.parseLong(projectId));
                                     wbsParam.setName(next.getName());
                                     wbsParam.setK(next.getK());
                                     wbsParam.setV(next.getV());
                                     wbsParam.setRemark(next.getRemark());
+                                    wbsParam.setType(1);
+                                    wbsParam.setStatus(1);
+                                    wbsParam.setIsDeleted(0);
                                     updateList.add(wbsParam);
                                 }
                             }
@@ -691,7 +775,13 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                     this.wbsParamServiceImpl.updateBatchById(updateList, 1000);
                 }
                 if (insertList.size() > 0) {
-                    this.wbsParamServiceImpl.saveBatch(insertList, 1000);
+                    //异步新增
+                    List<List<WbsParam>> partition1 = Lists.partition(insertList, 1000);
+                    CompletableFuture<Void> handle = CompletableFuture.allOf(partition1.stream().map(addList ->
+                            CompletableFuture.runAsync(() -> {
+                                wbsParamServiceImpl.insertBatch(addList, 1000);
+                            }, executor)).toArray(CompletableFuture[]::new));
+                    handle.join();
                 }
                 return true;
             }
@@ -1297,6 +1387,155 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         return false;
     }
 
+    @Override
+    public boolean syncProjectEVisa(String projectId) {
+        if (StringUtils.isNotEmpty(projectId)) {
+            ProjectInfo projectInfo = projectInfoMapper.selectById(projectId);
+            if (projectInfo != null && ("private").equals(projectInfo.getReferenceWbsTemplateType()) && ObjectUtils.isNotEmpty(projectInfo.getReferenceWbsTemplateId())) {
+                //构造参数集合
+                List<TextdictInfo> insertData = new ArrayList<>();
+                Map<Long, List<TextdictInfo>> textDictInfoData = new HashMap<>();
+
+                //获取当前引用的项目节点树的根节点信息
+                WbsTreePrivate oneRecordRoot = this.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().select(WbsTreePrivate::getProjectId, WbsTreePrivate::getWbsId).eq(WbsTreePrivate::getPKeyId, projectInfo.getReferenceWbsTemplateId()));
+
+                //获取当前项目下节点树所有节点、表、独立表
+                String sqlNodeTreeAllNow = "SELECT p_key_id,id,type,parent_id,html_url FROM m_wbs_tree_private WHERE project_id = " + projectId + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_type = 1) OR (type= 10 AND parent_id = -10 ))";
+                List<WbsTreePrivate> wbsTreePrivatesNodeAndTabNow = jdbcTemplate.query(sqlNodeTreeAllNow, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+                Map<Long, WbsTreePrivate> wbsTreePrivatesTableDL = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(10) && f.getParentId().equals(-10L)).collect(Collectors.toMap(WbsTreePrivate::getId, Function.identity()));
+
+                //获取当前项目节点树
+                Map<Long, WbsTreePrivate> nowNodeTreeAll = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(1)).collect(Collectors.toList()).stream()
+                        .collect(Collectors.toMap(WbsTreePrivate::getId, Function.identity()));
+
+                //获取当前引用的节点树下所有节点、表、独立表
+                String sqlNodeTreeAllOld = "SELECT p_key_id,id,type,parent_id FROM m_wbs_tree_private WHERE project_id = " + oneRecordRoot.getProjectId() + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_id = " + oneRecordRoot.getWbsId() + ") OR ((type= 10 OR parent_id = -10 ) AND wbs_id IS NULL))";
+                List<WbsTreePrivate> wbsTreePrivatesNodeAndTab = jdbcTemplate.query(sqlNodeTreeAllOld, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+
+                //获取当前对应电签位置配置信息
+                List<WbsTreePrivate> collect1 = wbsTreePrivatesNodeAndTab.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList());
+                List<Long> pKeyIds = collect1.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+
+                //分组查询
+                List<TextdictInfo> textDictInfosAll = new ArrayList<>();
+                List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
+                for (List<Long> ids : partition) {
+                    String sql = "select id,name,type,tab_id,col_key,sig_role_id,is_deleted,sig_role_name,col_name,pyzbx,pyzby from m_textdict_info where tab_id in(" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+                    List<TextdictInfo> textDictInfos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
+                    textDictInfosAll.addAll(textDictInfos);
+                }
+
+                //转换map
+                Map<String, List<TextdictInfo>> collect3 = textDictInfosAll.stream().collect(Collectors.groupingBy(TextdictInfo::getTabId));
+
+                //构造原始电签信息
+                for (WbsTreePrivate wbsTreePrivate : collect1) {
+                    if (wbsTreePrivate.getType() == 2) {
+                        WbsTreePrivate obj = nowNodeTreeAll.get(wbsTreePrivate.getParentId());
+                        assert obj != null;
+                        List<TextdictInfo> textDictInfos = collect3.get(String.valueOf(wbsTreePrivate.getPKeyId()));
+                        if (textDictInfos != null && textDictInfos.size() > 0) {
+                            textDictInfoData.put(wbsTreePrivate.getId(), textDictInfos);
+                        }
+                    }
+
+                    if (wbsTreePrivate.getType() == 10 && wbsTreePrivate.getParentId() == -10) { //type=10,parentId=-10 独立库
+                        //判断是否存在独立表单,存在则不新增
+                        WbsTreePrivate wbsTreePrivate1 = wbsTreePrivatesTableDL.get(wbsTreePrivate.getId());
+                        if (ObjectUtils.isEmpty(wbsTreePrivate1)) {
+                            //根据元素表pKeyId,获取电签位置匹配信息、编辑默认信息
+                            List<TextdictInfo> textDictInfos = collect3.get(String.valueOf(wbsTreePrivate.getPKeyId()));
+                            if (textDictInfos != null && textDictInfos.size() > 0) {
+                                textDictInfoData.put(wbsTreePrivate.getId(), textDictInfos);
+                            }
+                        }
+                    }
+                }
+
+                //只同步独立库中有关联过清表的元素表type=10,以及原始方式的元素表type=2
+                List<WbsTreePrivate> collect = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(2) || (f.getHtmlUrl() != null && f.getType().equals(10))).collect(Collectors.toList());
+
+                collect.forEach(tree -> {
+                    List<TextdictInfo> textDictInfos = textDictInfoData.get(tree.getId());
+                    if (textDictInfos != null) {
+                        for (TextdictInfo textdictInfo : textDictInfos) {
+                            TextdictInfo obj = BeanUtil.copyProperties(textdictInfo, TextdictInfo.class);
+                            assert obj != null;
+                            obj.setId(SnowFlakeUtil.getId());
+                            obj.setTabId(tree.getPKeyId().toString()); //重新赋值绑定到对应的表上
+                            insertData.add(obj);
+                        }
+                    }
+                });
+
+                //去重,删除当前表的电签信息
+                List<String> collect2 = insertData.stream().map(TextdictInfo::getTabId).collect(Collectors.toList());
+                List<List<String>> partitionDel = Lists.partition(collect2, 1000);
+                for (List<String> ids : partitionDel) {
+                    String delSql = "delete from m_textdict_info where tab_id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+                    jdbcTemplate.execute(delSql);
+                }
+
+                //新增
+                //textDictInfoService.insertBatch(insertData, 1000);
+
+                //异步新增
+                List<List<TextdictInfo>> partition1 = Lists.partition(insertData, 1000);
+                CompletableFuture<Void> handle = CompletableFuture.allOf(partition1.stream().map(addList ->
+                        CompletableFuture.runAsync(() -> {
+                            textDictInfoService.insertBatch(addList, 1000);
+                        }, executor)).toArray(CompletableFuture[]::new));
+                handle.join();
+
+                return true;
+            } else {
+                throw new ServiceException("当前项目关联的wbs树不是私有关联");
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public void eVisInfoRepeatDel(String pid) {
+        //获取当前项目下节点树所有节点、表、独立表
+        String sqlNodeTreeAllNow = "SELECT p_key_id,id,type,parent_id,html_url FROM m_wbs_tree_private WHERE project_id = " + pid + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_type = 1) OR (type= 10 AND parent_id = -10 ))";
+        List<WbsTreePrivate> wbsTreePrivatesNodeAndTabNow = jdbcTemplate.query(sqlNodeTreeAllNow, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+
+        //获取当前对应电签位置配置信息
+        List<WbsTreePrivate> collect1 = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList());
+        List<Long> pKeyIds = collect1.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+
+        //分组查询电签信息
+        List<TextdictInfo> textDictInfosAll = new ArrayList<>();
+        List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
+        for (List<Long> ids : partition) {
+            String sql = "select id,tab_id,col_key,col_name,sig_role_id,sig_role_name from m_textdict_info where tab_id in(" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+            List<TextdictInfo> textDictInfos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
+            textDictInfosAll.addAll(textDictInfos);
+        }
+
+        //去重,解决之前由于删除接口重复保存,导致数据重复问题
+        List<TextdictInfo> list = textDictInfosAll.stream().collect(
+                Collectors.collectingAndThen(
+                        Collectors.toCollection(() -> new TreeSet<>(
+                                Comparator.comparing(o -> o.getTabId() + ";" + o.getSigRoleId() + ";" + o.getColKey() + ";" + o.getSigRoleName() + ";" + o.getColName()
+                                )
+                        )), ArrayList::new));
+
+        List<Long> idsAll = textDictInfosAll.stream().map(TextdictInfo::getId).collect(Collectors.toList());
+
+        List<Long> saveIds = list.stream().map(TextdictInfo::getId).collect(Collectors.toList());
+
+        List<Long> delIds = idsAll.stream().filter(f -> !saveIds.contains(f)).collect(Collectors.toList());
+
+        List<List<Long>> partition1 = Lists.partition(delIds, 1000);
+        for (List<Long> ids : partition1) {
+            String delSql = "delete from m_textdict_info where id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
+            jdbcTemplate.execute(delSql);
+        }
+
+    }
+
     @Override
     public R addWbsTreeContractInfo(String nodeId, String primaryKeyIds, long contractId) {
         if (com.alibaba.cloud.commons.lang.StringUtils.isEmpty(nodeId)) {
@@ -1503,13 +1742,13 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         if (wbsTableOwnerRoleList.size() == 0) {
             throw new ServiceException("当前用户角色未授权,请先分配角色查看元素表相对应的权限");
         }
+        //角色权限
+        List<String> roleAndTabOwners = wbsTableOwnerRoleList.stream().map(WbsTableOwnerRole::getTableOwnerNumber).collect(Collectors.toList());
 
-        List<String> tableOwnerNumbers = wbsTableOwnerRoleList.stream().map(WbsTableOwnerRole::getTableOwnerNumber).collect(Collectors.toList());
-
+        //表单权限
         List<String> tableOwnerList = null;
         if (org.apache.commons.lang.StringUtils.isNotEmpty(tableOwner)) {
             String tableOwners = "";
-            //此处加载字典owner_type
             if (tableOwner.equals("1")) {
                 tableOwners = "1,2,3";
             } else if (tableOwner.equals("2")) {
@@ -1518,7 +1757,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
             tableOwnerList = Func.toStrList(tableOwners);
         }
 
-        List<WbsTreePrivate> wbsTreePrivates = baseMapper.selectWbsTreeContractList(tableOwnerNumbers, tableType, wbsTreePrivate.getProjectId(), wbsTreePrivate.getWbsId(), wbsTreePrivate.getId(), tableOwnerList);
+        List<WbsTreePrivate> wbsTreePrivates = baseMapper.selectWbsTreeContractList(roleAndTabOwners, tableType, wbsTreePrivate.getProjectId(), wbsTreePrivate.getWbsId(), wbsTreePrivate.getId(), tableOwnerList);
 
         if (ObjectUtil.isNotEmpty(id)) { //编辑
             //获取当前试验记录信息中的表状态
@@ -1625,148 +1864,6 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         return R.data(table + "");
     }
 
-    @Override
-    public boolean syncProjectEVisa(String projectId) {
-        if (StringUtils.isNotEmpty(projectId)) {
-            ProjectInfo projectInfo = projectInfoMapper.selectById(projectId);
-            if (projectInfo != null && ("private").equals(projectInfo.getReferenceWbsTemplateType()) && ObjectUtils.isNotEmpty(projectInfo.getReferenceWbsTemplateId())) {
-                //构造参数集合
-                List<TextdictInfo> insertData = new ArrayList<>();
-                Map<String, List<TextdictInfo>> textDictInfoData = new HashMap<>();
-
-                //获取当前引用的项目节点树的根节点信息
-                WbsTreePrivate oneRecordRoot = this.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, projectInfo.getReferenceWbsTemplateId()));
-
-                //获取当前项目下节点树所有节点、表、独立表
-                String sqlNodeTreeAllNow = "SELECT p_key_id,id,type,parent_id,html_url FROM m_wbs_tree_private WHERE project_id = " + projectId + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_type = 1) OR (type= 10 AND parent_id = -10 ))";
-                List<WbsTreePrivate> wbsTreePrivatesNodeAndTabNow = jdbcTemplate.query(sqlNodeTreeAllNow, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-                List<WbsTreePrivate> wbsTreePrivatesTableDL = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(10) && f.getParentId().equals(-10L)).collect(Collectors.toList());
-
-                //获取当前项目节点树
-                Map<Long, WbsTreePrivate> nowNodeTreeAll = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(1)).collect(Collectors.toList()).stream()
-                        .collect(Collectors.toMap(WbsTreePrivate::getId, Function.identity()));
-
-                //获取当前引用的节点树下所有节点、表、独立表
-                String sqlNodeTreeAllOld = "SELECT p_key_id,id,type,parent_id FROM m_wbs_tree_private WHERE project_id = " + oneRecordRoot.getProjectId() + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_id = " + oneRecordRoot.getWbsId() + ") OR ((type= 10 OR parent_id = -10 ) AND wbs_id IS NULL))";
-                List<WbsTreePrivate> wbsTreePrivatesNodeAndTab = jdbcTemplate.query(sqlNodeTreeAllOld, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-
-                //获取当前对应电签位置配置信息
-                List<WbsTreePrivate> collect1 = wbsTreePrivatesNodeAndTab.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList());
-                List<Long> pKeyIds = collect1.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
-
-                //分组查询
-                List<TextdictInfo> textDictInfosAll = new ArrayList<>();
-                List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
-                for (List<Long> ids : partition) {
-                    String sql = "select id,name,type,tab_id,col_key,sig_role_id,is_deleted,sig_role_name,col_name,pyzbx,pyzby from m_textdict_info where tab_id in(" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
-                    List<TextdictInfo> textDictInfos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
-                    textDictInfosAll.addAll(textDictInfos);
-                }
-
-                Map<String, List<TextdictInfo>> collect3 = textDictInfosAll.stream().collect(Collectors.groupingBy(TextdictInfo::getTabId));
-
-                //构造原始电签信息
-                for (WbsTreePrivate wbsTreePrivate : collect1) {
-                    if (wbsTreePrivate.getType() == 2) {
-                        WbsTreePrivate obj = nowNodeTreeAll.get(wbsTreePrivate.getParentId());
-                        assert obj != null;
-                        List<TextdictInfo> textDictInfos = collect3.get(String.valueOf(wbsTreePrivate.getPKeyId()));
-                        if (textDictInfos != null && textDictInfos.size() > 0) {
-                            textDictInfoData.put(wbsTreePrivate.getPKeyId() + "," + wbsTreePrivate.getId(), textDictInfos);
-                        }
-                    }
-
-                    if (wbsTreePrivate.getType() == 10 && wbsTreePrivate.getParentId() == -10) { //type=10,parentId=-10 独立库
-                        //判断是否存在独立表单,存在则不新增
-                        List<WbsTreePrivate> collect = wbsTreePrivatesTableDL.stream().filter(f -> f.getId().equals(wbsTreePrivate.getId())).collect(Collectors.toList());
-                        if (collect.size() == 0) {
-                            //根据元素表pKeyId,获取电签位置匹配信息、编辑默认信息
-                            List<TextdictInfo> textDictInfos = collect3.get(String.valueOf(wbsTreePrivate.getPKeyId()));
-                            if (textDictInfos != null && textDictInfos.size() > 0) {
-                                textDictInfoData.put(wbsTreePrivate.getPKeyId() + "," + wbsTreePrivate.getId(), textDictInfos);
-                            }
-                        }
-                    }
-                }
-
-                //只同步独立库中有关联过清表的元素表type=10,以及原始方式的元素表type=2
-                List<WbsTreePrivate> collect = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(2) || (f.getHtmlUrl() != null && f.getType().equals(10))).collect(Collectors.toList());
-
-                collect.forEach(tree -> {
-                    textDictInfoData.forEach((k, v) -> {
-                        String nodeId = k.split(",")[1];
-                        if (tree.getId().equals(Long.parseLong(nodeId))) {
-                            for (TextdictInfo textdictInfo : v) {
-                                TextdictInfo obj = BeanUtil.copyProperties(textdictInfo, TextdictInfo.class);
-                                assert obj != null;
-                                obj.setTabId(String.valueOf(tree.getPKeyId())); //重新赋值绑定到对应的表上
-                                obj.setId(SnowFlakeUtil.getId());
-                                insertData.add(obj);
-                            }
-                        }
-                    });
-                });
-
-                //去重,删除当前表的电签信息
-                List<String> collect2 = insertData.stream().map(TextdictInfo::getTabId).collect(Collectors.toList());
-                List<List<String>> partitionDel = Lists.partition(collect2, 1000);
-                for (List<String> ids : partitionDel) {
-                    String delSql = "delete from m_textdict_info where tab_id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
-                    jdbcTemplate.execute(delSql);
-                }
-
-                //新增
-                textDictInfoService.insertBatch(insertData, 1000);
-
-                return true;
-            } else {
-                throw new ServiceException("当前项目关联的wbs树不是私有关联");
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public void eVisInfoRepeatDel(String pid) {
-        //获取当前项目下节点树所有节点、表、独立表
-        String sqlNodeTreeAllNow = "SELECT p_key_id,id,type,parent_id,html_url FROM m_wbs_tree_private WHERE project_id = " + pid + " AND STATUS = 1 AND is_deleted = 0 AND (((type = 1 OR type = 2) AND wbs_type = 1) OR (type= 10 AND parent_id = -10 ))";
-        List<WbsTreePrivate> wbsTreePrivatesNodeAndTabNow = jdbcTemplate.query(sqlNodeTreeAllNow, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-
-        //获取当前对应电签位置配置信息
-        List<WbsTreePrivate> collect1 = wbsTreePrivatesNodeAndTabNow.stream().filter(f -> f.getType().equals(10) || f.getType().equals(2)).collect(Collectors.toList());
-        List<Long> pKeyIds = collect1.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
-
-        //分组查询电签信息
-        List<TextdictInfo> textDictInfosAll = new ArrayList<>();
-        List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
-        for (List<Long> ids : partition) {
-            String sql = "select id,tab_id,col_key,col_name,sig_role_id,sig_role_name from m_textdict_info where tab_id in(" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
-            List<TextdictInfo> textDictInfos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
-            textDictInfosAll.addAll(textDictInfos);
-        }
-
-        //去重,解决之前由于删除接口重复保存,导致数据重复问题
-        List<TextdictInfo> list = textDictInfosAll.stream().collect(
-                Collectors.collectingAndThen(
-                        Collectors.toCollection(() -> new TreeSet<>(
-                                Comparator.comparing(o -> o.getTabId() + ";" + o.getSigRoleId() + ";" + o.getColKey() + ";" + o.getSigRoleName() + ";" + o.getColName()
-                                )
-                        )), ArrayList::new));
-
-        List<Long> idsAll = textDictInfosAll.stream().map(TextdictInfo::getId).collect(Collectors.toList());
-
-        List<Long> saveIds = list.stream().map(TextdictInfo::getId).collect(Collectors.toList());
-
-        List<Long> delIds = idsAll.stream().filter(f -> !saveIds.contains(f)).collect(Collectors.toList());
-
-        List<List<Long>> partition1 = Lists.partition(delIds, 1000);
-        for (List<Long> ids : partition1) {
-            String delSql = "delete from m_textdict_info where id in (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ")";
-            jdbcTemplate.execute(delSql);
-        }
-
-    }
-
     @Transactional(rollbackFor = Exception.class)
     public boolean insertBatch(Collection<WbsTreePrivate> entityList, int batchSize) {
         try {

+ 93 - 57
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.service.impl;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.common.collect.Lists;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.common.utils.FileUtils;
@@ -33,9 +34,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ThreadPoolExecutor;
 import java.util.stream.Collectors;
 
 @Service
@@ -59,6 +63,9 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     private final JdbcTemplate jdbcTemplate;
     private final ITableInfoService tableInfoService;
 
+    @Resource(name = "taskExecutor1")
+    private ThreadPoolExecutor executor;
+
     @Override
     public IPage<WbsTreeVO> selectWbsTreePage(IPage<WbsTreeVO> page, WbsTreeVO wbsTree) {
         return page.setRecords(baseMapper.selectWbsTreePage(page, wbsTree));
@@ -551,12 +558,16 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
 
             if (pawDTO.getReferenceType().equals("public")) {
                 //当前公有引用
-                List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getWbsId, pawDTO.getWbsId()).eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 1));
+                List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
+                        .select(WbsTreePrivate::getId)
+                        .eq(WbsTreePrivate::getWbsId, pawDTO.getWbsId()).eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 1));
                 List<String> collect = wbsTreePrivates.stream().map(WbsTreePrivate::getId).collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.toList());
                 idList2.addAll(collect);
             } else if (pawDTO.getReferenceType().equals("private")) {
                 //当前私有引用
-                List<WbsTreePrivate> wbsTreePrivates2 = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getWbsId, pawDTO.getPrimaryKeyId()).eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 1));
+                List<WbsTreePrivate> wbsTreePrivates2 = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
+                        .select(WbsTreePrivate::getId)
+                        .eq(WbsTreePrivate::getWbsId, pawDTO.getPrimaryKeyId()).eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 1));
                 List<String> collect = wbsTreePrivates2.stream().map(WbsTreePrivate::getId).collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.toList());
                 idList2.addAll(collect);
             }
@@ -564,30 +575,11 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
             List<String> saveIds = idList1.stream().filter(f -> !idList2.contains(f)).collect(Collectors.toList());
             List<String> delIds = idList2.stream().filter(f -> !idList1.contains(f)).collect(Collectors.toList());
 
-            //TODO -------同步私有电签默认信息--------
+            //TODO -------同步新增独立表单--------
             if (saveIds.size() == 0 && delIds.size() == 0) {
                 if (pawDTO.getReferenceType().equals("private")) {
                     //新增独立表单
                     this.insertDLTabAsync(pawDTO);
-
-                    /*//获取私有引用项目的wbs树的所有节点、元素表、独立表(type=10)
-                    WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getPKeyId, pawDTO.getPrimaryKeyId()));
-                    List<WbsTreePrivate> wbsTreePrivateAllOld = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
-                            .eq(WbsTreePrivate::getProjectId, Long.parseLong(wbsTreePrivate.getProjectId()))
-                            .eq(WbsTreePrivate::getStatus, 1)
-                            .and(obj -> obj.eq(WbsTreePrivate::getWbsId, Long.parseLong(wbsTreePrivate.getWbsId())).or().isNull(WbsTreePrivate::getWbsId))
-                    );
-                    List<WbsTreePrivate> WbsTreePrivateTables = wbsTreePrivateAllOld.stream().filter(f -> f.getType() == 2 || f.getType() == 10).collect(Collectors.toList());
-
-                    //获取当前项目私有wbs树下当前所有节点、元素表、独立表(type=10)
-                    List<WbsTreePrivate> wbsTreePrivatesAllNow = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
-                            .eq(WbsTreePrivate::getProjectId, Long.parseLong(pawDTO.getProjectId()))
-                            .and(obj -> obj.eq(WbsTreePrivate::getWbsId, Long.parseLong(pawDTO.getPrimaryKeyId())).or().isNull(WbsTreePrivate::getWbsId))
-                    );
-                    List<WbsTreePrivate> wbsTreePrivateNowTables = wbsTreePrivatesAllNow.stream().filter(f -> f.getType() == 2 || f.getType() == 10).collect(Collectors.toList());
-
-                    //同步私有-电签匹配数据、默认信息数据
-                    this.insertTextDictInfoAsync(WbsTreePrivateTables, wbsTreePrivateNowTables);*/
                 }
 
             } else {
@@ -600,7 +592,9 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                         if (wbsTreeContractList.size() > 0) {
                             List<ContractInfo> contractInfoArrayList = new ArrayList<>();
                             wbsTreeContractList.forEach(list -> {
-                                ContractInfo contractInfos = contractInfoMapper.selectOne(Wrappers.<ContractInfo>query().lambda().eq(ContractInfo::getId, list.getContractId()));
+                                ContractInfo contractInfos = contractInfoMapper.selectOne(Wrappers.<ContractInfo>query().lambda()
+                                        .select(ContractInfo::getContractName)
+                                        .eq(ContractInfo::getId, list.getContractId()));
                                 contractInfoArrayList.add(contractInfos);
                             });
                             List<String> names = contractInfoArrayList.stream().distinct().map(ContractInfo::getContractName).collect(Collectors.toList());
@@ -609,8 +603,20 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 throw new ServiceException(StringUtil.format("当前项目wbs树的节点已被 {} 引用中,删除失败", join));
                             }
                         }
+
+                        //删除对应节点下表的电签默认信息,获取当前项目所有表的pKeyId
+                        String sqlTabPkeyId = "select p_key_id from m_wbs_tree_private where wbs_id = " + pawDTO.getWbsId() + " and project_id = " + pawDTO.getProjectId() + " and parent_id in (" + StringUtils.join(ids1, ",") + ")";
+                        List<Long> pKeyIds = jdbcTemplate.query(sqlTabPkeyId, new BeanPropertyRowMapper<>(WbsTreePrivate.class)).stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+                        List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
+                        for (List<Long> pKIds : partition) {
+                            String sqlDelTextDict = "delete from m_textdict_info where tab_id in (" + StringUtils.join(pKIds, ",") + ")";
+                            jdbcTemplate.execute(sqlDelTextDict);
+                        }
+
+                        //删除节点、表
                         baseMapper.deleteBatch(ids1, pawDTO.getWbsId(), pawDTO.getProjectId());
                         baseMapper.deleteBatch2(ids1, pawDTO.getWbsId(), pawDTO.getProjectId());
+
                         //全部删除时,需要删除该项目独立库表,且只能是删除质检的wbsType=1,质量的无法删除
                         Long rows = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
                                 .eq(WbsTreePrivate::getWbsId, pawDTO.getWbsId())
@@ -628,7 +634,9 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                         if (wbsTreeContractList.size() > 0) {
                             List<ContractInfo> contractInfoArrayList = new ArrayList<>();
                             wbsTreeContractList.forEach(list -> {
-                                ContractInfo contractInfos = contractInfoMapper.selectOne(Wrappers.<ContractInfo>query().lambda().eq(ContractInfo::getId, list.getContractId()));
+                                ContractInfo contractInfos = contractInfoMapper.selectOne(Wrappers.<ContractInfo>query().lambda()
+                                        .select(ContractInfo::getContractName)
+                                        .eq(ContractInfo::getId, list.getContractId()));
                                 contractInfoArrayList.add(contractInfos);
                             });
                             List<String> names = contractInfoArrayList.stream().distinct().map(ContractInfo::getContractName).collect(Collectors.toList());
@@ -637,8 +645,20 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 throw new ServiceException(StringUtil.format("当前项目wbs树的节点已被 {} 引用中,删除失败", join));
                             }
                         }
+
+                        //删除对应节点下表的电签默认信息,获取当前项目所有表的pKeyId
+                        String sqlTabPkeyId = "select p_key_id from m_wbs_tree_private where wbs_id = " + pawDTO.getPrimaryKeyId() + " and project_id = " + pawDTO.getProjectId() + " and parent_id in (" + StringUtils.join(ids2, ",") + ")";
+                        List<Long> pKeyIds = jdbcTemplate.query(sqlTabPkeyId, new BeanPropertyRowMapper<>(WbsTreePrivate.class)).stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+                        List<List<Long>> partition = Lists.partition(pKeyIds, 1000);
+                        for (List<Long> pKIds : partition) {
+                            String sqlDelTextDict = "delete from m_textdict_info where tab_id in (" + StringUtils.join(pKIds, ",") + ")";
+                            jdbcTemplate.execute(sqlDelTextDict);
+                        }
+
+                        //删除节点、表
                         baseMapper.deleteBatch(ids2, pawDTO.getPrimaryKeyId(), pawDTO.getProjectId());
                         baseMapper.deleteBatch2(ids2, pawDTO.getPrimaryKeyId(), pawDTO.getProjectId());
+
                         //全部删除时,需要删除该项目独立库表,且只能是删除质检的wbsType=1,质量的无法删除
                         Long rows = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
                                 .eq(WbsTreePrivate::getWbsId, pawDTO.getPrimaryKeyId())
@@ -698,13 +718,15 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 .eq(WbsTreePrivate::getStatus, 1)
                                 .eq(WbsTreePrivate::getProjectId, pawDTO.getReferencePrivateWbsProjectId())
                                 .eq(WbsTreePrivate::getWbsId, pawDTO.getWbsId())
-                                .and(obj -> obj.eq(WbsTreePrivate::getType, 1).or().eq(WbsTreePrivate::getType,2))
+                                .and(obj -> obj.eq(WbsTreePrivate::getType, 1).or().eq(WbsTreePrivate::getType, 2))
                         );
                         List<WbsTreePrivate> wbsTreePrivatesTableDLOld = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, pawDTO.getReferencePrivateWbsProjectId()).eq(WbsTreePrivate::getType, 10).eq(WbsTreePrivate::getStatus, 1).eq(WbsTreePrivate::getParentId, -10).isNull(WbsTreePrivate::getWbsId));
                         wbsTreePrivatesNodeAndTab.addAll(wbsTreePrivatesTableDLOld);
 
                         //获取当前项目下的所有独立表
-                        List<WbsTreePrivate> wbsTreePrivatesTableDL = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 10).eq(WbsTreePrivate::getParentId, -10).eq(WbsTreePrivate::getStatus, 1));
+                        List<WbsTreePrivate> wbsTreePrivatesTableDL = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
+                                .select(WbsTreePrivate::getId)
+                                .eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 10).eq(WbsTreePrivate::getParentId, -10).eq(WbsTreePrivate::getStatus, 1));
 
                         for (WbsTreePrivate wbsTreePrivate : wbsTreePrivatesNodeAndTab) {
                             if (wbsTreePrivate.getType() == 1 || wbsTreePrivate.getType() == 2) {
@@ -753,9 +775,15 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                     }
 
                     if (pawDTO.getReferenceType().equals("public")) {
-
-                        this.insertBatch(insertData1, 1000);
-
+                        //异步新增
+                        List<List<WbsTreePrivate>> partition1 = Lists.partition(insertData1, 1000);
+                        CompletableFuture<Void> handle = CompletableFuture.allOf(partition1.stream().map(addList ->
+                                CompletableFuture.runAsync(() -> {
+                                    wbsTreePrivateService.insertBatch(addList,1000);
+                                }, executor)).toArray(CompletableFuture[]::new));
+                        handle.join();
+
+                        //修改状态
                         if (pawDTO.getWbsType() == 1) {
                             projectInfoMapper.updateTemplateInfoQuality(pawDTO.getProjectId(), pawDTO.getWbsId(), "public");
                         }
@@ -764,9 +792,15 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                         }
 
                     } else if (pawDTO.getReferenceType().equals("private")) {
-
-                        this.insertBatch(insertData2, 1000);
-
+                        //异步新增
+                        List<List<WbsTreePrivate>> partition1 = Lists.partition(insertData2, 1000);
+                        CompletableFuture<Void> handle = CompletableFuture.allOf(partition1.stream().map(addList ->
+                                CompletableFuture.runAsync(() -> {
+                                    wbsTreePrivateService.insertBatch(addList,1000);
+                                }, executor)).toArray(CompletableFuture[]::new));
+                        handle.join();
+
+                        //修改状态
                         if (pawDTO.getWbsType() == 1) {
                             projectInfoMapper.updateTemplateInfoQuality(pawDTO.getProjectId(), pawDTO.getPrimaryKeyId(), "private");
                         }
@@ -787,31 +821,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         return false;
     }
 
-    @Transactional(rollbackFor = Exception.class)
-    public boolean insertBatch(Collection<WbsTreePrivate> entityList, int batchSize) {
-        try {
-            int size = entityList.size();
-            int idxLimit = Math.min(batchSize, size);
-            int i = 1;
-            //保存单批提交的数据集合
-            List<WbsTreePrivate> oneBatchList = new ArrayList<>();
-            for (Iterator<WbsTreePrivate> var1 = entityList.iterator(); var1.hasNext(); ++i) {
-                WbsTreePrivate element = var1.next();
-                oneBatchList.add(element);
-                if (i == idxLimit) {
-                    wbsTreePrivateMapper.insertBatchSomeColumn(oneBatchList);
-                    //每次提交后清空集合数据
-                    oneBatchList.clear();
-                    idxLimit = Math.min(idxLimit + batchSize, size);
-                }
-            }
-        } catch (Exception e) {
-            log.error("保存失败", e);
-            return false;
-        }
-        return true;
-    }
-
     @Async
     public boolean updateWbsInfoPrivateAsync(List<WbsTree> wbsTreeListAll, List<WbsTreePrivate> wbsTreePrivatesAll, String projectId, Integer wbsType) {
         return wbsTreePrivateService.updateBatchByIds(wbsTreeListAll, wbsTreePrivatesAll, projectId, wbsType);
@@ -827,6 +836,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     private void insertDLTabAsync(WbsTreeContractDTO pawDTO) {
         //获取当前引用项目的独立表
         List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
+                //.select(WbsTreePrivate::getId, WbsTreePrivate::getHtmlUrl, WbsTreePrivate::getNodeName, WbsTreePrivate::getTableType)
                 .eq(WbsTreePrivate::getProjectId, pawDTO.getReferencePrivateWbsProjectId())
                 .eq(WbsTreePrivate::getType, 10)
                 .isNotNull(WbsTreePrivate::getHtmlUrl)
@@ -834,6 +844,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
 
         //获取当前项目独立表
         List<WbsTreePrivate> wbsTreePrivatesNew = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
+                .select(WbsTreePrivate::getPKeyId, WbsTreePrivate::getId, WbsTreePrivate::getNodeName, WbsTreePrivate::getTableType, WbsTreePrivate::getHtmlUrl)
                 .eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId())
                 .eq(WbsTreePrivate::getType, 10)
         );
@@ -1224,4 +1235,29 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         return false;
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    public boolean insertBatch(Collection<WbsTreePrivate> entityList, int batchSize) {
+        try {
+            int size = entityList.size();
+            int idxLimit = Math.min(batchSize, size);
+            int i = 1;
+            //保存单批提交的数据集合
+            List<WbsTreePrivate> oneBatchList = new ArrayList<>();
+            for (Iterator<WbsTreePrivate> var1 = entityList.iterator(); var1.hasNext(); ++i) {
+                WbsTreePrivate element = var1.next();
+                oneBatchList.add(element);
+                if (i == idxLimit) {
+                    wbsTreePrivateMapper.insertBatchSomeColumn(oneBatchList);
+                    //每次提交后清空集合数据
+                    oneBatchList.clear();
+                    idxLimit = Math.min(idxLimit + batchSize, size);
+                }
+            }
+        } catch (Exception e) {
+            log.error("保存失败", e);
+            return false;
+        }
+        return true;
+    }
+
 }