|
@@ -677,7 +677,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//重塑关键信息
|
|
|
Map<Long,Long> oldToNewIdMap = new HashMap<>();
|
|
|
- allList.forEach(node -> oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId()));
|
|
|
+ //节点信息
|
|
|
+ Map<String, WbsTreeContract> nodeMap = new HashMap<>();
|
|
|
+ allList.forEach(node -> {
|
|
|
+ oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
|
|
|
+ nodeMap.put(node.getId().toString(), node);
|
|
|
+ });
|
|
|
//todo 单份复制
|
|
|
allList.forEach(node -> {
|
|
|
WbsTreeContract newData = new WbsTreeContract();
|
|
@@ -723,7 +728,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
if(new Integer("6").equals(node.getDeptCategory())){
|
|
|
//生成施工日志
|
|
|
- this.createLedger(newData, saveLedger);
|
|
|
+ this.createLedger(newData, saveLedger, nodeMap, null);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -739,7 +744,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//重塑关键信息
|
|
|
Map<Long,Long> oldToNewIdMap = new HashMap<>();
|
|
|
- allList.forEach(node -> oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId()));
|
|
|
+ Map<String, WbsTreeContract> nodeMap = new HashMap<>();
|
|
|
+ allList.forEach(node -> {
|
|
|
+ oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
|
|
|
+ nodeMap.put(node.getId().toString(), node);
|
|
|
+ });
|
|
|
|
|
|
allList.forEach(node -> {
|
|
|
WbsTreeContract newData = new WbsTreeContract();
|
|
@@ -784,7 +793,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
if(new Integer("6").equals(node.getDeptCategory())){
|
|
|
//生成施工日志
|
|
|
- this.createLedger(newData, saveLedger);
|
|
|
+ this.createLedger(newData, saveLedger, nodeMap, null);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -820,10 +829,31 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
/**
|
|
|
* 生成施工日志记录
|
|
|
*/
|
|
|
- private void createLedger(WbsTreeContract newData, List<ConstructionLedger> saveLedger){
|
|
|
+ private void createLedger(WbsTreeContract newData, List<ConstructionLedger> saveLedger, Map<String, WbsTreeContract> contractNodeMap, Map<String, WbsTreePrivate> projectNodeMap){
|
|
|
//工序,需要新增施工台账
|
|
|
ConstructionLedger ledger = new ConstructionLedger();
|
|
|
- ledger.setSite(newData.getDeptName());
|
|
|
+ //获取这个节点的原始信息
|
|
|
+ if(contractNodeMap != null){
|
|
|
+ if(contractNodeMap.containsKey(newData.getOldId())){
|
|
|
+ WbsTreeContract contractNode = contractNodeMap.get(newData.getOldId());
|
|
|
+ if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
|
+ WbsTreeContract parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(contractNode.getContractId()), contractNode.getParentId());
|
|
|
+ if(parentNode != null){
|
|
|
+ ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if(projectNodeMap != null) {
|
|
|
+ if(projectNodeMap.containsKey(newData.getOldId())){
|
|
|
+ WbsTreePrivate contractNode = projectNodeMap.get(newData.getOldId());
|
|
|
+ if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
|
+ WbsTreePrivate parentNode = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(contractNode.getProjectId(), contractNode.getParentId());
|
|
|
+ ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ledger.setSite(StringUtils.isNotEmpty(newData.getFullName()) ? newData.getFullName() : newData.getDeptName());
|
|
|
ledger.setIsBeton(newData.getIsConcrete());
|
|
|
ledger.setWbsId(newData.getPKeyId());
|
|
|
ledger.setContractId(Long.parseLong(newData.getContractId()));
|
|
@@ -1123,7 +1153,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//保存进回收站
|
|
|
this.recycleBinClient.saveDelBusinessData(ids, removeNode.getDeptName(), 2, parentNodeName.toString(), removeNode.getProjectId(), removeNode.getContractId());
|
|
|
|
|
|
- return R.data(this.wbsTreeContractClient.removeContractTreeNode(ids));
|
|
|
+ return R.data(this.wbsTreeContractClient.removeContractTreeNode(Func.toStrList(ids)));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1207,7 +1237,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(selectedNodeList.size() > 0){
|
|
|
//重塑关键信息
|
|
|
Map<Long, Long> OldIdToNewIdMap = new HashMap<>();
|
|
|
- selectedNodeList.forEach(half -> OldIdToNewIdMap.put(half.getId(), SnowFlakeUtil.getId()));
|
|
|
+ Map<String, WbsTreePrivate> nodeMap = new HashMap<>();
|
|
|
+ selectedNodeList.forEach(half -> {
|
|
|
+ OldIdToNewIdMap.put(half.getId(), SnowFlakeUtil.getId());
|
|
|
+ nodeMap.put(half.getId().toString(), half);
|
|
|
+ });
|
|
|
|
|
|
//处理数据
|
|
|
selectedNodeList.forEach(half -> {
|
|
@@ -1275,7 +1309,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
if(new Integer("6").equals(newData.getDeptCategory())){
|
|
|
//生成施工日志
|
|
|
- this.createLedger(newData, saveLedger);
|
|
|
+ this.createLedger(newData, saveLedger, null, nodeMap);
|
|
|
}
|
|
|
|
|
|
});
|