|
|
|
@ -78,8 +78,8 @@ public class AppGroupServiceImpl implements AppGroupService {
|
|
|
|
|
@Override |
|
|
|
|
public Page<AppGroupListResult> getAppGroupList(PageModel pageModel, AppGroupQuery query) { |
|
|
|
|
//查询映射
|
|
|
|
|
org.springframework.data.domain.Page<AppGroupPO> list = appGroupRepository |
|
|
|
|
.getAppGroupList(query, PageRequest.of(pageModel.getCurrent(), pageModel.getPageSize())); |
|
|
|
|
org.springframework.data.domain.Page<AppGroupPO> list = appGroupRepository.getAppGroupList( |
|
|
|
|
query, PageRequest.of(pageModel.getCurrent(), pageModel.getPageSize())); |
|
|
|
|
return appGroupConverter.entityConvertToAppGroupListResult(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -92,9 +92,16 @@ public class AppGroupServiceImpl implements AppGroupService {
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Boolean createAppGroup(AppGroupCreateParam param) { |
|
|
|
|
// TODO 创建后没有数据权限
|
|
|
|
|
AppGroupEntity entity = appGroupConverter.appGroupCreateParamConvertToEntity(param); |
|
|
|
|
appGroupRepository.save(entity); |
|
|
|
|
List<AppGroupAssociationEntity> list = new ArrayList<>(); |
|
|
|
|
for (String groupId : param.getGroupId()) { |
|
|
|
|
AppGroupAssociationEntity appGroupAssociationEntity = new AppGroupAssociationEntity(); |
|
|
|
|
appGroupAssociationEntity.setGroupId(Long.valueOf(groupId)); |
|
|
|
|
appGroupAssociationEntity.setAppId(entity.getId()); |
|
|
|
|
list.add(appGroupAssociationEntity); |
|
|
|
|
} |
|
|
|
|
appGroupAssociationRepository.saveAll(list); |
|
|
|
|
AuditContext.setTarget( |
|
|
|
|
Target.builder().id(String.valueOf(entity.getId())).type(TargetType.APP_GROUP).build()); |
|
|
|
|
return true; |
|
|
|
|