|
@@ -33,6 +33,7 @@ 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.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -539,7 +540,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
|
|
|
@Override
|
|
|
public void syncCurrentFormInProject(Long pKeyId) {
|
|
|
- WbsTreeContract node = this.getOne(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId,pKeyId));
|
|
|
+ WbsTreeContract node = this.getOne(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId, pKeyId));
|
|
|
baseMapper.syncCurrentFormInProject(node);
|
|
|
}
|
|
|
|
|
@@ -579,34 +580,34 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- Map<Long, String> sgYsNodeMaps = new HashMap<>();
|
|
|
- Map<Long, String> jlYsNodeMaps = new HashMap<>();
|
|
|
- Map<Long, String> plYsMaps = new HashMap<>();
|
|
|
+ Map<String, String> sgYsNodeMaps = new HashMap<>();
|
|
|
+ Map<String, String> jlYsNodeMaps = new HashMap<>();
|
|
|
+ Map<String, String> plYsMaps = new HashMap<>();
|
|
|
|
|
|
- Map<Long, String> sgCopyNodeMaps = new HashMap<>();
|
|
|
- Map<Long, String> jlCopyNodeMaps = new HashMap<>();
|
|
|
- Map<Long, String> plJlNodeMaps = new HashMap<>();
|
|
|
+ Map<String, String> sgCopyNodeMaps = new HashMap<>();
|
|
|
+ Map<String, String> jlCopyNodeMaps = new HashMap<>();
|
|
|
+ Map<String, String> plJlNodeMaps = new HashMap<>();
|
|
|
|
|
|
for (WbsTreeContract wbsTreeContract : sgTabSort) {
|
|
|
if (wbsTreeContract.getOldId() == null) {
|
|
|
//施工原始表
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- sgYsNodeMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ sgYsNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
} else {
|
|
|
//复制表
|
|
|
if (wbsTreeContract.getNodeName().contains("__")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- sgCopyNodeMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ sgCopyNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
//原始频率表
|
|
|
- if (wbsTreeContract.getNodeName().contains("pl")) {
|
|
|
+ if (wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- plYsMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ plYsMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -641,42 +642,70 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
//监理原始表
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- jlYsNodeMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ jlYsNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
} else {
|
|
|
//复制表
|
|
|
if (wbsTreeContract.getNodeName().contains("__")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- jlCopyNodeMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ jlCopyNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
//频率表
|
|
|
- if (wbsTreeContract.getNodeName().contains("pl")) {
|
|
|
+ if (wbsTreeContract.getNodeName().contains("_PL_")) {
|
|
|
String s = extractAlphameric(wbsTreeContract.getNodeName());
|
|
|
if (StringUtils.isNotEmpty(s)) {
|
|
|
- plJlNodeMaps.put(wbsTreeContract.getPKeyId(), s + "---" + wbsTreeContract.getInitTableName());
|
|
|
+ plJlNodeMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private void syncTabDataImpl(Map<Long, String> sgData, Map<Long, String> jlData) {
|
|
|
- for (Map.Entry<Long, String> sgTab : sgData.entrySet()) {
|
|
|
- Long pKeyId = sgTab.getKey();
|
|
|
- String[] split = sgTab.getValue().split("---");
|
|
|
- String tabNameRe = split[0];
|
|
|
- String initTabName = split[1];
|
|
|
-
|
|
|
-
|
|
|
+ private void syncTabDataImpl(Map<String, String> sgData, Map<String, String> jlData, WbsTreeContract node) {
|
|
|
+ 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()) {
|
|
|
+ String[] splitJl = jlTab.getKey().split("---");
|
|
|
+ String nodeNameReJL = splitJl[0];
|
|
|
+ String pKeyIdJL = splitJl[1];
|
|
|
+ String initTabNameJL = jlTab.getValue();
|
|
|
+
|
|
|
+ //相同表,复制数据
|
|
|
+ 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
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- // TODO
|
|
|
+ //复制完直接跳过
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -693,7 +722,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
- Pattern pattern = Pattern.compile("[a-zA-Z0-9]+");
|
|
|
+ Pattern pattern = Pattern.compile("[a-zA-Z0-9\\.]+");
|
|
|
Matcher matcher = pattern.matcher(str);
|
|
|
|
|
|
StringBuilder resultBuilder = new StringBuilder();
|
|
@@ -704,6 +733,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
return resultBuilder.toString();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public List<WbsTreeContract> updateAllNodeTabById(WbsTreePrivate aPrivate) {
|
|
|
return baseMapper.updateAllNodeTabById(aPrivate);
|