|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dayaedu.cbs.openfeign.service.CbsSubjectService;
|
|
|
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectApiWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
@@ -37,6 +39,7 @@ import com.yonge.toolset.base.exception.BizException;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -65,6 +68,11 @@ public class ActivityEvaluationServiceImpl extends ServiceImpl<ActivityEvaluatio
|
|
|
@Autowired
|
|
|
private ActivityPlanRewardService activityPlanRewardService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CbsSubjectService cbsSubjectService;
|
|
|
+ @Value("${openfeign-client.app-id:1745637981387108354}")
|
|
|
+ public Long applicationId;
|
|
|
+
|
|
|
@Override
|
|
|
public ActivityEvaluationVo detail(Long id) {
|
|
|
return baseMapper.detail(id);
|
|
@@ -263,7 +271,38 @@ public class ActivityEvaluationServiceImpl extends ServiceImpl<ActivityEvaluatio
|
|
|
|
|
|
@Override
|
|
|
public IPage<MusicSheetVo> musicPage(IPage<MusicSheetVo> page, MusicSheetSearch query) {
|
|
|
- return page.setRecords(baseMapper.musicPage(page, query));
|
|
|
+ List<MusicSheetVo> musicSheetVos = baseMapper.musicPage(page, query);
|
|
|
+ if(CollectionUtils.isNotEmpty(musicSheetVos)){
|
|
|
+ //获取内容平台声部信息
|
|
|
+ String subjectIds = musicSheetVos.stream().map(e -> e.getMusicSubject()).filter(Objects::nonNull).collect(Collectors.joining(","));
|
|
|
+ if(StringUtils.isNotEmpty(subjectIds)){
|
|
|
+ List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIds);
|
|
|
+ if(CollectionUtils.isNotEmpty(subjectList)){
|
|
|
+ List<Long> cbsSubjectIds = subjectList.stream().map(Subject::getCbsSubjectId).collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(cbsSubjectIds)) {
|
|
|
+ CbsSubjectApiWrapper.SubjectQuery cbsQuery = new CbsSubjectApiWrapper.SubjectQuery();
|
|
|
+ cbsQuery.setCbsSubjectIds(cbsSubjectIds);
|
|
|
+ cbsQuery.setApplicationId(applicationId);
|
|
|
+ List<CbsSubjectApiWrapper.Subject> list = cbsSubjectService.list(cbsQuery);
|
|
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ Map<Long, CbsSubjectApiWrapper.Subject> subjectMap = list.stream().collect(Collectors.toMap(CbsSubjectApiWrapper.Subject::getSubjectId, x -> x));
|
|
|
+ musicSheetVos.forEach(e -> {
|
|
|
+ if (StringUtils.isNotEmpty(e.getMusicSubject())) {
|
|
|
+ List<String> subjectNameList = Arrays.stream(e.getMusicSubject().split(","))
|
|
|
+ .map(Long::parseLong)
|
|
|
+ .map(subjectMap::get)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(CbsSubjectApiWrapper.Subject::getSubjectName)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ e.setSubjectNames(String.join(",", subjectNameList));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return page.setRecords(musicSheetVos);
|
|
|
}
|
|
|
|
|
|
/**
|