|
@@ -33,10 +33,7 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
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.excel.WbsExcelBatchUtil;
|
|
|
import org.springblade.manager.excel.WbsExcelUtil;
|
|
@@ -1213,7 +1210,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
Map<String, String> jlTabMaps = new LinkedHashMap<>();
|
|
|
|
|
|
List<WbsTreeContract> tabs = baseMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, node.getId())
|
|
|
- .select(WbsTreeContract::getNodeName, WbsTreeContract::getTableOwner, WbsTreeContract::getPKeyId, WbsTreeContract::getInitTableName, WbsTreeContract::getSort, WbsTreeContract::getFullName, WbsTreeContract::getUpdateTime)
|
|
|
.eq(WbsTreeContract::getContractId, node.getContractId()).eq(WbsTreeContract::getType, 2)
|
|
|
.eq(WbsTreeContract::getWbsId, node.getWbsId())
|
|
|
.apply("(wbs_type is null OR wbs_type = " + node.getWbsType() + ")")
|
|
@@ -1225,6 +1221,98 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
//初始化表
|
|
|
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<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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ System.out.println(list.size());
|
|
|
+ this.saveBatch(list);
|
|
|
+ jlTab.addAll(list);
|
|
|
+ }
|
|
|
+
|
|
|
List<WbsTreeContract> sgTabSort = sgTab.stream()
|
|
|
.sorted((a, b) -> {
|
|
|
Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
@@ -1285,6 +1373,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//构造表数据
|
|
|
List<InsertDataVO> resultData = new LinkedList<>();
|
|
|
this.syncTabDataImpl(sgTabMaps, jlTabMaps, resultData);
|
|
@@ -1359,7 +1449,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(vo.getDataLength()) && vo.getDataLength() > 500) {
|
|
|
//如果超过500字符长度,那么直接异常提示
|
|
|
- filedNames.add(vo.getName());
|
|
|
+ // filedNames.add(vo.getName());
|
|
|
+ exKeys.add(vo.getKey() + "---" + vo.getDataLength());
|
|
|
}
|
|
|
}
|
|
|
if (keys.size() > 0 && values.size() > 0 && keys.size() == values.size()) {
|
|
@@ -1490,10 +1581,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
String nodeNameReJL = splitJl[0];
|
|
|
String pKeyIdJL = splitJl[1];
|
|
|
String initTabNameJL = jlTab.getValue();
|
|
|
-
|
|
|
- //表的代码名称相同,就复制数据,例如:G10=G10
|
|
|
+ //表的代码名称相同,就复制数据,例如:G10=G10 复制的表是G101去掉最后一位
|
|
|
if (nodeNameRe.equals(nodeNameReJL)) {
|
|
|
-
|
|
|
String htmlStringJL = this.getHtmlString(pKeyIdJL);
|
|
|
|
|
|
//获取质检实体表对应数据
|
|
@@ -2409,4 +2498,4 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
throw new ServiceException("请传入ids");
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|