Kaynağa Gözat

Merge branch 'zx_saas_cbs' of http://git.dayaedu.com/yonge/mec into test

# Conflicts:
#	pom.xml
zouxuan 1 yıl önce
ebeveyn
işleme
8f39f31030
43 değiştirilmiş dosya ile 2595 ekleme ve 1524 silme
  1. 6 51
      mec-application/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java
  2. 192 0
      mec-application/src/main/java/com/ym/mec/web/controller/MusicSheetApplicationExtendController.java
  3. 118 13
      mec-application/src/main/java/com/ym/mec/web/controller/SubjectController.java
  4. 4 1
      mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreAccompanimentController.java
  5. 47 63
      mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java
  6. 3 1
      mec-application/src/main/java/com/ym/mec/web/controller/education/EduMusicScoreController.java
  7. 25 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InstrumentDao.java
  8. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java
  9. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreAccompanimentDao.java
  10. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreCategoriesDao.java
  11. 14 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreDao.java
  12. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysUserTenantDao.java
  13. 48 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ReasonDto.java
  14. 0 44
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SysMusicScoreMetronomeTranscod.java
  15. 0 47
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SysMusicScoreTranscod.java
  16. 5 115
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentMusicScore.java
  17. 55 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Instrument.java
  18. 9 96
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Subject.java
  19. 8 299
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java
  20. 5 257
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreAccompaniment.java
  21. 5 120
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java
  22. 123 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/InstrumentWrapper.java
  23. 226 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/MusicSheetWrapper.java
  24. 268 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SubjectWrapper.java
  25. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InstrumentService.java
  26. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java
  27. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreCategoriesService.java
  28. 16 6
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java
  29. 123 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsMusicSheetServiceImpl.java
  30. 65 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsSubjectServiceImpl.java
  31. 219 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InstrumentServiceImpl.java
  32. 128 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java
  33. 95 23
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreAccompanimentServiceImpl.java
  34. 6 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java
  35. 389 331
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java
  36. 39 0
      mec-biz/src/main/resources/config/mybatis/InstrumentMapper.xml
  37. 129 2
      mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml
  38. 10 5
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreAccompanimentMapper.xml
  39. 18 0
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml
  40. 76 40
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml
  41. 29 0
      mec-biz/src/main/resources/config/mybatis/SysUserTenantMapper.xml
  42. 1 1
      mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java
  43. 1 1
      pom.xml

+ 6 - 51
mec-application/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java

@@ -1,69 +1,24 @@
 package com.ym.mec.teacher.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
-import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
-import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
 
 @RequestMapping("${app-config.url.teacher:}/sysMusicScore")
 @Api(tags = "曲库")
 @RestController
 public class SysMusicScoreController extends BaseController {
 
-    @Autowired
+    @Resource
     private SysMusicScoreService sysMusicScoreService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    @ApiOperation(value = "新增")
-    @PostMapping("/add")
-    public Object add(@RequestBody MusicScoreDto musicScoreDto) {
-        SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScore.setType(ExamSongTypeEnum.PERSON);
-        if(sysMusicScore.getClientType() == null){
-            sysMusicScore.setClientType(ClientTypeEnum.NETWORK_ROOM);
-        }
-        sysMusicScore.setShowFlag(1);
-        sysMusicScoreService.add(musicScoreDto);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除")
-    @PostMapping("/del")
-    public Object del(Integer id) {
-        sysMusicScoreService.del(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询")
-    @GetMapping("/queryPage")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
-        String type = queryInfo.getType();
-        if(StringUtils.isEmpty(type)){
-            queryInfo.setType("ALL");
-        }
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            throw new BizException("请登录");
-        }
-        if(queryInfo.getClientType() == null){
-            queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
-        }
-        queryInfo.setCreateUserId(sysUser.getId());
-        queryInfo.setShowFlag(1);
-        return succeed(sysMusicScoreService.queryPage(queryInfo));
-    }
 
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage2")

+ 192 - 0
mec-application/src/main/java/com/ym/mec/web/controller/MusicSheetApplicationExtendController.java

@@ -0,0 +1,192 @@
+package com.ym.mec.web.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
+import com.dayaedu.cbs.openfeign.properties.OpenFeignClientConfigProperties;
+import com.dayaedu.cbs.openfeign.service.CbsMusicSheetService;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendClientWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetCategoryWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.microsvc.toolkit.common.webportal.exception.BizException;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.vo.PageUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("${app-config.url.web:}/musicSheetApplicationExtend")
+@Api(tags = "曲目应用拓展表")
+public class MusicSheetApplicationExtendController {
+
+    @Resource
+    private MusicFeignClientService musicFeignClientService;
+
+
+    @Resource
+    private CbsMusicSheetService cbsMusicSheetService;
+
+    @Resource
+    private OpenFeignClientConfigProperties openFeignClientConfigProperties;
+
+    @Resource
+    private SysMusicScoreService sysMusicScoreService;
+
+    @PreAuthorize("@pcs.hasPermissions('musicSheetApplicationExtend/pageByApplication')")
+    @PostMapping({"/pageByApplication"})
+    public R<com.ym.mec.common.page.PageInfo<MusicSheetWrapper.MusicSheetApplication>> musicSheetPageByApplication(@RequestBody CbsMusicSheetWrapper.MusicSheetQuery var1) {
+        var1.setApplicationId(Long.parseLong(openFeignClientConfigProperties.getAppId()));
+        try {
+            PageInfo<CbsMusicSheetWrapper.MusicSheet> info = this.musicFeignClientService.musicSheetPage(var1).feignData();
+            List<CbsMusicSheetWrapper.MusicSheet> rows = info.getRows();
+            if (CollectionUtils.isEmpty(rows)) {
+                return R.from(PageUtil.pageInfo(info, new ArrayList<>()));
+            }
+            String instrumentIds = rows.stream().map(CbsMusicSheetWrapper.MusicSheet::getMusicalInstrumentIds).filter(StringUtils::isNotEmpty).collect(Collectors.joining(","));
+            //获取乐器名称
+            Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap = new HashMap<>();
+            if(StringUtils.isNotEmpty(instrumentIds)){
+                List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryDtos =
+                        sysMusicScoreService.queryMusicalInstrument(Arrays.stream(instrumentIds.split(",")).map(Integer::parseInt).distinct().collect(Collectors.toList()));
+                musicalInstrumentQueryMap = musicalInstrumentQueryDtos.stream()
+                        .collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId, o -> o, (o1, o2) -> o1));
+            }
+            List<Long> cbsMusicIds = rows.stream().map(CbsMusicSheetWrapper.MusicSheet::getId).collect(Collectors.toList());
+            List<SysMusicScore> musicSheetList = sysMusicScoreService.getDao().findByCbsId(cbsMusicIds);
+            Map<String, SysMusicScore> map = musicSheetList.stream().collect(Collectors.toMap(SysMusicScore::getCbsMusicSheetId, o -> o, (o1, o2) -> o1));
+
+            List<MusicSheetWrapper.MusicSheetApplication> musicSheetApplications = new ArrayList<>();
+            for (CbsMusicSheetWrapper.MusicSheet row : rows) {
+                MusicSheetWrapper.MusicSheetApplication musicSheetApplication = JSONObject.parseObject(JSONObject.toJSONString(row), MusicSheetWrapper.MusicSheetApplication.class);
+                musicSheetApplication.setId(row.getId().toString());
+                SysMusicScore musicSheet = map.get(musicSheetApplication.getId());
+                if (Objects.nonNull(musicSheet)) {
+                    musicSheetApplication.setBizId(musicSheet.getId().toString());
+                }
+                if(StringUtils.isNotEmpty(musicSheetApplication.getMusicalInstrumentIds())){
+                    String[] split = musicSheetApplication.getMusicalInstrumentIds().split(",");
+                    for (String s : split) {
+                        StringBuffer sb = new StringBuffer();
+                        CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto musicalInstrumentQueryDto = musicalInstrumentQueryMap.get(Integer.parseInt(s));
+                        if(Objects.nonNull(musicalInstrumentQueryDto)){
+                            if(sb.length() > 0){
+                                sb.append(",");
+                            }
+                            sb.append(musicalInstrumentQueryDto.getName());
+                        }
+                        musicSheetApplication.setSubjectNames(sb.toString());
+                    }
+                }
+                musicSheetApplications.add(musicSheetApplication);
+            }
+            return R.from(PageUtil.pageInfo(info, musicSheetApplications));
+        } catch (Exception e) {
+            log.error("查询曲目应用拓展表异常", e);
+            if (e instanceof BizException) {
+                throw e;
+            }
+            throw BizException.from("内容平台服务异常");
+        }
+    }
+
+
+    @ApiOperation(value = "修改应用扩展信息", notes = "曲目应用拓展表- 传入 MusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend")
+    @PreAuthorize("@pcs.hasPermissions('musicSheetApplicationExtend/update')")
+    @PostMapping("/update")
+    public R<JSONObject> update(@RequestBody CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend addMusicSheetApplicationExtend) {
+
+        // 更新数据
+        addMusicSheetApplicationExtend.setApplicationId(Long.parseLong(openFeignClientConfigProperties.getAppId()));
+        try {
+
+            musicFeignClientService.musicSheetApplicationExtendUpdate(addMusicSheetApplicationExtend).feignData();
+        } catch (Exception e) {
+            log.error("修改应用扩展信息异常", e);
+            if (e instanceof BizException) {
+                throw e;
+            }
+            throw BizException.from("内容平台服务异常");
+        }
+
+        return R.defaultR();
+    }
+
+
+    @ApiOperation(value = "批量保存扩展信息")
+    @PreAuthorize("@pcs.hasPermissions('musicSheetApplicationExtend/saveBatch')")
+    @PostMapping("/saveBatch")
+    public R<JSONObject> saveBatch(@RequestBody List<CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend> list) {
+
+        if (CollectionUtils.isEmpty(list)) {
+            throw BizException.from("参数错误");
+        }
+        for (CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend addMusicSheetApplicationExtend : list) {
+            addMusicSheetApplicationExtend.setApplicationId(Long.parseLong(openFeignClientConfigProperties.getAppId()));
+        }
+        // 更新数据
+        try {
+            musicFeignClientService.musicSheetApplicationExtendSaveBatch(list).feignData();
+        } catch (Exception e) {
+            log.error("批量保存扩展信息异常", e);
+            if (e instanceof BizException) {
+                throw e;
+            }
+            throw BizException.from("内容平台服务异常");
+        }
+
+        return R.defaultR();
+    }
+
+
+    @ApiOperation(value = "应用分类列表")
+    @PostMapping("/categoryList")
+    public R<List<CbsMusicSheetCategoryWrapper.MusicSheetCategory>> categoryList() {
+
+        return R.from(cbsMusicSheetService.categoryList(new CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery()));
+
+    }
+
+    @ApiOperation(value = "所属人信息查询")
+    @PostMapping("/ownerList")
+    public R<PageInfo<CbsMusicSheetExtendWrapper.MusicSheetExtend>> ownerList(@RequestBody CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo) {
+
+        return R.from(cbsMusicSheetService.ownerList(queryInfo));
+    }
+
+    @ApiOperation(value = "查询曲目适用项目的扩展信息")
+    @PostMapping("/applicationExtendInfo")
+    public R<CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtend> applicationExtendInfo(@RequestBody @Validated CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendQuery query) {
+        if (query == null || query.getMusicSheetId() == null) {
+            throw BizException.from("参数错误");
+        }
+        query.setApplicationId(Long.parseLong(openFeignClientConfigProperties.getAppId()));
+        R<List<CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtend>> listR = musicFeignClientService.musicSheetApplicationExtendApplicationExtendInfo(query);
+        List<CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtend> data = listR.feignData();
+        if (CollectionUtils.isNotEmpty(data)) {
+            return R.from(data.get(0));
+        } else {
+            throw new BizException("扩展信息不存在");
+        }
+    }
+
+}

+ 118 - 13
mec-application/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -1,29 +1,48 @@
 package com.ym.mec.web.controller;
 
+import com.alibaba.fastjson.JSON;
+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.ym.mec.biz.dal.dto.SubFeeSettingDto;
+import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import com.ym.mec.biz.dal.page.SubjectQueryInfo;
+import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
+import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @RequestMapping("${app-config.url.web:}/subject")
 @Api(tags = "科目服务")
 @RestController
