|
@@ -1487,22 +1487,28 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
@Async
|
|
|
@Override
|
|
|
public void batchResetHtmlUrl(List<WbsTreePrivate> wbsTreePrivateList) throws IOException, InterruptedException {
|
|
|
+ Thread.sleep(10000L);
|
|
|
if (wbsTreePrivateList != null) {
|
|
|
//存在htmlUrl才重新保存
|
|
|
wbsTreePrivateList = wbsTreePrivateList.stream().filter(wtp -> StringUtils.isNotBlank(wtp.getHtmlUrl())).collect(Collectors.toList());
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
//批量复制保存html
|
|
|
for (WbsTreePrivate tree : wbsTreePrivateList) {
|
|
|
+ String[] split = tree.getHtmlUrl().split("/");
|
|
|
File file_in = ResourceUtil.getFile(tree.getHtmlUrl());
|
|
|
- String fileCode = SnowFlakeUtil.getId() + "";
|
|
|
- String htmlUrl = file_path + "/privateUrlCopy/" + fileCode + ".html";
|
|
|
+// File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\"+split[split.length-1]);
|
|
|
+ if (!file_in.exists() || file_in==null || file_in.length()==0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String htmlUrl = file_path + "/privateUrlCopy/" + 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);
|
|
|
}
|
|
|
//批量修改
|
|
|
if (wbsTreePrivateList.size() > 1000) {
|
|
|
- List<List<WbsTreePrivate>> splitList = CommonUtil.splitList(wbsTreePrivateList, 1000);
|
|
|
+ List<List<WbsTreePrivate>> splitList = CommonUtil.splitList(wbsTreePrivateList, 800);
|
|
|
for (List<WbsTreePrivate> list : splitList) {
|
|
|
baseMapper.updateBatchByPKeyId(list);
|
|
|
}
|