|
@@ -2284,6 +2284,28 @@ public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
|
|
|
if (StringUtils.isEmpty(contractId)) {
|
|
|
contractId = toCopyNode.getContractId();
|
|
|
}
|
|
|
+ if (vo.getIsCopyData() == 1) {
|
|
|
+ // 查询当前节点有没有数据,有数据则不能复制
|
|
|
+ if(vo.getClassifyType() != null && !vo.getClassifyType().isEmpty()) {
|
|
|
+ List<InformationQuery> queries = informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getContractId, contractId)
|
|
|
+ .in(InformationQuery::getClassify, vo.getClassifyType()).eq(InformationQuery::getWbsId, toCopyNode.getPKeyId()).in(InformationQuery::getStatus, 1, 2));
|
|
|
+ if (!queries.isEmpty()) {
|
|
|
+ Map<Integer, List<InformationQuery>> map = queries.stream().collect(Collectors.groupingBy(InformationQuery::getClassify));
|
|
|
+ if (vo.getClassifyType().contains("1")) {
|
|
|
+ List<InformationQuery> queryList = map.get(1);
|
|
|
+ if (queryList != null && !queryList.isEmpty()) {
|
|
|
+ throw new ServiceException(toCopyNode.getFullName() + "节点有施工上报数据,不允许复制");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (vo.getClassifyType().contains("2")) {
|
|
|
+ List<InformationQuery> queryList = map.get(2);
|
|
|
+ if (queryList != null && !queryList.isEmpty()) {
|
|
|
+ throw new ServiceException(toCopyNode.getFullName() + "节点有监理上报数据,不允许复制");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
WbsTreeContract needCopyNodeRoot = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|