+@Slf4j
 public class SubjectController extends BaseController {
 
-    @Autowired
+    @Resource
     private SubjectService subjectService;
+    @Resource
+    private MusicFeignClientService musicFeignClientService;
 
     @ApiOperation(value = "修改、新增科目")
     @PostMapping("/upset")
     @PreAuthorize("@pcs.hasPermissions('subject/upset')")
-    public Object update(@RequestBody Subject subject){
+    public HttpResponseResult<Object> update(@RequestBody Subject subject){
         subjectService.upSetSubject(subject);
         return succeed();
     }
@@ -31,21 +50,21 @@ public class SubjectController extends BaseController {
     @ApiOperation(value = "根据科目编号查询科目")
     @GetMapping("/get/{id}")
     @PreAuthorize("@pcs.hasPermissions('subject/get')")
-    public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
+    public HttpResponseResult<Subject> get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
         return succeed(subjectService.get(id));
     }
 
     @ApiOperation(value = "分页查询科目列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('subject/queryPage')")
-    public Object queryPage(SubjectQueryInfo queryInfo){
+    public HttpResponseResult<PageInfo<Subject>> queryPage(SubjectQueryInfo queryInfo){
         return succeed(subjectService.queryPage(queryInfo));
     }
 
     @ApiOperation(value = "分页查询科目树状列表")
     @GetMapping("/queryPageTree")
     @PreAuthorize("@pcs.hasPermissions('subject/queryPageTree')")
-    public Object queryPageTree(SubjectQueryInfo queryInfo){
+    public HttpResponseResult<PageInfo<Subject>> queryPageTree(SubjectQueryInfo queryInfo){
         return succeed(subjectService.queryPageTree(queryInfo));
     }
 
@@ -53,7 +72,7 @@ public class SubjectController extends BaseController {
     @GetMapping("/querySubByMusicGroupId")
     @PreAuthorize("@pcs.hasPermissions('subject/querySubByMusicGroupId')")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
-    public Object findSubByMusicGroupId(String musicGroupId){
+    public HttpResponseResult<List<Subject>> findSubByMusicGroupId(String musicGroupId){
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
     }
 
@@ -61,14 +80,14 @@ public class SubjectController extends BaseController {
     @GetMapping("/setSubjectInfo")
     @PreAuthorize("@pcs.hasPermissions('subject/setSubjectInfo')")
     @ApiImplicitParams({ @ApiImplicitParam(name = "chargeTypeId", value = "收费类型编号", required = true, dataType = "Integer")})
-    public Object setSubjectInfo(Integer chargeTypeId){
+    public HttpResponseResult<SubFeeSettingDto> setSubjectInfo(Integer chargeTypeId){
         return succeed(subjectService.setSubjectInfo(chargeTypeId));
     }
 
     @ApiOperation(value = "修改、新增声部关联的商品列表")
     @PostMapping("/markGoods")
     @PreAuthorize("@pcs.hasPermissions('subject/markGoods')")
-    public Object markGoods(@RequestBody List<SubjectGoodsMapper> subjectGoodsMappers){
+    public HttpResponseResult<Object> markGoods(@RequestBody List<SubjectGoodsMapper> subjectGoodsMappers){
         subjectService.markGoods(subjectGoodsMappers);
         return succeed();
     }
@@ -77,28 +96,114 @@ public class SubjectController extends BaseController {
     @GetMapping("/findSubApplyDetail")
     @PreAuthorize("@pcs.hasPermissions('subject/findSubApplyDetail')")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
-    public Object findSubApplyDetail(String musicGroupId){
+    public HttpResponseResult<List<SubjectApplyDetailDto>> findSubApplyDetail(String musicGroupId){
         return succeed(subjectService.findSubApplyDetail(musicGroupId));
     }
 
     @ApiOperation(value = "获取子集科目列表按父Id")
     @GetMapping("/findSubSubjects")
     @PreAuthorize("@pcs.hasPermissions('subject/findSubSubjects')")
-    public Object findSubSubjects(Integer parentSubjectId){
+    public HttpResponseResult<List<Subject>> findSubSubjects(Integer parentSubjectId){
         return succeed(subjectService.findSubSubjects(parentSubjectId));
     }
 
     @ApiOperation(value = "搜索按Id和名称")
     @PostMapping("/queryPageByIdOrName")
     @PreAuthorize("@pcs.hasPermissions('subject/queryPageByIdOrName')")
-    public Object queryPageByIdOrName(SubjectQueryInfo queryInfo){
+    public HttpResponseResult<PageInfo<Subject>> queryPageByIdOrName(SubjectQueryInfo queryInfo){
         return succeed(subjectService.queryPageByIdOrName(queryInfo));
     }
 
     @ApiOperation(value = "列出所有分部")
     @PostMapping("/list")
     // @PreAuthorize("@pcs.hasPermissions('subject/list')")
-    public Object list(){
+    public HttpResponseResult<List<Subject>> list(){
         return succeed(subjectService.list());
     }
+
+
+    /**
+     * 声部分页
+     */
+    @ApiOperation(value = "内容平台对应的声部数据")
+    @PostMapping("/cbsSubject/page")
+    public HttpResponseResult<List<SubjectWrapper.CbsSubject>> subjectPage(@RequestBody SubjectWrapper.CbsSubjectQuery query){
+        // 移除已被使用的声部ID
+        if (Boolean.TRUE.equals(query.getRemoveUsed())) {
+            List<Subject> list = subjectService.getDao().notInSubjectIds(query.getSubjectId());
+            if (CollectionUtils.isNotEmpty(list)) {
+                List<Long> cbsSubjectIds = list.stream().map(Subject::getCbsSubjectId).filter(Objects::nonNull).map(Integer::longValue).distinct().collect(Collectors.toList());
+                if (CollectionUtils.isNotEmpty(cbsSubjectIds)) {
+                    query.setRemoveIds(cbsSubjectIds);
+                }
+            }
+        }
+
+        try {
+            query.setPage(1);
+            query.setRows(-1);
+            List<CbsSubjectWrapper.Subject> subjectPageInfo = musicFeignClientService.subjectPage(query).feignData().getRows();
+            if (CollectionUtils.isEmpty(subjectPageInfo)) {
+                return succeed(new ArrayList<>());
+            }
+            List<Integer> subjectIds = subjectPageInfo.stream().map(CbsSubjectWrapper.Subject::getId).map(Long::intValue).collect(Collectors.toList());
+
+            // 查询乐器信息
+            CbsMusicalInstrumentWrapper.MusicalInstrumentQuery musicalInstrumentQuery = new CbsMusicalInstrumentWrapper.MusicalInstrumentQuery();
+            musicalInstrumentQuery.setSubjectIds(subjectIds);
+            musicalInstrumentQuery.setPage(1);
+            musicalInstrumentQuery.setRows(9999);
+            List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> rows = musicFeignClientService
+                    .musicalInstrumentPage(musicalInstrumentQuery).feignData().getRows();
+            Map<Long, List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto>> subjectIdMap = rows.stream()
+                    .collect(Collectors.groupingBy(o -> o.getSubjectId().longValue(), LinkedHashMap::new, Collectors.toList()));
+
+            // 查询本地已经添加过的曲目数据
+            SubjectWrapper.SubjectQuery query1 = new SubjectWrapper.SubjectQuery();
+            query1.setHasInstrument(true);
+            List<SubjectWrapper.Subject> list = subjectService.queryList(query1);
+            // 转map
+            Map<Long, List<SubjectWrapper.Subject>> subjectMap = list.stream()
+                    .collect(Collectors.groupingBy(SubjectWrapper.Subject::getCbsSubjectId));
+
+            List<SubjectWrapper.CbsSubject> cbsSubjects = new ArrayList<>();
+            for (CbsSubjectWrapper.Subject subject : subjectPageInfo) {
+                SubjectWrapper.CbsSubject cbsSubject = new SubjectWrapper.CbsSubject();
+                BeanUtils.copyProperties(subject, cbsSubject);
+
+                List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryDtos = subjectIdMap.get(cbsSubject.getId());
+                if (CollectionUtils.isEmpty(musicalInstrumentQueryDtos)) {
+                    continue;
+                }
+                cbsSubject.setInstruments(JSON.parseArray(JSON.toJSONString(musicalInstrumentQueryDtos), SubjectWrapper.Instrument.class));
+
+                cbsSubjects.add(cbsSubject);
+                // 本地已经添加过的曲目数据
+                List<SubjectWrapper.Subject> subjects = subjectMap.get(subject.getId());
+                if (CollectionUtils.isEmpty(subjects)) {
+                    continue;
+                }
+                List<InstrumentWrapper.Instrument> instruments = new ArrayList<>();
+                for (SubjectWrapper.Subject subject1 : subjects) {
+                    if (CollectionUtils.isNotEmpty(subject1.getInstruments())) {
+                        instruments.addAll(subject1.getInstruments());
+                    }
+                }
+                if (CollectionUtils.isEmpty(instruments)) {
+                    continue;
+                }
+                // instruments 转map
+                Map<Integer, InstrumentWrapper.Instrument> instrumentMap = instruments.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, o -> o));
+                for (SubjectWrapper.Instrument instrument : cbsSubject.getInstruments()) {
+                    instrument.setAdded(instrumentMap.containsKey(instrument.getId()));
+                }
+
+            }
+
+            return succeed(cbsSubjects);
+        } catch (Exception e) {
+            log.error("内容平台对应的声部数据查询失败", e);
+            throw BizException.from("内容平台服务异常");
+        }
+    }
 }

+ 4 - 1
mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreAccompanimentController.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -11,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @RequestMapping("${app-config.url.web:}/sysMusicScoreAccompaniment")
 @Api(tags = "曲库服务")
 @RestController
@@ -38,7 +41,7 @@ public class SysMusicScoreAccompanimentController extends BaseController {
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScoreAccompaniment/queryPage')")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+    public HttpResponseResult<List<SysMusicScoreAccompaniment>> queryPage(SysExamSongQueryInfo queryInfo) {
         return succeed(sysMusicScoreAccompanimentService.queryAll(queryInfo));
     }
 

+ 47 - 63
mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -1,78 +1,45 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
+import com.ym.mec.biz.dal.dto.ReasonDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
-import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
+import javax.annotation.Resource;
+import java.util.concurrent.CompletableFuture;
 
 @RequestMapping("${app-config.url.web:}/sysMusicScore")
 @Api(tags = "曲库")
 @RestController
 public class SysMusicScoreController extends BaseController {
 
-    @Autowired
+    @Resource
     private SysMusicScoreService sysMusicScoreService;
 
-    @ApiOperation(value = "修改")
+    @ApiOperation(value = "修改应用扩展信息")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/update', {'BACKEND'})")
     @PostMapping("/update")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/update')")
-    public Object update(@RequestBody MusicScoreDto musicScoreDto) {
-        sysMusicScoreService.updateMusicScore(musicScoreDto);
-        return succeed();
-    }
-
-    @ApiOperation(value = "修改样式")
-    @PostMapping("/updateExtStyleConfigJson")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/updateExtStyleConfigJson')")
-    public Object updateExtStyleConfigJson(Integer sysMusicScoreId,String extStyleConfigJson) {
-        sysMusicScoreService.updateExtStyleConfigJson(sysMusicScoreId, extStyleConfigJson);
-        return succeed();
-    }
-
-    @ApiOperation(value = "启用/停用")
-    @PostMapping("/show")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/show')")
-    public Object update(Integer sysMusicScoreId,Integer showFlag) {
-        SysMusicScore sysMusicScore = sysMusicScoreService.get(sysMusicScoreId);
-        if(sysMusicScore == null){
-            throw new BizException("曲目信息不存在");
-        }
-        sysMusicScore.setShowFlag(showFlag);
-        sysMusicScoreService.update(sysMusicScore);
-        return succeed();
-    }
-
-    @ApiOperation(value = "新增")
-    @PostMapping("/add")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/add')")
-    public Object add(@RequestBody MusicScoreDto musicScoreDto) {
-        sysMusicScoreService.add(musicScoreDto);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除")
-    @PostMapping("/del")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/del')")
-    public Object del(Integer id) {
-        sysMusicScoreService.del(id);
+    public HttpResponseResult<Object> update(@RequestBody MusicSheetWrapper.MusicSheetApplicationExtendWrapper addMusicSheetApplicationExtend) {
+        sysMusicScoreService.updateCbs(addMusicSheetApplicationExtend);
         return succeed();
     }
 
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScore/queryPage')")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+    public HttpResponseResult<PageInfo<SysMusicScore>> queryPage(SysExamSongQueryInfo queryInfo) {
         return succeed(sysMusicScoreService.queryMusicScorePage(queryInfo));
     }
 
@@ -82,24 +49,41 @@ public class SysMusicScoreController extends BaseController {
         queryInfo.setType("COMMON");
         queryInfo.setShowFlag(1);
         queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
-        return succeed(sysMusicScoreService.queryMusicScorePageInfo(queryInfo));
+        return succeed(sysMusicScoreService.queryMusicScorePage(queryInfo));
+    }
+
+    @PostMapping("/state/{id}")
+    @ApiOperation(value = "启用/停用", notes = "传入id")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/state')")
+    public HttpResponseResult<Boolean> state(@ApiParam(value = "曲目编号", required = true)  @PathVariable Integer id) {
+        if (id == null) {
+            return failed("参数不能为空");
+        }
+        return succeed(sysMusicScoreService.state(id));
     }
-    
-    private void getAllCategoryIdList(List<Integer> categoryIdList, List<SysMusicScoreCategories> sysMusicScoreCategoriesList){
-    	
-    	if(sysMusicScoreCategoriesList != null && sysMusicScoreCategoriesList.size() > 0){
-    		for(SysMusicScoreCategories sysMusicScoreCategories : sysMusicScoreCategoriesList){
-    			categoryIdList.add(sysMusicScoreCategories.getId());
-    			getAllCategoryIdList(categoryIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
-    		}
-    	}
+
+    @PostMapping("/stateList")
+    @ApiOperation(value = "批量启用/停用")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/stateList')")
+    public HttpResponseResult<Boolean> stateList(@RequestBody ReasonDto reasonDto) {
+        if (StringUtils.isEmpty(reasonDto.getMusicSheetIds())) {
+            return failed("参数不能为空");
+        }
+        if (reasonDto.getState() == null) {
+            return failed("启用/禁用状态不能为空");
+        }
+        if (reasonDto.getState().equals(YesOrNoEnum.NO) && StringUtils.isEmpty(reasonDto.getReason())) {
+            return failed("停用原因不能为空");
+        }
+        return succeed(sysMusicScoreService.stateList(reasonDto));
     }
 
-    @ApiOperation(value = "转码")
-    @PostMapping("/transcod")
-    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/transcod')")
-    public Object transcod(Integer sysMusicScoreId) {
-        sysMusicScoreService.transcod(sysMusicScoreId);
+    @ApiOperation(value = "数据同步", notes = "曲谱表- 修改曲目缓存 MusicSheetVo.MusicSheet")
+    @PostMapping("/sync")
+    public HttpResponseResult<Object> sync() {
+        CompletableFuture.runAsync(() -> {
+            sysMusicScoreService.sync();
+        });
         return succeed();
     }
 }

+ 3 - 1
mec-application/src/main/java/com/ym/mec/web/controller/education/EduMusicScoreController.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
@@ -11,6 +12,7 @@ import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
 import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
 import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -49,7 +51,7 @@ public class EduMusicScoreController extends BaseController {
 
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+    public HttpResponseResult<List<SysMusicScoreAccompaniment>> queryPage(SysExamSongQueryInfo queryInfo) {
         queryInfo.setShowFlag(1);
         return succeed(sysMusicScoreAccompanimentService.queryAll(queryInfo));
     }

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InstrumentDao.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ym.mec.biz.dal.entity.Instrument;
+import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 乐器设置
+ * 2024-04-22 16:55:18
+ */
+public interface InstrumentDao extends BaseMapper<Instrument> {
+
+	/**
+	 * 分页查询
+	 * @param page IPage<InstrumentWrapper.Instrument>
+	 * @param param InstrumentWrapper.InstrumentQuery
+	 * @return List<InstrumentWrapper.Instrument>
+	 */
+	List<InstrumentWrapper.Instrument> selectPage(@Param("page") IPage<InstrumentWrapper.Instrument> page, @Param("param") InstrumentWrapper.InstrumentQuery param);
+
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectApiWrapper;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.StudentAttendanceViewDto;
 import com.ym.mec.biz.dal.dto.StudentSubjectDto;
@@ -8,6 +9,7 @@ import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
 import com.ym.mec.common.dal.BaseDAO;
 
 import org.apache.ibatis.annotations.Param;
@@ -174,4 +176,14 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
     List<StudentSubjectDto> getSubjectByStudentId(@Param("studentIds") Set studentIds);
 
     List<Subject> findByNames();
+
+    List<Subject> queryCbsList(@Param("cbsSubjectIds") List<Long> cbsSubjectIds);
+
+    List<Subject> notInSubjectIds(@Param("subjectId") Integer subjectId);
+
+    int findCount(Map<String, Object> params);
+
+    List<SubjectWrapper.Subject> findPage(Map<String, Object> params);
+
+    List<CbsSubjectApiWrapper.Subject> queryCbsSubjects(@Param("query") CbsSubjectApiWrapper.SubjectQuery query);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreAccompanimentDao.java

@@ -34,4 +34,6 @@ public interface SysMusicScoreAccompanimentDao extends BaseDAO<Integer, SysMusic
      * @return
      */
     List<Subject> querySubjectIds(@Param("categoriesIdList") List<Integer> categoriesIdList);
+
+    List<SysMusicScoreAccompaniment> findByMusicScoreId(@Param("recordId") Integer recordId);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreCategoriesDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetCategoryWrapper;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -28,4 +29,6 @@ public interface SysMusicScoreCategoriesDao extends BaseDAO<Integer, SysMusicSco
     List<SysMusicScoreCategories> queryByIds(String ids);
     
     SysMusicScoreCategories queryByParentId(Integer parentId);
+
+    List<CbsMusicSheetCategoryWrapper.MusicSheetCategory> categoryList(@Param("param") CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery queryInfo);
 }

+ 14 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreDao.java

@@ -1,12 +1,11 @@
 package com.ym.mec.biz.dal.dao;
 
 
-import com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod;
-import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApiWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendWrapper;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.common.dal.BaseDAO;
-
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -17,11 +16,19 @@ public interface SysMusicScoreDao extends BaseDAO<Integer, SysMusicScore> {
 
     int countBuyCategoriesIds(@Param("categoriesIds") String delCategoriesIds);
 
-    SysMusicScoreTranscod getTranscod(@Param("sysMusicScoreId") Integer sysMusicScoreId);
+    List<SysMusicScore> findByCbsId(@Param("cbsMusicSheetIds") List<Long> cbsMusicSheetIds);
+
+    void updateBatchByCbsId(@Param("vos") List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> updateMusicScore);
+
+    void batchInsert(@Param("vos") List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> addMusicSheet);
+
+    void batchEnable(@Param("cbsMusicSheetIds") String cbsMusicSheetIds, @Param("status") Boolean status);
+
+    void batchDel(@Param("cbsMusicSheetIds") String cbsMusicSheetIds);
 
-    List<SysMusicScoreMetronomeTranscod> getMetronomeTranscod(@Param("sysMusicScoreId") Integer sysMusicScoreId);
+    void updateMusicSheet(@Param("param") CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate);
 
-    int updateAccompanimentBySongId(@Param("param") SysMusicScoreAccompaniment param);
+    void batchInsertAccompaniment(@Param("vos") List<Integer> musicSheetIds);
 
-    int updateExtStyleConfigJson(@Param("id") Integer id, @Param("extStyleConfigJson") String extStyleConfigJson);
+    List<SysMusicScore> selectSyncPage();
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysUserTenantDao.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper;
 import com.ym.mec.biz.dal.entity.SysUserTenant;
 import com.ym.mec.biz.dal.vo.SysUserTenantVo;
 import org.apache.ibatis.annotations.Param;
@@ -19,5 +21,10 @@ public interface SysUserTenantDao extends BaseMapper<SysUserTenant> {
 
     List<SysUserTenantVo> queryUserTenant(@Param("userId") Integer userId);
 
+    IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> personOwnerList(@Param("page") IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> page,
+                                                                       @Param("param") CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo);
+
+    IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> orgOwnerList(@Param("page") IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> page,
+                                                                    @Param("param") CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo);
 }
 

+ 48 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ReasonDto.java

@@ -0,0 +1,48 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-08-08
+ */
+@ApiModel("曲目下架原因")
+public class ReasonDto {
+
+    @ApiModelProperty("曲目下架原因")
+    private String  reason;
+
+    @ApiModelProperty("曲目id集合 逗号隔开")
+    private String musicSheetIds;
+
+    @ApiModelProperty("启用: 1 ,停用 : 0")
+    private YesOrNoEnum state;
+
+    public YesOrNoEnum getState() {
+        return state;
+    }
+
+    public void setState(YesOrNoEnum state) {
+        this.state = state;
+    }
+
+    public String getMusicSheetIds() {
+        return musicSheetIds;
+    }
+
+    public void setMusicSheetIds(String musicSheetIds) {
+        this.musicSheetIds = musicSheetIds;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+}

+ 0 - 44
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SysMusicScoreMetronomeTranscod.java

@@ -1,44 +0,0 @@
-package com.ym.mec.biz.dal.dto;
-
-public class SysMusicScoreMetronomeTranscod {
-    //sys_music_score_accompaniment.id_
-    private Integer id;
-    //sys_music_score_accompaniment.exam_song_id_
-    private Integer examSongId;
-    //原音MP3
-    private String mp3Url;
-    //原音MP3(含节拍器)
-    private String  metronomeMp3Url;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getExamSongId() {
-        return examSongId;
-    }
-
-    public void setExamSongId(Integer examSongId) {
-        this.examSongId = examSongId;
-    }
-
-    public String getMp3Url() {
-        return mp3Url;
-    }
-
-    public void setMp3Url(String mp3Url) {
-        this.mp3Url = mp3Url;
-    }
-
-    public String getMetronomeMp3Url() {
-        return metronomeMp3Url;
-    }
-
-    public void setMetronomeMp3Url(String metronomeMp3Url) {
-        this.metronomeMp3Url = metronomeMp3Url;
-    }
-}

+ 0 - 47
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SysMusicScoreTranscod.java

@@ -1,47 +0,0 @@
-package com.ym.mec.biz.dal.dto;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class SysMusicScoreTranscod {
-    //sys_music_score.id_
-    private Integer id;
-    //伴奏MP3
-    private String url;
-    //伴奏MP3(含节拍器)
-    private String  metronomeUrl;
-
-    private List<SysMusicScoreMetronomeTranscod> accompanimentList = new ArrayList<>();
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getMetronomeUrl() {
-        return metronomeUrl;
-    }
-
-    public void setMetronomeUrl(String metronomeUrl) {
-        this.metronomeUrl = metronomeUrl;
-    }
-
-    public List<SysMusicScoreMetronomeTranscod> getAccompanimentList() {
-        return accompanimentList;
-    }
-
-    public void setAccompanimentList(List<SysMusicScoreMetronomeTranscod> accompanimentList) {
-        this.accompanimentList = accompanimentList;
-    }
-}

+ 5 - 115
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentMusicScore.java

@@ -1,9 +1,11 @@
 package com.ym.mec.biz.dal.entity;
 
-import java.util.Date;
-
 import com.ym.mec.common.entity.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
 
+@Data
 public class CourseScheduleStudentMusicScore extends BaseEntity {
     private Integer id;
     private Long courseScheduleId;
@@ -13,122 +15,10 @@ public class CourseScheduleStudentMusicScore extends BaseEntity {
     private Integer musicScoreAccompanimentId;
     private Integer playStatus = 0;
     private Integer accompanimentPlayStatus = 0;
-    private Integer speed;
+    private String speed;
     private String mp3Url;
     private String url;
     private String musicScoreName;
     private Date createTime;
     private Date updateTime;
-
-    public Integer getAccompanimentPlayStatus() {
-        return accompanimentPlayStatus;
-    }
-
-    public void setAccompanimentPlayStatus(Integer accompanimentPlayStatus) {
-        this.accompanimentPlayStatus = accompanimentPlayStatus;
-    }
-
-    public String getMp3Url() {
-        return mp3Url;
-    }
-
-    public void setMp3Url(String mp3Url) {
-        this.mp3Url = mp3Url;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getMusicScoreName() {
-        return musicScoreName;
-    }
-
-    public void setMusicScoreName(String musicScoreName) {
-        this.musicScoreName = musicScoreName;
-    }
-
-    public Integer getUserType() {
-        return userType;
-    }
-
-    public void setUserType(Integer userType) {
-        this.userType = userType;
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Long getCourseScheduleId() {
-        return courseScheduleId;
-    }
-
-    public void setCourseScheduleId(Long courseScheduleId) {
-        this.courseScheduleId = courseScheduleId;
-    }
-
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
-    public Integer getDownStatus() {
-        return downStatus;
-    }
-
-    public void setDownStatus(Integer downStatus) {
-        this.downStatus = downStatus;
-    }
-
-    public Integer getMusicScoreAccompanimentId() {
-        return musicScoreAccompanimentId;
-    }
-
-    public void setMusicScoreAccompanimentId(Integer musicScoreAccompanimentId) {
-        this.musicScoreAccompanimentId = musicScoreAccompanimentId;
-    }
-
-    public Integer getPlayStatus() {
-        return playStatus;
-    }
-
-    public void setPlayStatus(Integer playStatus) {
-        this.playStatus = playStatus;
-    }
-
-    public Integer getSpeed() {
-        return speed;
-    }
-
-    public void setSpeed(Integer speed) {
-        this.speed = speed;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
 }

+ 55 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Instrument.java

@@ -0,0 +1,55 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 乐器设置
+ * 2024-04-22 16:55:18
+ */
+@Data
+@ApiModel(" Instrument-乐器设置")
+@TableName("instrument")
+public class Instrument implements Serializable {
+
+    @ApiModelProperty("主键ID,内容平台乐器ID")
+    @TableId(value = "id_")
+    private Integer id;
+
+    @ApiModelProperty("声部ID")
+	@TableField(value = "subject_id_")
+    private Integer subjectId;
+
+    @ApiModelProperty("横竖屏:1:竖 0:横")
+	@TableField(value = "orientation_")
+    private Boolean orientation;
+
+    @ApiModelProperty("启用/停用")
+    @TableField(value = "enable_flag_")
+    private Boolean enableFlag;
+
+    @ApiModelProperty("删除标记")
+	@TableField(value = "del_flag_")
+    private Boolean delFlag;
+
+    @ApiModelProperty("创建时间")
+	@TableField(value = "create_time_")
+    private Date createTime;
+
+    @ApiModelProperty("更新时间")
+	@TableField(value = "update_time_")
+    private Date updateTime;
+
+    @ApiModelProperty("操作人")
+	@TableField(value = "operator_")
+    private Long operator;
+
+}

+ 9 - 96
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Subject.java

@@ -1,9 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-
 import io.swagger.annotations.ApiModelProperty;
-
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -12,10 +11,14 @@ import java.util.List;
 /**
  * 对应数据库表(subject):
  */
+@Data
 public class Subject {
 
 	/**  */
 	private Integer id;
+
+	/**  */
+	private Integer cbsSubjectId;
 	
 	/**  */
 	@ApiModelProperty(value = "科目名称",required = false)
@@ -57,104 +60,14 @@ public class Subject {
 	@ApiModelProperty(value = "子节点列表",required = false)
 	private List<Subject> subjects;
 
-	public Integer getTenantId() {
-		return tenantId;
-	}
-
-	public void setTenantId(Integer tenantId) {
-		this.tenantId = tenantId;
-	}
-
-	public List<Subject> getSubjects() {
-		return subjects;
-	}
+	@ApiModelProperty(value = "乐器编号(逗号分隔)",required = false)
+	private String instrumentIds;
 
-	public BigDecimal getFee() {
-		return fee;
-	}
-
-	public void setFee(BigDecimal fee) {
-		this.fee = fee;
-	}
-
-	public void setSubjects(List<Subject> subjects) {
-		this.subjects = subjects;
-	}
-
-	public void setId(Integer id){
-		this.id = id;
-	}
-	
-	public Integer getId(){
-		return this.id;
-	}
-			
-	public void setName(String name){
-		this.name = name;
-	}
-	
-	public String getName(){
-		return this.name;
-	}
-			
-	public void setCode(String code){
-		this.code = code;
-	}
-	
-	public String getCode(){
-		return this.code;
-	}
-			
-	public void setParentSubjectId(Integer parentSubjectId){
-		this.parentSubjectId = parentSubjectId;
-	}
-	
-	public Integer getParentSubjectId(){
-		return this.parentSubjectId;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-
-	public YesOrNoEnum getDelFlag() {
-		return delFlag;
-	}
-
-	public void setDelFlag(YesOrNoEnum delFlag) {
-		this.delFlag = delFlag;
-	}
-
-	public String getImg() {
-		return img;
-	}
-
-	public void setImg(String img) {
-		this.img = img;
-	}
+	@ApiModelProperty(value = "乐器名称",required = false)
+	private String instrumentName;
 
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}
-
-	public String getParentSubjectName() {
-		return parentSubjectName;
-	}
-
-	public void setParentSubjectName(String parentSubjectName) {
-		this.parentSubjectName = parentSubjectName;
-	}
 }

+ 8 - 299
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java

@@ -3,11 +3,14 @@ package com.ym.mec.biz.dal.entity;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
 import com.ym.mec.common.enums.BaseEnum;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
  * 对应数据库表(sys_music_score):
  */
+@Data
 public class SysMusicScore {
 	
 	public enum PlayMode  implements BaseEnum<String, PlayMode> {
@@ -37,6 +40,9 @@ public class SysMusicScore {
 
 	/**  */
 	private Integer id;
+
+	@ApiModelProperty(value = "内容平台曲目ID")
+	private String cbsMusicSheetId;  //主键ID
 	
 	/**  */
 	private Integer musicScoreCategoriesId;
@@ -63,7 +69,7 @@ public class SysMusicScore {
 	private String subjectName;
 	
 	/** 速度 */
-	private Integer speed;
+	private String speed;
 	
 	/** 原音MP3 */
 	private String url;
@@ -107,8 +113,8 @@ public class SysMusicScore {
 	/**  */
 	private java.util.Date createTime;
 
-	//是否显示
 	private Integer showFlag = 0;
+
 	private String showName;
 
 	private Boolean isOpenMetronome;
@@ -122,303 +128,6 @@ public class SysMusicScore {
 	private PlayMode playMode;
 
 	private String organName;
-
-	public String getExtConfigJson() {
-		return extConfigJson;
-	}
-
-	public void setExtConfigJson(String extConfigJson) {
-		this.extConfigJson = extConfigJson;
-	}
-
-	public String getExtStyleConfigJson() {
-		return extStyleConfigJson;
-	}
-
-	public void setExtStyleConfigJson(String extStyleConfigJson) {
-		this.extStyleConfigJson = extStyleConfigJson;
-	}
-
-	public String getTypeName() {
-		return typeName;
-	}
-
-	public void setTypeName(String typeName) {
-		this.typeName = typeName;
-	}
-
-	public String getOpenMetronomeName() {
-		return openMetronomeName;
-	}
-
-	public String getShowName() {
-		return showName;
-	}
-
-	public void setShowName(String showName) {
-		this.showName = showName;
-	}
-
-	public void setOpenMetronomeName(String openMetronomeName) {
-		this.openMetronomeName = openMetronomeName;
-	}
-
-	public Integer getSubjectId() {
-		return subjectId;
-	}
-
-	public void setSubjectId(Integer subjectId) {
-		this.subjectId = subjectId;
-	}
-
-	public String getSubjectName() {
-		return subjectName;
-	}
-
-	public void setSubjectName(String subjectName) {
-		this.subjectName = subjectName;
-	}
-
-	public String getOrganName() {
-		return organName;
-	}
-
-	public void setOrganName(String organName) {
-		this.organName = organName;
-	}
-
-	public Boolean getIsOpenMetronome() {
-		return isOpenMetronome;
-	}
-
-	public void setIsOpenMetronome(Boolean isOpenMetronome) {
-		this.isOpenMetronome = isOpenMetronome;
-	}
-
-	public PlayMode getPlayMode() {
-		return playMode;
-	}
-
-	public void setPlayMode(PlayMode playMode) {
-		this.playMode = playMode;
-	}
-
-	public String getAccompanimentUrl() {
-		return accompanimentUrl;
-	}
-
-	public void setAccompanimentUrl(String accompanimentUrl) {
-		this.accompanimentUrl = accompanimentUrl;
-	}
-
-	public String getAccompanimentMetronomeUrl() {
-		return accompanimentMetronomeUrl;
-	}
-
-	public void setAccompanimentMetronomeUrl(String accompanimentMetronomeUrl) {
-		this.accompanimentMetronomeUrl = accompanimentMetronomeUrl;
-	}
-
-	public String getXmlUrl() {
-		return xmlUrl;
-	}
-
-	public void setXmlUrl(String xmlUrl) {
-		this.xmlUrl = xmlUrl;
-	}
-
-	public String getMetronomeUrl() {
-		return metronomeUrl;
-	}
-
-	public void setMetronomeUrl(String metronomeUrl) {
-		this.metronomeUrl = metronomeUrl;
-	}
-
-	public String getMidiUrl() {
-		return midiUrl;
-	}
-
-	public void setMidiUrl(String midiUrl) {
-		this.midiUrl = midiUrl;
-	}
-
-	public Integer getShowFlag() {
-		return showFlag;
-	}
-
-	public void setShowFlag(Integer showFlag) {
-		this.showFlag = showFlag;
-	}
-
-	public String getRankIds() {
-		return rankIds;
-	}
-
-	public void setRankIds(String rankIds) {
-		this.rankIds = rankIds;
-	}
-
-	public String getRenderFrom() {
-		return renderFrom;
-	}
-
-	public void setRenderFrom(String renderFrom) {
-		this.renderFrom = renderFrom;
-	}
-
-	public boolean isEnableEvaluation() {
-		return enableEvaluation;
-	}
-
-	public void setEnableEvaluation(boolean enableEvaluation) {
-		this.enableEvaluation = enableEvaluation;
-	}
-
-	public ClientTypeEnum getClientType() {
-		return clientType;
-	}
-
-	public void setClientType(ClientTypeEnum clientType) {
-		this.clientType = clientType;
-	}
-
-	public Integer getOrder() {
-		return order;
-	}
-
-	public void setOrder(Integer order) {
-		this.order = order;
-	}
-
-	public Integer getCategoriesId() {
-		return categoriesId;
-	}
-
-	public void setCategoriesId(Integer categoriesId) {
-		this.categoriesId = categoriesId;
-	}
-
-	public String getCategoriesName() {
-		return categoriesName;
-	}
-
-	public void setCategoriesName(String categoriesName) {
-		this.categoriesName = categoriesName;
-	}
-
-	public String getCreateUserName() {
-		return createUserName;
-	}
-
-	public void setCreateUserName(String createUserName) {
-		this.createUserName = createUserName;
-	}
-
-	public void setId(Integer id){
-		this.id = id;
-	}
-	
-	public Integer getId(){
-		return this.id;
-	}
-			
-	public void setMusicScoreCategoriesId(Integer musicScoreCategoriesId){
-		this.musicScoreCategoriesId = musicScoreCategoriesId;
-	}
-	
-	public Integer getMusicScoreCategoriesId(){
-		return this.musicScoreCategoriesId;
-	}
-			
-	public void setName(String name){
-		this.name = name;
-	}
-	
-	public String getName(){
-		return this.name;
-	}
-
-	public ExamSongTypeEnum getType() {
-		return type;
-	}
-
-	public void setType(ExamSongTypeEnum type) {
-		this.type = type;
-	}
-
-	public void setSubjectIds(String subjectIds){
-		this.subjectIds = subjectIds;
-	}
-	
-	public String getSubjectIds(){
-		return this.subjectIds;
-	}
-			
-	public void setSpeed(Integer speed){
-		this.speed = speed;
-	}
-	
-	public Integer getSpeed(){
-		return this.speed;
-	}
-			
-	public void setUrl(String url){
-		this.url = url;
-	}
-	
-	public String getUrl(){
-		return this.url;
-	}
-			
-	public void setCreateUserId(Integer createUserId){
-		this.createUserId = createUserId;
-	}
-	
-	public Integer getCreateUserId(){
-		return this.createUserId;
-	}
-			
-	public void setDelFlag(Integer delFlag){
-		this.delFlag = delFlag;
-	}
-	
-	public Integer getDelFlag(){
-		return this.delFlag;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-
-	public String getMuseScoreUrl() {
-		return museScoreUrl;
-	}
-
-	public void setMuseScoreUrl(String museScoreUrl) {
-		this.museScoreUrl = museScoreUrl;
-	}
-
-	public String getMuseScoreMemo() {
-		return museScoreMemo;
-	}
-
-	public void setMuseScoreMemo(String museScoreMemo) {
-		this.museScoreMemo = museScoreMemo;
-	}
-
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 5 - 257
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreAccompaniment.java

@@ -2,11 +2,13 @@ package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.entity.SysMusicScore.PlayMode;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
  * 对应数据库表(sys_music_score_accompaniment):
  */
+@Data
 public class SysMusicScoreAccompaniment {
 
 	/**  */
@@ -14,6 +16,8 @@ public class SysMusicScoreAccompaniment {
 	
 	/**  */
 	private Integer examSongId;
+	/**  */
+	private String cbsMusicSheetId;
 	
 	/**  */
 	private Integer subjectId;
@@ -31,7 +35,7 @@ public class SysMusicScoreAccompaniment {
 	private Integer delFlag;
 	
 	/** 速度 */
-	private Integer speed;
+	private String speed;
 	
 	/**  */
 	private String xmlUrl;
@@ -91,262 +95,6 @@ public class SysMusicScoreAccompaniment {
 	
 	private String extStyleConfigJson;
 
-	public String getExtConfigJson() {
-		return extConfigJson;
-	}
-
-	public void setExtConfigJson(String extConfigJson) {
-		this.extConfigJson = extConfigJson;
-	}
-
-	public String getExtStyleConfigJson() {
-		return extStyleConfigJson;
-	}
-
-	public void setExtStyleConfigJson(String extStyleConfigJson) {
-		this.extStyleConfigJson = extStyleConfigJson;
-	}
-
-	public String getMetronomeUrl() {
-		return metronomeUrl;
-	}
-
-	public void setMetronomeUrl(String metronomeUrl) {
-		this.metronomeUrl = metronomeUrl;
-	}
-
-	public String getMidiUrl() {
-		return midiUrl;
-	}
-
-	public void setMidiUrl(String midiUrl) {
-		this.midiUrl = midiUrl;
-	}
-
-	public String getRankIds() {
-		return rankIds;
-	}
-
-	public void setRankIds(String rankIds) {
-		this.rankIds = rankIds;
-	}
-
-	public ClientTypeEnum getClientType() {
-		return clientType;
-	}
-
-	public void setClientType(ClientTypeEnum clientType) {
-		this.clientType = clientType;
-	}
-
-	public Boolean getIsShowFingering() {
-		return isShowFingering;
-	}
-
-	public void setIsShowFingering(Boolean showFingering) {
-		isShowFingering = showFingering;
-	}
-
-	public String getMemo() {
-		return memo;
-	}
-
-	public void setMemo(String memo) {
-		this.memo = memo;
-	}
-
-	public Integer getCategoriesId() {
-		return categoriesId;
-	}
-
-	public void setCategoriesId(Integer categoriesId) {
-		this.categoriesId = categoriesId;
-	}
-
-	public Integer getParentCategoriesId() {
-		return parentCategoriesId;
-	}
-
-	public void setParentCategoriesId(Integer parentCategoriesId) {
-		this.parentCategoriesId = parentCategoriesId;
-	}
-
-	public String getCategoriesName() {
-		return categoriesName;
-	}
-
-	public void setCategoriesName(String categoriesName) {
-		this.categoriesName = categoriesName;
-	}
-
-	public String getSubjectName() {
-		return subjectName;
-	}
-
-	public void setSubjectName(String subjectName) {
-		this.subjectName = subjectName;
-	}
-
-	public String getExamSongName() {
-		return examSongName;
-	}
-
-	public void setExamSongName(String examSongName) {
-		this.examSongName = examSongName;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
-	public void setId(Integer id){
-		this.id = id;
-	}
-	
-	public Integer getId(){
-		return this.id;
-	}
-			
-	public void setExamSongId(Integer examSongId){
-		this.examSongId = examSongId;
-	}
-	
-	public Integer getExamSongId(){
-		return this.examSongId;
-	}
-			
-	public void setSubjectId(Integer subjectId){
-		this.subjectId = subjectId;
-	}
-	
-	public Integer getSubjectId(){
-		return this.subjectId;
-	}
-			
-	public void setMp3Url(String mp3Url){
-		this.mp3Url = mp3Url;
-	}
-	
-	public String getMp3Url(){
-		return this.mp3Url;
-	}
-			
-	public void setDelFlag(Integer delFlag){
-		this.delFlag = delFlag;
-	}
-	
-	public Integer getDelFlag(){
-		return this.delFlag;
-	}
-			
-	public void setSpeed(Integer speed){
-		this.speed = speed;
-	}
-	
-	public Integer getSpeed(){
-		return this.speed;
-	}
-			
-	public void setXmlUrl(String xmlUrl){
-		this.xmlUrl = xmlUrl;
-	}
-	
-	public String getXmlUrl(){
-		return this.xmlUrl;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	public Boolean getIsOpenMetronome() {
-		return isOpenMetronome;
-	}
-
-	public void setIsOpenMetronome(Boolean isOpenMetronome) {
-		this.isOpenMetronome = isOpenMetronome;
-	}
-
-	public String getRenderFrom() {
-		return renderFrom;
-	}
-
-	public void setRenderFrom(String renderFrom) {
-		this.renderFrom = renderFrom;
-	}
-
-	public boolean isEnableEvaluation() {
-		return enableEvaluation;
-	}
-
-	public void setEnableEvaluation(boolean enableEvaluation) {
-		this.enableEvaluation = enableEvaluation;
-	}
-
-	public String getMetronomeMp3Url() {
-		return metronomeMp3Url;
-	}
-
-	public void setMetronomeMp3Url(String metronomeMp3Url) {
-		this.metronomeMp3Url = metronomeMp3Url;
-	}
-
-	public String getMuseScoreUrl() {
-		return museScoreUrl;
-	}
-
-	public void setMuseScoreUrl(String museScoreUrl) {
-		this.museScoreUrl = museScoreUrl;
-	}
-
-	public String getMuseScoreMemo() {
-		return museScoreMemo;
-	}
-
-	public void setMuseScoreMemo(String museScoreMemo) {
-		this.museScoreMemo = museScoreMemo;
-	}
-
-	public PlayMode getPlayMode() {
-		return playMode;
-	}
-
-	public void setPlayMode(PlayMode playMode) {
-		this.playMode = playMode;
-	}
-
-	public String getTrack() {
-		return track;
-	}
-
-	public void setTrack(String track) {
-		this.track = track;
-	}
-
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 5 - 120
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java

@@ -3,9 +3,11 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.List;
 
+@Data
 public class SysExamSongQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "上传人",required = true)
@@ -14,6 +16,9 @@ public class SysExamSongQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "声部",required = true)
     private Integer subjectId;
 
+    @ApiModelProperty(value = "声部",required = true)
+    private String subjectIds;
+
     @ApiModelProperty(value = "类型",required = true)
     private String type;
 
@@ -42,124 +47,4 @@ public class SysExamSongQueryInfo extends QueryInfo {
     private Boolean enable;
 
     private String organId;
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public String getOrganId() {
-        return organId;
-    }
-
-    public void setOrganId(String organId) {
-        this.organId = organId;
-    }
-
-    public Integer getShowFlag() {
-        return showFlag;
-    }
-
-    public void setShowFlag(Integer showFlag) {
-        this.showFlag = showFlag;
-    }
-
-    public Integer getRankType() {
-        return rankType;
-    }
-
-    public void setRankType(Integer rankType) {
-        this.rankType = rankType;
-    }
-
-    public List<Integer> getCategoriesIdList() {
-        return categoriesIdList;
-    }
-
-    public void setCategoriesIdList(List<Integer> categoriesIdList) {
-        this.categoriesIdList = categoriesIdList;
-    }
-
-    public ClientTypeEnum getClientType() {
-        return clientType;
-    }
-
-    public void setClientType(ClientTypeEnum clientType) {
-        this.clientType = clientType;
-    }
-
-    public Boolean getIsShowFingering() {
-        return isShowFingering;
-    }
-
-    public void setIsShowFingering(Boolean showFingering) {
-        isShowFingering = showFingering;
-    }
-
-    public Integer getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Integer parentId) {
-        this.parentId = parentId;
-    }
-
-    public String getCategoriesId() {
-        return categoriesId;
-    }
-
-    public void setCategoriesId(String categoriesId) {
-        this.categoriesId = categoriesId;
-    }
-
-    public Integer getSysMusicScoreId() {
-        return sysMusicScoreId;
-    }
-
-    public void setSysMusicScoreId(Integer sysMusicScoreId) {
-        this.sysMusicScoreId = sysMusicScoreId;
-    }
-
-    public Integer getCreateUserId() {
-        return createUserId;
-    }
-
-    public void setCreateUserId(Integer createUserId) {
-        this.createUserId = createUserId;
-    }
-
-    public Integer getSubjectId() {
-        return subjectId;
-    }
-
-    public void setSubjectId(Integer subjectId) {
-        this.subjectId = subjectId;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-	public String getFilterCategoriesIds() {
-		return filterCategoriesIds;
-	}
-
-	public void setFilterCategoriesIds(String filterCategoriesIds) {
-		this.filterCategoriesIds = filterCategoriesIds;
-	}
-
-	public String getCategoriesIds() {
-		return categoriesIds;
-	}
-
-	public void setCategoriesIds(String categoriesIds) {
-		this.categoriesIds = categoriesIds;
-	}
 }

+ 123 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/InstrumentWrapper.java

@@ -0,0 +1,123 @@
+package com.ym.mec.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 乐器设置
+ * 2024-04-22 16:55:18
+ */
+@ApiModel(value = "InstrumentWrapper对象", description = "乐器设置查询对象")
+public class InstrumentWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" InstrumentQuery-乐器设置")
+    public static class InstrumentQuery implements QueryInfo {
+    	@ApiModelProperty("当前页")
+        private Integer page;
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+        @ApiModelProperty("声部")
+        private Integer subjectId;
+        @ApiModelProperty("声部")
+        private List<Integer> subjectIds;
+        @ApiModelProperty("是否启用")
+        private Boolean enableFlag;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static InstrumentQuery from(String json) {
+            return JSON.parseObject(json, InstrumentQuery.class);
+        }
+    }
+
+    @Data
+	@ApiModel(" Instrument-乐器设置")
+    public static class Instrument {
+
+        @ApiModelProperty("乐器ID")
+        private Integer id;
+
+        @ApiModelProperty("乐器名称")
+        private String name;
+
+        @ApiModelProperty("声部ID")
+        private Integer subjectId;
+
+        @ApiModelProperty("声部名称")
+        private String subjectName;
+
+        @ApiModelProperty("横竖屏:1:竖 0:横")
+        private Boolean orientation;
+
+        @ApiModelProperty("启用/停用")
+        private Boolean enableFlag;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("更新时间")
+        private Date updateTime;
+
+        @ApiModelProperty("操作人")
+        private Long operator;
+
+        @ApiModelProperty("编码")
+        private String code;
+
+
+        @ApiModelProperty("是否可转普")
+        private Boolean transferFlag;
+
+        @ApiModelProperty("图片")
+        private String img;
+
+        @ApiModelProperty("音频")
+        private String media;
+
+        @ApiModelProperty("频率")
+        private Integer hz;
+
+        @ApiModelProperty("默认谱面(STAVE: 五线谱; JIAN: 固定调; FIRST: 首调)")
+        private String defaultScore;
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static Instrument from(String json) {
+            return JSON.parseObject(json, Instrument.class);
+        }
+	}
+
+    @Data
+    public static class Update {
+
+        @ApiModelProperty("乐器ID")
+        @NotNull(message = "乐器ID不能为空")
+        private Long id;
+
+        @ApiModelProperty("操作人")
+        private Long operator;
+
+        @ApiModelProperty("横竖屏:1:竖 0:横")
+        private Boolean orientation;
+
+        @ApiModelProperty("启用/停用")
+        private Boolean enableFlag;
+    }
+}

+ 226 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/MusicSheetWrapper.java

@@ -3,12 +3,16 @@ package com.dayaedu.cbs.domain.wrapper;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.dayaedu.cbs.common.enums.music.*;
 import com.dayaedu.cbs.common.enums.school.EMusicSheetType;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 import java.util.Optional;
 
 import lombok.AllArgsConstructor;
@@ -199,6 +203,30 @@ public class MusicSheetWrapper {
     @NoArgsConstructor
     @AllArgsConstructor
     @ApiModel(" MusicSheet-管乐迷曲谱表")
+    public static class MusicSheetApplicationExtendWrapper {
+        @ApiModelProperty("曲目ID")
+        private @NotNull(
+                message = "曲目ID不能为空"
+        ) Long musicSheetId;
+
+        @ApiModelProperty("分类ID")
+        private Long musicSheetCategoryId;
+
+        @ApiModelProperty("启用状态")
+        private Boolean status;
+
+        @ApiModelProperty("排序")
+        private Integer sortNo;
+
+        @ApiModelProperty("收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
+        private String paymentType;
+    }
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" MusicSheet-管乐迷曲谱表")
     public static class MecMusicSheet extends MusicSheet {
 
         @ApiModelProperty("曲目分类")
@@ -218,4 +246,202 @@ public class MusicSheetWrapper {
             return JSON.parseObject(json, MusicSheet.class);
         }
     }
+
+    @Data
+    public static class MusicSheetApplication{
+
+        @ApiModelProperty("主键")
+        private String id;
+
+        @ApiModelProperty("业务平台曲目ID")
+        private String bizId;
+
+        @ApiModelProperty("曲目分类ID")
+        private Long musicCategoryId;
+
+        @ApiModelProperty("曲目分类名称")
+        private String musicCategoryName;
+
+        @ApiModelProperty("曲目标签")
+        private String musicTag;
+
+        @ApiModelProperty("曲目标签名称")
+        private String musicTagNames;
+
+        @ApiModelProperty("曲目封面图")
+        private String musicCover;
+
+        @ApiModelProperty("曲目名称")
+        private String name;
+
+        @ApiModelProperty("是否审核版本")
+        private Boolean appAuditFlag;
+
+        @ApiModelProperty("曲目声部(多个,用逗号分隔)")
+        private String subjectIds;
+
+        @ApiModelProperty("曲目声部code")
+        private String subjectCodes;
+
+        @ApiModelProperty("曲目声部名称")
+        private String subjectNames;
+
+        @ApiModelProperty("曲目乐器(多个,用逗号分隔)")
+        private String musicalInstrumentIds;
+
+        @ApiModelProperty("曲目乐器code")
+        private String musicalInstrumentIdCodes;
+
+        @ApiModelProperty("曲目乐器名称")
+        private String musicalInstrumentNames;
+
+        @ApiModelProperty("作曲人/音乐人")
+        private String composer;
+
+        @ApiModelProperty("曲目类型(SINGLE:单曲 CONCERT:合奏)")
+        private EMusicSheetType musicSheetType;
+
+        @ApiModelProperty("演奏是否使用系统节拍器(0:否;1:是)")
+        private Boolean isUseSystemBeat;
+
+        @ApiModelProperty("演唱是否使用系统节拍器(0:否;1:是)")
+        private Boolean isUseSingSystemBeat;
+
+        @ApiModelProperty("是否可评测(0:否;1:是)") //  midi默认1, mp3 有伴奏1
+        private Boolean isEvaluated;
+
+        @ApiModelProperty("是否可转谱(0:否; 1:是)") // 固定调,首调 有值 1
+        private Boolean isConvertibleScore;
+
+        @ApiModelProperty("是否展示指法(0:否;1:是)") // moren 1
+        private Boolean isShowFingering;
+
+        @ApiModelProperty("是否播入演奏节拍器(0: 否 1:是)")
+        private Boolean isPlayBeat;
+
+        @ApiModelProperty("是否播入演唱节拍器(0: 否 1:是)")
+        private Boolean isPlaySingBeat;
+
+        @ApiModelProperty("是否全部声部可使用(0: 否 1:是)")
+        private Boolean isAllSubject;
+
+        @ApiModelProperty("多声轨选择")
+        private String multiTracksSelection;
+
+        @ApiModelProperty("播放速度")
+        private String playSpeed;
+
+        @ApiModelProperty("音频类型,SING:演唱,PLAY:演奏")
+        private String audioPlayTypes;
+
+        @ApiModelProperty("播放模式(MIDI;MP3)")
+        private EMusicPlayMode playMode;
+
+        @ApiModelProperty("XML文件")
+        private String xmlFileUrl;
+
+        @ApiModelProperty("MIDI文件(保留字段)")
+        private String midiFileUrl;
+
+        @ApiModelProperty("曲目JSON")
+        private String musicJson;
+
+        @ApiModelProperty("曲目缓存JSON(后续使用)")
+        private String musicSvgJson;
+
+        @ApiModelProperty("曲目缓存")
+        private String musicSvg;
+
+
+        @ApiModelProperty("评测标准 节奏 AMPLITUDE 音准 FREQUENCY 分贝 DECIBELS")
+        private EEvaluationStandard evaluationStandard;
+
+        @ApiModelProperty("简谱缓存")
+        private String musicJianSvg;
+
+        @ApiModelProperty("首调缓存")
+        private String musicFirstSvg;
+
+        @ApiModelProperty("谱面图片JSON(后续使用)")
+        private String musicImgJson;
+
+        @ApiModelProperty("五线谱图片")
+        private String musicImg;
+
+        @ApiModelProperty("首调图片")
+        private String musicFirstImg;
+
+        @ApiModelProperty("固定调图片")
+        private String musicJianImg;
+
+        @ApiModelProperty("谱面参数设置")
+        private String extConfigJson;
+
+        @ApiModelProperty("谱面样式参数设置")
+        private String extStyleConfigJson;
+
+        @ApiModelProperty("可用类型(PLATFORM: 平台; ORG: 机构; PERSON: 个人)") // 暂时没有
+        private EMusicAvailableType availableType;
+
+        @ApiModelProperty("来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人)") // 作者属性
+        private EMusicSourceType sourceType;
+
+        @ApiModelProperty("音频类型(HOMEMODE: 自制 COMMON: 普通)")
+        private EAudioType audioType;
+
+        @ApiModelProperty("曲目状态(0:停用,1:启用)")
+        private Boolean status;
+
+        @ApiModelProperty("停用原因")
+        private String reason;
+
+        @ApiModelProperty("备注")
+        private String remark;
+
+        @ApiModelProperty("逻辑删除标识(0: 未删 1:已删)")
+        private Boolean delFlag;
+
+        @ApiModelProperty("更新人")
+        private Long updateBy;
+
+        @ApiModelProperty("更新时间")
+        private Date updateTime;
+
+        @ApiModelProperty("创建人")
+        private Long createBy;
+
+        @ApiModelProperty("上传人名称")
+        private String createByName;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("评测频率,详情返回,指定应用端")
+        private String evaluationFrequency;
+
+
+        @ApiModelProperty("曲目伴奏")
+        private List<CbsMusicSheetWrapper.MusicSheetAccompaniment> musicSheetAccompanimentList;
+
+
+        @ApiModelProperty("曲目原音")
+        private List<CbsMusicSheetWrapper.MusicSheetSound> musicSheetSoundList;
+
+
+        @ApiModelProperty("所属人信息")
+        private CbsMusicSheetWrapper.MusicSheetExtend musicSheetExtend;
+
+        @ApiModelProperty("乐器信息")
+        private List<CbsMusicSheetWrapper.MusicalInstrument> musicalInstruments;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CbsMusicSheetWrapper.MusicSheet from(String json) {
+            return JSON.parseObject(json, CbsMusicSheetWrapper.MusicSheet.class);
+        }
+
+    }
+
 }

+ 268 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SubjectWrapper.java

@@ -0,0 +1,268 @@
+package com.ym.mec.biz.dal.wrapper;
+
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectWrapper;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
+
+public class SubjectWrapper {
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class SubjectQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        @ApiModelProperty("删除标识")
+        private Integer delFlag;
+
+        @ApiModelProperty("启用标识")
+        private Boolean enableFlag;
+
+        @ApiModelProperty("声部ID")
+        private Integer subjectId;
+
+        @ApiModelProperty("父级声部ID")
+        private Integer parentSubjectId;
+
+        @ApiModelProperty("多个声部ID")
+        private String subjectIds;
+
+        @ApiModelProperty("多个乐器ID")
+        private String instrumentIds;
+
+        @ApiModelProperty("有乐器")
+        private Boolean hasInstrument;
+
+    }
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class Subject {
+
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        @ApiModelProperty("内容平台声部ID")
+        private Long cbsSubjectId;
+
+        @ApiModelProperty("内容平台声部名称")
+        private String cbsSubjectName;
+
+        @ApiModelProperty("名称")
+        private String name;
+
+        @ApiModelProperty("编码")
+        private String code;
+
+        @ApiModelProperty(value = "父级编号",required = false)
+        private Integer parentSubjectId;
+
+        private String parentSubjectName;
+
+        @ApiModelProperty("封面")
+        private String img;
+
+        @ApiModelProperty("orientation:1:竖 0:横")
+        private Boolean orientation;
+
+        @ApiModelProperty("删除标识")
+        private Boolean delFlag;
+
+        @ApiModelProperty("描述信息")
+        private String desc;
+
+        @ApiModelProperty("logo")
+        private String logo;
+
+        @ApiModelProperty("音频")
+        private String media;
+
+        @ApiModelProperty("更新时间")
+        private Date updateTime;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("启用标识")
+        private Boolean enableFlag;
+
+        @ApiModelProperty("声部列表")
+        private List<Subject> subjects;
+
+        @ApiModelProperty("乐器列表")
+        private List<InstrumentWrapper.Instrument> instruments;
+
+    }
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class SmallInstrument {
+
+        @ApiModelProperty("乐器ID")
+        private Integer id;
+
+        @ApiModelProperty("乐器名称")
+        private String name;
+
+        @ApiModelProperty("编码")
+        private String code;
+
+        @ApiModelProperty("横竖屏:1:竖 0:横")
+        private Boolean orientation;
+
+        @ApiModelProperty("是否可转普")
+        private Boolean transferFlag;
+
+        @ApiModelProperty("图片")
+        private String img;
+
+        @ApiModelProperty("音频")
+        private String media;
+
+        @ApiModelProperty("频率")
+        private Integer hz;
+
+        @ApiModelProperty("是否启用")
+        private Boolean enableFlag = false;
+
+        @ApiModelProperty("操作人")
+        private Long operator;
+    }
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class SmallSubject {
+
+        @ApiModelProperty("声部ID")
+        private Integer id;
+
+        @ApiModelProperty("声部名称")
+        private String name;
+    }
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class SmallMusicSheet {
+
+        @ApiModelProperty("id")
+        private Long id;
+
+        @ApiModelProperty("声部ID")
+        private String musicSubject;
+
+        @ApiModelProperty("内容平台声部ID")
+        private String cbsSubjectId;
+    }
+
+    @Data
+    @ApiModel("声部启用")
+    public static class SubjectEnable {
+
+        @ApiModelProperty("声部ID")
+        @NotNull(message = "声部ID不能为空")
+        private Long id;
+
+        @ApiModelProperty("启用标识")
+        @NotNull(message = "启用标识不能为空")
+        private Boolean enableFlag;
+    }
+
+
+    @Data
+    public static class AddSubject {
+
+        @ApiModelProperty("内容平台声部")
+        private List<AddSubjectInstrument> subjects;
+
+        @ApiModelProperty("操作人")
+        private Long operator;
+    }
+
+    @Data
+    public static class AddSubjectInstrument {
+
+        @ApiModelProperty("内容平台声部ID")
+        @NotNull(message = "内容平台声部ID不能为空")
+        private Long cbsSubjectId;
+
+        @ApiModelProperty("分类编号")
+        @NotNull(message = "分类编号不能为空")
+        private Long parentSubjectId;
+
+        @ApiModelProperty("乐器ID")
+        private List<Long> instrumentIds;
+    }
+
+    @Data
+    public static class CbsSubject{
+        @ApiModelProperty("声部ID")
+        private Long id;
+
+        @ApiModelProperty("名称")
+        private String name;
+
+        @ApiModelProperty("编码")
+        private String code;
+
+        @ApiModelProperty("是否启用")
+        private Boolean enableFlag;
+
+        @ApiModelProperty("乐器列表")
+        private List<Instrument> instruments;
+    }
+
+
+    @Data
+    @ApiModel(" Instrument-乐器设置")
+    public static class Instrument {
+
+        @ApiModelProperty("乐器ID")
+        private Integer id;
+
+        @ApiModelProperty("乐器名称")
+        private String name;
+
+        @ApiModelProperty("是否已被添加过")
+        private Boolean added = false;
+    }
+
+    @Data
+    @ApiModel(" SubjectList-声部表")
+    public static class CbsSubjectQuery extends CbsSubjectWrapper.SubjectQuery {
+
+        @ApiModelProperty("当前声部ID")
+        private Integer subjectId;
+
+        @ApiModelProperty("是否移除被使用过的声部")
+        private Boolean removeUsed = false;
+    }
+}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InstrumentService.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.entity.Instrument;
+import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 乐器设置
+ * 2024-04-22 16:55:18
+ */
+public interface InstrumentService extends IService<Instrument>  {
+
+	/**
+     * 查询详情
+     * @param id 详情ID
+     * @return Instrument
+     */
+	Instrument detail(Integer id);
+
+    /**
+     * 分页查询
+     * @param page IPage<Instrument>
+     * @param query InstrumentWrapper.InstrumentQuery
+     * @return IPage<Instrument>
+     */
+    IPage<InstrumentWrapper.Instrument> selectPage(IPage<InstrumentWrapper.Instrument> page, InstrumentWrapper.InstrumentQuery query);
+
+    /**
+     * 添加
+     * @param instrument InstrumentWrapper.Instrument
+     * @return Boolean
+     */
+     Boolean add(InstrumentWrapper.Instrument instrument);
+
+    /**
+     * 更新
+     * @param instrument InstrumentWrapper.Instrument
+     * @return Boolean
+     */
+     Boolean update(InstrumentWrapper.Instrument instrument);
+
+    List<Instrument> queryBySubjectId(Integer subject);
+
+    Map<Integer,InstrumentWrapper.Instrument> getMapByIds(List<Integer> instrumentIdList);
+
+    List<InstrumentWrapper.Instrument> getInstruments(List<Integer> instrumentIdList);
+
+    Map<Integer,List<InstrumentWrapper.Instrument>> getGroupBySubjectId(List<Integer> subjectIds, Boolean enableFlag);
+
+    List<InstrumentWrapper.Instrument> getList(InstrumentWrapper.InstrumentQuery query);
+
+    List<Integer> getInstrumentIdsBySubjectId(Integer subjectId);
+
+    void modify(InstrumentWrapper.Update update);
+}

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import com.ym.mec.biz.dal.page.SubjectQueryInfo;
+import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
@@ -116,4 +117,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
     Map<Integer, StudentSubjectDto> getSubjectByStudentId(Set studentIds);
 
+    List<SubjectWrapper.Subject> queryList(SubjectWrapper.SubjectQuery query);
+
+    PageInfo<SubjectWrapper.Subject> selectPage(SubjectWrapper.SubjectQuery query);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreCategoriesService.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 
 import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.common.service.BaseService;
 
@@ -9,6 +10,8 @@ import java.util.List;
 
 public interface SysMusicScoreCategoriesService extends BaseService<Integer, SysMusicScoreCategories> {
 
+    SysMusicScoreCategoriesDao getDao();
+
     List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo);
     
     List<SysMusicScoreCategories> queryCategoriesTreeList(String categoryIdList, Boolean isQueryEnable);

+ 16 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java

@@ -4,7 +4,12 @@ package com.ym.mec.biz.service;
 import java.util.List;
 import java.util.Map;
 
+import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
 import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.dto.ReasonDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -12,11 +17,12 @@ import com.ym.mec.common.service.BaseService;
 
 public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore> {
 
-    void updateMusicScore(MusicScoreDto musicScoreDto);
+    SysMusicScoreDao getDao();
 
-    void add(MusicScoreDto musicScoreDto);
+    List<CbsMusicSheetWrapper.MusicSheetApplication> queryCbsMusicSheetApplication(List<String> cbsMusicSheetIds);
 
-    void del(Integer id);
+    //获取乐器名称
+    List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> queryMusicalInstrument(List<Integer> musicalInstrumentIds);
 
     List<SysMusicScore> queryMusicScoreAll(SysExamSongQueryInfo queryInfo);
 
@@ -24,9 +30,13 @@ public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore
     
     PageInfo<SysMusicScore> queryMusicScorePageInfo(SysExamSongQueryInfo queryInfo);
 
-    void transcod(Integer sysMusicScoreId);
+    Map<Long, SysMusicScore> getMapByIds(List<Long> musicSheetIds);
 
-    int updateExtStyleConfigJson(Integer id, String extStyleConfigJson);
+    Boolean stateList(ReasonDto reasonDto);
 
-    Map<Long, SysMusicScore> getMapByIds(List<Long> musicSheetIds);
+    Boolean state(Integer id);
+
+    void updateCbs(MusicSheetWrapper.MusicSheetApplicationExtendWrapper addMusicSheetApplicationExtend);
+
+    void sync();
 }

+ 123 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsMusicSheetServiceImpl.java

@@ -0,0 +1,123 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.dayaedu.cbs.common.enums.music.EMusicSourceType;
+import com.dayaedu.cbs.openfeign.service.CbsMusicSheetService;
+import com.dayaedu.cbs.openfeign.wrapper.music.*;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.ym.mec.biz.dal.dao.SysUserTenantDao;
+import com.ym.mec.biz.dal.entity.Subject;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.biz.service.SubjectService;
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.exception.BizException;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
+
+    private static final Logger log = LoggerFactory.getLogger(CbsMusicSheetServiceImpl.class);
+
+    @Resource
+    private SysMusicScoreService sysMusicScoreService;
+    @Resource
+    private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
+    @Resource
+    private SubjectService subjectService;
+    @Resource
+    private SysUserTenantDao sysUserTenantDao;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean saveApplicationExtend(List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> addMusicSheet) {
+        if (CollectionUtils.isEmpty(addMusicSheet)) {
+            throw new BizException("请选择曲目信息");
+        }
+        List<Long> cbsMusicSheetIds = addMusicSheet.stream().map(CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend::getMusicSheetId).collect(Collectors.toList());
+        for (CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend extend : addMusicSheet) {
+            CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate = extend.getMusicSheetUpdate();
+            if(StringUtils.isNotBlank(musicSheetUpdate.getSubjectIds())) {
+                List<Long> cbsSubjectIds = Arrays.stream(musicSheetUpdate.getSubjectIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
+                List<Subject> subjectIds = subjectService.getDao().queryCbsList(cbsSubjectIds);
+                if (CollectionUtils.isNotEmpty(subjectIds)) {
+                    musicSheetUpdate.setSubjectIds(subjectIds.stream().map(e -> e.getId().toString()).collect(Collectors.joining(",")));
+                }
+            }
+        }
+        //需要修改的曲目
+        List<SysMusicScore> musicSheets = sysMusicScoreService.getDao().findByCbsId(cbsMusicSheetIds);
+        if (CollectionUtils.isNotEmpty(musicSheets)){
+            List<String> collect = musicSheets.stream().map(SysMusicScore::getCbsMusicSheetId).collect(Collectors.toList());
+            //获取需要修改的曲目
+            List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> updateMusicScore =
+                    addMusicSheet.stream().filter(e -> collect.contains(e.getMusicSheetId().toString())).collect(Collectors.toList());
+            sysMusicScoreService.getDao().updateBatchByCbsId(updateMusicScore);
+            //排除已经存在的曲目
+            addMusicSheet = addMusicSheet.stream().filter(e -> !collect.contains(e.getMusicSheetId().toString())).collect(Collectors.toList());
+        }
+        if(CollectionUtils.isNotEmpty(addMusicSheet)){
+            sysMusicScoreService.getDao().batchInsert(addMusicSheet);
+            List<Long> cbsIds = addMusicSheet.stream().map(CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend::getMusicSheetId).collect(Collectors.toList());
+            List<SysMusicScore> sysMusicScores = sysMusicScoreService.getDao().findByCbsId(cbsIds);
+            List<Integer> collect = sysMusicScores.stream().map(SysMusicScore::getId).collect(Collectors.toList());
+            sysMusicScoreService.getDao().batchInsertAccompaniment(collect);
+        }
+        return true;
+    }
+
+    public Boolean updateApplicationExtendStatus(CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtendStatus updateMusicSheet){
+        if (updateMusicSheet == null || StringUtils.isEmpty(updateMusicSheet.getIds())){
+            throw new BizException("请选择曲目");
+        }
+        if (updateMusicSheet.getStatus() == null){
+            throw new BizException("请选择状态");
+        }
+        sysMusicScoreService.getDao().batchEnable(updateMusicSheet.getIds(),updateMusicSheet.getStatus());
+        return true;
+    }
+
+    public Boolean delApplicationExtend(CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtendDel musicSheetApplicationExtendDel){
+        if (musicSheetApplicationExtendDel == null || StringUtils.isEmpty(musicSheetApplicationExtendDel.getIds())){
+            throw new BizException("请选择曲目");
+        }
+        sysMusicScoreService.getDao().batchDel(musicSheetApplicationExtendDel.getIds());
+        return true;
+    }
+
+    public List<CbsMusicSheetTagWrapper.MusicSheetTag> tagList(CbsMusicSheetTagWrapper.MusicSheetTagQuery queryInfo){
+        return null;
+    }
+
+    public List<CbsMusicSheetCategoryWrapper.MusicSheetCategory> categoryList(CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery queryInfo){
+        return sysMusicScoreCategoriesService.getDao().categoryList(queryInfo);
+    }
+
+    public PageInfo<CbsMusicSheetExtendWrapper.MusicSheetExtend> ownerList(CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo){
+        IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> page = QueryInfo.getPage(queryInfo);
+        if (queryInfo.getSourceType() == null){
+            queryInfo.setSourceType(EMusicSourceType.PERSON);
+        }
+        if(queryInfo.getSourceType() == EMusicSourceType.PERSON){
+            return QueryInfo.pageInfo(sysUserTenantDao.personOwnerList(page, queryInfo));
+        }else {
+            return QueryInfo.pageInfo(sysUserTenantDao.orgOwnerList(page, queryInfo));
+        }
+    }
+
+    public boolean updateMusicSheet(CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate) {
+        sysMusicScoreService.getDao().updateMusicSheet(musicSheetUpdate);
+        return true;
+    }
+}

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

@@ -0,0 +1,65 @@
+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.Subject;
+import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
+import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
+import com.ym.mec.biz.service.SubjectService;
+import com.ym.mec.common.page.PageInfo;
+import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class CbsSubjectServiceImpl implements CbsSubjectService {
+
+    private static final Logger log = LoggerFactory.getLogger(CbsSubjectServiceImpl.class);
+
+    @Resource
+    private SubjectService subjectService;
+
+    public Boolean checkSubjectEnable(CbsSubjectApiWrapper.CheckSubjectDto checkSubjectDto) {
+        List<Subject> subjects = subjectService.getDao().queryCbsList(Lists.newArrayList(checkSubjectDto.getSubjectId().longValue()));
+        if (CollectionUtils.isNotEmpty(subjects)){
+            return true;
+        }
+        return false;
+    }
+
+    public List<CbsSubjectApiWrapper.Subject> list(CbsSubjectApiWrapper.SubjectQuery query) {
+        SubjectWrapper.SubjectQuery subjectQuery = new SubjectWrapper.SubjectQuery();
+        subjectQuery.setPage(1);
+        subjectQuery.setRows(999);
+        subjectQuery.setEnableFlag(query.getEnable());
+        List<Long> subjectIds = query.getSubjectIds();
+        if (CollectionUtils.isNotEmpty(subjectIds)) {
+            subjectQuery.setSubjectIds(subjectIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
+        }
+        PageInfo<SubjectWrapper.Subject> subjectPageInfo = subjectService.selectPage(subjectQuery);
+        Map<Integer, SubjectWrapper.Subject> subjectIdNameMap = subjectPageInfo.getRows().stream()
+                .collect(Collectors.toMap(SubjectWrapper.Subject::getId,o->o,(v1,v2)->v2));
+
+        List<CbsSubjectApiWrapper.Subject> subjects = subjectService.getDao().queryCbsSubjects(query);
+        for (CbsSubjectApiWrapper.Subject subject : subjects) {
+            if(subject.getCbsSubjectId() != null){
+                SubjectWrapper.Subject cbsSubject = subjectIdNameMap.get(subject.getSubjectId().intValue());
+                if (cbsSubject != null) {
+                    List<InstrumentWrapper.Instrument> instruments = cbsSubject.getInstruments();
+                    if (CollectionUtils.isNotEmpty(instruments)) {
+                        subject.setSubjectName(instruments.stream().map(InstrumentWrapper.Instrument::getName).collect(Collectors.joining(",")));
+                        subject.setInstrumentId(instruments.get(0).getId().longValue());
+                    }
+                }
+            }
+        }
+        return subjects;
+    }
+}

+ 219 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InstrumentServiceImpl.java

@@ -0,0 +1,219 @@
+package com.ym.mec.biz.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
+import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.microsvc.toolkit.common.webportal.exception.BizException;
+import com.ym.mec.biz.dal.dao.InstrumentDao;
+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.service.InstrumentService;
+import com.ym.mec.biz.service.SubjectService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * 乐器设置
+ * 2024-04-22 16:55:18
+ */
+@Slf4j
+@Service
+public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument> implements InstrumentService {
+
+    @Resource
+    private MusicFeignClientService musicFeignClientService;
+    @Resource
+    private SubjectService subjectService;
+
+    /**
+     * 查询详情
+     *
+     * @param id 详情ID
+     * @return Instrument
+     */
+    @Override
+    public Instrument detail(Integer id) {
+
+        return baseMapper.selectById(id);
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param page  IPage<Instrument>
+     * @param query InstrumentWrapper.InstrumentQuery
+     * @return IPage<Instrument>
+     */
+    @Override
+    public IPage<InstrumentWrapper.Instrument> selectPage(IPage<InstrumentWrapper.Instrument> page, InstrumentWrapper.InstrumentQuery query) {
+
+        IPage<InstrumentWrapper.Instrument> instrumentIPage = page.setRecords(baseMapper.selectPage(page, query));
+        List<InstrumentWrapper.Instrument> records = instrumentIPage.getRecords();
+        if (CollectionUtils.isEmpty(records)) {
+            return instrumentIPage;
+        }
+        List<InstrumentWrapper.Instrument> instruments = getInstruments(records.stream().map(InstrumentWrapper.Instrument::getId).distinct().collect(Collectors.toList()));
+        return instrumentIPage.setRecords(instruments);
+    }
+
+    /**
+     * 添加
+     *
+     * @param instrument InstrumentWrapper.Instrument
+     * @return Boolean
+     */
+    @Override
+    public Boolean add(InstrumentWrapper.Instrument instrument) {
+
+        return this.save(JSON.parseObject(instrument.jsonString(), Instrument.class));
+    }
+
+    /**
+     * 更新
+     *
+     * @param instrument InstrumentWrapper.Instrument
+     * @return Boolean
+     */
+    @Override
+    public Boolean update(InstrumentWrapper.Instrument instrument) {
+
+        return this.updateById(JSON.parseObject(instrument.jsonString(), Instrument.class));
+    }
+
+    @Override
+    public List<Instrument> queryBySubjectId(Integer subject) {
+        if (subject == null) {
+            return new ArrayList<>();
+        }
+        return this.lambdaQuery()
+            .eq(Instrument::getSubjectId, subject)
+            .list();
+    }
+
+    @Override
+    public Map<Integer, InstrumentWrapper.Instrument> getMapByIds(List<Integer> instrumentIdList) {
+        if (CollectionUtils.isEmpty(instrumentIdList)) {
+            return new HashMap<>();
+        }
+        instrumentIdList = instrumentIdList.stream().distinct().collect(Collectors.toList());
+        List<InstrumentWrapper.Instrument> instrumentList = getInstruments(instrumentIdList);
+        return instrumentList.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, Function.identity()));
+    }
+
+    @Override
+    public List<InstrumentWrapper.Instrument> getInstruments(List<Integer> instrumentIdList) {
+        instrumentIdList = instrumentIdList.stream().filter(Objects::nonNull).collect(Collectors.toList());
+        Map<Integer, Instrument> idImstrumentMap = this.lambdaQuery().in(Instrument::getId, instrumentIdList).list()
+            .stream().collect(Collectors.toMap(Instrument::getId, Function.identity()));
+        // 去内容平台查询乐器名称
+        CbsMusicalInstrumentWrapper.MusicalInstrumentQuery build = CbsMusicalInstrumentWrapper.MusicalInstrumentQuery.builder()
+            .rows(-1)
+            .ids(instrumentIdList)
+            .build();
+        List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> rows;
+        try {
+            rows = musicFeignClientService
+                .musicalInstrumentPage(build).feignData().getRows();
+        } catch (Exception e) {
+            throw new BizException("内容平台服务异常");
+        }
+        Map<Integer, CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> idMap = rows.stream().collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId,
+            Function.identity()));
+
+        List<InstrumentWrapper.Instrument> instrumentList = new ArrayList<>();
+        instrumentIdList.forEach(next -> {
+            CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto dto = idMap.get(next.intValue());
+            if (dto == null) {
+                return;
+            }
+            InstrumentWrapper.Instrument instrument = JSON.parseObject(JSON.toJSONString(dto), InstrumentWrapper.Instrument.class);
+            if (dto.getDefaultScore() != null) {
+                instrument.setDefaultScore(dto.getDefaultScore().name());
+            }
+            instrument.setId(next);
+
+            Instrument instrument1 = idImstrumentMap.getOrDefault(next, new Instrument());
+            instrument.setOrientation(instrument1.getOrientation());
+            instrument.setEnableFlag(instrument1.getEnableFlag());
+            instrument.setOperator(instrument1.getOperator());
+            instrument.setSubjectId(instrument1.getSubjectId());
+            instrumentList.add(instrument);
+        });
+        return instrumentList;
+    }
+
+    @Override
+    public Map<Integer, List<InstrumentWrapper.Instrument>> getGroupBySubjectId(List<Integer> subjectIds, Boolean enableFlag) {
+        if (CollectionUtils.isEmpty(subjectIds)) {
+            return new HashMap<>();
+        }
+        List<Instrument> list = this.lambdaQuery()
+            .in(Instrument::getSubjectId, subjectIds)
+            .eq(enableFlag != null, Instrument::getEnableFlag, enableFlag)
+            .list();
+        if (CollectionUtils.isEmpty(list)) {
+            return new HashMap<>();
+        }
+        // group
+        Map<Integer, List<Integer>> idResult = list.stream()
+            .collect(Collectors.groupingBy(Instrument::getSubjectId, LinkedHashMap::new,Collectors.mapping(Instrument::getId, Collectors.toList())));
+
+        // id 集合
+        List<Integer> instrumentIds = list.stream().map(Instrument::getId).collect(Collectors.toList());
+        Map<Integer, InstrumentWrapper.Instrument> instrumentMap = getMapByIds(instrumentIds);
+        Map<Integer, List<InstrumentWrapper.Instrument>> result = new HashMap<>();
+        idResult.forEach((k,v)->{
+            List<InstrumentWrapper.Instrument> instruments = v.stream().map(instrumentMap::get).collect(Collectors.toList());
+            result.put(k, instruments);
+        });
+        return result;
+
+    }
+
+    @Override
+    public List<InstrumentWrapper.Instrument> getList(InstrumentWrapper.InstrumentQuery query) {
+
+        IPage<InstrumentWrapper.Instrument> instrumentIPage = this.selectPage(new Page<>(1, -1), query);
+        return instrumentIPage.getRecords();
+    }
+
+    @Override
+    public List<Integer> getInstrumentIdsBySubjectId(Integer subjectId) {
+        List<Instrument> list = this.lambdaQuery()
+            .eq(Instrument::getSubjectId, subjectId)
+            .list();
+        if (CollectionUtils.isEmpty(list)) {
+            return new ArrayList<>();
+        }
+        return list.stream().map(Instrument::getId).collect(Collectors.toList());
+    }
+
+    @Override
+    @Transactional
+    public void modify(InstrumentWrapper.Update update) {
+        Instrument instrument = JSON.parseObject(JSON.toJSONString(update), Instrument.class);
+
+        this.updateById(instrument);
+
+        if (update.getEnableFlag() != null && update.getEnableFlag()) {
+            // 启用声部
+            Instrument entity = this.getById(update.getId());
+            if (entity == null) {
+                return;
+            }
+            Subject subject = subjectService.get(entity.getSubjectId());
+            subjectService.getDao().update(subject);
+        }
+    }
+}

+ 128 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java

@@ -1,5 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
+import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
+import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.dao.SubjectGoodsMapperDao;
@@ -7,17 +10,23 @@ import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.StudentSubjectDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
+import com.ym.mec.biz.dal.entity.Instrument;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.SubjectQueryInfo;
+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.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
@@ -35,6 +44,10 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     private StudentRegistrationDao studentRegistrationDao;
     @Resource
     private SubjectGoodsMapperDao subjectGoodsMapperDao;
+    @Resource
+    private InstrumentService instrumentService;
+    @Resource
+    private MusicFeignClientService musicFeignClientService;
 
     @Override
     public BaseDAO<Integer, Subject> getDAO() {
@@ -87,9 +100,11 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void upSetSubject(Subject subject) {
         if (subject.getDelFlag() == YesOrNoEnum.YES) {
             subjectDao.delete(subject.getId());
+            instrumentService.lambdaUpdate().eq(Instrument::getSubjectId, subject.getId()).remove();
             return;
         }
         Integer parentId = upset(subject, null);
@@ -111,9 +126,28 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
         } else {
             subjectDao.insert(subject);
         }
+        //保存乐器关联
+        this.saveInstrument(subject);
         return subject.getId();
     }
 
+    private void saveInstrument(Subject subject) {
+        if (StringUtils.isNotEmpty(subject.getInstrumentIds())) {
+            instrumentService.lambdaUpdate().eq(Instrument::getSubjectId, subject.getId()).remove();
+            List<Instrument> instruments = new ArrayList<>();
+            String[] split = subject.getInstrumentIds().split(",");
+            for (String s : split) {
+                Instrument instrument = new Instrument();
+                instrument.setSubjectId(subject.getId());
+                instrument.setId(Integer.valueOf(s));
+                instrument.setEnableFlag(true);
+                instrument.setDelFlag(false);
+                instruments.add(instrument);
+            }
+            instrumentService.saveBatch(instruments);
+        }
+    }
+
     @Override
     public void markGoods(List<SubjectGoodsMapper> subjectGoodsMappers) {
         subjectGoodsMappers.forEach(e -> {
@@ -212,6 +246,39 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = subjectDao.queryPageByIdOrName(params);
+            List<Integer> subjectIds = dataList.stream().map(Subject::getId).collect(Collectors.toList());
+            List<Instrument> list = instrumentService.lambdaQuery().in(Instrument::getSubjectId, subjectIds).list();
+            Map<Integer, List<Instrument>> groupBySubjectId = list.stream().collect(Collectors.groupingBy(Instrument::getSubjectId));
+            List<Integer> instrumentIds = list.stream().map(Instrument::getId).collect(Collectors.toList());
+            CbsMusicalInstrumentWrapper.MusicalInstrumentQuery query = new CbsMusicalInstrumentWrapper.MusicalInstrumentQuery();
+            query.setIds(instrumentIds);
+            query.setPage(1);
+            query.setRows(instrumentIds.size());
+            R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto>> infoR =
+                    musicFeignClientService.musicalInstrumentPage(query);
+            if (infoR.getCode() != 200){
+                throw new BizException("调用内容平台失败 : {}",infoR.getMessage());
+            }
+            List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> rows = infoR.getData().getRows();
+            Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> map = rows.stream()
+                    .collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId, Function.identity()));
+            for (Subject subject : dataList) {
+                List<Instrument> instruments = groupBySubjectId.get(subject.getId());
+                if(!CollectionUtils.isEmpty(instruments)){
+                    subject.setInstrumentIds(instruments.stream().map(Instrument::getId).map(String::valueOf).collect(Collectors.joining(",")));
+                    StringBuffer sb  = new StringBuffer();
+                    for (Instrument instrument : instruments) {
+                        CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto dto = map.get(instrument.getId());
+                        if (dto != null) {
+                            if(sb.length() > 0){
+                                sb.append(",");
+                            }
+                            sb.append(dto.getName());
+                        }
+                    }
+                    subject.setInstrumentName(sb.toString());
+                }
+            }
         }
         if (count == 0) {
             dataList = new ArrayList<>();
@@ -252,4 +319,65 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
         }
         return map;
     }
+
+    @Override
+    public List<SubjectWrapper.Subject> queryList(SubjectWrapper.SubjectQuery query) {
+        query.setPage(1);
+        query.setRows(9999);
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, query);
+
+        PageInfo<SubjectWrapper.Subject> subjectIPage = this.selectPage(query);
+        List<SubjectWrapper.Subject> records = subjectIPage.getRows();
+        if (CollectionUtils.isEmpty(records)) {
+            return records;
+        }
+        String instrumentIds = query.getInstrumentIds();
+        List<Integer> instrumentIdList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(instrumentIds)) {
+            List<Integer> collect = Arrays.stream(instrumentIds.split(",")).map(Integer::valueOf).distinct().collect(Collectors.toList());
+            instrumentIdList.addAll(collect);
+        }
+        if (!instrumentIdList.isEmpty()) {
+            records.forEach(record -> {
+                List<InstrumentWrapper.Instrument> instruments = record.getInstruments();
+                instruments.removeIf(next -> !instrumentIdList.contains(next.getId()));
+            });
+        }
+        return records;
+    }
+
+    @Override
+    public PageInfo<SubjectWrapper.Subject> selectPage(SubjectWrapper.SubjectQuery query) {
+        PageInfo<SubjectWrapper.Subject> pageInfo = new PageInfo<>(query.getPage(), query.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, query);
+
+        List<SubjectWrapper.Subject> dataList = null;
+        int count = subjectDao.findCount(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = subjectDao.findPage(params);
+            // 设置声部下的乐器信息
+            List<Integer> subjectIds = dataList.stream().map(SubjectWrapper.Subject::getId).distinct().collect(Collectors.toList());
+            Map<Integer, List<InstrumentWrapper.Instrument>> groupBySubjectId = instrumentService.getGroupBySubjectId(subjectIds, query.getEnableFlag());
+            Map<Integer, Subject> map = this.findBySubjectByIdList(dataList.stream().map(SubjectWrapper.Subject::getParentSubjectId).collect(Collectors.toList())).stream()
+                    .collect(Collectors.toMap(Subject::getId, t -> t));
+            dataList.forEach(e -> {
+                if(e.getParentSubjectId() != null && e.getParentSubjectId() > 0) {
+                    e.setParentSubjectName(map.get(e.getParentSubjectId()).getName());
+                }
+                List<InstrumentWrapper.Instrument> instruments = groupBySubjectId.get(e.getId());
+                if (org.apache.commons.collections.CollectionUtils.isNotEmpty(instruments)) {
+                    e.setInstruments(instruments);
+                }
+            });
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 }

+ 95 - 23
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreAccompanimentServiceImpl.java

@@ -1,38 +1,43 @@
 package com.ym.mec.biz.service.impl;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
 import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
 import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
 import com.ym.mec.biz.dal.entity.Subject;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
 import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
+import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 @Service
 public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integer, SysMusicScoreAccompaniment> implements SysMusicScoreAccompanimentService {
 	
-	@Autowired
+	@Resource
 	private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
-	@Autowired
+	@Resource
 	private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
-
+	@Resource
+	private SysMusicScoreService sysMusicScoreService;
 	@Override
 	public BaseDAO<Integer, SysMusicScoreAccompaniment> getDAO() {
 		return sysMusicScoreAccompanimentDao;
@@ -47,7 +52,7 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
 		List<Integer> idList = new ArrayList<>();
 		idList.add(accompaniment.getId());
 		List<Integer> subjectIds = sysMusicScoreAccompanimentDao.findSubjectByMusicScoreId(accompaniment.getExamSongId(),idList);
-		if(subjectIds.size() > 0 && subjectIds.contains(accompaniment.getId())){
+		if(CollectionUtils.isNotEmpty(subjectIds) && subjectIds.contains(accompaniment.getId())){
 			throw new BizException("操作失败:请勿提交重复的伴奏声部");
 		}
 		sysMusicScoreAccompanimentDao.update(sysMusicScoreAccompaniment);
@@ -57,7 +62,75 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
 	public List<SysMusicScoreAccompaniment> queryAll(SysExamSongQueryInfo queryInfo) {
 		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
-		return sysMusicScoreAccompanimentDao.queryPage(params);
+		return this.initAccompaniment(sysMusicScoreAccompanimentDao.queryPage(params));
+	}
+
+	public List<SysMusicScoreAccompaniment> initAccompaniment(List<SysMusicScoreAccompaniment> accompaniments){
+		List<SysMusicScoreAccompaniment> result = new ArrayList<>();
+		if(CollectionUtils.isEmpty(accompaniments)){
+			return result;
+		}
+		long count = accompaniments.stream().filter(e -> e.getCbsMusicSheetId() != null).count();
+		if(count == 0){
+			return result;
+		}
+		List<String> cbsMusicSheetIds = accompaniments.stream().map(SysMusicScoreAccompaniment::getCbsMusicSheetId)
+				.filter(StringUtils::isNotEmpty).collect(Collectors.toList());
+		List<CbsMusicSheetWrapper.MusicSheetApplication> applications = sysMusicScoreService.queryCbsMusicSheetApplication(cbsMusicSheetIds);
+		if (CollectionUtils.isEmpty(applications)) {
+			throw new BizException("获取曲目信息失败");
+		}
+		Map<String, CbsMusicSheetWrapper.MusicSheetApplication> applicationMap = applications.stream().collect(Collectors.toMap(e->e.getId().toString(), Function.identity()));
+		for (SysMusicScoreAccompaniment accompaniment : accompaniments) {
+			if(accompaniment.getCbsMusicSheetId() == null){
+				result.add(accompaniment);
+				continue;
+			}
+			CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = applicationMap.get(accompaniment.getCbsMusicSheetId());
+			if (musicSheetApplication == null) {
+				throw new BizException("曲目信息不存在,曲目ID:" + accompaniment.getCbsMusicSheetId());
+			}
+			if(CollectionUtils.isEmpty(musicSheetApplication.getMusicSheetSoundList())){
+				throw new BizException("曲目原音信息不存在,曲目ID:" + accompaniment.getCbsMusicSheetId());
+			}
+			List<SysMusicScoreAccompaniment> childAccompaniments = new ArrayList<>();
+			for (int i = 0; i < musicSheetApplication.getMusicSheetSoundList().size(); i++) {
+				SysMusicScoreAccompaniment record = new SysMusicScoreAccompaniment();
+				record.setId(accompaniment.getId());
+				record.setType(accompaniment.getType());
+				record.setRankIds("FREE".equals(musicSheetApplication.getPaymentType()) ? "1" : null);
+				record.setClientType(accompaniment.getClientType());
+				record.setExamSongId(accompaniment.getExamSongId());
+				record.setCbsMusicSheetId(musicSheetApplication.getId().toString());
+				record.setPlayMode(SysMusicScore.PlayMode.valueOf(musicSheetApplication.getPlayMode().getCode()));
+				record.setExtConfigJson(musicSheetApplication.getExtConfigJson());
+				record.setSubjectId(accompaniment.getSubjectId());
+				record.setExtStyleConfigJson(musicSheetApplication.getExtStyleConfigJson());
+				if(musicSheetApplication.getMusicSheetCategoryId() != null){
+					record.setCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
+				}
+				record.setExamSongName(musicSheetApplication.getName());
+				record.setCategoriesName(musicSheetApplication.getMusicSheetCategoryName());
+				record.setSpeed(musicSheetApplication.getPlaySpeed());
+				List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = musicSheetApplication.getMusicSheetAccompanimentList();
+				if (CollectionUtils.isNotEmpty(accompanimentList)) {
+					record.setMetronomeUrl(accompanimentList.get(0).getAudioFileUrl());
+				}
+				CbsMusicSheetWrapper.MusicSheetSound sound = musicSheetApplication.getMusicSheetSoundList().get(i);
+				record.setMp3Url(sound.getAudioFileUrl());
+				record.setMetronomeMp3Url(sound.getAudioFileUrl());
+				record.setTrack(sound.getTrack());
+				record.setSubjectName(sound.getTrack());
+				record.setXmlUrl(musicSheetApplication.getXmlFileUrl());
+				record.setMidiUrl(musicSheetApplication.getMidiFileUrl());
+				record.setEnableEvaluation(musicSheetApplication.getIsEvaluated());
+				record.setIsOpenMetronome(musicSheetApplication.getIsUseSystemBeat() && musicSheetApplication.getIsPlayBeat());
+				record.setIsShowFingering(musicSheetApplication.getIsShowFingering());
+				childAccompaniments.add(record);
+			}
+			result.addAll(childAccompaniments);
+		}
+		return result;
 	}
 
 	@Override
@@ -73,8 +146,8 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
 			musicScoreQueryInfo.setEnable(queryInfo.getEnable());
 			musicScoreQueryInfo.setOrganId(queryInfo.getOrganId());
 			List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesService.queryTree(musicScoreQueryInfo);
-			if(scoreCategories.size() > 0){
-				categoriesIdList = scoreCategories.stream().map(e->e.getId()).collect(Collectors.toList());
+			if(CollectionUtils.isNotEmpty(scoreCategories)){
+				categoriesIdList = scoreCategories.stream().map(SysMusicScoreCategories::getId).collect(Collectors.toList());
 			}else {
 				categoriesIdList.add(categoriesId);
 			}
@@ -90,7 +163,7 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
                 }
             }
         }
-        return sysMusicScoreAccompaniments;
+        return this.initAccompaniment(sysMusicScoreAccompaniments);
     }
 
 	@Override
@@ -100,15 +173,14 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
 			MusicScoreQueryInfo musicScoreQueryInfo = new MusicScoreQueryInfo();
 			musicScoreQueryInfo.setParentId(categoriesId);
 			List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesService.queryTree(musicScoreQueryInfo);
-			if(scoreCategories.size() > 0){
-				List<SysMusicScoreCategories> allScoreCategories = new ArrayList<>();
-				allScoreCategories.addAll(scoreCategories);
+			if(CollectionUtils.isNotEmpty(scoreCategories)){
+                List<SysMusicScoreCategories> allScoreCategories = new ArrayList<>(scoreCategories);
 				for (SysMusicScoreCategories scoreCategory : scoreCategories) {
 					if(scoreCategory.getSysMusicScoreCategoriesList() != null){
 						allScoreCategories.addAll(scoreCategory.getSysMusicScoreCategoriesList());
 					}
 				}
-				categoriesIdList = allScoreCategories.stream().map(e->e.getId()).collect(Collectors.toList());
+				categoriesIdList = allScoreCategories.stream().map(SysMusicScoreCategories::getId).collect(Collectors.toList());
 			}else {
 				categoriesIdList.add(categoriesId);
 			}
@@ -156,7 +228,7 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
     
     private void getAllCategoryIdList(List<Integer> categoryIdList, List<SysMusicScoreCategories> sysMusicScoreCategoriesList){
     	
-    	if(sysMusicScoreCategoriesList != null && sysMusicScoreCategoriesList.size() > 0){
+    	if(CollectionUtils.isNotEmpty(sysMusicScoreCategoriesList)){
     		for(SysMusicScoreCategories sysMusicScoreCategories : sysMusicScoreCategoriesList){
     			categoryIdList.add(sysMusicScoreCategories.getId());
     			getAllCategoryIdList(categoryIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java

@@ -34,7 +34,12 @@ public class SysMusicScoreCategoriesServiceImpl extends BaseServiceImpl<Integer,
 	}
 
 
-	@Override
+    @Override
+    public SysMusicScoreCategoriesDao getDao() {
+		return sysMusicScoreCategoriesDao;
+    }
+
+    @Override
 	public List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo) {
 		List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesDao.findByParentId(menuQueryInfo.getParentId(),menuQueryInfo.getSearch(),menuQueryInfo.getEnable());
 		List<SysMusicScoreCategories> scoreCategoriesAllList = sysMusicScoreCategoriesDao.findByParentId(null,menuQueryInfo.getSearch(),menuQueryInfo.getEnable());

+ 389 - 331
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -1,77 +1,70 @@
 package com.ym.mec.biz.service.impl;
 
 
-import static com.ym.mec.biz.dal.enums.ClientTypeEnum.SMART_PRACTICE;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod;
-import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
-import com.ym.mec.biz.dal.entity.SysMusicScoreChangeLog;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.UploadFileService;
-import com.ym.mec.common.entity.UploadReturnBean;
-import com.ym.mec.common.service.IdGeneratorService;
-import com.ym.mec.util.file.FileUtil;
-import com.ym.mec.util.shell.ScriptUtil;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
-import com.ym.mec.biz.dal.entity.SysMusicScore;
-import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
-import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
+import com.beust.jcommander.internal.Lists;
+import com.dayaedu.cbs.common.enums.EClientType;
+import com.dayaedu.cbs.common.enums.music.EAudioType;
+import com.dayaedu.cbs.common.enums.music.EMusicAvailableType;
+import com.dayaedu.cbs.common.enums.music.EMusicPlayMode;
+import com.dayaedu.cbs.common.enums.music.EMusicSourceType;
+import com.dayaedu.cbs.common.enums.school.EMusicSheetType;
+import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendClientWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.microsvc.toolkit.common.response.template.R;
+import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
+import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
+import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
+import com.ym.mec.biz.dal.dto.ReasonDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
-import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 @Service
+@Slf4j
 public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicScore> implements SysMusicScoreService {
 
-    @Autowired
+    @Resource
     private SysMusicScoreDao sysMusicScoreDao;
-    @Autowired
-    private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
+    @Resource
     private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
-    @Autowired
-    private SubjectDao subjectDao;
-    @Autowired
+    @Resource
     private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
-    @Autowired
-    private SysMusicScoreChangeLogDao sysMusicScoreChangeLogDao;
-    @Autowired
-    private IdGeneratorService idGeneratorService;
-    @Autowired
-    private UploadFileService uploadFileService;
-    @Autowired
+    @Resource
     private OrganizationService organizationService;
+    @Resource
+    private SubjectService subjectService;
+    @Resource
+    private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
+    @Resource
+    private MusicFeignClientService musicFeignClientService;
+    @Resource
+    private InstrumentService instrumentService;
+
+    @Value("${openfeign-client.app-id:1745637981387108354}")
+    public Long applicationId;
 
     @Override
     public BaseDAO<Integer, SysMusicScore> getDAO() {
@@ -79,98 +72,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void updateMusicScore(MusicScoreDto musicScoreDto) {
-        SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScoreDao.update(sysMusicScore);
-        List<Integer> delExamSongAccompanimentIds = musicScoreDto.getDelExamSongAccompanimentIds();
-        if (delExamSongAccompanimentIds != null && delExamSongAccompanimentIds.size() > 0) {
-            sysMusicScoreAccompanimentDao.batchDel(delExamSongAccompanimentIds);
-        }
-        List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
-        if (sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0) {
-            List<Integer> subjectIdList = sysMusicScoreAccompaniments.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
-            subjectIdList.removeAll(Collections.singleton(null));
-
-            if (subjectIdList.size() > 0) {
-                List<Integer> idList = sysMusicScoreAccompaniments.stream().map(e -> e.getId()).collect(Collectors.toList());
-                List<Integer> subjectIds = sysMusicScoreAccompanimentDao.findSubjectByMusicScoreId(sysMusicScore.getId(), idList);
-                int subjectSize = subjectIds.size() + subjectIdList.size();
-                subjectIdList.addAll(subjectIds);
-                int size = new HashSet<>(subjectIdList).size();
-                if (size < subjectSize && !musicScoreDto.getMultitrack()) {
-                    throw new BizException("操作失败:请勿提交重复的伴奏声部");
-                }
-            }
-            //获取需要修改的伴奏
-            List<SysMusicScoreAccompaniment> updateCollect = sysMusicScoreAccompaniments.stream().filter(e -> e.getId() != null).collect(Collectors.toList());
-            if (updateCollect.size() > 0) {
-                sysMusicScoreAccompanimentDao.batchUpdate(updateCollect, sysMusicScore.getIsOpenMetronome());
-            }
-            //获取需要新增的伴奏
-            List<SysMusicScoreAccompaniment> addCollect = sysMusicScoreAccompaniments.stream().filter(e -> e.getId() == null).collect(Collectors.toList());
-            if (addCollect.size() > 0) {
-                sysMusicScoreAccompanimentDao.batchInsert(addCollect, sysMusicScore.getId(), sysMusicScore.getIsOpenMetronome());
-            }
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void add(MusicScoreDto musicScoreDto) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("请登录");
-        }
-        SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScore.setCreateUserId(sysUser.getId());
-        sysMusicScoreDao.insert(sysMusicScore);
-        List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
-        if (sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0) {
-            sysMusicScoreAccompaniments.forEach(e -> {
-                e.setIsOpenMetronome(sysMusicScore.getIsOpenMetronome());
-            });
-            sysMusicScoreAccompanimentDao.batchInsert(sysMusicScoreAccompaniments, sysMusicScore.getId(), sysMusicScore.getIsOpenMetronome());
-        }
-        Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
-        if (categoriesId != null && sysMusicScore.getClientType() == SMART_PRACTICE) {
-            while (true) {
-                SysMusicScoreCategories categories = sysMusicScoreCategoriesDao.get(categoriesId);
-                if (categories.getParentId() == 0) {
-                    categories.setMusicScoreNum(categories.getMusicScoreNum() + 1);
-                    sysMusicScoreCategoriesDao.update(categories);
-                    return;
-                }
-                categoriesId = categories.getParentId();
-            }
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void del(Integer id) {
-        SysMusicScore sysMusicScore = sysMusicScoreDao.get(id);
-        if (sysMusicScore == null) {
-            throw new BizException("曲目不存在");
-        }
-        sysMusicScoreDao.delete(id);
-        sysMusicScoreAccompanimentDao.deleteBySongId(id);
-        Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
-        if (categoriesId != null && sysMusicScore.getClientType() == SMART_PRACTICE) {
-            while (true) {
-                SysMusicScoreCategories categories = sysMusicScoreCategoriesDao.get(categoriesId);
-                if (categories.getParentId() == 0) {
-                    Integer musicScoreNum = categories.getMusicScoreNum() - 1;
-                    if (musicScoreNum < 0) {
-                        musicScoreNum = 0;
-                    }
-                    categories.setMusicScoreNum(musicScoreNum);
-                    sysMusicScoreCategoriesDao.update(categories);
-                    return;
-                }
-                categoriesId = categories.getParentId();
-            }
-        }
+    public SysMusicScoreDao getDao() {
+        return sysMusicScoreDao;
     }
 
     private String getParentTreeName(Integer categoriesId) {
@@ -190,56 +93,143 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         }
     }
 
-    private void dealMusicScoreParam(SysExamSongQueryInfo queryInfo){
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
-        if(queryInfo.getCategoriesId() != null){
-            List<Integer> categoriesIdList = new ArrayList<>();
-            Integer categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
+    @Override
+    public List<CbsMusicSheetWrapper.MusicSheetApplication> queryCbsMusicSheetApplication(List<String> cbsMusicSheetIds){
+        CbsMusicSheetWrapper.MusicSheetApplicationQuery query = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
+        query.setMusicSheetIds(cbsMusicSheetIds.stream().map(Long::parseLong).collect(Collectors.toList()));
+        query.setDetailFlag(true);
+        query.setDelFlag(true);
+        query.setPage(1);
+        query.setRows(cbsMusicSheetIds.size());
+        query.setApplicationId(applicationId);
+        R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> pageInfoR =
+                musicFeignClientService.musicSheetPageByApplication(query);
+        if(pageInfoR.getCode() != 200){
+            throw new BizException("获取曲目信息失败");
+        }
+        com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplication> pageInfo = pageInfoR.getData();
+        if(pageInfo != null && CollectionUtils.isNotEmpty(pageInfo.getRows())){
+            return pageInfo.getRows();
+        }
+        return new ArrayList<>();
+    }
 
-            SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
+    //获取乐器名称
+    @Override
+    public List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> queryMusicalInstrument(List<Integer> musicalInstrumentIds){
+        //获取乐器名称
+        CbsMusicalInstrumentWrapper.MusicalInstrumentQuery musicalInstrumentQuery = new CbsMusicalInstrumentWrapper.MusicalInstrumentQuery();
+        musicalInstrumentQuery.setIds(musicalInstrumentIds);
+        musicalInstrumentQuery.setPage(1);
+        musicalInstrumentQuery.setRows(musicalInstrumentIds.size());
+        R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto>> infoR = musicFeignClientService.musicalInstrumentPage(musicalInstrumentQuery);
+        if(infoR.getCode() != 200){
+            throw new com.microsvc.toolkit.common.webportal.exception.BizException("获取乐器信息失败,{}",infoR.getMessage());
+        }
+        return infoR.getData().getRows();
+    }
 
-            if(sysMusicScoreCategories == null){
-                throw new BizException("分类找不到");
+    private void dealMusicScoreData(List<SysMusicScore> records){
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<String> cbsMusicSheetIds = records.stream().map(SysMusicScore::getCbsMusicSheetId).collect(Collectors.toList());
+            List<CbsMusicSheetWrapper.MusicSheetApplication> applications = this.queryCbsMusicSheetApplication(cbsMusicSheetIds);
+            if(CollectionUtils.isNotEmpty(applications)){
+                Set<Integer> categoriesIds = records.stream().map(SysMusicScore::getMusicScoreCategoriesId).collect(Collectors.toSet());
+                //获取分部列表
+                Map<Integer, String> organMap = MapUtil.convertMybatisMap(sysMusicScoreCategoriesDao.queryOrganByIds(categoriesIds));
+                Map<Integer, String> map = new HashMap<>(categoriesIds.size());
+                for (Integer categoriesId : categoriesIds) {
+                    if(null != categoriesId){
+                        map.put(categoriesId, getParentTreeName(categoriesId));
+                    }
+                }
+                Map<Long, CbsMusicSheetWrapper.MusicSheetApplication> musicSheetApplicationMap = applications
+                        .stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
+
+                //获取乐器名称
+                String instrumentIds = applications.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getMusicalInstrumentIds).collect(Collectors.joining(","));
+                List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryDtos =
+                        this.queryMusicalInstrument(Arrays.stream(instrumentIds.split(",")).map(Integer::parseInt).distinct().collect(Collectors.toList()));
+                Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap = musicalInstrumentQueryDtos.stream()
+                        .collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId, o -> o, (o1, o2) -> o1));
+                //获取分类名称
+                Map<Integer, String> categoriesMap = new HashMap<>(categoriesIds.size());
+                for (Integer categoriesId : categoriesIds) {
+                    if(null != categoriesId){
+                        categoriesMap.put(categoriesId, getParentTreeName(categoriesId));
+                    }
+                }
+                for (SysMusicScore record : records) {
+                    record.setCategoriesName(map.get(record.getMusicScoreCategoriesId()));
+                    record.setOrganName(organMap.get(record.getMusicScoreCategoriesId()));
+                    CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = musicSheetApplicationMap.get(Long.parseLong(record.getCbsMusicSheetId()));
+                    if(musicSheetApplication != null){
+                        this.initMusicSheetVo(record,musicSheetApplication,musicalInstrumentQueryMap,categoriesMap);
+                    }
+                }
             }
-            categoriesIdList.add(categoriesId);
-            sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
-            getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
-
-            queryInfo.setCategoriesIdList(categoriesIdList);
         }
     }
 
-    private void dealMusicScoreData(List<SysMusicScore> rows){
-        if (rows != null && rows.size() > 0) {
-            Set<Integer> categoriesIds = rows.stream().map(e -> e.getMusicScoreCategoriesId()).collect(Collectors.toSet());
-            //获取分部列表
-            Map<Integer, String> organMap = MapUtil.convertMybatisMap(sysMusicScoreCategoriesDao.queryOrganByIds(categoriesIds));
-            //获取声部列表
-            Set<Integer> subjectIds = rows.stream().map(e -> e.getSubjectId()).collect(Collectors.toSet());
-            subjectIds.removeAll(Collections.singleton(null));
-            Map<Long, String> subjectMap = new HashMap();
-            if (subjectIds.size() > 0) {
-                String ids = StringUtils.join(subjectIds, ",");
-                subjectMap = MapUtil.convertMybatisMap(subjectDao.findBySubjecIds(ids));
-            }
-            Map<Integer, String> map = new HashMap<>(categoriesIds.size());
-            for (Integer categoriesId : categoriesIds) {
-                if(null != categoriesId){
-                    map.put(categoriesId, getParentTreeName(categoriesId));
+    public void initMusicSheetVo(SysMusicScore record,CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication
+            ,Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap,Map<Integer, String> categoriesMap){
+        record.setRankIds(StringUtils.equals("FREE",musicSheetApplication.getPaymentType()) ? "" : "1");
+        record.setCbsMusicSheetId(musicSheetApplication.getId().toString());
+        record.setPlayMode(SysMusicScore.PlayMode.valueOf(musicSheetApplication.getPlayMode().getCode()));
+        record.setExtConfigJson(musicSheetApplication.getExtConfigJson());
+        record.setExtStyleConfigJson(musicSheetApplication.getExtStyleConfigJson());
+        if(musicSheetApplication.getMusicSheetCategoryId() != null){
+            record.setMusicScoreCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
+            record.setCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
+        }
+        record.setName(musicSheetApplication.getName());
+        if(musicSheetApplication.getMusicSheetCategoryId() != null){
+            record.setCategoriesName(categoriesMap.get(musicSheetApplication.getMusicSheetCategoryId().intValue()));
+        }
+        record.setSpeed(musicSheetApplication.getPlaySpeed());
+        List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = musicSheetApplication.getMusicSheetAccompanimentList();
+        if (CollectionUtils.isNotEmpty(accompanimentList)) {
+            record.setMetronomeUrl(accompanimentList.get(0).getAudioFileUrl());
+            record.setUrl(accompanimentList.get(0).getAudioFileUrl());
+        }
+        List<CbsMusicSheetWrapper.MusicSheetSound> soundList = musicSheetApplication.getMusicSheetSoundList();
+        if (CollectionUtils.isNotEmpty(soundList)) {
+            record.setAccompanimentMetronomeUrl(soundList.get(0).getAudioFileUrl());
+            record.setAccompanimentUrl(soundList.get(0).getAudioFileUrl());
+        }
+        record.setXmlUrl(musicSheetApplication.getXmlFileUrl());
+        record.setMidiUrl(musicSheetApplication.getMidiFileUrl());
+        record.setOrder(musicSheetApplication.getSortNo());
+        record.setEnableEvaluation(musicSheetApplication.getIsEvaluated());
+        record.setIsOpenMetronome(musicSheetApplication.getIsUseSystemBeat() && musicSheetApplication.getIsPlayBeat());
+        if(musicSheetApplication.getMusicSheetType() == EMusicSheetType.CONCERT){
+            record.setSubjectName("");
+        }else {
+            if(StringUtils.isNotEmpty(musicSheetApplication.getMusicalInstrumentIds())){
+                String[] split = musicSheetApplication.getMusicalInstrumentIds().split(",");
+                for (String s : split) {
+                    StringBuffer sb = new StringBuffer();
+                    CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto musicalInstrumentQueryDto = musicalInstrumentQueryMap.get(Integer.parseInt(s));
+                    if(Objects.nonNull(musicalInstrumentQueryDto)){
+                        if(sb.length() > 0){
+                            sb.append(",");
+                        }
+                        sb.append(musicalInstrumentQueryDto.getName());
+                    }
+                    record.setSubjectName(sb.toString());
                 }
             }
-            for (SysMusicScore row : rows) {
-                row.setCategoriesName(map.get(row.getMusicScoreCategoriesId()));
-                row.setOrganName(organMap.get(row.getMusicScoreCategoriesId()));
-                row.setSubjectName(subjectMap.get(row.getSubjectId()));
-            }
         }
     }
 
     @Override
     public List<SysMusicScore> queryMusicScoreAll(SysExamSongQueryInfo queryInfo) {
         //封装查询参数
-        dealMusicScoreParam(queryInfo);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        if(queryInfo.getSubjectId() != null){
+            queryInfo.setSubjectIds(queryInfo.getSubjectId().toString());
+        }
+        this.initCategoryIds(queryInfo);
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
 
@@ -252,7 +242,11 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     @Override
     public PageInfo<SysMusicScore> queryMusicScorePage(SysExamSongQueryInfo queryInfo) {
         //封装查询参数
-        dealMusicScoreParam(queryInfo);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        if(queryInfo.getSubjectId() != null){
+            queryInfo.setSubjectIds(queryInfo.getSubjectId().toString());
+        }
+        this.initCategoryIds(queryInfo);
 
         PageInfo<SysMusicScore> sysMusicScorePageInfo = queryPage(queryInfo);
         List<SysMusicScore> rows = sysMusicScorePageInfo.getRows();
@@ -261,19 +255,14 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         return sysMusicScorePageInfo;
     }
 
-    @Override
-    public PageInfo<SysMusicScore> queryMusicScorePageInfo(SysExamSongQueryInfo queryInfo) {
-        if (queryInfo.getCategoriesId() != null) {
+    private void initCategoryIds(SysExamSongQueryInfo queryInfo){
+        if(StringUtils.isNotEmpty(queryInfo.getCategoriesId())){
             List<Integer> categoriesIdList = new ArrayList<>();
-            Integer categoriesId = null;
-            if (StringUtils.isNotEmpty(queryInfo.getCategoriesId())) {
-                categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
-            }
-            //List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesService.queryTree(musicScoreQueryInfo);
+            Integer categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
 
             SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
 
-            if (sysMusicScoreCategories == null) {
+            if(sysMusicScoreCategories == null){
                 throw new BizException("分类找不到");
             }
             categoriesIdList.add(categoriesId);
@@ -281,93 +270,31 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
             getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
 
             queryInfo.setCategoriesIdList(categoriesIdList);
-        }else {
-            if(queryInfo.getCategoriesId() == null){
-                return new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-            }
         }
-        return this.queryPage(queryInfo);
     }
 
-    @Override
-    public void transcod(Integer sysMusicScoreId) {
-        SysMusicScoreTranscod obj = sysMusicScoreDao.getTranscod(sysMusicScoreId);
-        if (obj == null) {
-            throw new BizException("曲目信息不存在");
-        }
-        List<SysMusicScoreMetronomeTranscod> metronomeTranscod = sysMusicScoreDao.getMetronomeTranscod(sysMusicScoreId);
-        obj.setAccompanimentList(metronomeTranscod);
-        //
-        String old = JSONObject.toJSONString(obj);
-        boolean flag = false;
-        String url = doTranscod(obj.getUrl());
-        if (StringUtils.isNotEmpty(url)) {
-            obj.setUrl(url);
-            flag = true;
-        }
-        String metronomeUrl = doTranscod(obj.getMetronomeUrl());
-        if (StringUtils.isNotEmpty(metronomeUrl)) {
-            obj.setMetronomeUrl(metronomeUrl);
-            flag = true;
-        }
-        if (flag) {
-            //更新obj
-            SysMusicScore sysMusicScore = new SysMusicScore();
-            sysMusicScore.setId(obj.getId());
-            sysMusicScore.setUrl(obj.getUrl());
-            sysMusicScore.setMetronomeUrl(obj.getMetronomeUrl());
-            sysMusicScoreDao.update(sysMusicScore);
-        }
 
-        for (SysMusicScoreMetronomeTranscod o : metronomeTranscod) {
-            Boolean subFlag = false;
-            String mp3Url = doTranscod(o.getMp3Url());
-            if (StringUtils.isNotEmpty(mp3Url)) {
-                o.setMp3Url(mp3Url);
-                flag = true;
-                subFlag = true;
-            }
-            String metronomeMp3Url = doTranscod(o.getMetronomeMp3Url());
-            if (StringUtils.isNotEmpty(metronomeMp3Url)) {
-                o.setMetronomeMp3Url(metronomeMp3Url);
-                flag = true;
-                subFlag = true;
-            }
-            if (subFlag) {
-                SysMusicScoreAccompaniment accompaniment = new SysMusicScoreAccompaniment();
-                accompaniment.setExamSongId(o.getId());
-                accompaniment.setMp3Url(o.getMp3Url());
-                accompaniment.setMetronomeMp3Url(o.getMetronomeMp3Url());
-                sysMusicScoreDao.updateAccompanimentBySongId(accompaniment);
-            }
+    @Override
+    public PageInfo<SysMusicScore> queryMusicScorePageInfo(SysExamSongQueryInfo queryInfo) {
+        this.initCategoryIds(queryInfo);
+        if(queryInfo.getSubjectId() != null){
+            queryInfo.setSubjectIds(queryInfo.getSubjectId().toString());
         }
-        if (!flag) {
-            return;
+        if(CollectionUtils.isEmpty(queryInfo.getCategoriesIdList())){
+            return new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         }
-        obj.setAccompanimentList(metronomeTranscod);
-        String now = JSONObject.toJSONString(obj);
-
-        //记录日志
-        SysMusicScoreChangeLog log = new SysMusicScoreChangeLog();
-        log.setSysMusicScoreId(obj.getId());
-        log.setChangeBefore(old);
-        log.setChangeAfter(now);
-        sysMusicScoreChangeLogDao.insert(log);
+        PageInfo<SysMusicScore> pageInfo = this.queryPage(queryInfo);
+        List<SysMusicScore> rows = pageInfo.getRows();
+        dealMusicScoreData(rows);
+        return pageInfo;
     }
 
     @Override
-	public int updateExtStyleConfigJson(Integer id, String extStyleConfigJson) {
-		return sysMusicScoreDao.updateExtStyleConfigJson(id, extStyleConfigJson);
-	}
-
-    @Override
     public Map<Long, SysMusicScore> getMapByIds(List<Long> musicSheetIds) {
         if (CollectionUtils.isEmpty(musicSheetIds)) {
             return new HashMap<>();
         }
-
         List<SysMusicScore> musicScoreList = sysMusicScoreDao.findByIds(musicSheetIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
-
         if (CollectionUtils.isEmpty(musicScoreList)) {
             return new HashMap<>();
         }
@@ -375,82 +302,213 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         return musicScoreList.stream().collect(Collectors.toMap(o -> o.getId().longValue(), e -> e));
     }
 
-    /**
-     * 进行转码
-     *
-     * @param fileUrl
-     * @return
-     */
-    private String doTranscod(String fileUrl) {
-        String transcodUrl = "";
-        if (StringUtils.isEmpty(fileUrl)) {
-            return transcodUrl;
+    @Override
+    public Boolean stateList(ReasonDto reasonDto) {
+        List<Integer> musicSheets = Arrays.stream(reasonDto.getMusicSheetIds().split(",")).map(Integer::parseInt).collect(Collectors.toList());
+        List<SysMusicScore> musicSheetList = sysMusicScoreDao.findByIds(musicSheets.stream().map(String::valueOf).collect(Collectors.joining(",")));
+
+        List<CbsMusicSheetWrapper.MusicSheetApplication> rows =
+                this.queryCbsMusicSheetApplication(musicSheetList.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList()));
+        String applicationExtendIds = rows.stream().map(e -> e.getApplicationExtendId().toString()).collect(Collectors.joining(","));
+        CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus extendStatus = new CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus();
+        extendStatus.setIds(applicationExtendIds);
+        extendStatus.setStatus(reasonDto.getState()== YesOrNoEnum.YES);
+        R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendStatus(extendStatus);
+        if (jsonObjectR.getCode() != 200) {
+            throw new BizException("修改曲目状态失败,{}", jsonObjectR.getMessage());
         }
-        //文件扩展名
-        String expand = FileUtil.getFileExpandByPath(fileUrl);
-        //将远程文件写入本地临时文件路径
-        String tempFileName = getTempFileName(expand);
-        File tempFile = new File(tempFileName);
-        //转码后文件路径
-        String tempTranscodFileName = getTempFileName(expand);
-        try {
-            URL url = new URL(fileUrl);
-            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-            //设置超时间为3秒
-            conn.setConnectTimeout(3 * 1000);
-            //防止屏蔽程序抓取而返回403错误
-            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
-
-            FileUtil.inputStreamToFile(conn.getInputStream(), tempFile);
-
-            String script = "ffmpeg -i " + tempFileName + " -vn -c:a libmp3lame -b:a 320k -ac 2 " + tempTranscodFileName;
-            int i = ScriptUtil.callScript(script);
-            if (i == 0) {
-                //转码成功
-                FileInputStream inputStream = new FileInputStream(tempTranscodFileName);
-                UploadReturnBean uploadReturnBean = uploadFileService.uploadFile(inputStream, expand);
-                transcodUrl = uploadReturnBean.getUrl();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            //删除服务器中的文件
-            if (tempFile.exists()) {
-                tempFile.delete();
+        return true;
+    }
+
+    @Override
+    public Boolean state(Integer id) {
+        SysMusicScore musicScore = sysMusicScoreDao.get(id);
+        if (musicScore == null) {
+            throw new BizException("曲目信息不存在");
+        }
+        List<CbsMusicSheetWrapper.MusicSheetApplication> rows =
+                this.queryCbsMusicSheetApplication(Collections.singletonList(musicScore.getCbsMusicSheetId()));
+        String applicationExtendIds = rows.stream().map(e -> e.getApplicationExtendId().toString()).collect(Collectors.joining(","));
+        CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus extendStatus = new CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus();
+        extendStatus.setIds(applicationExtendIds);
+        extendStatus.setStatus(musicScore.getShowFlag() != 1);
+        R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendStatus(extendStatus);
+        if (jsonObjectR.getCode() != 200) {
+            throw new BizException("修改曲目状态失败,{}", jsonObjectR.getMessage());
+        }
+        return true;
+    }
+
+    @Override
+    public void updateCbs(MusicSheetWrapper.MusicSheetApplicationExtendWrapper addMusicSheetApplicationExtend) {
+        CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend extend =
+                JSONObject.parseObject(JSONObject.toJSONString(addMusicSheetApplicationExtend), CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend.class);
+        extend.setApplicationId(applicationId);
+        R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendUpdate(extend);
+        if (jsonObjectR.getCode() != 200) {
+            throw new BizException("修改失败,{}",jsonObjectR.getMessage());
+        }
+    }
+
+    @Override
+    public void sync() {
+        ThreadPoolExecutor executorService =  new ThreadPoolExecutor(50, 50,
+                0L, TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<>());
+        List<SysMusicScore> records = sysMusicScoreDao.selectSyncPage();
+        if (CollectionUtils.isEmpty(records)) {
+            return;
+        }
+        for (SysMusicScore record : records) {
+            executorService.submit(() ->
+                    {
+                        try {
+                            syncMusicSheet(record);
+                        }catch (Exception e) {
+                            log.error("曲目同步异常,曲目ID:{}", record.getId(), e);
+                        }
+                    }
+            );
+        }
+        while (!executorService.getQueue().isEmpty()) {
+            try {
+                log.info("线程池中正在执行的任务数量:{},等待数量:{}", executorService.getActiveCount(),executorService.getQueue().size());
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                log.error("线程等待异常", e);
             }
-            File tempTranscodFile = new File(tempTranscodFileName);
-            if (tempTranscodFile.exists()) {
-                tempTranscodFile.delete();
+        }
+        log.info("-------------------- 曲目数据同步成功! -------------------------------");
+        executorService.shutdown();
+    }
+
+    private void syncMusicSheet(SysMusicScore record) {
+        List<SysMusicScoreAccompaniment> list = sysMusicScoreAccompanimentDao.findByMusicScoreId(record.getId());
+
+        CbsMusicSheetWrapper.AddMusicSheet addMusicSheet = this.musicToAddMusicSheet(record,list);
+
+        R<CbsMusicSheetWrapper.MusicSheet> musicSheetR = musicFeignClientService.musicCbsSync(addMusicSheet);
+        try {
+            CbsMusicSheetWrapper.MusicSheet musicSheet = musicSheetR.feignData();
+            if (musicSheet == null) {
+                log.error("曲目同步失败,曲目ID:{}", record.getId());
             }
+        } catch (Exception e){
+            log.error("曲目同步失败,曲目ID:{}", record.getId(),e);
         }
-        return transcodUrl;
+
     }
 
-    /**
-     * 通过网络文件路径获取临时文件路径
-     *
-     * @param fileUrl
-     * @return
-     */
-    String tempPath = "/usr/temp";
-
-    private String getTempFileName(String expand) {
-        //没有目录则创建
-        File file = new File(tempPath);
-        if (!file.exists()) {
-            file.mkdirs();
+    //测试环境合奏分类
+    private static String categoryIds = "42,43,44,45,46,91,92,93,94,95,7,11,15,180";
+    private static String prodCategoryIds = "42,43,44,45,46,91,92,93,94,95,185,186,7,11,15,180";
+
+    private CbsMusicSheetWrapper.AddMusicSheet musicToAddMusicSheet(SysMusicScore from, List<SysMusicScoreAccompaniment> accList) {
+        CbsMusicSheetWrapper.AddMusicSheet addMusicSheet = new CbsMusicSheetWrapper.AddMusicSheet();
+        addMusicSheet.setId(Long.parseLong(from.getCbsMusicSheetId()));
+        addMusicSheet.setName(from.getName());
+        if (StringUtils.isNotBlank(from.getSubjectIds())) {
+            List<Integer> subjectIds = Arrays.stream(from.getSubjectIds().split(","))
+                    .map(Integer::parseInt).distinct().collect(Collectors.toList());
+            List<Subject> list = subjectService.findBySubjectByIdList(subjectIds);
+            if (CollectionUtils.isNotEmpty(list)) {
+                addMusicSheet.setSubjectIds(list.stream().filter(e->e.getCbsSubjectId() != null).map(o->o.getCbsSubjectId().toString()).collect(Collectors.joining(",")));
+                //获取关联的乐器
+                List<Instrument> list1 = instrumentService.lambdaQuery().in(Instrument::getSubjectId, subjectIds).list();
+                if (CollectionUtils.isNotEmpty(list1)) {
+                    addMusicSheet.setMusicalInstrumentIds(list1.stream().map(o -> o.getId().toString()).collect(Collectors.joining(",")));
+                }
+            }
         }
-        //.mp3
-        String fileName = tempPath + File.separator + idGeneratorService.generatorId("tempFile");
-        if (StringUtils.isNotEmpty(expand)) {
-            fileName += "." + expand;
+        addMusicSheet.setSendAppFlag(false);
+        addMusicSheet.setMusicCover("https://oss.dayaedu.com/gyt/07/1690789356356.png");
+        addMusicSheet.setAppAuditFlag(false);
+        addMusicSheet.setRemark(from.getMuseScoreMemo());
+        addMusicSheet.setIsPlayBeat(true);
+        if(categoryIds.contains(from.getMusicScoreCategoriesId().toString())){
+            addMusicSheet.setMusicSheetType(EMusicSheetType.CONCERT);
+        }else {
+            addMusicSheet.setMusicSheetType(EMusicSheetType.SINGLE);
+        }
+        addMusicSheet.setIsEvaluated(from.isEnableEvaluation());
+        addMusicSheet.setIsConvertibleScore(true);
+        addMusicSheet.setPlaySpeed(from.getSpeed());
+        addMusicSheet.setPlayMode(from.getPlayMode() == SysMusicScore.PlayMode.MP3 ? EMusicPlayMode.MP3 : EMusicPlayMode.MIDI);
+        addMusicSheet.setMidiFileUrl(from.getMidiUrl());
+        addMusicSheet.setExtConfigJson(from.getExtConfigJson());
+        addMusicSheet.setCreateTime(from.getCreateTime());
+        addMusicSheet.setAudioType(EAudioType.HOMEMODE);
+        addMusicSheet.setAvailableType(EMusicAvailableType.ORG);
+        addMusicSheet.setSourceType(EMusicSourceType.PLATFORM);
+        addMusicSheet.setStatus(true);
+
+        String tracks = "";
+        // 伴奏,原音 扩展信息
+        if (addMusicSheet.getPlayMode() == EMusicPlayMode.MP3) {
+            CbsMusicSheetWrapper.MusicSheetAccompaniment musicSheetAccompaniment = new CbsMusicSheetWrapper.MusicSheetAccompaniment();
+            if (StringUtils.isNotBlank(musicSheetAccompaniment.getAudioFileUrl())) {
+                addMusicSheet.setMusicSheetAccompanimentList(Lists.newArrayList(musicSheetAccompaniment));
+            }
+            if (CollectionUtils.isNotEmpty(accList)) {
+                List<CbsMusicSheetWrapper.MusicSheetSound> musicSheetSounds = new ArrayList<>();
+                int i = 0;
+                for (SysMusicScoreAccompaniment sheetAccompaniment : accList) {
+                    CbsMusicSheetWrapper.MusicSheetSound musicSheetSound = new CbsMusicSheetWrapper.MusicSheetSound();
+                    if (StringUtils.isNotBlank(sheetAccompaniment.getMetronomeMp3Url())){
+                        musicSheetSound.setAudioFileUrl(sheetAccompaniment.getMetronomeMp3Url());
+                    } else {
+                        musicSheetSound.setAudioFileUrl(sheetAccompaniment.getMp3Url());
+                    }
+                    musicSheetSound.setTrack(sheetAccompaniment.getTrack());
+                    if (sheetAccompaniment.getSubjectId() != null) {
+                        Subject subject = subjectService.get(sheetAccompaniment.getSubjectId());
+                        if (Objects.nonNull(subject)) {
+                            //获取关联的乐器
+                            Instrument one = instrumentService.lambdaQuery().eq(Instrument::getSubjectId, subject.getId()).one();
+                            if (Objects.nonNull(one)) {
+                                musicSheetSound.setMusicalInstrumentId(one.getId().toString());
+                            }
+                        }
+                    }
+                    musicSheetSound.setSortNumber(i++);
+                    if (StringUtils.isNotBlank(musicSheetSound.getAudioFileUrl())) {
+                        //xml
+                        addMusicSheet.setXmlFileUrl(sheetAccompaniment.getXmlUrl());
+                        //是否显示指法
+                        addMusicSheet.setIsShowFingering(sheetAccompaniment.getIsShowFingering());
+                        //是否使用系统节拍器
+                        addMusicSheet.setIsUseSystemBeat(sheetAccompaniment.getIsOpenMetronome());
+                        musicSheetSounds.add(musicSheetSound);
+                    }
+                }
+                tracks = musicSheetSounds.stream().map(CbsMusicSheetWrapper.MusicSheetSound::getTrack).collect(Collectors.joining(","));
+                addMusicSheet.setMusicSheetSoundList(musicSheetSounds);
+            }
         }
-        return fileName;
+        addMusicSheet.setMultiTracksSelection(tracks);
+
+        CbsMusicSheetWrapper.MusicSheetExtend musicSheetExtend = new CbsMusicSheetWrapper.MusicSheetExtend();
+        musicSheetExtend.setApplicationId(applicationId);
+        musicSheetExtend.setClientType(EClientType.BACKEND.name());
+        addMusicSheet.setMusicSheetExtend(musicSheetExtend);
+
+        // 应用扩展信息
+        CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend addMusicSheetApplicationExtend = new CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend();
+        addMusicSheetApplicationExtend.setApplicationId(applicationId);
+        addMusicSheetApplicationExtend.setStatus(addMusicSheet.getStatus());
+        addMusicSheetApplicationExtend.setSortNo(from.getOrder());
+        addMusicSheetApplicationExtend.setPaymentType(StringUtils.isNotEmpty(from.getRankIds()) ? "VIP" : "FREE");
+        addMusicSheetApplicationExtend.setAvailableType(EMusicAvailableType.ORG);
+        addMusicSheetApplicationExtend.setMusicSheetCategoryId(from.getMusicScoreCategoriesId().longValue());
+        addMusicSheet.setMusicCategoryId(from.getMusicScoreCategoriesId().longValue());
+        addMusicSheet.setAddMusicSheetApplicationExtend(Lists.newArrayList(addMusicSheetApplicationExtend));
+        addMusicSheet.setIsConvertibleScore(true);
+        return addMusicSheet;
     }
 
     private void getAllCategoryIdList(List<Integer> categoryIdList, List<SysMusicScoreCategories> sysMusicScoreCategoriesList) {
 
-        if (sysMusicScoreCategoriesList != null && sysMusicScoreCategoriesList.size() > 0) {
+        if (CollectionUtils.isNotEmpty(sysMusicScoreCategoriesList)) {
             for (SysMusicScoreCategories sysMusicScoreCategories : sysMusicScoreCategoriesList) {
                 categoryIdList.add(sysMusicScoreCategories.getId());
                 getAllCategoryIdList(categoryIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());

+ 39 - 0
mec-biz/src/main/resources/config/mybatis/InstrumentMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ym.mec.biz.dal.dao.InstrumentDao">
+
+
+
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+         t.id_ AS id
+        , t.subject_id_ AS subjectId
+        , t.orientation_ AS orientation
+        , t.del_flag_ AS delFlag
+        , t.enable_flag_ AS enableFlag
+        , t.create_time_ AS createTime
+        , t.update_time_ AS updateTime
+        , t.operator_ AS operator
+        </sql>
+
+    <select id="selectPage" resultType="com.ym.mec.biz.dal.wrapper.InstrumentWrapper$Instrument">
+		SELECT
+        	<include refid="baseColumns" />
+		FROM instrument t
+        <where>
+            <if test="param.subjectId != null">
+                AND t.subject_id_ = #{param.subjectId}
+            </if>
+            <if test="param.subjectIds != null and param.subjectIds.size() != 0">
+                AND t.subject_id_ in
+                <foreach collection="param.subjectIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="param.enableFlag != null">
+                AND t.enable_flag_ = #{param.enableFlag}
+            </if>
+        </where>
+	</select>
+
+</mapper>

+ 129 - 2
mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -8,6 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.Subject" id="Subject">
         <result column="id_" property="id"/>
+        <result column="cbs_subject_id_" property="cbsSubjectId"/>
         <result column="name_" property="name"/>
         <result column="code_" property="code"/>
         <result column="parent_subject_id_" property="parentSubjectId"/>
@@ -30,8 +31,8 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Subject" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO subject (id_,name_,code_,parent_subject_id_,img_,create_time_,update_time_)
-        VALUES(#{id},#{name},#{code},#{parentSubjectId},#{img},now(),now())
+        INSERT INTO subject (id_,cbs_subject_id_,name_,code_,parent_subject_id_,img_,create_time_,update_time_)
+        VALUES(#{id},#{cbsSubjectId},#{name},#{code},#{parentSubjectId},#{img},now(),now())
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -44,6 +45,9 @@
             <if test="parentSubjectId != null">
                 parent_subject_id_ = #{parentSubjectId},
             </if>
+            <if test="cbsSubjectId != null">
+                cbs_subject_id_ = #{cbsSubjectId},
+            </if>
             <if test="code != null">
                 code_ = #{code},
             </if>
@@ -305,4 +309,127 @@
     <select id="findByNames" resultMap="Subject">
         SELECT * FROM `subject` where name_ IN ('长笛','单簧管','萨克斯','小号','长号','圆号','上低音号','大号','打击乐') and del_flag_ = 0
     </select>
+    <select id="queryCbsList" resultMap="Subject">
+        SELECT * FROM `subject` WHERE del_flag_ = 0 AND parent_subject_id_ != 0 AND cbs_subject_id_ IS NOT NULL
+        <if test="cbsSubjectIds != null and cbsSubjectIds.size > 0">
+            AND cbs_subject_id_ IN
+            <foreach collection="cbsSubjectIds" item="cbsSubjectId" open="(" close=")" separator=",">
+                #{cbsSubjectId}
+            </foreach>
+        </if>
+    </select>
+    <select id="notInSubjectIds" resultMap="Subject">
+        SELECT * FROM subject WHERE del_flag_ = 0 and id_ != #{subjectId}
+    </select>
+    <select id="findCount" resultType="java.lang.Integer">
+        select count(DISTINCT t.id_) from
+        (SELECT t.id_
+        FROM subject t
+        LEFT JOIN instrument i on t.id_ = i.subject_id_
+        <where>
+            <if test="parentSubjectId != null">
+                AND t.parent_subject_id_ = #{parentSubjectId}
+            </if>
+            <if test="parentSubjectId == null">
+                AND t.parent_subject_id_ != 0 AND t.cbs_subject_id_ is not null
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND (t.name_ LIKE CONCAT('%',#{keyword},'%') OR t.code_ LIKE CONCAT('%',#{keyword},'%'))
+            </if>
+            <if test="delFlag != null">
+                AND t.del_flag_ = #{delFlag}
+            </if>
+            <if test="subjectId != null">
+                AND t.id_ = #{subjectId}
+            </if>
+            <if test="subjectIds != null">
+                AND find_in_set(t.id_,#{subjectIds})
+            </if>
+            <if test="instrumentIds != null">
+                AND find_in_set(i.id_, #{instrumentIds})
+            </if>
+            <if test="enableFlag != null">
+                AND t.enable_flag_ = #{enableFlag} and i.enable_flag_ = #{enableFlag}
+            </if>
+        </where>
+        group by t.id_
+        <if test="hasInstrument != null">
+            <if test="hasInstrument == true">
+                having count(i.id_) > 0
+            </if>
+            <if test="hasInstrument == false">
+                having count(i.id_) = 0
+            </if>
+        </if>) t
+    </select>
+    <sql id="baseColumns">
+        t.id_ as id
+        , t.name_ as name
+        , t.code_ as code
+        , t.parent_subject_id_ as parentSubjectId
+        , t.img_ as img
+        , t.del_flag_ as delFlag
+        , t.update_time_ as updateTime
+        , t.create_time_ as createTime
+        ,t.cbs_subject_id_ as cbsSubjectId
+    </sql>
+    <select id="findPage" resultType="com.ym.mec.biz.dal.wrapper.SubjectWrapper$Subject">
+        SELECT
+        <include refid="baseColumns" />
+        FROM subject t
+        LEFT JOIN instrument i on t.id_ = i.subject_id_
+        <where>
+            <if test="parentSubjectId != null">
+                AND t.parent_subject_id_ = #{parentSubjectId}
+            </if>
+            <if test="parentSubjectId == null">
+                AND t.parent_subject_id_ != 0 AND t.cbs_subject_id_ is not null
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND (t.name_ LIKE CONCAT('%',#{keyword},'%') OR t.code_ LIKE CONCAT('%',#{keyword},'%'))
+            </if>
+            <if test="delFlag != null">
+                AND t.del_flag_ = #{delFlag}
+            </if>
+            <if test="subjectId != null">
+                AND t.id_ = #{subjectId}
+            </if>
+            <if test="subjectIds != null">
+                AND find_in_set(t.id_,#{subjectIds})
+            </if>
+            <if test="instrumentIds != null">
+                AND find_in_set(i.id_, #{instrumentIds})
+            </if>
+            <if test="enableFlag != null">
+                AND t.enable_flag_ = #{enableFlag} and i.enable_flag_ = #{enableFlag}
+            </if>
+        </where>
+        group by t.id_
+        <if test="hasInstrument != null">
+            <if test="hasInstrument == true">
+                having count(i.id_) > 0
+            </if>
+            <if test="hasInstrument == false">
+                having count(i.id_) = 0
+            </if>
+        </if>
+        <include refid="global.limit"/>
+    </select>
+    <select id="queryCbsSubjects"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectApiWrapper$Subject">
+        SELECT id_ subjectId,cbs_subject_id_ cbsSubjectId,name_ subjectName,code_ code FROM `subject`
+        WHERE del_flag_ = 0
+        <if test="query.cbsSubjectIds != null and query.cbsSubjectIds.size > 0">
+            AND cbs_subject_id_ IN
+            <foreach collection="query.cbsSubjectIds" item="cbsSubjectId" open="(" close=")" separator=",">
+                #{cbsSubjectId}
+            </foreach>
+        </if>
+        <if test="query.subjectIds != null and query.subjectIds.size > 0">
+            AND id_ IN
+            <foreach collection="query.subjectIds" item="subjectId" open="(" close=")" separator=",">
+                #{subjectId}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 10 - 5
mec-biz/src/main/resources/config/mybatis/SysMusicScoreAccompanimentMapper.xml

@@ -50,7 +50,7 @@
 	<select id="get" resultMap="SysMusicScoreAccompaniment" >
 		SELECT sesa.id_,sesa.exam_song_id_,sesa.subject_id_,CASE WHEN sesa.metronome_mp3_url_ IS NULL OR sesa.metronome_mp3_url_ = '' THEN sesa.mp3_url_ ELSE sesa.metronome_mp3_url_ END url_,sesa.speed_,
 		sesa.xml_url_,sesa.is_show_fingering_,sesa.is_open_metronome_,sesa.memo_,sesa.track_,
-		ses.name_,ses.type_,ses.url_ mp3_url_,sesc.name_ categories_name_,sesc.id_ categories_id_,ses.client_type_,ses.metronome_url_,ses.midi_url_
+		ses.name_,ses.type_,ses.url_ mp3_url_,sesc.name_ categories_name_,sesc.id_ categories_id_,ses.client_type_,ses.metronome_url_,ses.midi_url_,ses.cbs_music_sheet_id_
 		FROM sys_music_score ses
 		LEFT JOIN sys_music_score_accompaniment sesa ON ses.id_ = sesa.exam_song_id_
 		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
@@ -147,7 +147,8 @@
 		SELECT
 		    sesa.*,ses.name_,ses.type_,ses.url_,
 		       s.name_ subject_name_,sesc.name_ categories_name_,sesc.id_ categories_id_,sesc.parent_id_ parent_categories_id_,ses.client_type_,
-		ses.rank_ids_,ses.render_from_,ses.enable_evaluation_,ses.metronome_url_,ses.midi_url_,ses.play_mode_,ses.render_from_,ses.ext_config_json_,ses.ext_style_config_json_
+		ses.rank_ids_,ses.render_from_,ses.enable_evaluation_,ses.metronome_url_,ses.midi_url_,ses.play_mode_,ses.render_from_,
+		ses.ext_config_json_,ses.ext_style_config_json_,ses.cbs_music_sheet_id_
 		FROM sys_music_score ses
 		LEFT JOIN sys_music_score_accompaniment sesa ON ses.id_ = sesa.exam_song_id_
 		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
@@ -183,7 +184,8 @@
 	</select>
 	<select id="queryAccPage" resultMap="SysMusicScoreAccompaniment">
 		SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_,sesc.name_ categories_name_,sesc.id_ categories_id_,sesc.parent_id_ parent_categories_id_,ses.client_type_,
-		ses.enable_evaluation_,ses.metronome_url_,ses.midi_url_,ses.play_mode_,ses.render_from_,ses.ext_config_json_,ses.ext_style_config_json_,ses.rank_ids_
+		ses.enable_evaluation_,ses.metronome_url_,ses.midi_url_,ses.play_mode_,ses.render_from_,ses.ext_config_json_,
+		ses.ext_style_config_json_,ses.rank_ids_,ses.cbs_music_sheet_id_
 		FROM sys_music_score ses
 		LEFT JOIN sys_music_score_accompaniment sesa ON ses.id_ = sesa.exam_song_id_
 		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
@@ -213,10 +215,13 @@
 		</if>
 		GROUP BY sesa.subject_id_
 	</select>
+    <select id="findByMusicScoreId" resultMap="SysMusicScoreAccompaniment">
+		SELECT * FROM sys_music_score_accompaniment WHERE exam_song_id_ = #{recordId} AND del_flag_ = 0
+	</select>
 
-	<sql id="queryPageSql">
+    <sql id="queryPageSql">
 		<where>
-			sesa.del_flag_ = 0
+			sesa.del_flag_ = 0 AND ses.del_flag_ = 0
 			<if test="enable != null">
 				AND sesc.enable_ = #{enable}
 			</if>

+ 18 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml

@@ -204,4 +204,22 @@
 	<select id="queryByParentId" resultMap="SysMusicScoreCategories" >
 		SELECT categ.* FROM sys_music_score_categories categ WHERE categ.id_ = #{parentId}
 	</select>
+    <select id="categoryList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetCategoryWrapper$MusicSheetCategory">
+		SELECT t.id_ id,t.name_ name,t.parent_id_ parentId FROM sys_music_score_categories t
+		<where>
+			<if test="param.ids != null and param.ids.size > 0">
+				and t.id_ IN
+				<foreach collection="param.ids" item="id" open="(" close=")" separator=",">
+					#{id}
+				</foreach>
+			</if>
+			<if test="param.id != null">
+				and t.id_ = #{param.id}
+			</if>
+			<if test="param.enable != null">
+				and t.enable_ = #{param.enable}
+			</if>
+		</where>
+	</select>
 </mapper>

+ 76 - 40
mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml

@@ -31,6 +31,7 @@
 		<result column="render_from_" property="renderFrom" />
 		<result column="enable_evaluation_" property="enableEvaluation" />
 		<result column="subject_id_" property="subjectId" />
+		<result column="subject_ids_" property="subjectIds" />
 		<result column="play_mode_" property="playMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
 		<result column="muse_score_url_" property="museScoreUrl" />
 		<result column="muse_score_memo_" property="museScoreMemo" />
@@ -142,7 +143,7 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysMusicScore" parameterType="map">
 		SELECT ses.*,su.real_name_ create_user_name_,smsc.name_ categories_name_,smsc.id_ categories_id_,
-		smsa.mp3_url_ accompaniment_url_,smsa.metronome_mp3_url_ accompaniment_metronome_url_,smsa.is_open_metronome_,smsa.subject_id_,smsa.xml_url_
+		smsa.mp3_url_ accompaniment_url_,smsa.metronome_mp3_url_ accompaniment_metronome_url_,smsa.is_open_metronome_,smsa.subject_id_,ses.subject_ids_,smsa.xml_url_
 		FROM sys_music_score ses
 		LEFT JOIN sys_music_score_accompaniment smsa ON smsa.exam_song_id_ = ses.id_
 		LEFT JOIN sys_user su ON ses.create_user_id_ = su.id_
@@ -166,52 +167,84 @@
     <select id="countBuyCategoriesIds" resultType="java.lang.Integer">
 		SELECT COUNT(0) FROM sys_music_score WHERE FIND_IN_SET(music_score_categories_id_,#{categoriesIds}) AND del_flag_ = 0
 	</select>
-    <select id="getTranscod" resultType="com.ym.mec.biz.dal.dto.SysMusicScoreTranscod">
-		select
-			t.id_ as id,
-		   	t.url_ as url,
-		   	t.metronome_url_ as metronomeUrl
-		from sys_music_score t
-		where t.del_flag_ = 0 and t.id_ = #{sysMusicScoreId}
+	<select id="findByCbsId" resultMap="SysMusicScore">
+		SELECT * FROM sys_music_score WHERE del_flag_ = 0
+		<if test="cbsMusicSheetIds != null">
+			AND cbs_music_sheet_id_ IN
+			<foreach collection="cbsMusicSheetIds" separator="," item="item" open="(" close=")">
+				#{item}
+			</foreach>
+		</if>
 	</select>
-
-	<select id="getMetronomeTranscod" resultType="com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod">
-		select
-			smsa.id_ as id,
-			smsa.exam_song_id_ as examSongId,
-			smsa.mp3_url_ as mp3Url,
-			smsa.metronome_mp3_url_ as metronomeMp3Url
-		from sys_music_score_accompaniment smsa
-		where smsa.del_flag_ = 0 and smsa.exam_song_id_ = #{sysMusicScoreId}
+	<select id="selectSyncPage" resultMap="SysMusicScore">
+		select * from sys_music_score where cbs_music_sheet_id_ iS NOT NULL and del_flag_ = 0 AND client_type_ = 'SMART_PRACTICE' AND update_time_ > NOW()
 	</select>
 
-	<update id="updateAccompanimentBySongId">
-		update sys_music_score_accompaniment t
-		<set>
-			<if test="param.mp3Url != null and param.mp3Url != ''">
-				t.mp3_url_ = #{param.mp3Url},
+	<update id="updateBatchByCbsId">
+		<foreach collection="vos" item="item" index="index" separator=";">
+			update sys_music_score set music_score_categories_id_ = #{item.musicSheetCategoryId},
+			client_type_ = 'SMART_PRACTICE',type_ = 'COMMON',
+			rank_ids_ = CASE WHEN #{item.paymentType} = 'FREE' THEN NULL ELSE '1' END,
+			order_ = #{item.sortNo},del_flag_ = 0
+			<if test="item.musicSheetUpdate != null">
+				,name_ = #{item.musicSheetUpdate.name},
+				subject_ids_ = #{item.musicSheetUpdate.subjectIds},
+				speed_ = #{item.musicSheetUpdate.playSpeed},
+				enable_evaluation_ = #{item.musicSheetUpdate.canEvaluate},
+				play_mode_ = #{item.musicSheetUpdate.playMode}
 			</if>
-			<if test="param.metronomeMp3Url != null and param.metronomeMp3Url != ''">
-				t.metronome_mp3_url_ = #{param.metronomeMp3Url},
-			</if>
-		</set>
-		where t.exam_song_id_ = #{param.examSongId} and t.del_flag_ = 0
+			where cbs_music_sheet_id_ = #{item.musicSheetId}
+		</foreach>
 	</update>
-
-	<update id="updateExtStyleConfigJson">
-		update sys_music_score ms set ms.ext_style_config_json_ = #{extStyleConfigJson}
-		where ms.id_ = #{id}
+	<update id="batchEnable">
+		update sys_music_score set show_flag_ = #{status} where FIND_IN_SET(cbs_music_sheet_id_,#{cbsMusicSheetIds});
+	</update>
+	<update id="batchDel">
+		update sys_music_score set del_flag_ = 1 where FIND_IN_SET(cbs_music_sheet_id_,#{cbsMusicSheetIds});
+		update sys_music_score_accompaniment msa
+			left join sys_music_score sms ON sms.id_ = msa.exam_song_id_
+			set msa.del_flag_ = 1
+		where FIND_IN_SET(sms.cbs_music_sheet_id_,#{cbsMusicSheetIds})
+	</update>
+	<update id="updateMusicSheet">
+		update sys_music_score set name_ = #{param.name},
+		subject_ids_ = #{param.subjectIds},
+		speed_ = #{param.playSpeed},
+		enable_evaluation_ = #{param.canEvaluate},
+		play_mode_ = #{param.playMode}
+		where cbs_music_sheet_id_ = #{param.id}
 	</update>
 
+	<insert id="batchInsert">
+		insert into sys_music_score
+		(music_score_categories_id_,client_type_,type_,rank_ids_,order_
+		,name_,subject_ids_,speed_,enable_evaluation_,play_mode_,show_flag_,cbs_music_sheet_id_)
+		values
+		<foreach collection="vos" item="item" separator=",">
+			(#{item.musicSheetCategoryId},
+			'SMART_PRACTICE','COMMON',
+			CASE WHEN #{item.paymentType} = 'FREE' THEN NULL ELSE '1' END,
+			#{item.sortNo},
+			#{item.musicSheetUpdate.name},
+			#{item.musicSheetUpdate.subjectIds},
+			#{item.musicSheetUpdate.playSpeed},
+			#{item.musicSheetUpdate.canEvaluate},
+			#{item.musicSheetUpdate.playMode},0,
+			#{item.musicSheetId}
+			)
+		</foreach>
+	</insert>
+	<insert id="batchInsertAccompaniment">
+		INSERT INTO sys_music_score_accompaniment (exam_song_id_)
+		VALUES
+		<foreach collection="vos" item="item"  separator=",">
+			(#{item})
+		</foreach>
+	</insert>
+
 	<sql id="queryPageSql">
 		<where>
-			ses.del_flag_ = 0
-			<!-- <if test="organId != null and organId != null">
-				AND INTE_ARRAY(smsc.organ_id_,#{organId})
-			</if> -->
-			<!-- <if test="categoriesId != null">
-				AND FIND_IN_SET(ses.music_score_categories_id_,#{categoriesId})
-			</if> -->
+			ses.del_flag_ = 0 AND ses.cbs_music_sheet_id_ IS NOT NULL
 			<if test="categoriesIdList != null">
 				AND smsc.id_ IN
 				<foreach collection="categoriesIdList" separator="," item="item" open="(" close=")">
@@ -219,13 +252,16 @@
 				</foreach>
 			</if>
 			<if test="search != null and search != ''">
-				AND (ses.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
+				AND (ses.cbs_music_sheet_id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 			<if test="showFlag != null">
 				AND ses.show_flag_ = #{showFlag}
 			</if>
 			<if test="subjectId != null">
-				AND (smsa.subject_id_ = #{subjectId} or smsa.subject_id_ is null)
+				AND (FIND_IN_SET(#{subjectId},ses.subject_ids_) OR ses.subject_ids_ IS NULL OR ses.subject_ids_ = '')
+			</if>
+			<if test="subjectIds != null and subjectIds != ''">
+				AND (FIND_IN_SET(#{subjectIds},ses.subject_ids_) OR ses.subject_ids_ IS NULL OR ses.subject_ids_ = '')
 			</if>
 			<if test="clientType != null">
 				AND ses.client_type_ = #{clientType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}

+ 29 - 0
mec-biz/src/main/resources/config/mybatis/SysUserTenantMapper.xml

@@ -33,5 +33,34 @@
                  left join tenant_info as b on a.tenant_id_ = b.id_
         where a.user_id_ = #{userId}
     </select>
+    <select id="personOwnerList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
+        select su.id_ userId,su.real_name_ username
+        ,'TEACHER' clientType,su.phone_ phone from teacher t
+        left join sys_user su ON su.id_ = t.id_
+        where su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0 AND su.lock_flag_ = 0
+        <if test="param.name != null and param.name != ''">
+            AND (su.phone_ LIKE CONCAT('%',#{param.name},'%') OR su.username_ LIKE CONCAT('%',#{param.name},'%'))
+        </if>
+        <if test="param.userIdList != null and param.userIdList.size > 0">
+            AND su.id_ IN
+            <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+    <select id="orgOwnerList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
+        select id_ organizationRoleId,name_ organizationRole,'ORG' clientType,phone_ phone from tenant_info where state_ = 1
+        <if test="param.name != null and param.name != ''">
+            AND (phone_ LIKE CONCAT('%',#{param.name},'%') OR name_ LIKE CONCAT('%',#{param.name},'%'))
+        </if>
+        <if test="param.userIdList != null and param.userIdList.size > 0">
+            AND id_ IN
+            <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 
 </mapper>

+ 1 - 1
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -41,7 +41,7 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
     @Override
     public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
-        syncSaveLog(request, handler);
+//        syncSaveLog(request, handler);
     }
 
     public void syncSaveLog(HttpServletRequest request, Object handler) {

+ 1 - 1
pom.xml

@@ -26,7 +26,7 @@
 		<docker.registry.repository>127.0.0.1:5000</docker.registry.repository>
 		<docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
 		<com.microsvc.toolkit.version>1.0.7</com.microsvc.toolkit.version>
-        <cbs.version>1.0.10</cbs.version>
+        <cbs.version>1.0.11</cbs.version>
 	</properties>
 
 	<dependencyManagement>