Преглед изворни кода

Merge branch 'zx_online_cbs' of http://git.dayaedu.com/yonge/cooleshow into develop-new

zouxuan пре 1 година
родитељ
комит
231af140fd

+ 5 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -1462,7 +1462,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     @Override
     public Boolean top(Long musicSheetId) {
         MusicSheet musicSheet = getById(musicSheetId);
-        if (musicSheet == null) {
+        if (musicSheet == null || musicSheet.getCbsMusicSheetId() == null) {
             throw new BizException("曲目不存在");
         }
         if (YesOrNoEnum.NO.equals(musicSheet.getState())) {
@@ -1470,7 +1470,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         }
         CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend addMusicSheetApplicationExtend = new CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend();
         addMusicSheetApplicationExtend.setApplicationId(applicationId);
-        addMusicSheetApplicationExtend.setMusicSheetId(musicSheetId);
+        addMusicSheetApplicationExtend.setMusicSheetId(musicSheet.getCbsMusicSheetId());
         addMusicSheetApplicationExtend.setTopFlag(musicSheet.getTopFlag() != YesOrNoEnum.YES);
         R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendUpdate(addMusicSheetApplicationExtend);
         if (jsonObjectR.getCode() != 200) {
@@ -1482,9 +1482,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     @Override
     public Boolean stateList(ReasonDto reasonDto) {
         List<Long> musicSheets = Arrays.stream(reasonDto.getMusicSheetIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
+        List<MusicSheet> musicSheetList = musicSheetService.lambdaQuery().in(MusicSheet::getId, musicSheets).list();
+
         CbsMusicSheetWrapper.MusicSheetApplicationQuery query = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
         query.setApplicationId(applicationId);
-        query.setMusicSheetIds(musicSheets);
+        query.setMusicSheetIds(musicSheetList.stream().map(MusicSheet::getCbsMusicSheetId).collect(Collectors.toList()));
         query.setDelFlag(true);
         query.setPage(1);
         query.setRows(musicSheets.size());
@@ -1508,7 +1510,6 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (reasonDto.getState().equals(YesOrNoEnum.YES)){
             return true;
         }
-        List<MusicSheet> musicSheetList = musicSheetService.lambdaQuery().in(MusicSheet::getId, musicSheets).list();
         for (MusicSheet musicSheet : musicSheetList) {
              if (SourceTypeEnum.TEACHER.equals(musicSheet.getSourceType())) {
                  sendOutSaleMessage(reasonDto.getReason(),musicSheet);