|
@@ -195,22 +195,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
|
|
|
// 判断是否是机构学生 机构学生 检测机构专辑购买记录
|
|
|
TenantInfo tenantInfo = tenantInfoService.detail(detail.getTenantId());
|
|
|
- Long tenantGroupId = detail.getTenantGroupId();
|
|
|
- if (tenantInfo != null && tenantGroupId != null && tenantGroupId != -1L) {
|
|
|
+ if (tenantInfo != null) {
|
|
|
studentHomeVo.setTenantName(tenantInfo.getName());
|
|
|
QueryWrapper<TenantGroupAlbum> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.lambda().eq(TenantGroupAlbum::getTenantGroupId, tenantGroupId);
|
|
|
+ queryWrapper.lambda().eq(TenantGroupAlbum::getTenantGroupId, Optional.ofNullable(detail.getTenantGroupId()).orElse(-1L));
|
|
|
List<TenantGroupAlbum> tenantGroupAlbums = tenantGroupAlbumMapper.selectList(queryWrapper);
|
|
|
- List<Long> albIds = new ArrayList<>();
|
|
|
+ List<Long> albIds = tenantGroupAlbums.stream().map(TenantGroupAlbum::getTenantAlbumId).distinct().collect(Collectors.toList());
|
|
|
if (!tenantGroupAlbums.isEmpty()) {
|
|
|
- albIds.addAll(tenantGroupAlbums.stream().map(TenantGroupAlbum::getTenantAlbumId).distinct().collect(Collectors.toList()));
|
|
|
- QueryWrapper<TenantAlbum> query = new QueryWrapper<>();
|
|
|
- query.lambda().in(TenantAlbum::getId, albIds)
|
|
|
- .eq(TenantAlbum::getStatus,true);
|
|
|
- Integer count = tenantAlbumMapper.selectCount(query);
|
|
|
- if (count > 0) {
|
|
|
- studentHomeVo.setTenantAlbumStatus(1);
|
|
|
- }
|
|
|
+ studentHomeVo.setTenantAlbumStatus(1);
|
|
|
}
|
|
|
List<UserTenantAlbumRecord> record = userTenantAlbumRecordService.lambdaQuery()
|
|
|
.eq(UserTenantAlbumRecord::getUserId, detail.getUserId())
|