|
@@ -513,16 +513,9 @@ public class WbsSynchronousServiceImpl {
|
|
for (Long pId : pIds) {
|
|
for (Long pId : pIds) {
|
|
nodeNumEnd++;
|
|
nodeNumEnd++;
|
|
List<WbsTreePrivate> list = collect1.get(pId);
|
|
List<WbsTreePrivate> list = collect1.get(pId);
|
|
- //排序调整
|
|
|
|
- if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
|
|
- list.sort(Comparator.comparingInt(WbsTreePrivate::getSort));
|
|
|
|
- for (WbsTreePrivate wbsTreePrivate : list) {
|
|
|
|
- wbsTreePrivateMapper.updateSortByPId(pId, wbsTreePrivate.getSort());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
//更新最新节点
|
|
//更新最新节点
|
|
- wbsSynchronousEViSaService.updatePrivate(wbsTreeSynchronousRecord.getCreateUserId(), list);
|
|
|
|
|
|
+ wbsSynchronousEViSaService.updatePrivate(wbsTreeSynchronousRecord.getType(), pId, wbsTreeSynchronousRecord.getCreateUserId(), list);
|
|
|
|
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
.set(WbsTreeSynchronousRecord::getNodeNumEnd, nodeNumEnd)
|
|
.set(WbsTreeSynchronousRecord::getNodeNumEnd, nodeNumEnd)
|
|
@@ -798,15 +791,8 @@ public class WbsSynchronousServiceImpl {
|
|
for (Long pId : pIds) {
|
|
for (Long pId : pIds) {
|
|
nodeNumEnd++;
|
|
nodeNumEnd++;
|
|
List<WbsTreeContract> list = collect1.get(pId);
|
|
List<WbsTreeContract> list = collect1.get(pId);
|
|
- //排序调整
|
|
|
|
- if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
|
|
- list.sort(Comparator.comparingInt(WbsTreeContract::getSort));
|
|
|
|
- for (WbsTreeContract wbsTreeContract : list) {
|
|
|
|
- wbsTreePrivateMapper.updateSortByPId(pId, wbsTreeContract.getSort());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- wbsSynchronousEViSaService.updateContract(wbsTreeSynchronousRecord.getCreateUserId(), list);
|
|
|
|
|
|
+ wbsSynchronousEViSaService.updateContract(wbsTreeSynchronousRecord.getType(), pId, wbsTreeSynchronousRecord.getCreateUserId(), list);
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
.set(WbsTreeSynchronousRecord::getNodeNumEnd, nodeNumEnd)
|
|
.set(WbsTreeSynchronousRecord::getNodeNumEnd, nodeNumEnd)
|
|
.set(WbsTreeSynchronousRecord::getUpdateTime, DateTime.now())
|
|
.set(WbsTreeSynchronousRecord::getUpdateTime, DateTime.now())
|
|
@@ -932,21 +918,32 @@ public class WbsSynchronousServiceImpl {
|
|
List<List<Long>> partition = Lists.partition(pIds, 100);
|
|
List<List<Long>> partition = Lists.partition(pIds, 100);
|
|
|
|
|
|
for (List<Long> data : partition) {
|
|
for (List<Long> data : partition) {
|
|
- for (Long datum : data) {
|
|
|
|
- List<WbsTreePrivate> list = collect.get(datum);
|
|
|
|
- //修改排序
|
|
|
|
|
|
+ for (Long pId : data) {
|
|
|
|
+ List<WbsTreePrivate> list = collect.get(pId);
|
|
|
|
+ //排序调整
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
list.sort(Comparator.comparingInt(WbsTreePrivate::getSort));
|
|
list.sort(Comparator.comparingInt(WbsTreePrivate::getSort));
|
|
|
|
+ //获取节点下的当前表单
|
|
|
|
+ List<WbsTreePrivate> resourceData = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
|
+ .select(WbsTreePrivate::getPKeyId, WbsTreePrivate::getSort)
|
|
|
|
+ .eq(WbsTreePrivate::getPId, pId)
|
|
|
|
+ .eq(WbsTreePrivate::getIsDeleted, 0)
|
|
|
|
+ .orderByAsc(WbsTreePrivate::getSort));
|
|
|
|
+ for (int i = 0; i < resourceData.size(); i++) {
|
|
|
|
+ resourceData.get(i).setSort(i + 1);
|
|
|
|
+ }
|
|
|
|
+ //修改排序为连续排序
|
|
|
|
+ wbsTreePrivateMapper.updateSortBatchByPKeyId(resourceData);
|
|
|
|
+
|
|
for (WbsTreePrivate wbsTreePrivate : list) {
|
|
for (WbsTreePrivate wbsTreePrivate : list) {
|
|
- Integer sort = wbsTreePrivate.getSort();
|
|
|
|
- if (sort != null) {
|
|
|
|
- wbsTreePrivateMapper.updateSortByPId(datum, wbsTreePrivate.getSort());
|
|
|
|
- }
|
|
|
|
|
|
+ wbsTreePrivateMapper.updateSortByPId(pId, wbsTreePrivate.getSort());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
boolean b = saveData.addAll(list);
|
|
boolean b = saveData.addAll(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
//单个批次一个事务,只会回滚当前批次数据
|
|
//单个批次一个事务,只会回滚当前批次数据
|
|
Integer i = wbsTreePrivateMapper.insertBatchSomeColumn(saveData);
|
|
Integer i = wbsTreePrivateMapper.insertBatchSomeColumn(saveData);
|
|
//如果失败 -- - - - - 继续执行 或者把当前节点的p_key_id 记录到某个地方 方便后续处理
|
|
//如果失败 -- - - - - 继续执行 或者把当前节点的p_key_id 记录到某个地方 方便后续处理
|
|
@@ -1047,16 +1044,25 @@ public class WbsSynchronousServiceImpl {
|
|
//按最小节点批量新增
|
|
//按最小节点批量新增
|
|
List<List<Long>> partition = Lists.partition(pIds, 100);
|
|
List<List<Long>> partition = Lists.partition(pIds, 100);
|
|
for (List<Long> data : partition) {
|
|
for (List<Long> data : partition) {
|
|
- for (Long datum : data) {
|
|
|
|
- List<WbsTreeContract> list = collect.get(datum);
|
|
|
|
- //修改排序
|
|
|
|
|
|
+ for (Long pId : data) {
|
|
|
|
+ List<WbsTreeContract> list = collect.get(pId);
|
|
|
|
+ //排序调整
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
if (wbsTreeSynchronousRecord.getType().contains("7")) {
|
|
list.sort(Comparator.comparingInt(WbsTreeContract::getSort));
|
|
list.sort(Comparator.comparingInt(WbsTreeContract::getSort));
|
|
- for (WbsTreeContract wbsTreeContract : list) {
|
|
|
|
- Integer sort = wbsTreeContract.getSort();
|
|
|
|
- if (sort != null) {
|
|
|
|
- wbsTreeContractMapper.updateSortByPId(datum, wbsTreeContract.getSort());
|
|
|
|
- }
|
|
|
|
|
|
+ //获取节点下的当前表单
|
|
|
|
+ List<WbsTreeContract> resourceData = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
|
+ .select(WbsTreeContract::getPKeyId, WbsTreeContract::getSort)
|
|
|
|
+ .eq(WbsTreeContract::getPId, pId)
|
|
|
|
+ .eq(WbsTreeContract::getIsDeleted, 0)
|
|
|
|
+ .orderByAsc(WbsTreeContract::getSort));
|
|
|
|
+ for (int i = 0; i < resourceData.size(); i++) {
|
|
|
|
+ resourceData.get(i).setSort(i + 1);
|
|
|
|
+ }
|
|
|
|
+ //修改排序为连续排序
|
|
|
|
+ wbsTreeContractMapper.updateSortBatchByPKeyId(resourceData);
|
|
|
|
+
|
|
|
|
+ for (WbsTreeContract wbsTreePrivate : list) {
|
|
|
|
+ wbsTreeContractMapper.updateSortByPId(pId, wbsTreePrivate.getSort());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
boolean b = saveData.addAll(list);
|
|
boolean b = saveData.addAll(list);
|