|
@@ -599,6 +599,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
|
|
|
List<WbsTreeContract> editData = new ArrayList<>();
|
|
|
List<WbsTreeContract> oldHtml = new ArrayList<>();
|
|
|
+ StringBuilder errorMsg = new StringBuilder("");
|
|
|
for (String primaryKeyId : nodeIds) {
|
|
|
|
|
|
//获取当前节点对应节点信息
|
|
@@ -617,6 +618,9 @@ public class WbsSynchronousServiceImpl {
|
|
|
.eq(WbsTreePrivate::getType, 2)
|
|
|
.eq(WbsTreePrivate::getIsDeleted, 0)
|
|
|
.apply("FIND_IN_SET({0},ancestors_p_id)", wbsTreePrivate.getPKeyId());
|
|
|
+ if(CollectionUtil.isNotEmpty(formList)){
|
|
|
+ wrapperPrivate.in(WbsTreePrivate::getPKeyId, formList);
|
|
|
+ }
|
|
|
//当前项目的子节点数据
|
|
|
List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(wrapperPrivate);
|
|
|
wbsTreePrivates.add(wbsTreePrivate);
|
|
@@ -680,7 +684,6 @@ public class WbsSynchronousServiceImpl {
|
|
|
//需要新增的表单
|
|
|
List<WbsTreePrivate> addPrivateNodes = wbsTreePrivates.stream().filter(f -> !typePrivateIds.contains(f.getPKeyId())).collect(Collectors.toList());
|
|
|
|
|
|
-
|
|
|
//筛选出需要更新的节点 同时做数据隔离
|
|
|
List<WbsTreeContract> editContractNodes = new ArrayList<>();
|
|
|
for (WbsTreePrivate templateNode : wbsTreePrivates) {
|
|
@@ -703,7 +706,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
case 1:
|
|
|
//判断是否已保存
|
|
|
if(StringUtils.isEmpty(editContractNode.getInitTableName())){
|
|
|
- throw new ServiceException(wbsTreeContract.getNodeName() + "( " + wbsTreeContract.getPKeyId() + ")--实体表不存在");
|
|
|
+ throw new ServiceException(editContractNode.getNodeName() + "( " + editContractNode.getPKeyId() + ")--实体表不存在");
|
|
|
}
|
|
|
String isSave = "select count(0) from " + editContractNode.getInitTableName() + " where p_key_id = " + editContractNode.getPKeyId();
|
|
|
Integer i = jdbcTemplate.queryForObject(isSave, Integer.class);
|
|
@@ -716,23 +719,26 @@ public class WbsSynchronousServiceImpl {
|
|
|
isSync = true;
|
|
|
} else {
|
|
|
if (i == 0) {
|
|
|
- throw new ServiceException(editContractNode.getNodeName() + "( " + wbsTreeContract.getPKeyId() + ")--表单未查到填报信息");
|
|
|
+ isSync = false;
|
|
|
+ errorMsg.append(editContractNode.getNodeName() + "( " + editContractNode.getPKeyId() + ")").append("未填报;");
|
|
|
}
|
|
|
if (contractRanges.contains(WbsSyncTypeEnum.ALREADY_FILLED_IN_NOT_REPORTED.code) && (submit == null || submit == 0)) {
|
|
|
//已填报-未上报 102
|
|
|
isSync = true;
|
|
|
} else {
|
|
|
if (submit == null) {
|
|
|
- throw new ServiceException(wbsTreeContract.getNodeName() + "( " + wbsTreeContract.getPKeyId() + ")--下表单未查到上报信息");
|
|
|
- }
|
|
|
- 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;
|
|
|
+ isSync = false;
|
|
|
+ errorMsg.append(editContractNode.getNodeName() + "( " + editContractNode.getPKeyId() + ")").append("未上报;");
|
|
|
+ }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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -850,7 +856,7 @@ public class WbsSynchronousServiceImpl {
|
|
|
|
|
|
synchronousRecordMapper.update(null, Wrappers.<WbsTreeSynchronousRecord>lambdaUpdate()
|
|
|
.set(WbsTreeSynchronousRecord::getStatus, 2)
|
|
|
- .set(WbsTreeSynchronousRecord::getErrorMsg, null)
|
|
|
+ .set(WbsTreeSynchronousRecord::getErrorMsg, errorMsg.toString())
|
|
|
.set(WbsTreeSynchronousRecord::getUpdateTime, DateTime.now())
|
|
|
.eq(WbsTreeSynchronousRecord::getId, wbsTreeSynchronousRecord.getId()));
|
|
|
}
|