Просмотр исходного кода

Merge branch 'online' of http://git.dayaedu.com/yonge/cooleshow into test

zouxuan 1 год назад
Родитель
Сommit
890e2eceaa

+ 16 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/SubjectController.java

@@ -5,6 +5,7 @@ import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
 import com.microsvc.toolkit.common.webportal.exception.BizException;
+import com.yonge.cooleshow.biz.dal.dto.PageUtil;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.queryInfo.SubjectQueryInfo;
 import com.yonge.cooleshow.biz.dal.service.SubjectService;
@@ -179,4 +180,19 @@ public class SubjectController extends BaseController {
 			throw BizException.from("内容平台服务异常");
 		}
     }
+
+	@ApiOperation(value = "内容平台对应的声部数据")
+	@PostMapping("/cbsSubject/list")
+	public HttpResponseResult<PageInfo<CbsSubjectWrapper.Subject>> subjectPage(){
+		CbsSubjectWrapper.SubjectQuery subjectQuery = new CbsSubjectWrapper.SubjectQuery();
+		subjectQuery.setPage(1);
+		subjectQuery.setRows(-1);
+
+		try {
+			return succeed(PageUtil.pageInfo(musicFeignClientService.subjectPage(subjectQuery).feignData()));
+		} catch (Exception e) {
+			log.error("内容平台对应的声部数据查询失败", e);
+			throw BizException.from("内容平台服务异常");
+		}
+	}
 }

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

@@ -2313,11 +2313,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         ThreadPoolExecutor executorService =  new ThreadPoolExecutor(50, 50,
             0L, TimeUnit.MILLISECONDS,
             new LinkedBlockingQueue<>());
-        while (true) {
-            IPage<MusicSheet> page = baseMapper.selectSyncPage(new Page<>(curPage, pageSize));
+//        while (true) {
+            IPage<MusicSheet> page = baseMapper.selectSyncPage(new Page<>(1, -1));
             List<MusicSheet> records = page.getRecords();
             if (CollectionUtils.isEmpty(records)) {
-                break;
+                return;
             }
             for (MusicSheet record : records) {
                 if (record.getCbsMusicSheetId() != null && !DateUtil.format(record.getCreateTime(),"yyyy-MM-dd HH:mm:ss").equals("2024-06-25 00:00:00")) {
@@ -2338,7 +2338,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             }
 
             curPage++;
-        }
+//        }
 
         while (!executorService.getQueue().isEmpty()) {
             try {
@@ -2372,7 +2372,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             musicSheet1.setMusicSheetName(musicSheet.getName());
             this.updateById(musicSheet1);
         } catch (Exception e){
-            log.error("曲目同步失败,曲目ID:{}", record.getId());
+            log.error("曲目同步失败,曲目ID:{}", record.getId(),e);
         }
 
     }

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

@@ -334,8 +334,8 @@ public class SubjectServiceImpl extends BaseServiceImpl<Long, Subject> implement
                                 continue;
                             }
                             subject.setCbsSubjectName(row.getName());
-                            subject.setName(row.getName());
-                            subject.setCode(row.getCode());
+//                            subject.setName(row.getName());
+//                            subject.setCode(row.getCode());
                             dataList.add(subject);
                         }
                     }
@@ -394,11 +394,11 @@ public class SubjectServiceImpl extends BaseServiceImpl<Long, Subject> implement
 
     @Override
     public void convertSubject(List<Subject> subjectSelect) {
-        convert(subjectSelect);
+//        convert(subjectSelect);
     }
 
     private void convert(List<Subject> subjects){
-        if(CollectionUtils.isNotEmpty(subjects)){
+        /*if(CollectionUtils.isNotEmpty(subjects)){
             // cbs声部ID集合
             List<Long> cbsSubjectIds = subjects.stream().map(Subject::getCbsSubjectId).collect(Collectors.toList());
             CbsSubjectWrapper.SubjectQuery subjectQuery = new CbsSubjectWrapper.SubjectQuery();
@@ -423,7 +423,7 @@ public class SubjectServiceImpl extends BaseServiceImpl<Long, Subject> implement
             } catch (Exception e) {
                 log.error("调用音乐服务查询曲目详情失败", e);
             }
-        }
+        }*/
     }
 
     @Override

+ 1 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -10,9 +10,7 @@
 			(select count(1) from teacher_auth_musician_record a
 				left join sys_user u on a.user_id_ = u.id_
 			 	where u.del_flag_ =0 and a.teacher_auth_status_ = 'DOING') as musicianNum,
-        	(select count(1) from music_sheet a
-				left join sys_user u on a.user_id_ = u.id_
-			 	where u.del_flag_ =0 and a.del_flag_ = 0 and a.audit_status_ = 'DOING') as musicNum,
+        	(select count(1) from music_sheet_auth_record where audit_state_ = last_audit_state_ and audit_state_ = 'DOING') as musicNum,
         	(select count(1) from video_lesson_group where audit_status_ = 'DOING') as videoCourseNum,
 			(select count(1) from teacher_style_video a
 				left join sys_user u on a.user_id_ = u.id_

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -1020,7 +1020,7 @@
     <select id="selectSyncPage" resultType="com.yonge.cooleshow.biz.dal.entity.MusicSheet">
         select *
         from music_sheet
-        where del_flag_ = 0 and audit_status_ = 'PASS'
+        where del_flag_ = 0 and audit_status_ = 'PASS' and cbs_music_sheet_id_ is null
     </select>
     <!--单曲专辑数量统计-->
 </mapper>