浏览代码

管乐迷曲目来源内容平台

zouxuan 1 年之前
父节点
当前提交
b36d1fa49a
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsSubjectServiceImpl.java

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsSubjectServiceImpl.java

@@ -3,9 +3,11 @@ package com.ym.mec.biz.service.impl;
 import com.dayaedu.cbs.openfeign.service.CbsSubjectService;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectApiWrapper;
 import com.google.common.collect.Lists;
+import com.ym.mec.biz.dal.entity.Instrument;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
 import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
+import com.ym.mec.biz.service.InstrumentService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.page.PageInfo;
 import org.apache.commons.collections.CollectionUtils;
@@ -25,6 +27,8 @@ public class CbsSubjectServiceImpl implements CbsSubjectService {
 
     @Resource
     private SubjectService subjectService;
+    @Resource
+    private InstrumentService instrumentService;
 
     public Boolean checkSubjectEnable(CbsSubjectApiWrapper.CheckSubjectDto checkSubjectDto) {
         List<Subject> subjects = subjectService.getDao().queryCbsList(Lists.newArrayList(checkSubjectDto.getSubjectId().longValue()));
@@ -62,4 +66,9 @@ public class CbsSubjectServiceImpl implements CbsSubjectService {
         }
         return subjects;
     }
+
+    public List<Long> instrumentList(CbsSubjectApiWrapper.InstrumentQuery query){
+        List<Instrument> list = instrumentService.lambdaQuery().in(Instrument::getId, query.getMusicalInstrumentIds()).list();
+        return list.stream().map(e->e.getId().longValue()).collect(Collectors.toList());
+    }
 }