Merge remote-tracking branch 'origin/feature/REQ-2046' into feature/REQ-2046

This commit is contained in:
zhansihu 2024-02-26 21:44:32 +08:00
commit 963c99ca4e
6 changed files with 24 additions and 0 deletions

View File

@ -31,6 +31,10 @@ public class ListPermissionFromRoleGroupResp {
*/
private Long teamOuId;
private Long resourceId;
private Integer resourceType;
/**
* 分类名称
*/

View File

@ -25,5 +25,13 @@ public class SaasProductModuleFeatureRelationDao extends ServiceImpl<SaasProduct
this.remove(new LambdaQueryWrapper<SaasProductModuleFeatureRelation>()
.in(SaasProductModuleFeatureRelation::getFeatureId, permissionPointIds));
}
public void removeByProductId(List<Long> productId) {
if (CollectionUtil.isEmpty(productId)) {
return;
}
this.remove(new LambdaQueryWrapper<SaasProductModuleFeatureRelation>()
.in(SaasProductModuleFeatureRelation::getProductModuleId, productId));
}
}

View File

@ -35,4 +35,6 @@ public interface ProductFeatureRelationService {
/** 数据清洗 **/
boolean refreshFeature(Integer workspaceType, Long productId);
void removeByProductId(Long productId);
}

View File

@ -218,4 +218,8 @@ public class ProductFeatureRelationServiceImpl implements ProductFeatureRelation
}
@Override
public void removeByProductId(Long productId) {
saasProductModuleFeatureRelationDao.removeByProductId(Collections.singletonList(productId));
}
}

View File

@ -12,6 +12,7 @@ import cn.axzo.tyr.client.model.product.ProductUpdateReq;
import cn.axzo.tyr.client.model.product.ProductVO;
import cn.axzo.tyr.server.repository.entity.ProductModule;
import cn.axzo.tyr.server.repository.dao.ProductModuleDao;
import cn.axzo.tyr.server.service.ProductFeatureRelationService;
import cn.axzo.tyr.server.service.ProductService;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -38,6 +39,7 @@ import java.util.stream.Collectors;
@Service
public class ProductServiceImpl implements ProductService {
private final ProductModuleDao productModuleDao;
private final ProductFeatureRelationService productFeatureRelationService;
@Override
public ApiResult<List<ProductVO>> list(ProductSearchListReq req) {
@ -130,6 +132,9 @@ public class ProductServiceImpl implements ProductService {
.eq(ProductModule::getId, id)
.set(ProductModule::getIsDelete, id)
.update();
// 删除产品与权限点对应关系
productFeatureRelationService.removeByProductId(id);
return ApiResult.ok(BeanMapper.copyBean(productModule, ProductVO.class));
}
}

View File

@ -111,6 +111,7 @@
t5.ou_id ouId,
t5.workspace_Id workspaceId,
t5.resource_id teamOuId,
t5.resource_id resourceId,
t5.resource_type resourceType,
t1.category_code categoryCode,
t1.name roleGroupName,