|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.mysql.cj.x.protobuf.MysqlxDatatypes;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
@@ -33,6 +34,7 @@ import org.springblade.manager.vo.*;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -1512,6 +1514,32 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量重新保存文件htmlUrl
|
|
|
+ * @param wbsTreePrivateList
|
|
|
+ */
|
|
|
+ @Async
|
|
|
+ @Override
|
|
|
+ public void batchResetHtmlUrl(List<WbsTreePrivate> wbsTreePrivateList) throws IOException, InterruptedException {
|
|
|
+ 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) {
|
|
|
+ File file_in = ResourceUtil.getFile(tree.getHtmlUrl());
|
|
|
+ String fileCode = SnowFlakeUtil.getId() + "";
|
|
|
+ String htmlUrl = file_path + "/privateUrlCopy/" + fileCode + ".html";
|
|
|
+// String htmlUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrlCopy\\" + fileCode + ".html";
|
|
|
+ File file_out = ResourceUtil.getFile(htmlUrl);
|
|
|
+ FileUtil.copy(file_in, file_out);
|
|
|
+ tree.setHtmlUrl(htmlUrl);
|
|
|
+ }
|
|
|
+ //批量修改
|
|
|
+ baseMapper.updateBatchByPKeyId(wbsTreePrivateList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public R addWbsTreeContractInfo(String nodeId, String primaryKeyIds, long contractId) {
|
|
|
if (com.alibaba.cloud.commons.lang.StringUtils.isEmpty(nodeId)) {
|