|
@@ -578,6 +578,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
WbsTreePrivate treePrivateNow = maps.getOrDefault(wbsTreePrivate.getId(), null);
|
|
WbsTreePrivate treePrivateNow = maps.getOrDefault(wbsTreePrivate.getId(), null);
|
|
//判断相同节点基础信息、元素表类型、元素表所属方是否发生改变
|
|
//判断相同节点基础信息、元素表类型、元素表所属方是否发生改变
|
|
if (treePrivateNow != null && this.fieldsNotEqualPrivateWbs(wbsTreePrivate, treePrivateNow)) {
|
|
if (treePrivateNow != null && this.fieldsNotEqualPrivateWbs(wbsTreePrivate, treePrivateNow)) {
|
|
|
|
+ //先复制html,并修改位置
|
|
//修改项目wbs信息
|
|
//修改项目wbs信息
|
|
WbsTreePrivate wbsPrivate = BeanUtil.copyProperties(wbsTreePrivate, WbsTreePrivate.class);
|
|
WbsTreePrivate wbsPrivate = BeanUtil.copyProperties(wbsTreePrivate, WbsTreePrivate.class);
|
|
if (wbsPrivate != null) {
|
|
if (wbsPrivate != null) {
|
|
@@ -1947,21 +1948,25 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
System.out.println("copyHtml-去除空路径之前:"+wbsTreePrivateList.size());
|
|
System.out.println("copyHtml-去除空路径之前:"+wbsTreePrivateList.size());
|
|
wbsTreePrivateList = wbsTreePrivateList.stream().filter(wtp -> StringUtils.isNotBlank(wtp.getHtmlUrl())).collect(Collectors.toList());
|
|
wbsTreePrivateList = wbsTreePrivateList.stream().filter(wtp -> StringUtils.isNotBlank(wtp.getHtmlUrl())).collect(Collectors.toList());
|
|
System.out.println("copyHtml-去除重复路径之前:"+wbsTreePrivateList.size());
|
|
System.out.println("copyHtml-去除重复路径之前:"+wbsTreePrivateList.size());
|
|
- wbsTreePrivateList = wbsTreePrivateList.stream().collect(Collectors.toMap(WbsTreePrivate::getHtmlUrl,wbs->wbs,(w1,w2)->w1))
|
|
|
|
|
|
+ List<WbsTreePrivate> wbsTreePrivateList2 = wbsTreePrivateList.stream().collect(Collectors.toMap(WbsTreePrivate::getHtmlUrl,wbs->wbs,(w1,w2)->w1))
|
|
.values().stream().collect(Collectors.toList());
|
|
.values().stream().collect(Collectors.toList());
|
|
- System.out.println("copyHtml-去除重复路径之后:"+wbsTreePrivateList.size());
|
|
|
|
|
|
+ System.out.println("copyHtml-去除重复路径之后:"+wbsTreePrivateList2.size());
|
|
|
|
+ Set<String> urls = new HashSet<>();
|
|
//批量复制保存html
|
|
//批量复制保存html
|
|
for (WbsTreePrivate tree : wbsTreePrivateList) {
|
|
for (WbsTreePrivate tree : wbsTreePrivateList) {
|
|
String[] split = tree.getHtmlUrl().split("/");
|
|
String[] split = tree.getHtmlUrl().split("/");
|
|
- File file_in = ResourceUtil.getFile(tree.getHtmlUrl());
|
|
|
|
|
|
+ String htmlUrl = file_path + "/privateUrlCopy/" +projectId+"/"+ split[split.length - 1];
|
|
|
|
+ if (!urls.contains(tree.getHtmlUrl())){
|
|
|
|
+ urls.add(tree.getHtmlUrl());
|
|
|
|
+ File file_in = ResourceUtil.getFile(tree.getHtmlUrl());
|
|
// File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\"+split[split.length-1]);
|
|
// File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\"+split[split.length-1]);
|
|
- if (!file_in.exists() || file_in.length() == 0) {
|
|
|
|
- continue;
|
|
|
|
|
|
+ if (!file_in.exists() || file_in.length() == 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //String htmlUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrlCopy\\" + split[split.length-1];
|
|
|
|
+ File file_out = ResourceUtil.getFile(htmlUrl);
|
|
|
|
+ FileUtil.copy(file_in, file_out);
|
|
}
|
|
}
|
|
- String htmlUrl = file_path + "/privateUrlCopy/" +projectId+"/"+ split[split.length - 1];
|
|
|
|
- //String htmlUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrlCopy\\" + split[split.length-1];
|
|
|
|
- File file_out = ResourceUtil.getFile(htmlUrl);
|
|
|
|
- FileUtil.copy(file_in, file_out);
|
|
|
|
tree.setHtmlUrl(htmlUrl);
|
|
tree.setHtmlUrl(htmlUrl);
|
|
}
|
|
}
|
|
//批量修改
|
|
//批量修改
|