|
@@ -7,18 +7,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import jodd.util.ArraysUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
+import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.select.Elements;
|
|
|
import org.springblade.business.entity.ConstructionLedger;
|
|
|
import org.springblade.business.feign.ConstructionLedgerFeignClient;
|
|
|
import org.springblade.business.feign.InformationQueryClient;
|
|
|
+import org.springblade.business.vo.QueryProcessDataVO;
|
|
|
+import org.springblade.common.constant.CommonConstant;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.FileUtils;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
import org.springblade.manager.dto.RangeInfo;
|
|
@@ -33,16 +42,14 @@ import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
import org.springblade.manager.service.IWbsTreeContractService;
|
|
|
import org.springblade.manager.utils.DiffListUtil;
|
|
|
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.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
-import java.io.FileNotFoundException;
|
|
|
-import java.io.IOException;
|
|
|
+import java.io.*;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.regex.Matcher;
|
|
@@ -545,18 +552,28 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean syncTabData(String pKeyId) {
|
|
|
+ public boolean syncTabData(String pKeyId) throws Exception {
|
|
|
WbsTreeContract node = baseMapper.selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, pKeyId));
|
|
|
if (node != null) {
|
|
|
+ //原始表
|
|
|
+ Map<String, String> sgYsNodeMaps = new LinkedHashMap<>();
|
|
|
+ Map<String, String> jlYsNodeMaps = new LinkedHashMap<>();
|
|
|
+ //频率表
|
|
|
+ Map<String, String> sgPLNodeMaps = new LinkedHashMap<>();
|
|
|
+ Map<String, String> jlPLNodeMaps = new LinkedHashMap<>();
|
|
|
+ //复制的表
|
|
|
+ Map<String, String> sgCopyNodeMaps = new LinkedHashMap<>();
|
|
|
+ Map<String, String> jlCopyNodeMaps = 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, WbsTreeContract::getOldId)
|
|
|
.eq(WbsTreeContract::getContractId, node.getContractId()).eq(WbsTreeContract::getType, 2)
|
|
|
.eq(WbsTreeContract::getWbsId, node.getWbsId()).eq(WbsTreeContract::getWbsType, node.getWbsType())
|
|
|
.eq(WbsTreeContract::getStatus, 1));
|
|
|
|
|
|
+ //初始化表
|
|
|
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> sgTabSort = sgTab.stream()
|
|
|
.sorted((a, b) -> {
|
|
|
Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
@@ -579,17 +596,31 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
return aUpdateTime.compareTo(bUpdateTime);
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
|
+ List<WbsTreeContract> jlTabSort = jlTab.stream()
|
|
|
+ .sorted((a, b) -> {
|
|
|
+ Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
|
+ Integer bSort = b.getSort() != null ? b.getSort() : 0;
|
|
|
+ int compareSort = aSort.compareTo(bSort);
|
|
|
+ if (compareSort != 0) return compareSort;
|
|
|
+
|
|
|
+ String aFullName = a.getFullName() != null ? a.getFullName() : "";
|
|
|
+ String bFullName = b.getFullName() != null ? b.getFullName() : "";
|
|
|
+ int compareFullName = aFullName.compareToIgnoreCase(bFullName);
|
|
|
+ if (compareFullName != 0) return compareFullName;
|
|
|
|
|
|
- Map<String, String> sgYsNodeMaps = new HashMap<>();
|
|
|
- Map<String, String> jlYsNodeMaps = new HashMap<>();
|
|
|
- Map<String, String> plYsMaps = new HashMap<>();
|
|
|
+ long aPKeyId = a.getPKeyId() != null ? a.getPKeyId() : 0L;
|
|
|
+ long bPKeyId = b.getPKeyId() != null ? b.getPKeyId() : 0L;
|
|
|
+ int comparePKeyId = Long.compare(aPKeyId, bPKeyId);
|
|
|
+ if (comparePKeyId != 0) return comparePKeyId;
|
|
|
|
|
|
- Map<String, String> sgCopyNodeMaps = new HashMap<>();
|
|
|
- Map<String, String> jlCopyNodeMaps = new HashMap<>();
|
|
|
- Map<String, String> plJlNodeMaps = new HashMap<>();
|
|
|
+ Long aUpdateTime = a.getUpdateTime() != null ? a.getUpdateTime().getTime() : 0L;
|
|
|
+ Long bUpdateTime = b.getUpdateTime() != null ? b.getUpdateTime().getTime() : 0L;
|
|
|
+ return aUpdateTime.compareTo(bUpdateTime);
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
for (WbsTreeContract wbsTreeContract : sgTabSort) {
|
|
|
- if (wbsTreeContract.getOldId() == null) {
|
|
|
+ if (wbsTreeContract.getOldId() == null && !wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
//施工原始表
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
@@ -607,38 +638,14 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
if (wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- plYsMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
+ sgPLNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- List<WbsTreeContract> jlTabSort = jlTab.stream()
|
|
|
- .sorted((a, b) -> {
|
|
|
- Integer aSort = a.getSort() != null ? a.getSort() : 0;
|
|
|
- Integer bSort = b.getSort() != null ? b.getSort() : 0;
|
|
|
- int compareSort = aSort.compareTo(bSort);
|
|
|
- if (compareSort != 0) return compareSort;
|
|
|
-
|
|
|
- String aFullName = a.getFullName() != null ? a.getFullName() : "";
|
|
|
- String bFullName = b.getFullName() != null ? b.getFullName() : "";
|
|
|
- int compareFullName = aFullName.compareToIgnoreCase(bFullName);
|
|
|
- if (compareFullName != 0) return compareFullName;
|
|
|
-
|
|
|
- long aPKeyId = a.getPKeyId() != null ? a.getPKeyId() : 0L;
|
|
|
- long bPKeyId = b.getPKeyId() != null ? b.getPKeyId() : 0L;
|
|
|
- int comparePKeyId = Long.compare(aPKeyId, bPKeyId);
|
|
|
- if (comparePKeyId != 0) return comparePKeyId;
|
|
|
-
|
|
|
- Long aUpdateTime = a.getUpdateTime() != null ? a.getUpdateTime().getTime() : 0L;
|
|
|
- Long bUpdateTime = b.getUpdateTime() != null ? b.getUpdateTime().getTime() : 0L;
|
|
|
- return aUpdateTime.compareTo(bUpdateTime);
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
for (WbsTreeContract wbsTreeContract : jlTabSort) {
|
|
|
- if (wbsTreeContract.getOldId() == null) {
|
|
|
+ if (wbsTreeContract.getOldId() == null && !wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
//监理原始表
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
@@ -656,60 +663,200 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
if (wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- plJlNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
+ jlPLNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //构造表数据
|
|
|
+ List<InsertDataVO> resultData = new LinkedList<>();
|
|
|
+ this.syncTabDataImpl(sgYsNodeMaps, jlYsNodeMaps, resultData);
|
|
|
+ this.syncTabDataImpl(sgCopyNodeMaps, jlCopyNodeMaps, resultData);
|
|
|
+ this.syncTabDataImpl(sgPLNodeMaps, jlPLNodeMaps, resultData);
|
|
|
+
|
|
|
+ //入库处理
|
|
|
+ if (resultData.size() > 0) {
|
|
|
+ List<String> resultAddData = new ArrayList<>();
|
|
|
+ Map<String, List<InsertDataVO>> maps = resultData.stream().filter(f -> f.getKey().contains("key_")).collect(Collectors.groupingBy(InsertDataVO::getInitTabName));
|
|
|
+
|
|
|
+ for (Map.Entry<String, List<InsertDataVO>> oneTabData : maps.entrySet()) {
|
|
|
+ String initTabName = oneTabData.getKey();
|
|
|
+ List<InsertDataVO> dataValue = oneTabData.getValue();
|
|
|
+ List<String> collect = dataValue.stream().map(InsertDataVO::getPKeyId).distinct().collect(Collectors.toList());
|
|
|
+ String pKeyIdJL = "";
|
|
|
+ if (collect.size() == 1) {
|
|
|
+ pKeyIdJL = collect.stream().findAny().orElse(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ StringBuilder dataSql = new StringBuilder();
|
|
|
+ List<String> keys = new LinkedList<>();
|
|
|
+ List<String> values = new LinkedList<>();
|
|
|
+ for (InsertDataVO vo : dataValue) {
|
|
|
+ String key = vo.getKey();
|
|
|
+ keys.add(key);
|
|
|
+ String data = vo.getData();
|
|
|
+ values.add(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (keys.size() > 0 && values.size() > 0 && keys.size() == values.size()) {
|
|
|
+ //delete SQL(删除旧数据,去重)
|
|
|
+ String delSql = "delete from " + initTabName + " where p_key_id = " + pKeyIdJL + ";";
|
|
|
+ //insert SQL(新增)
|
|
|
+ dataSql.append(delSql).append("insert into ")
|
|
|
+ .append(initTabName).append(" (id,p_key_id,group_id,")
|
|
|
+ .append(String.join(",", keys))
|
|
|
+ .append(") values (")
|
|
|
+ .append(SnowFlakeUtil.getId()).append(",")
|
|
|
+ .append(pKeyIdJL).append(",null,")
|
|
|
+ .append(values.stream()
|
|
|
+ .map(s -> "'" + s + "'")
|
|
|
+ .collect(Collectors.joining(",")))
|
|
|
+ .append(");");
|
|
|
+
|
|
|
+ resultAddData.add(dataSql.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //入库
|
|
|
+ if (resultAddData.size() > 0) {
|
|
|
+ List<List<String>> partition = Lists.partition(resultAddData, 10);
|
|
|
+ for (List<String> strings : partition) {
|
|
|
+ jdbcTemplate.execute(StringUtils.join(strings, " "));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("未获取到当前节点信息,请联系管理员");
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
|
|
|
- private void syncTabDataImpl(Map<String, String> sgData, Map<String, String> jlData, WbsTreeContract node) {
|
|
|
- for (Map.Entry<String, String> sgTab : sgData.entrySet()) {
|
|
|
+ /**
|
|
|
+ * 构造数据
|
|
|
+ *
|
|
|
+ * @param sgData
|
|
|
+ * @param jlData
|
|
|
+ * @param resultData
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ private void syncTabDataImpl(Map<String, String> sgData, Map<String, String> jlData, List<InsertDataVO> resultData) throws Exception {
|
|
|
+ for (Map.Entry<String, String> sgTab : sgData.entrySet()) { //质检表
|
|
|
String[] split = sgTab.getKey().split("---");
|
|
|
String nodeNameRe = split[0];
|
|
|
String pKeyId = split[1];
|
|
|
String initTabName = sgTab.getValue();
|
|
|
- for (Map.Entry<String, String> jlTab : jlData.entrySet()) {
|
|
|
+ //质检html
|
|
|
+ String htmlString = this.getHtmlString(pKeyId);
|
|
|
+
|
|
|
+ for (Map.Entry<String, String> jlTab : jlData.entrySet()) { //监理表
|
|
|
String[] splitJl = jlTab.getKey().split("---");
|
|
|
String nodeNameReJL = splitJl[0];
|
|
|
String pKeyIdJL = splitJl[1];
|
|
|
String initTabNameJL = jlTab.getValue();
|
|
|
+ //监理html
|
|
|
+ String htmlStringJL = this.getHtmlString(pKeyIdJL);
|
|
|
|
|
|
- //相同表,复制数据
|
|
|
+ //表的代码名称相同,则复制数据,例如:G10=G10
|
|
|
if (nodeNameRe.equals(nodeNameReJL)) {
|
|
|
- //当前原始施工表
|
|
|
- WbsTreeContract wbsTreeContract = baseMapper.selectOne(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
- .eq(WbsTreeContract::getPKeyId, pKeyId).eq(WbsTreeContract::getStatus, 1).eq(WbsTreeContract::getIsBussShow, 1));
|
|
|
- if (wbsTreeContract != null) {
|
|
|
- //获取initTabId,获取表字段
|
|
|
- WbsTreePrivate initTabId = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
- .select(WbsTreePrivate::getInitTableId)
|
|
|
- .eq(WbsTreePrivate::getProjectId, node.getProjectId())
|
|
|
- .eq(WbsTreePrivate::getWbsId, node.getWbsId())
|
|
|
- .eq(WbsTreePrivate::getNodeName, node.getNodeName())
|
|
|
- .eq(WbsTreePrivate::getId, node.getId())
|
|
|
- .eq(WbsTreePrivate::getWbsType, node.getWbsType())
|
|
|
- .eq(WbsTreePrivate::getType, 2)
|
|
|
- .eq(WbsTreePrivate::getStatus, 1));
|
|
|
-
|
|
|
- if (initTabId != null) { //表元素字段
|
|
|
- List<WbsFormElement> elementList = jdbcTemplate.query("select * from m_wbs_form_element where f_id = " + initTabId.getInitTableId(), new BeanPropertyRowMapper<>(WbsFormElement.class));
|
|
|
- }
|
|
|
- //TODO
|
|
|
+ //获取质检实体表对应数据
|
|
|
+ List<Map<String, Object>> mapsList = jdbcTemplate.queryForList("select * from " + initTabName + " where p_key_id = " + pKeyId);
|
|
|
+ if (mapsList.size() > 0) {
|
|
|
+ Map<String, Object> maps = mapsList.get(0);
|
|
|
+ maps.entrySet().removeIf(entry -> entry.getValue() == null); //排查空字段
|
|
|
+ for (Map.Entry<String, Object> obj : maps.entrySet()) {
|
|
|
+ String key = obj.getKey();
|
|
|
+ Object value = obj.getValue();
|
|
|
+
|
|
|
+ //非跨单元格(一个单元格)
|
|
|
+ if (value.toString().contains("_^_") && !value.toString().contains("☆")) {
|
|
|
+ String[] fieldArr = value.toString().split("_\\^_");
|
|
|
+ String data = fieldArr[0];
|
|
|
+ String index = fieldArr[1];
|
|
|
+ String findIndex = key + "__" + index;
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(htmlString)) {
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ Elements td = doc.select("el-input[keyname~=" + findIndex + ".*]");
|
|
|
+ String placeholderValue = "";
|
|
|
+ if (td.size() >= 1) {
|
|
|
+ for (Element element : td) {
|
|
|
+ placeholderValue = element.attr("placeholderxx");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ //警告跳过
|
|
|
+ if (!placeholderValue.contains("警告")) {
|
|
|
+ if (StringUtils.isNotEmpty(htmlStringJL)) {
|
|
|
+ Document docJL = Jsoup.parse(htmlStringJL);
|
|
|
+ Elements tdJL = docJL.select("el-input[placeholderxx~=" + this.escapeRegex(placeholderValue) + ".*]");
|
|
|
+ if (tdJL.size() >= 1) {
|
|
|
+ for (Element element : tdJL) {
|
|
|
+ String keyname = element.attr("keyname");
|
|
|
+ if (StringUtils.isNotEmpty(keyname)) {
|
|
|
+ String[] keynameJL = keyname.split("__");
|
|
|
+ String keyJL = keynameJL[0];
|
|
|
+ String keyJLIndex = keynameJL[1];
|
|
|
+
|
|
|
+ InsertDataVO vo = new InsertDataVO();
|
|
|
+ vo.setPKeyId(pKeyIdJL);
|
|
|
+ vo.setInitTabName(initTabNameJL);
|
|
|
+ vo.setKey(keyJL);
|
|
|
+ vo.setData(data + "_^_" + keyJLIndex);
|
|
|
+ resultData.add(vo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //复制完直接跳过
|
|
|
- break;
|
|
|
+ //跨单元格(多个单元格)
|
|
|
+ } else if (value.toString().contains("_^_") && value.toString().contains("☆")) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取html页面信息
|
|
|
+ *
|
|
|
+ * @param pkeyId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ private String getHtmlString(String pkeyId) throws Exception {
|
|
|
+ String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
+ WbsTreeContract wbsTreeContract = baseMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .select(WbsTreeContract::getHtmlUrl)
|
|
|
+ .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
+ if (wbsTreeContract == null || wbsTreeContract.getHtmlUrl() == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ String fileUrl = wbsTreeContract.getHtmlUrl();
|
|
|
+ File file1 = ResourceUtil.getFile(fileUrl);
|
|
|
+ InputStream fileInputStream;
|
|
|
+ if (file1.exists()) {
|
|
|
+ fileInputStream = new FileInputStream(file1);
|
|
|
+ } else {
|
|
|
+ String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
|
|
|
+ fileInputStream = CommonUtil.getOSSInputStream(path);
|
|
|
+ }
|
|
|
+
|
|
|
+ String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
+ htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ return doc.select("table").first() + "";
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 截取字符串中的英文和数字,返回处理后的字符串
|
|
@@ -721,18 +868,26 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
if (str == null) {
|
|
|
return "";
|
|
|
}
|
|
|
-
|
|
|
Pattern pattern = Pattern.compile("[a-zA-Z0-9\\.]+");
|
|
|
Matcher matcher = pattern.matcher(str);
|
|
|
-
|
|
|
StringBuilder resultBuilder = new StringBuilder();
|
|
|
while (matcher.find()) {
|
|
|
- resultBuilder.append(matcher.group());
|
|
|
+ String match = matcher.group();
|
|
|
+ match = match.replace(".", "");
|
|
|
+ resultBuilder.append(match);
|
|
|
}
|
|
|
-
|
|
|
return resultBuilder.toString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 转义字符串
|
|
|
+ *
|
|
|
+ * @param input
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String escapeRegex(String input) {
|
|
|
+ return Pattern.quote(input);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public List<WbsTreeContract> updateAllNodeTabById(WbsTreePrivate aPrivate) {
|