feat(REQ-2545): 保存产品接口修改
This commit is contained in:
parent
89d0d040fc
commit
1087c505c8
@ -32,6 +32,8 @@ public interface ProductFeatureRelationService extends IService<SaasProductModul
|
||||
*/
|
||||
void updateFeatureResourceRelation(List<ProductFeatureRelationUpdateReq> req, int relationType);
|
||||
|
||||
void removeFeatureResourceRelationByProductIdAndType(Long productId, int relationType);
|
||||
|
||||
ApiResult<List<ProductFeatureRelationVO>> featureListByProduct(List<Long> productIds);
|
||||
|
||||
/**
|
||||
|
||||
@ -139,6 +139,12 @@ public class ProductFeatureRelationServiceImpl extends ServiceImpl<SaasProductMo
|
||||
saasProductModuleFeatureRelationDao.saveBatch(saveList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFeatureResourceRelationByProductIdAndType(Long productId, int relationType) {
|
||||
saasProductModuleFeatureRelationDao.remove(new LambdaQueryWrapper<SaasProductModuleFeatureRelation>()
|
||||
.eq(SaasProductModuleFeatureRelation::getProductModuleId, productId).eq(SaasProductModuleFeatureRelation::getType, relationType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResult<List<ProductFeatureRelationVO>> featureListByProduct(List<Long> productIds) {
|
||||
if (CollectionUtil.isEmpty(productIds)) {
|
||||
|
||||
@ -367,6 +367,10 @@ public class ProductServiceImpl implements ProductService {
|
||||
* 保存非政务端产品功能权限
|
||||
*/
|
||||
private void saveNonGaFeatureResource(Long productId, List<ProductSaveReq.ProductFeatureRelation> relations) {
|
||||
if (CollectionUtils.isEmpty(relations)) {
|
||||
productFeatureRelationService.removeFeatureResourceRelationByProductIdAndType(productId, ProductModuleFeatureRelationTypeEnum.FEATURE_RESOURCE.getCode());
|
||||
return;
|
||||
}
|
||||
List<Long> dictCodeIds = Lists.newArrayList();
|
||||
for (ProductSaveReq.ProductFeatureRelation relation : relations) {
|
||||
AssertUtil.notNull(relation.getDictCodeId(), "功能范围选择的字典ID不能未空。");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user