|
@@ -140,7 +140,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
.ne(WbsTree::getId, wbsTree.getId())
|
|
|
.eq(WbsTree::getInitTableName, wbsTree.getInitTableName())
|
|
|
.eq(WbsTree::getIsDeleted, 0));
|
|
|
- if(CollectionUtil.isEmpty(wbsTrees)){
|
|
|
+ if (CollectionUtil.isEmpty(wbsTrees)) {
|
|
|
throw new ServiceException("当前项目没有相同实体表的其他表单");
|
|
|
}
|
|
|
|
|
@@ -166,11 +166,11 @@ public class WbsSynchronousServiceImpl {
|
|
|
Objects.equals(f.getExcelId(), wbsTreePrivate.getExcelId())
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
|
- if(CollectionUtil.isNotEmpty(collect1)){
|
|
|
+ if (CollectionUtil.isNotEmpty(collect1)) {
|
|
|
collect.addAll(collect1);
|
|
|
}
|
|
|
//清表不同的数据
|
|
|
- List<WbsTreePrivate> noExcelIdEq = wbsTreePrivates.stream().filter(f -> f.getExcelId()!=null && !Objects.equals(f.getExcelId(), wbsTreePrivate.getExcelId())).collect(Collectors.toList());
|
|
|
+ List<WbsTreePrivate> noExcelIdEq = wbsTreePrivates.stream().filter(f -> f.getExcelId() != null && !Objects.equals(f.getExcelId(), wbsTreePrivate.getExcelId())).collect(Collectors.toList());
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
if (CollectionUtil.isNotEmpty(noExcelIdEq)) {
|
|
|
for (WbsTreePrivate treePrivate : noExcelIdEq) {
|
|
@@ -183,7 +183,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
}
|
|
|
|
|
|
//修改数据
|
|
|
- wbsSynchronousEViSaService.updateSyncPrivateForm(wbsTreePrivate, collect, wbsTreeSynchronousRecord.getId(),sb.toString());
|
|
|
+ wbsSynchronousEViSaService.updateSyncPrivateForm(wbsTreePrivate, collect, wbsTreeSynchronousRecord.getId(), sb.toString());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -598,6 +598,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
List<ContractInfo> contractInfos = contractInfoMapper.selectContractIdByProjectId(String.valueOf(wbsTreeSynchronousRecord.getProjectId()));
|
|
|
|
|
|
List<WbsTreeContract> editData = new ArrayList<>();
|
|
|
+ List<WbsTreeContract> oldHtml = new ArrayList<>();
|
|
|
for (String primaryKeyId : nodeIds) {
|
|
|
|
|
|
//获取当前节点对应节点信息
|
|
@@ -687,6 +688,10 @@ public class WbsSynchronousServiceImpl {
|
|
|
if (templateNode.getType() == 2) {
|
|
|
//同步范围 当前节点是否允许修改
|
|
|
Boolean isSync = false;
|
|
|
+
|
|
|
+ //是否记录历史html
|
|
|
+ Boolean isOldHtml = false;
|
|
|
+
|
|
|
if (CollectionUtil.isNotEmpty(contractRanges)) {
|
|
|
switch (Integer.valueOf(wbsTreePrivate.getWbsType())) {
|
|
|
//质检
|
|
@@ -706,9 +711,11 @@ public class WbsSynchronousServiceImpl {
|
|
|
} else if (submit == 1 && contractRanges.contains(WbsSyncTypeEnum.PENDING_APPROVAL.code)) {
|
|
|
//待审批 104
|
|
|
isSync = true;
|
|
|
+ isOldHtml = true;
|
|
|
} else if (submit == 2 && contractRanges.contains(WbsSyncTypeEnum.APPROVED.code)) {
|
|
|
//已审批 105
|
|
|
isSync = true;
|
|
|
+ isOldHtml = true;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -761,6 +768,11 @@ public class WbsSynchronousServiceImpl {
|
|
|
if (isSync) {
|
|
|
editContractNodes.add(editContractNode);
|
|
|
}
|
|
|
+ //记录历史html
|
|
|
+ if (isOldHtml) {
|
|
|
+ oldHtml.add(editContractNode);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//找到了某个选中节点下与项目节点想同的节点了 提前结束循环,节省资源
|
|
@@ -818,17 +830,21 @@ public class WbsSynchronousServiceImpl {
|
|
|
Set<Long> pIds = collect1.keySet();
|
|
|
Integer nodeNumEnd = 0;
|
|
|
|
|
|
+ Map<Long, List<WbsTreeContract>> collect2 = oldHtml.stream().collect(Collectors.groupingBy(WbsTreeContract::getPId));
|
|
|
+
|
|
|
for (Long pId : pIds) {
|
|
|
nodeNumEnd++;
|
|
|
List<WbsTreeContract> list = collect1.get(pId);
|
|
|
+ List<WbsTreeContract> oldHtmlPId = collect2.get(pId);
|
|
|
|
|
|
- wbsSynchronousEViSaService.updateContract(wbsTreeSynchronousRecord.getType(), pId, wbsTreeSynchronousRecord.getCreateUserId(), list);
|
|
|
+ wbsSynchronousEViSaService.updateContract(wbsTreeSynchronousRecord.getType(), pId, wbsTreeSynchronousRecord.getCreateUserId(), list, oldHtmlPId);
|
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
|
.set(WbsTreeSynchronousRecord::getNodeNumEnd, nodeNumEnd)
|
|
|
.set(WbsTreeSynchronousRecord::getUpdateTime, DateTime.now())
|
|
|
.eq(WbsTreeSynchronousRecord::getId, wbsTreeSynchronousRecord.getId()));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
|
.set(WbsTreeSynchronousRecord::getStatus, 2)
|
|
|
.set(WbsTreeSynchronousRecord::getErrorMsg, null)
|
|
@@ -982,7 +998,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
List<Long> collect1 = addData.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
//这里可以保存到数据库指定错误日志表
|
|
|
throw new ServiceException("添加失败:" + StringUtil.join(collect1, ","));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//排序调整-连续排序
|
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
|
//获取节点下的当前表单
|
|
@@ -1128,7 +1144,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
//这里可以保存到数据库指定错误日志表
|
|
|
//这里可以保存到数据库指定错误日志表
|
|
|
throw new ServiceException("添加失败:" + StringUtil.join(collect1, ","));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//排序调整
|
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
|
//获取节点下的当前表单
|