|
@@ -56,6 +56,7 @@ import org.joda.time.DateTime;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+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;
|
|
@@ -150,6 +151,9 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
@Resource
|
|
|
private OpenFeignClientConfigProperties openFeignClientConfigProperties;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserService sysUserService;
|
|
|
+
|
|
|
@Value("${openfeign-client.app-id:1745637981387108354}")
|
|
|
public Long applicationId;
|
|
|
|
|
@@ -1175,7 +1179,39 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
|
|
|
@Override
|
|
|
public IPage<TeacherMusicSheetVo> selectTeacherPage(IPage<TeacherMusicSheetVo> page, TeacherMusicSheetSearch query) {
|
|
|
- return page.setRecords(baseMapper.selectTeacherPage(page, query));
|
|
|
+ IPage<TeacherMusicSheetVo> teacherMusicSheetVoIPage = page.setRecords(baseMapper.selectTeacherPage(page, query));
|
|
|
+ List<TeacherMusicSheetVo> records = teacherMusicSheetVoIPage.getRecords();
|
|
|
+ if (CollectionUtils.isEmpty(records)) {
|
|
|
+ return teacherMusicSheetVoIPage;
|
|
|
+ }
|
|
|
+ // 曲目ID
|
|
|
+ List<String> musicIds = records.stream().map(TeacherMusicSheetVo::getMusicSheetId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<MusicSheetAuthRecord> list = musicSheetAuthRecordService.lambdaQuery()
|
|
|
+ .in(MusicSheetAuthRecord::getMusicSheetId, musicIds)
|
|
|
+ .eq(MusicSheetAuthRecord::getAuditState, AuthStatusEnum.PASS)
|
|
|
+ .orderByAsc(MusicSheetAuthRecord::getId)
|
|
|
+ .list();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ Map<Long, MusicSheetAuthRecord> musicSheetAuthRecordMap = list.stream().collect(Collectors.toMap(MusicSheetAuthRecord::getMusicSheetId, Function.identity(), (o, n) -> n));
|
|
|
+ // 审核人 ID集合
|
|
|
+ List<Long> auditUserIds = list.stream().map(MusicSheetAuthRecord::getVerifyUserId).collect(Collectors.toList());
|
|
|
+ Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds(auditUserIds);
|
|
|
+ for (TeacherMusicSheetVo record : records) {
|
|
|
+ MusicSheetAuthRecord musicSheetAuthRecord = musicSheetAuthRecordMap.get(Long.parseLong(record.getMusicSheetId()));
|
|
|
+ if (musicSheetAuthRecord != null && musicSheetAuthRecord.getVerifyUserId() != null) {
|
|
|
+ com.yonge.cooleshow.biz.dal.entity.SysUser sysUser = mapByIds.get(musicSheetAuthRecord.getVerifyUserId());
|
|
|
+ if (sysUser != null) {
|
|
|
+ record.setAuditName(sysUser.getUsername());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return teacherMusicSheetVoIPage;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|