|
@@ -500,37 +500,6 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*for (WbsTreePrivate treePrivateNow : wbsTreePrivatesAllNow) {
|
|
|
- //判断相同节点基础信息、元素表类型、元素表所属方 是否发生改变
|
|
|
- if (wbsTreePrivate.getId().equals(treePrivateNow.getId()) &&
|
|
|
- (!wbsTreePrivate.getNodeName().equals(treePrivateNow.getNodeName())
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getNodeType()) && !wbsTreePrivate.getNodeType().equals(treePrivateNow.getNodeType()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getMajorDataType()) && !wbsTreePrivate.getMajorDataType().equals(treePrivateNow.getMajorDataType()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getTableType()) && !wbsTreePrivate.getTableType().equals(treePrivateNow.getTableType()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getTableOwner()) && !wbsTreePrivate.getTableOwner().equals(treePrivateNow.getTableOwner()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getImportMatchingInfo()) && !wbsTreePrivate.getImportMatchingInfo().equals(treePrivateNow.getImportMatchingInfo()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getMixRatioTestIds()) && !wbsTreePrivate.getMixRatioTestIds().equals(treePrivateNow.getMixRatioTestIds()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getInitTableId()) && !wbsTreePrivate.getInitTableId().equals(treePrivateNow.getInitTableId()))
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getInitTableName()) && !wbsTreePrivate.getInitTableName().equals(treePrivateNow.getInitTableName())
|
|
|
- || (ObjectUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl()) && !wbsTreePrivate.getHtmlUrl().equals(treePrivateNow.getHtmlUrl()))))) {
|
|
|
- //修改项目wbs信息
|
|
|
- WbsTreePrivate wbsPrivate = BeanUtil.copyProperties(wbsTreePrivate, WbsTreePrivate.class);
|
|
|
- if (wbsPrivate != null) {
|
|
|
- wbsPrivate.setWbsId(wbsId);
|
|
|
- wbsPrivate.setProjectId(projectId);
|
|
|
- listPrivate.add(wbsPrivate);
|
|
|
- }
|
|
|
- for (ContractInfo contractInfo : contractInfos) {
|
|
|
- //修改合同段wbs信息
|
|
|
- WbsTreeContract wbsContract = BeanUtil.copyProperties(wbsTreePrivate, WbsTreeContract.class);
|
|
|
- if (wbsContract != null) {
|
|
|
- wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
- wbsContract.setProjectId(projectId);
|
|
|
- listContract.add(wbsContract);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
|
|
|
//修改到项目
|
|
@@ -544,22 +513,11 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
String sql = "select id,old_id,project_id,contract_id from m_wbs_tree_contract where project_id = " + projectId + " and contract_id in(" + org.apache.commons.lang.StringUtils.join(contractInfosIds, ",") + ") and wbs_type = " + wbsType + " and type = 1 and status = 1 and is_deleted = 0 and old_id is not null";
|
|
|
List<WbsTreeContract> wbsTreeContractsCopyOrAddAll = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
Map<String, List<WbsTreeContract>> copyAddNodes = wbsTreeContractsCopyOrAddAll.stream().collect(Collectors.groupingBy(WbsTreeContract::getOldId));
|
|
|
- /*for (ContractInfo contractInfo : contractInfos) {
|
|
|
- List<WbsTreeContract> wbsTreeContractsCopyOrAdd = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
- .select(WbsTreeContract::getId, WbsTreeContract::getOldId, WbsTreeContract::getProjectId, WbsTreeContract::getContractId)
|
|
|
- .eq(WbsTreeContract::getProjectId, projectId)
|
|
|
- .eq(WbsTreeContract::getContractId, contractInfo.getId())
|
|
|
- .eq(WbsTreeContract::getWbsType, wbsType)
|
|
|
- .eq(WbsTreeContract::getType, 1)
|
|
|
- .isNotNull(WbsTreeContract::getOldId)
|
|
|
- );
|
|
|
- wbsTreeContractsCopyOrAddAll.addAll(wbsTreeContractsCopyOrAdd);
|
|
|
- }*/
|
|
|
|
|
|
List<WbsTreeContract> listContractAdd = new ArrayList<>();
|
|
|
for (WbsTreeContract obj1 : listContract) {
|
|
|
List<WbsTreeContract> copyAddNodesNow = copyAddNodes.get(obj1.getId().toString());
|
|
|
- if (copyAddNodesNow.size() > 0) {
|
|
|
+ if (ObjectUtils.isNotEmpty(copyAddNodesNow) && copyAddNodesNow.size() > 0) {
|
|
|
WbsTreeContract obj2 = copyAddNodesNow.stream().filter(f -> f.getContractId().equals(obj1.getContractId()) && f.getProjectId().equals(obj1.getProjectId())).findAny().orElse(null);
|
|
|
if (obj2 != null) {
|
|
|
obj2.setNodeName(obj1.getNodeName());
|
|
@@ -571,17 +529,6 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
listContractAdd.add(obj2);
|
|
|
}
|
|
|
}
|
|
|
- /*for (WbsTreeContract obj2 : wbsTreeContractsCopyOrAddAll) {
|
|
|
- if (obj1.getId().toString().equals(obj2.getOldId()) && obj1.getProjectId().equals(obj2.getProjectId()) && obj1.getContractId().equals(obj2.getContractId())) {
|
|
|
- obj2.setNodeName(obj1.getNodeName());
|
|
|
- obj2.setNodeType(obj1.getNodeType());
|
|
|
- obj2.setMajorDataType(obj1.getMajorDataType());
|
|
|
- obj2.setTableType(obj1.getTableType());
|
|
|
- obj2.setTableOwner(obj1.getTableOwner());
|
|
|
- obj2.setHtmlUrl(obj1.getHtmlUrl());
|
|
|
- listContractAdd.add(obj2);
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
|
|
|
listContractAdd.addAll(listContract);
|
|
@@ -1516,6 +1463,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|
|
|
/**
|
|
|
* 批量重新保存文件htmlUrl
|
|
|
+ *
|
|
|
* @param wbsTreePrivateList
|
|
|
*/
|
|
|
@Async
|
|
@@ -1590,49 +1538,53 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
.last("limit 1"));
|
|
|
//如果存在则复制最新表的配置,调整表单的值
|
|
|
if (wbsTreePrivate != null) {
|
|
|
+
|
|
|
if (wbsPrivate.getExcelId() != null) {
|
|
|
- wbsPrivate.setExcelId(wbsTreePrivate.getExcelId());
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl())){
|
|
|
- //复制生成html
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- File file_in = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
+ if (StringUtils.isNotEmpty(wbsTreePrivate.getExcelId() + "")) {
|
|
|
+ wbsPrivate.setExcelId(wbsTreePrivate.getExcelId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl())) {
|
|
|
+ //复制生成html
|
|
|
+ String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ File file_in = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
// File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1636553444422582272.html");
|
|
|
- String filecode = SnowFlakeUtil.getId() + "";
|
|
|
- String thmlUrl = file_path + "/privateUrl/" + filecode + ".html";
|
|
|
+ String filecode = SnowFlakeUtil.getId() + "";
|
|
|
+ String thmlUrl = file_path + "/privateUrl/" + filecode + ".html";
|
|
|
// String thmlUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\9527.html";
|
|
|
- File file_out = ResourceUtil.getFile(thmlUrl);
|
|
|
- FileUtil.copy(file_in, file_out);
|
|
|
- wbsPrivate.setHtmlUrl(thmlUrl);
|
|
|
- }
|
|
|
- List<TextdictInfo> list = textDictInfoService.list(new LambdaQueryWrapper<TextdictInfo>()
|
|
|
- .eq(TextdictInfo::getTabId, wbsTreePrivate.getPKeyId()));
|
|
|
- if (list.size() >= 0 ){
|
|
|
- list.stream().forEach(l->{
|
|
|
- l.setId(SnowFlakeUtil.getId());
|
|
|
- l.setTabId(wbsPrivate.getPKeyId().toString());
|
|
|
- });
|
|
|
- textDictInfoService.saveBatch(list);
|
|
|
+ File file_out = ResourceUtil.getFile(thmlUrl);
|
|
|
+ FileUtil.copy(file_in, file_out);
|
|
|
+ wbsPrivate.setHtmlUrl(thmlUrl);
|
|
|
+ }
|
|
|
+ List<TextdictInfo> list = textDictInfoService.list(new LambdaQueryWrapper<TextdictInfo>()
|
|
|
+ .eq(TextdictInfo::getTabId, wbsTreePrivate.getPKeyId()));
|
|
|
+ if (list.size() >= 0) {
|
|
|
+ list.stream().forEach(l -> {
|
|
|
+ l.setId(SnowFlakeUtil.getId());
|
|
|
+ l.setTabId(wbsPrivate.getPKeyId().toString());
|
|
|
+ });
|
|
|
+ textDictInfoService.saveBatch(list);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- wbsPrivate.setTableOwner(tableInfo.getTableOwner());
|
|
|
- wbsPrivate.setInitTableId(tableInfo.getId() + "");
|
|
|
- wbsPrivate.setTableType(tableInfo.getTabType());
|
|
|
- wbsPrivate.setInitTableName(tableInfo.getTabEnName());
|
|
|
- wbsPrivate.setNodeName(tableInfo.getTabChName());
|
|
|
- wbsPrivate.setFullName(tableInfo.getTabChName());
|
|
|
- wbsPrivate.setFillRate(tableInfo.getFillRate());
|
|
|
- wbsPrivate.setProjectId(projectId);
|
|
|
- wbsPrivate.setType(10);//带过来的元素信息
|
|
|
- wbsPrivate.setParentId(-10L);
|
|
|
- wbsPrivate.setStatus(1);
|
|
|
- wbsTreePrivateMapper.insert(wbsPrivate);
|
|
|
+ wbsPrivate.setTableOwner(tableInfo.getTableOwner());
|
|
|
+ wbsPrivate.setInitTableId(tableInfo.getId() + "");
|
|
|
+ wbsPrivate.setTableType(tableInfo.getTabType());
|
|
|
+ wbsPrivate.setInitTableName(tableInfo.getTabEnName());
|
|
|
+ wbsPrivate.setNodeName(tableInfo.getTabChName());
|
|
|
+ wbsPrivate.setFullName(tableInfo.getTabChName());
|
|
|
+ wbsPrivate.setFillRate(tableInfo.getFillRate());
|
|
|
+ wbsPrivate.setProjectId(projectId);
|
|
|
+ wbsPrivate.setType(10);//带过来的元素信息
|
|
|
+ wbsPrivate.setParentId(-10L);
|
|
|
+ wbsPrivate.setStatus(1);
|
|
|
+ wbsTreePrivateMapper.insert(wbsPrivate);
|
|
|
/* }else{
|
|
|
return R.success("没有查到主库信息");
|
|
|
}*/
|
|
|
+ }
|
|
|
+ return R.success("添加成功");
|
|
|
}
|
|
|
- return R.success("添加成功");
|
|
|
+ return R.fail("添加失败");
|
|
|
}
|
|
|
|
|
|
@Override
|