|
@@ -100,7 +100,8 @@ public class EqToSpCalculateServiceImpl implements CalculateService {
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(insertRels)){
|
|
|
deleteRelDataByCondition(calculatingDTO,insertRels.stream().map(ObjectRelation::getObjFrom).collect(Collectors.toSet()),
|
|
|
- insertRels.stream().map(ObjectRelation::getObjTo).collect(Collectors.toSet()));
|
|
|
+ insertRels.stream().map(ObjectRelation::getObjTo).collect(Collectors.toSet()),
|
|
|
+ insertRels.stream().map(ObjectRelation::getRelValue).collect(Collectors.toSet()));
|
|
|
objectRelationService.saveBatch(insertRels,insertRels.size());
|
|
|
}
|
|
|
}
|
|
@@ -137,14 +138,13 @@ public class EqToSpCalculateServiceImpl implements CalculateService {
|
|
|
* @date :2021/9/11 16:13
|
|
|
* Update By lijie 2021/9/11 16:13
|
|
|
*/
|
|
|
- private void deleteRelDataByCondition(CalculatingDTO calculatingDTO, Set<String> fromIds, Set<String> toIds) {
|
|
|
+ private void deleteRelDataByCondition(CalculatingDTO calculatingDTO, Set<String> fromIds, Set<String> toIds,
|
|
|
+ Set<String> relVals) {
|
|
|
QueryWrapper<ObjectRelation> queryWrapper = ObjectDigitalCriteriaHelper
|
|
|
.createCommonQueryWrapper(CollUtil.newHashSet(),calculatingDTO);
|
|
|
queryWrapper.eq(StrUtil.toUnderlineCase(ObjectRelation.GRAPH_CODE_HUM),calculatingDTO.getGraphCode());
|
|
|
queryWrapper.eq(StrUtil.toUnderlineCase(ObjectRelation.REL_CODE_HUM),calculatingDTO.getRelCode());
|
|
|
- if (StrUtil.isNotBlank(calculatingDTO.getRelValue())){
|
|
|
- queryWrapper.eq(StrUtil.toUnderlineCase(ObjectRelation.REL_VALUE_HUM),calculatingDTO.getRelValue());
|
|
|
- }
|
|
|
+ queryWrapper.in(CollUtil.isNotEmpty(relVals),StrUtil.toUnderlineCase(ObjectRelation.REL_VALUE_HUM),relVals);
|
|
|
queryWrapper.and(CollUtil.isNotEmpty(fromIds) || CollUtil.isNotEmpty(toIds),wrapper->{
|
|
|
wrapper.or(CollUtil.isNotEmpty(fromIds),subWapper->subWapper.in(ObjectRelation.OBJ_FROM,fromIds));
|
|
|
wrapper.or(CollUtil.isNotEmpty(toIds),subWapper->subWapper.in(ObjectRelation.OBJ_TO,toIds));
|