|
@@ -34,10 +34,7 @@ import org.springblade.core.tool.node.ForestNodeMerger;
|
|
import org.springblade.core.tool.support.Try;
|
|
import org.springblade.core.tool.support.Try;
|
|
import org.springblade.core.tool.utils.*;
|
|
import org.springblade.core.tool.utils.*;
|
|
import org.springblade.manager.bean.NodeVO;
|
|
import org.springblade.manager.bean.NodeVO;
|
|
-import org.springblade.manager.dto.TableSortDTO;
|
|
|
|
-import org.springblade.manager.dto.RangeInfo;
|
|
|
|
-import org.springblade.manager.dto.WbsTreeContractDTO;
|
|
|
|
-import org.springblade.manager.dto.WbsTreeContractDTO2;
|
|
|
|
|
|
+import org.springblade.manager.dto.*;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.excel.WbsExcelBatchUtil;
|
|
import org.springblade.manager.excel.WbsExcelBatchUtil;
|
|
import org.springblade.manager.excel.WbsExcelUtil;
|
|
import org.springblade.manager.excel.WbsExcelUtil;
|
|
@@ -1227,6 +1224,97 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
//初始化表
|
|
//初始化表
|
|
List<WbsTreeContract> sgTab = tabs.stream().filter(f -> "1,2,3".contains(f.getTableOwner())).collect(Collectors.toList());
|
|
List<WbsTreeContract> sgTab = tabs.stream().filter(f -> "1,2,3".contains(f.getTableOwner())).collect(Collectors.toList());
|
|
List<WbsTreeContract> jlTab = tabs.stream().filter(f -> "4,5,6".contains(f.getTableOwner())).collect(Collectors.toList());
|
|
List<WbsTreeContract> jlTab = tabs.stream().filter(f -> "4,5,6".contains(f.getTableOwner())).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<CopyDto>sgList=new ArrayList<>();
|
|
|
|
+ List<CopyDto>jlList=new ArrayList<>();
|
|
|
|
+ //所以施工的表
|
|
|
|
+ for (WbsTreeContract sg : sgTab) {
|
|
|
|
+ String sgName = sg.getNodeName();
|
|
|
|
+ if(sgName.indexOf("(")>=0||sgName.indexOf(")")>=0){
|
|
|
|
+ sgName = sgName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ }
|
|
|
|
+ if(sgName.indexOf("(")>=0||sgName.indexOf(")")>=0){
|
|
|
|
+ sgName = sgName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ }
|
|
|
|
+ if(sgName.indexOf("__")>0){
|
|
|
|
+ String[] sgNames = sgName.split("__");
|
|
|
|
+ CopyDto c=new CopyDto();
|
|
|
|
+ c.setNodeName(StringUtils.deleteWhitespace(sgNames[0]));
|
|
|
|
+ c.setNum(Integer.parseInt(sgNames[1]));
|
|
|
|
+ sgList.add(c);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //所以监理的复制表
|
|
|
|
+ for (WbsTreeContract jl : jlTab) {
|
|
|
|
+ String jlName = jl.getNodeName();
|
|
|
|
+ if(jlName.indexOf("(")>=0||jlName.indexOf(")")>=0){
|
|
|
|
+ jlName=jlName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ }
|
|
|
|
+ if(jlName.indexOf("(")>=0||jlName.indexOf(")")>=0){
|
|
|
|
+ jlName=jlName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ }
|
|
|
|
+ if(jlName.indexOf("__")>0){
|
|
|
|
+ String[] sgNames = jlName.split("__");
|
|
|
|
+ CopyDto c=new CopyDto();
|
|
|
|
+ c.setNodeName(StringUtils.deleteWhitespace(sgNames[0]));
|
|
|
|
+ c.setNum(Integer.parseInt(sgNames[1]));
|
|
|
|
+ jlList.add(c);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(sgList.size()>0){
|
|
|
|
+ //还需要添加的复制表
|
|
|
|
+ sgList.removeAll(jlList);
|
|
|
|
+ ArrayList<CopyDto> copyDtos = new ArrayList<>(sgList);
|
|
|
|
+ List<WbsTreeContract>list=new ArrayList<>();
|
|
|
|
+ for (WbsTreeContract jl : jlTab) {
|
|
|
|
+ String jlName = jl.getNodeName();
|
|
|
|
+ if(jlName.indexOf("(")>=0||jlName.indexOf(")")>=0){
|
|
|
|
+ jlName=jlName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ jlName=StringUtils.deleteWhitespace(jlName);
|
|
|
|
+ }
|
|
|
|
+ if(jlName.indexOf("(")>=0||jlName.indexOf(")")>=0){
|
|
|
|
+ jlName=jlName.replaceAll("\\(.*?\\)", "");
|
|
|
|
+ jlName=StringUtils.deleteWhitespace(jlName);
|
|
|
|
+ }
|
|
|
|
+ if(jlName.indexOf("__")>=0){
|
|
|
|
+ String[] oldName = jlName.split("__");
|
|
|
|
+ jlName=oldName[0];
|
|
|
|
+ }
|
|
|
|
+ for (CopyDto copyDto : sgList) {
|
|
|
|
+ if(copyDto.getNodeName().equals(jlName)){
|
|
|
|
+ String name= jl.getNodeName()+"__"+ copyDto.getNum();
|
|
|
|
+ char charToFind = '_'; // 要查找的字符
|
|
|
|
+ int count = 0;
|
|
|
|
+ int index = name.indexOf(charToFind);
|
|
|
|
+ while (index >= 0) {
|
|
|
|
+ count++;
|
|
|
|
+ index = name.indexOf(charToFind, index + 1);
|
|
|
|
+ }
|
|
|
|
+ if(count>2){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ long newPkId = SnowFlakeUtil.getId();
|
|
|
|
+ WbsTreeContract wbsTreeContract = new WbsTreeContract();
|
|
|
|
+ BeanUtil.copy(jl, wbsTreeContract);
|
|
|
|
+ wbsTreeContract.setPKeyId(newPkId);
|
|
|
|
+ wbsTreeContract.setCreateTime(new Date());
|
|
|
|
+ wbsTreeContract.setNodeName(name);
|
|
|
|
+ wbsTreeContract.setIsCopeTab(2);
|
|
|
|
+ wbsTreeContract.setIsTabPdf(1); // pdf 不能预览
|
|
|
|
+ wbsTreeContract.setIsBussShow(1); // 是否隐藏表
|
|
|
|
+ wbsTreeContract.setTabFileType(1);//没有上传附件
|
|
|
|
+ wbsTreeContract.setPdfUrl("");
|
|
|
|
+ list.add(wbsTreeContract);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.saveBatch(list);
|
|
|
|
+ jlTab.addAll(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
List<WbsTreeContract> sgTabSort = sgTab.stream()
|
|
List<WbsTreeContract> sgTabSort = sgTab.stream()
|
|
.sorted((a, b) -> {
|
|
.sorted((a, b) -> {
|
|
Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
@@ -2465,4 +2553,4 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
}
|
|
}
|
|
System.out.println("66666666666");
|
|
System.out.println("66666666666");
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|