Merge remote-tracking branch 'origin/feature/REQ-1102' into feature/REQ-1102
This commit is contained in:
commit
908c1104bc
@ -8,6 +8,7 @@ import cn.axzo.tyr.client.model.product.ProductFeatureRelationVO;
|
|||||||
import cn.axzo.tyr.server.repository.entity.SaasProductModuleFeatureRelation;
|
import cn.axzo.tyr.server.repository.entity.SaasProductModuleFeatureRelation;
|
||||||
import cn.axzo.tyr.server.repository.service.SaasProductModuleFeatureRelationDao;
|
import cn.axzo.tyr.server.repository.service.SaasProductModuleFeatureRelationDao;
|
||||||
import cn.axzo.tyr.server.service.ProductFeatureRelationService;
|
import cn.axzo.tyr.server.service.ProductFeatureRelationService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -44,7 +45,10 @@ public class ProductFeatureRelationServiceImpl implements ProductFeatureRelation
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ApiResult<Boolean> updateFeatureRelation(List<ProductFeatureRelationUpdateReq> req) {
|
public ApiResult<Boolean> updateFeatureRelation(List<ProductFeatureRelationUpdateReq> req) {
|
||||||
List<Long> productIds = req.stream().map(ProductFeatureRelationUpdateReq::getProductModuleId).distinct().collect(Collectors.toList());
|
List<Long> productIds = req.stream().map(ProductFeatureRelationUpdateReq::getProductModuleId).distinct().collect(Collectors.toList());
|
||||||
saasProductModuleFeatureRelationDao.removeByIds(productIds);
|
if(!CollectionUtils.isEmpty(productIds)) {
|
||||||
|
saasProductModuleFeatureRelationDao.remove(new LambdaQueryWrapper<SaasProductModuleFeatureRelation>()
|
||||||
|
.in(SaasProductModuleFeatureRelation::getProductModuleId, productIds));
|
||||||
|
}
|
||||||
List<SaasProductModuleFeatureRelation> saveList = new ArrayList<>();
|
List<SaasProductModuleFeatureRelation> saveList = new ArrayList<>();
|
||||||
req.forEach(i -> i.getFeatureIds().forEach(featureId -> {
|
req.forEach(i -> i.getFeatureIds().forEach(featureId -> {
|
||||||
SaasProductModuleFeatureRelation relation = new SaasProductModuleFeatureRelation();
|
SaasProductModuleFeatureRelation relation = new SaasProductModuleFeatureRelation();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user