Browse Source

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

zouxuan 1 year ago
parent
commit
52f778c5c2
21 changed files with 317 additions and 196 deletions
  1. 4 2
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumController.java
  2. 14 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicSheetAuthRecordController.java
  3. 0 6
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicSheetController.java
  4. 39 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicalInstrumentController.java
  5. 12 4
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/SubjectController.java
  6. 22 4
      cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/MusicSheetAuthRecordController.java
  7. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TeacherMusicSheetAuditReq.java
  8. 5 80
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/TeacherMusicSheetAuditSearch.java
  9. 9 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicSheetAccompaniment.java
  10. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/InstrumentService.java
  11. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetService.java
  12. 2 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/InstrumentServiceImpl.java
  13. 1 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAccompanimentServiceImpl.java
  14. 39 15
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAuthRecordServiceImpl.java
  15. 141 69
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java
  16. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicSheetDetailVo.java
  17. 0 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/InstrumentWrapper.java
  18. 2 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/MusicSheetAccompanimentWrapper.java
  19. 2 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetAccompanimentMapper.xml
  20. 9 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetAuthRecordMapper.xml
  21. 6 6
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

+ 4 - 2
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumController.java

@@ -171,7 +171,9 @@ public class TenantAlbumController {
                         tenantAlbumSheet.setMusicTag(musicSheet.getMusicTag());
                         tenantAlbumSheet.setComposer(musicSheet.getComposer());
                         tenantAlbumSheet.setMusicSubject(musicSheet.getMusicSubject());
-
+                        tenantAlbumSheet.setMusicSubjectName(musicSheet.getSubjectNames());
+                        tenantAlbumSheet.setMusicTagName(musicSheet.getMusicTagNames());
+/*
                         //设置对应标签名称
                         String musicTag = tenantAlbumSheet.getMusicTag();
                         if (StringUtils.isNotBlank(musicTag)){
@@ -192,7 +194,7 @@ public class TenantAlbumController {
                                 return null;
                             }).filter(Objects::nonNull).collect(Collectors.joining(","));
                             tenantAlbumSheet.setMusicSubjectName(subjectName);
-                        }
+                        }*/
 
                     }
                     break;

+ 14 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicSheetAuthRecordController.java

@@ -1,9 +1,14 @@
 package com.yonge.cooleshow.teacher.controller;
 
+import com.yonge.cooleshow.biz.dal.dto.search.TeacherMusicSheetAuditSearch;
 import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetAuthRecordService;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.vo.TeacherMusicSheetVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.annotation.Validated;
@@ -20,6 +25,15 @@ import javax.annotation.Resource;
 public class MusicSheetAuthRecordController extends BaseController {
     @Resource
     private MusicSheetAuthRecordService musicSheetAuthRecordService;
+    @Resource
+    private SysUserService sysUserService;
+
+    @PostMapping(value = "/list", consumes="application/json", produces="application/json")
+    @ApiOperation(value = "审核中心-乐谱审核列表", httpMethod="POST", consumes="application/json", produces="application/json")
+    public HttpResponseResult<PageInfo<TeacherMusicSheetVo>> audit(@RequestBody TeacherMusicSheetAuditSearch query) {
+        query.setCreateBy(sysUserService.getUserId());
+        return succeed(PageUtil.pageInfo(musicSheetAuthRecordService.selectAuditPage(PageUtil.getPage(query),query)));
+    }
 
     @ApiOperation(value = "新增", notes = " 传入 MusicSheetAuthRecord")
     @PostMapping("/save")

+ 0 - 6
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicSheetController.java

@@ -59,19 +59,13 @@ import java.util.Optional;
 public class MusicSheetController extends BaseController {
     @Resource
     private SysUserService sysUserService;
-
 	@Resource
 	private MusicSheetService musicSheetService;
-
     @Resource
     private AppVersionInfoService appVersionInfoService;
-
     @Resource
     private TeacherService teacherService;
 
-//    @Resource
-//    private CbsMusicScoreService cbsMusicScoreService;
-
     /**
      * 查询单条
      */

+ 39 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicalInstrumentController.java

@@ -0,0 +1,39 @@
+package com.yonge.cooleshow.teacher.controller;
+
+import com.microsvc.toolkit.common.response.template.R;
+import com.yonge.cooleshow.biz.dal.service.InstrumentService;
+import com.yonge.cooleshow.biz.dal.wrapper.InstrumentWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+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.List;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("${app-config.url.teacher:}/musicalInstrument")
+@Api(tags = "曲目乐器")
+public class MusicalInstrumentController {
+
+    @Resource
+    private InstrumentService instrumentService;
+
+    @ApiOperation(value = "乐器列表")
+    @PostMapping("/list")
+    public R<List<InstrumentWrapper.Instrument>> list() {
+        InstrumentWrapper.InstrumentQuery query = new InstrumentWrapper.InstrumentQuery();
+        query.setEnableFlag(true);
+        query.setPage(1);
+        query.setRows(1000);
+        List<InstrumentWrapper.Instrument> instruments = instrumentService.getList(query);
+        return R.from(instruments);
+	}
+
+}

+ 12 - 4
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/SubjectController.java

@@ -6,16 +6,16 @@ import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.service.SubjectService;
 import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.wrapper.SubjectWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -39,6 +39,14 @@ public class SubjectController extends BaseController {
 		return succeed(subjectService.get(id));
 	}
 
+	@ApiOperation(value = "分页查询声部列表")
+	@PostMapping("/queryPage")
+	@PreAuthorize("@pcs.hasPermissions('subject/queryPage')")
+	public HttpResponseResult<PageInfo<SubjectWrapper.Subject>> queryPage(@RequestBody SubjectWrapper.SubjectQuery query) {
+		query.setParentSubjectId(0);
+		return succeed(subjectService.selectPage(query));
+	}
+
 	@ApiOperation(value = "获取声部")
 	@GetMapping("/subjectSelect")
     public HttpResponseResult<List<Subject>> subjectSelect(

+ 22 - 4
cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/MusicSheetAuthRecordController.java

@@ -1,17 +1,20 @@
 package com.yonge.cooleshow.website.controller;
 
+import com.yonge.cooleshow.biz.dal.dto.search.TeacherMusicSheetAuditSearch;
 import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetAuthRecordService;
 import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
+import com.yonge.cooleshow.biz.dal.vo.TeacherMusicSheetVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+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 org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -21,6 +24,21 @@ import javax.annotation.Resource;
 public class MusicSheetAuthRecordController extends BaseController {
     @Resource
     private MusicSheetAuthRecordService musicSheetAuthRecordService;
+    @Resource
+    private SysUserService sysUserService;
+
+    @PostMapping(value = "/list", consumes="application/json", produces="application/json")
+    @ApiOperation(value = "审核中心-乐谱审核列表", httpMethod="POST", consumes="application/json", produces="application/json")
+    public HttpResponseResult<PageInfo<TeacherMusicSheetVo>> audit(@RequestBody TeacherMusicSheetAuditSearch query) {
+        query.setCreateBy(sysUserService.getUserId());
+        return succeed(PageUtil.pageInfo(musicSheetAuthRecordService.selectAuditPage(PageUtil.getPage(query),query)));
+    }
+
+    @GetMapping(value = "/auditDetail/{musicSheetAuthRecordId}")
+    @ApiOperation(value = "审核中心-乐谱审核详情",  notes = "传入曲目审核id")
+    public HttpResponseResult<MusicSheetDetailVo> auditDetail(@PathVariable Long musicSheetAuthRecordId) {
+        return succeed(musicSheetAuthRecordService.auditDetail(musicSheetAuthRecordId));
+    }
 
     @ApiOperation(value = "新增", notes = " 传入 MusicSheetAuthRecord")
     @PostMapping("/save")

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TeacherMusicSheetAuditReq.java

@@ -51,6 +51,9 @@ public class TeacherMusicSheetAuditReq {
     @ApiModelProperty("是否可以转简谱(0:否,1:是)")
     private YesOrNoEnum notation;
 
+    @ApiModelProperty(value = "曲目配置")
+    private String extConfigJson;
+
     @ApiModelProperty(value = "是否可以评测(0:否;1:是)")
     private YesOrNoEnum canEvaluate;  //是否可以评测(0:否;1:是)
 

+ 5 - 80
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/TeacherMusicSheetAuditSearch.java

@@ -5,21 +5,15 @@ import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.enums.ChargeTypeEnum;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.QueryInfo;
-
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
 
-/**
- * Description 老师乐谱审核
- *
- * @author liujunchi
- * @date 2022-04-02
- */
 @ApiModel(value = "TeacherMusicSheetAuditSearch", description = "老师乐谱审核查询")
+@Data
 public class TeacherMusicSheetAuditSearch extends QueryInfo{
 
     @ApiModelProperty("老师编号/名称/电话")
@@ -45,7 +39,7 @@ public class TeacherMusicSheetAuditSearch extends QueryInfo{
     private ChargeTypeEnum chargeType;  //收费类型(0:免费;1:会员;2:单曲收费)
 
     @ApiModelProperty(value = "审核状态  UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过")
-    private AuthStatusEnum authStatus;
+    private String authStatus;
 
     @ApiModelProperty(value = "假删除 0 : 未删除 1:已删除",hidden = true)
     private Boolean delFlag = false;
@@ -53,75 +47,6 @@ public class TeacherMusicSheetAuditSearch extends QueryInfo{
     @ApiModelProperty(value = "精品标志(0:否;1:是)")
     private YesOrNoEnum exquisiteFlag;
 
-    public Integer getFirstAuth() {
-        return firstAuth;
-    }
-
-    public void setFirstAuth(Integer firstAuth) {
-        this.firstAuth = firstAuth;
-    }
-
-    public ChargeTypeEnum getChargeType() {
-        return chargeType;
-    }
-
-    public void setChargeType(ChargeTypeEnum chargeType) {
-        this.chargeType = chargeType;
-    }
-
-    public String getIdAndName() {
-        return idAndName;
-    }
-
-    public void setIdAndName(String idAndName) {
-        this.idAndName = idAndName;
-    }
-
-    public String getAuditName() {
-        return auditName;
-    }
-
-    public void setAuditName(String auditName) {
-        this.auditName = auditName;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    public AuthStatusEnum getAuthStatus() {
-        return authStatus;
-    }
-
-    public void setAuthStatus(AuthStatusEnum authStatus) {
-        this.authStatus = authStatus;
-    }
-
-    public Boolean getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(Boolean delFlag) {
-        this.delFlag = delFlag;
-    }
-
-	public YesOrNoEnum getExquisiteFlag() {
-		return exquisiteFlag;
-	}
-
-	public void setExquisiteFlag(YesOrNoEnum exquisiteFlag) {
-		this.exquisiteFlag = exquisiteFlag;
-	}
+    @ApiModelProperty(value = "创建人id")
+    private Long createBy;
 }

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicSheetAccompaniment.java

@@ -37,6 +37,15 @@ public class MusicSheetAccompaniment extends BaseEntity {
     @ApiModelProperty(value = "声部")
     private String musicSubjectId;  //声部
 
+    @TableField("musical_instrument_id_")
+    @ApiModelProperty("声轨乐器")
+    private String musicalInstrumentId;
+
+    @ApiModelProperty("声轨乐器")
+    //排除该字段
+    @TableField(exist = false)
+    private String musicalInstrumentName;
+
     @TableField("audio_file_url_")
     @ApiModelProperty(value = "MP3原声音频文件URL")
     private String audioFileUrl;  //MP3原声音频文件URL

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/InstrumentService.java

@@ -47,6 +47,8 @@ public interface InstrumentService extends IService<Instrument>  {
 
     Map<Long,InstrumentWrapper.Instrument> getMapByIds(List<Long> instrumentIdList);
 
+    List<InstrumentWrapper.Instrument> getInstruments(List<Long> instrumentIdList);
+
     Map<Integer,List<InstrumentWrapper.Instrument>> getGroupBySubjectId(List<Integer> subjectIds, Boolean enableFlag);
 
     List<InstrumentWrapper.Instrument> getList(InstrumentWrapper.InstrumentQuery query);

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetService.java

@@ -398,5 +398,7 @@ public interface MusicSheetService extends IService<MusicSheet> {
 
     MusicSheet initMusicSheet(CbsMusicSheetWrapper.AddMusicSheet addMusicSheet);
 
+    void initMusicSheetDetailVo(CbsMusicSheetWrapper.AddMusicSheet addMusicSheet,MusicSheetDetailVo sheetDetailVo);
+
     void sync();
 }

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/InstrumentServiceImpl.java

@@ -14,7 +14,6 @@ import com.yonge.cooleshow.biz.dal.service.InstrumentService;
 import com.yonge.cooleshow.biz.dal.service.SubjectService;
 import com.yonge.cooleshow.biz.dal.wrapper.InstrumentWrapper;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -112,7 +111,8 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
         return instrumentList.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, Function.identity()));
     }
 
-    private List<InstrumentWrapper.Instrument> getInstruments(List<Long> instrumentIdList) {
+    @Override
+    public List<InstrumentWrapper.Instrument> getInstruments(List<Long> instrumentIdList) {
         instrumentIdList = instrumentIdList.stream().filter(Objects::nonNull).collect(Collectors.toList());
         Map<Long, Instrument> idImstrumentMap = this.lambdaQuery().in(Instrument::getId, instrumentIdList).list()
             .stream().collect(Collectors.toMap(Instrument::getId, Function.identity()));

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAccompanimentServiceImpl.java

@@ -64,6 +64,7 @@ public class MusicSheetAccompanimentServiceImpl extends ServiceImpl<MusicSheetAc
             accompaniment.setSortNumber(sound.getSortNumber());
             accompaniment.setTrack(sound.getTrack());
             accompaniment.setMusicSheetId(musicSheetId);
+            accompaniment.setMusicalInstrumentId(sound.getMusicalInstrumentId());
             background.add(accompaniment);
         }
         return background;

+ 39 - 15
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAuthRecordServiceImpl.java

@@ -11,9 +11,7 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dao.MusicSheetAuthRecordDao;
 import com.yonge.cooleshow.biz.dal.dto.req.TeacherMusicSheetAuditReq;
 import com.yonge.cooleshow.biz.dal.dto.search.TeacherMusicSheetAuditSearch;
-import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
-import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment;
-import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
+import com.yonge.cooleshow.biz.dal.entity.*;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
@@ -22,16 +20,17 @@ import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherMusicSheetVo;
 import com.yonge.cooleshow.biz.dal.wrapper.AddMusicSheetWrapper;
+import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.cooleshow.common.service.IdGeneratorService;
 import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
@@ -55,8 +54,12 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
     @Resource
     private SysUserService sysUserService;
     @Resource
+    private SubjectService subjectService;
+    @Resource
     private SysMessageService sysMessageService;
     @Resource
+    private InstrumentService instrumentService;
+    @Resource
     private MusicSheetAccompanimentService musicSheetAccompanimentService;
 
     @Value("${openfeign-client.app-id:1745637981387108354}")
@@ -99,10 +102,19 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
             addMusicSheet.setMusicImg(param.getMusicImg());
             addMusicSheet.setMusicFirstImg(param.getMusicFirstImg());
             addMusicSheet.setMusicJianImg(param.getMusicJianImg());
+            addMusicSheet.setExtConfigJson(param.getExtConfigJson());
+            addMusicSheet.setIsEvaluated(param.getCanEvaluate()==YesOrNoEnum.YES);
+            addMusicSheet.setIsPlayBeat(true);
+            addMusicSheet.setIsUseSystemBeat(param.getHasBeat()!=YesOrNoEnum.YES);
             if(musicSheet.getCbsMusicSheetId() == null){
                 musicSheet.setCbsMusicSheetId(IdWorker.getId());
             }
             addMusicSheet.setId(musicSheet.getCbsMusicSheetId());
+            //修改声部和乐器为内容平台id
+            String musicalInstrumentIds = addMusicSheet.getMusicalInstrumentIds();
+            List<Subject> subjectList = subjectService.findBySubjectByIdList(musicalInstrumentIds);
+            addMusicSheet.setMusicalInstrumentIds(subjectList.stream().map(e->e.getCbsSubjectId().toString()).distinct().collect(Collectors.joining(",")));
+            addMusicSheet.setSubjectIds(subjectList.stream().map(e->e.getParentSubjectId().toString()).distinct().collect(Collectors.joining(",")));
             musicFeignClientService.musicSheetAdd(addMusicSheet);
         }else {
             musicSheetService.updateById(musicSheet);
@@ -173,6 +185,13 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
             throw new BizException("曲目信息不能为空");
         }
         AddMusicSheetWrapper.AddMusicSheet addMusicSheet = JSON.parseObject(musicSheetAuthRecord.getMusicSheetJson(), AddMusicSheetWrapper.AddMusicSheet.class);
+        //反查乐器关联的声部
+        String musicalInstrumentIds = addMusicSheet.getMusicalInstrumentIds();
+        List<Instrument> list = instrumentService.lambdaQuery().in(Instrument::getId, musicalInstrumentIds.split(",")).list();
+        if(CollectionUtils.isEmpty(list)){
+            throw new BizException("乐器信息不存在");
+        }
+        addMusicSheet.setSubjectIds(list.stream().map(e->e.getSubjectId().toString()).distinct().collect(Collectors.joining(",")));
         List<CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend> extendList = new ArrayList<>();
         CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend extend = new CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend();
         extend.setApplicationId(applicationId);
@@ -219,15 +238,21 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         }
         MusicSheetAuthRecord record = baseMapper.selectById(musicSheetAuthRecord.getId());
         if (record == null){
+            throw new BizException("审核记录不存在");
+        }
+        MusicSheet musicSheet1 = musicSheetService.getById(record.getMusicSheetId());
+        if (musicSheet1 == null){
             throw new BizException("曲目信息不存在");
         }
+        if (musicSheet1.getState() == YesOrNoEnum.YES){
+            throw new BizException("请先下架曲目再修改");
+        }
         CbsMusicSheetWrapper.AddMusicSheet addMusicSheet = this.checkRecord(musicSheetAuthRecord);
         MusicSheet musicSheet = musicSheetService.initMusicSheet(addMusicSheet);
-        MusicSheet musicSheet1 = musicSheetService.getById(record.getMusicSheetId());
         musicSheet.setCbsMusicSheetId(musicSheet1.getCbsMusicSheetId());
+        musicSheetService.removeById(record.getMusicSheetId());
+        musicSheetAccompanimentService.delByMusicSheetId(record.getMusicSheetId());
         if(record.getAuditState() == AuthStatusEnum.DOING){
-            musicSheetService.removeById(record.getMusicSheetId());
-            musicSheetAccompanimentService.delByMusicSheetId(record.getMusicSheetId());
             //保存曲目信息
             musicSheetService.save(musicSheet);
             List<MusicSheetAccompaniment> musicSheetAccompaniments = musicSheetAccompanimentService.initMusicSheetAccompaniment(musicSheetAuthRecord.getMusicSheetJson(),musicSheet.getId());
@@ -268,14 +293,13 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
     public List<MusicSheetDetailVo> auditDetailList(String batchNo) {
         List<MusicSheetDetailVo> sheetDetailVos = musicSheetService.getDao().auditDetailList(null, batchNo);
         if (CollectionUtils.isNotEmpty(sheetDetailVos)) {
-            List<Long> musicSheetIds = sheetDetailVos.stream().map(e -> e.getId()).collect(Collectors.toList());
-            List<MusicSheetAccompaniment> musicSheetAccompaniments = musicSheetAccompanimentService.lambdaQuery()
-                                                                                                    .in(MusicSheetAccompaniment::getMusicSheetId, musicSheetIds)
-                                                                                                    .list();
-            if (CollectionUtils.isNotEmpty(musicSheetAccompaniments)) {
-                Map<Long, List<MusicSheetAccompaniment>> musicSheetAccompanimentMap = musicSheetAccompaniments.stream().collect(Collectors.groupingBy(MusicSheetAccompaniment::getMusicSheetId));
-                for (MusicSheetDetailVo sheetDetailVo : sheetDetailVos) {
-                    sheetDetailVo.setBackground(musicSheetAccompanimentMap.get(sheetDetailVo.getId()));
+            for (MusicSheetDetailVo sheetDetailVo : sheetDetailVos) {
+                String musicSheetJson = sheetDetailVo.getMusicSheetJson();
+                if(StringUtils.isNotEmpty(musicSheetJson)){
+                    CbsMusicSheetWrapper.AddMusicSheet addMusicSheet = JSON.parseObject(musicSheetJson, CbsMusicSheetWrapper.AddMusicSheet.class);
+                    musicSheetService.initMusicSheetDetailVo(addMusicSheet,sheetDetailVo);
+                    sheetDetailVo.setMusicSheetJson(null);
+                    sheetDetailVo.setSubmitAuditTime(sheetDetailVo.getCreateTime());
                 }
             }
         }

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

@@ -117,6 +117,8 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     @Resource
     private SubjectService subjectService;
     @Resource
+    private InstrumentService instrumentService;
+    @Resource
     private TeacherService teacherService;
     @Resource
     private CourseCoursewareService courseCoursewareService;
@@ -402,6 +404,16 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         MusicSheetDetailVo detailVo = JSON.parseObject(JSON.toJSONString(musicSheet), MusicSheetDetailVo.class);
         List<MusicSheetAccompaniment> list = musicSheetAccompanimentService.lambdaQuery().eq(MusicSheetAccompaniment::getMusicSheetId, id).list();
         detailVo.setBackground(list);
+        //声部名称
+        List<Subject> subjectList = subjectService.findBySubjectByIdList(musicSheet.getMusicSubject());
+        detailVo.setSubjectNames(subjectList.stream().map(e->e.getName()).collect(Collectors.joining(",")));
+        //曲目标签
+        if(StringUtils.isNotEmpty(musicSheet.getMusicTag())){
+            List<MusicTag> musicTagList = musicTagService.lambdaQuery()
+                    .in(MusicTag::getId, Arrays.stream(musicSheet.getMusicTag().split(","))
+                            .map(Long::parseLong).collect(Collectors.toList())).list();
+            detailVo.setMusicTagNames(musicTagList.stream().map(MusicTag::getName).collect(Collectors.joining(",")));
+        }
         return detailVo;
     }
 
@@ -496,7 +508,6 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 //        }
         sheet.setComposer(musicSheetApplication.getComposer());
         sheet.setAudioType(AudioTypeEnum.valueOf(musicSheetApplication.getPlayMode().getCode()));
-        sheet.setMp3Type(AudioTypeEnum.valueOf(musicSheetApplication.getIsPlayBeat()&&musicSheetApplication.getIsUseSystemBeat()?"MP3":"MP3_METRONOME"));
         if (StringUtils.isNotEmpty(musicSheetApplication.getPlaySpeed())) {
             sheet.setPlaySpeed(musicSheetApplication.getPlaySpeed());
         }
@@ -532,6 +543,8 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (musicSheetApplication.getAppAuditFlag() != null){
             sheet.setAuditVersion(musicSheetApplication.getAppAuditFlag()?YesOrNoEnum.YES:YesOrNoEnum.NO);
         }
+        sheet.setHasBeat((musicSheetApplication.getIsPlayBeat() && !musicSheetApplication.getIsUseSystemBeat()) ? YesOrNoEnum.YES : YesOrNoEnum.NO);
+        sheet.setMp3Type((musicSheetApplication.getIsPlayBeat() && musicSheetApplication.getIsUseSystemBeat()) ? AudioTypeEnum.MP3 : AudioTypeEnum.MP3_METRONOME);
         sheet.setUpdateBy(musicSheetApplication.getUpdateBy());
         sheet.setExtConfigJson(musicSheetApplication.getExtConfigJson());
         sheet.setMusicJSON(musicSheetApplication.getMusicJson());
@@ -552,7 +565,39 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 
     @Override
     public MusicSheetDetailVo detail(Long id, SysUser sysUser, ClientEnum userType,String tenantAlbumId) {
-
+        MusicSheetDetailVo detailVo = baseMapper.detail(id);
+        if (detailVo == null) {
+            throw new BizException("未找到曲目信息");
+        }
+        if(detailVo.getDelFlag()){
+            //获取乐器名称
+            List<MusicSheetAccompaniment> background = detailVo.getBackground();
+            if (CollectionUtils.isNotEmpty(background)) {
+                String instrumentIds = background.stream().map(e -> e.getMusicalInstrumentId()).filter(StringUtils::isNotEmpty).collect(Collectors.joining(","));
+                if (StringUtils.isNotEmpty(instrumentIds)) {
+                    List<Long> instrumentIsList = Arrays.stream(instrumentIds.split(",")).map(Long::valueOf).distinct().collect(Collectors.toList());
+                    List<InstrumentWrapper.Instrument> instruments = instrumentService.getInstruments(instrumentIsList);
+                    Map<Long,InstrumentWrapper.Instrument> instrumentMap =
+                            instruments.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, o -> o, (o1, o2) -> o1));
+                    for (MusicSheetAccompaniment accompaniment : background) {
+                        if (StringUtils.isNotEmpty(accompaniment.getMusicalInstrumentId())){
+                            StringBuffer sb = new StringBuffer();
+                            for (String s : accompaniment.getMusicalInstrumentId().split(",")) {
+                                InstrumentWrapper.Instrument instrument = instrumentMap.get(Long.parseLong(s));
+                                if (instrument != null){
+                                    if(sb.length() > 0) {
+                                        sb.append(",");
+                                    }
+                                    sb.append(instrument.getName());
+                                }
+                            }
+                            accompaniment.setMusicalInstrumentName(sb.toString());
+                        }
+                    }
+                }
+            }
+            return detailVo;
+        }
         MusicSheetDetailVo detail = this.getCbsDetail(id);
         // 设置收藏人数
         detail.setFavoriteCount(detail.getFavoriteCount() + detail.getVirtualNumber());
@@ -747,24 +792,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     }
 
     public void initMusicSheetVo(MusicSheetVo record,CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication,Map<Long, CbsSubjectApiWrapper.Subject> subjectMap){
-        if(StringUtils.isNotEmpty(musicSheetApplication.getSubjectIds())){
-            StringBuffer sb = new StringBuffer();
-            for (String s : musicSheetApplication.getSubjectIds().split(",")) {
-                CbsSubjectApiWrapper.Subject subject = subjectMap.get(Long.parseLong(s));
-                if(subject != null){
-                    if (sb.length() > 0) {
-                        sb.append(",");
-                    }
-                    sb.append(subject.getSubjectName());
-                }
-            }
-            record.setSubjectNames(sb.toString());
-        }
+        record.setSubjectNames(musicSheetApplication.getSubjectNames());
         record.setCbsMusicSheetId(musicSheetApplication.getId());
         record.setAudioType(AudioTypeEnum.valueOf(musicSheetApplication.getPlayMode().getCode()));
         record.setCanEvaluate(musicSheetApplication.getIsEvaluated() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
         record.setShowFingering(musicSheetApplication.getIsShowFingering() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
-        record.setMusicTag(musicSheetApplication.getMusicTagIds());
         record.setMusicTagNames(musicSheetApplication.getMusicTagNames());
         List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = musicSheetApplication.getMusicSheetAccompanimentList();
         if (CollectionUtils.isNotEmpty(accompanimentList)) {
@@ -774,6 +806,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         record.setMidiUrl(musicSheetApplication.getMidiFileUrl());
         record.setAuditVersion(musicSheetApplication.getAppAuditFlag() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
         record.setHasBeat((musicSheetApplication.getIsPlayBeat() && !musicSheetApplication.getIsUseSystemBeat()) ? YesOrNoEnum.YES : YesOrNoEnum.NO);
+        record.setMp3Type((musicSheetApplication.getIsPlayBeat() && musicSheetApplication.getIsUseSystemBeat()) ? AudioTypeEnum.MP3 : AudioTypeEnum.MP3_METRONOME);
         record.setExtConfigJson(musicSheetApplication.getExtConfigJson());
         record.setMusicJSON(musicSheetApplication.getMusicJson());
         record.setMusicJianSvg(musicSheetApplication.getMusicJianSvg());
@@ -790,6 +823,8 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if(CollectionUtils.isNotEmpty(records)){
             List<Long> cbsMusicSheetIds = records.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList());
             CbsMusicSheetWrapper.MusicSheetApplicationQuery query = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
+            query.setPage(1);
+            query.setRows(cbsMusicSheetIds.size());
             query.setMusicSheetIds(cbsMusicSheetIds);
             query.setDetailFlag(true);
             R<PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> pageInfoR = cbsMusicScoreService.selectPage(query);
@@ -824,58 +859,6 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 
             // 统计单曲归属专辑数
             updateMusicAlbumNumInfo(records);
-
-            // 声部
-
-            /*List<Long> collect = records.stream().map(MusicSheetVo::getMusicSubject)
-                                          .filter(StringUtils::isNotEmpty)
-                                            .map(Long::parseLong)
-                                          .collect(Collectors.toList());
-
-
-            List<Subject> subjectList = subjectService.findBySubjectByIdList(collect);
-            if (CollectionUtils.isNotEmpty(subjectList)) {
-                Map<Long, String> subjectMap = subjectList.stream()
-                                                        .collect(Collectors.toMap(Subject::getId, Subject::getName));
-                for (MusicSheetVo record : records) {
-                    if (StringUtils.isNotEmpty(record.getMusicSubject())) {
-                        record.setSubjectNames(subjectMap.get(Long.parseLong(record.getMusicSubject())));
-                    }
-                }
-            }*/
-
-            // 标签
-
-            List<Long>collect = records.stream().map(MusicSheetVo::getMusicTag)
-                             .filter(StringUtils::isNotEmpty)
-                             .flatMap(s -> Arrays.stream(s.split(",")))
-                             .filter(StringUtils::isNotEmpty)
-                             .map(Long::parseLong)
-                             .collect(Collectors.toList());
-            List<MusicTag> list = new ArrayList<>();
-            if (CollectionUtils.isNotEmpty(collect)) {
-                list = musicTagService.lambdaQuery()
-                                      .in(MusicTag::getId, collect)
-                                      .eq(MusicTag::getDelFlag, 0)
-                                      .eq(MusicTag::getState, 1)
-                                      .list();
-            }
-            if (CollectionUtils.isNotEmpty(list)) {
-                Map<Long, String> tagMap = list.stream()
-                                                          .collect(Collectors.toMap(MusicTag::getId, MusicTag::getName));
-                for (MusicSheetVo record : records) {
-                    if (StringUtils.isNotEmpty(record.getMusicTag())) {
-
-                        List<Long> tagIdList = Arrays.stream(record.getMusicTag().split(","))
-                                                    .filter(StringUtils::isNotEmpty)
-                                                    .map(Long::parseLong)
-                                                    .collect(Collectors.toList());
-                        String tagNames = tagIdList.stream().map(tagMap::get).collect(Collectors.joining(","));
-                        record.setMusicTagNames(tagNames);
-                    }
-                }
-            }
-
             // 是否关注
             if (query.getStudentId() != null) {
                 List<Long> musicIdList = records.stream().map(MusicSheetVo::getId).collect(Collectors.toList());
@@ -1988,6 +1971,12 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (addMusicSheet.getMusicCategoryId() == null) {
             addMusicSheet.setMusicCategoryId(-2L);
         }
+        if (addMusicSheet.getAudioType() == null) {
+            addMusicSheet.setAudioType(EAudioType.HOMEMODE);
+        }
+        if (addMusicSheet.getIsUseSystemBeat() == null) {
+            addMusicSheet.setIsUseSystemBeat(true);
+        }
     }
 
     @Override
@@ -2012,6 +2001,8 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         musicSheetAudit.setMusicSvg(addMusicSheet.getMusicSvg());
         musicSheetAudit.setComposer(addMusicSheet.getComposer());
         musicSheetAudit.setTitleImg(addMusicSheet.getMusicCover());
+        musicSheetAudit.setExtConfigJson(addMusicSheet.getExtConfigJson());
+        musicSheetAudit.setRemark(addMusicSheet.getRemark());
         if(addMusicSheet.getAudioType() != null){
             musicSheetAudit.setAccompanimentType(AccompanimentTypeEnum.valueOf(addMusicSheet.getAudioType().getCode()));
         }
@@ -2031,6 +2022,14 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if(addMusicSheet.getIsEvaluated() != null){
             musicSheetAudit.setCanEvaluate(addMusicSheet.getIsEvaluated()? YesOrNoEnum.YES: YesOrNoEnum.NO);
         }
+        //兼容审核流程修改,是否自带节拍器
+        if(addMusicSheet.getIsUseSystemBeat() == null || !addMusicSheet.getIsUseSystemBeat()){
+            musicSheetAudit.setHasBeat(YesOrNoEnum.NO);
+            musicSheetAudit.setMp3Type(AudioTypeEnum.MP3);
+        }else {
+            musicSheetAudit.setHasBeat(YesOrNoEnum.YES);
+            musicSheetAudit.setMp3Type(AudioTypeEnum.MP3_METRONOME);
+        }
         List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = addMusicSheet.getMusicSheetAccompanimentList();
         if (CollectionUtils.isNotEmpty(accompanimentList)) {
             musicSheetAudit.setMetronomeUrl(accompanimentList.get(0).getAudioFileUrl());
@@ -2051,13 +2050,86 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             if(applicationExtend.getExquisiteFlag() != null){
                 musicSheetAudit.setExquisiteFlag(applicationExtend.getExquisiteFlag()? YesOrNoEnum.YES: YesOrNoEnum.NO);
             }
+            musicSheetAudit.setSortNumber(applicationExtend.getSortNo());
+            musicSheetAudit.setMusicPrice(applicationExtend.getMusicPrice());
+        }
+        return musicSheetAudit;
+    }
+
+    @Override
+    public void initMusicSheetDetailVo(CbsMusicSheetWrapper.AddMusicSheet addMusicSheet, MusicSheetDetailVo musicSheetAudit) {
+        musicSheetAudit.setProviderType(SourceTypeEnum.TEACHER);
+        musicSheetAudit.setSourceType(SourceTypeEnum.TEACHER);
+        musicSheetAudit.setMusicSheetName(addMusicSheet.getName());
+        musicSheetAudit.setMusicSubject(addMusicSheet.getSubjectIds());
+        musicSheetAudit.setMusicSvg(addMusicSheet.getMusicSvg());
+        musicSheetAudit.setComposer(addMusicSheet.getComposer());
+        musicSheetAudit.setTitleImg(addMusicSheet.getMusicCover());
+        musicSheetAudit.setExtConfigJson(addMusicSheet.getExtConfigJson());
+        musicSheetAudit.setRemark(addMusicSheet.getRemark());
+        if(addMusicSheet.getAudioType() != null){
+            musicSheetAudit.setAccompanimentType(AccompanimentTypeEnum.valueOf(addMusicSheet.getAudioType().getCode()));
+        }
+        musicSheetAudit.setPlaySpeed(addMusicSheet.getPlaySpeed());
+        if(addMusicSheet.getIsConvertibleScore() != null){
+            musicSheetAudit.setNotation(addMusicSheet.getIsConvertibleScore()? YesOrNoEnum.YES: YesOrNoEnum.NO);
+        }
+        if(addMusicSheet.getMusicSheetType() != null){
+            musicSheetAudit.setMusicSheetType(MusicSheetTypeEnum.valueOf(addMusicSheet.getMusicSheetType().getCode()));
+        }
+        if(addMusicSheet.getPlayMode() != null){
+            musicSheetAudit.setAudioType(AudioTypeEnum.valueOf(addMusicSheet.getPlayMode().getCode()));
+        }
+        if(addMusicSheet.getIsShowFingering() != null){
+            musicSheetAudit.setShowFingering(addMusicSheet.getIsShowFingering()? YesOrNoEnum.YES: YesOrNoEnum.NO);
+        }
+        if(addMusicSheet.getIsEvaluated() != null){
+            musicSheetAudit.setCanEvaluate(addMusicSheet.getIsEvaluated()? YesOrNoEnum.YES: YesOrNoEnum.NO);
+        }
+        //兼容审核流程修改,是否自带节拍器
+        if(addMusicSheet.getIsUseSystemBeat() == null || !addMusicSheet.getIsUseSystemBeat()){
+            musicSheetAudit.setHasBeat(YesOrNoEnum.NO);
+            musicSheetAudit.setMp3Type(AudioTypeEnum.MP3);
+        }else {
+            musicSheetAudit.setHasBeat(YesOrNoEnum.YES);
+            musicSheetAudit.setMp3Type(AudioTypeEnum.MP3_METRONOME);
+        }
+        List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = addMusicSheet.getMusicSheetAccompanimentList();
+        if (CollectionUtils.isNotEmpty(accompanimentList)) {
+            musicSheetAudit.setMetronomeUrl(accompanimentList.get(0).getAudioFileUrl());
+        }
+        List<CbsMusicSheetWrapper.MusicSheetSound> soundList = addMusicSheet.getMusicSheetSoundList();
+        if (CollectionUtils.isNotEmpty(soundList)) {
+            List<MusicSheetAccompaniment> background = new ArrayList<>();
+            for (CbsMusicSheetWrapper.MusicSheetSound sound : soundList) {
+                MusicSheetAccompaniment musicSheetAccompaniment = new MusicSheetAccompaniment();
+                musicSheetAccompaniment.setAudioFileUrl(sound.getAudioFileUrl());
+                musicSheetAccompaniment.setSortNumber(sound.getSortNumber());
+                musicSheetAccompaniment.setTrack(sound.getTrack());
+                musicSheetAccompaniment.setMusicalInstrumentId(sound.getMusicalInstrumentId());
+                background.add(musicSheetAccompaniment);
+            }
+            musicSheetAudit.setBackground(background);
+        }
+        musicSheetAudit.setXmlFileUrl(addMusicSheet.getXmlFileUrl());
+        musicSheetAudit.setMidiUrl(addMusicSheet.getMidiFileUrl());
+        List<CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend> extend = addMusicSheet.getAddMusicSheetApplicationExtend();
+        if(CollectionUtils.isNotEmpty(extend)){
+            CbsMusicSheetApplicationExtendClientWrapper.AddMusicSheetApplicationExtend applicationExtend = extend.get(0);
+            musicSheetAudit.setMusicTag(applicationExtend.getMusicTagIds());
+            if(applicationExtend.getPaymentType() != null){
+                musicSheetAudit.setPaymentType(applicationExtend.getPaymentType());
+                musicSheetAudit.setChargeType(ChargeTypeEnum.valueOf(applicationExtend.getPaymentType()));
+            }
+            if(applicationExtend.getTopFlag() != null){
+                musicSheetAudit.setTopFlag(applicationExtend.getTopFlag()? YesOrNoEnum.YES: YesOrNoEnum.NO);
+            }
             if(applicationExtend.getExquisiteFlag() != null){
                 musicSheetAudit.setExquisiteFlag(applicationExtend.getExquisiteFlag()? YesOrNoEnum.YES: YesOrNoEnum.NO);
             }
             musicSheetAudit.setSortNumber(applicationExtend.getSortNo());
             musicSheetAudit.setMusicPrice(applicationExtend.getMusicPrice());
         }
-        return musicSheetAudit;
     }
 
 

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicSheetDetailVo.java

@@ -79,5 +79,8 @@ public class MusicSheetDetailVo extends MusicSheet {
 
     @ApiModelProperty("课件id")
     private Long coursewareId;
+
+    @ApiModelProperty("曲目json文件")
+    private String musicSheetJson;
 }
 

+ 0 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/InstrumentWrapper.java

@@ -26,14 +26,10 @@ public class InstrumentWrapper {
     @AllArgsConstructor
     @ApiModel(" InstrumentQuery-乐器设置")
     public static class InstrumentQuery implements QueryInfo {
-
     	@ApiModelProperty("当前页")
         private Integer page;
-
         @ApiModelProperty("分页行数")
         private Integer rows;
-
-
         @ApiModelProperty("声部")
         private Integer subjectId;
         @ApiModelProperty("声部")
@@ -41,8 +37,6 @@ public class InstrumentWrapper {
         @ApiModelProperty("是否启用")
         private Boolean enableFlag;
 
-
-
         public String jsonString() {
             return JSON.toJSONString(this);
         }

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/MusicSheetAccompanimentWrapper.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.wrapper;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -47,7 +48,7 @@ public class MusicSheetAccompanimentWrapper {
         public static MusicSheetAccompanimentQuery from(String json) {
             return JSON.parseObject(json, MusicSheetAccompanimentQuery.class);
         }
-    }  
+    }
 
     @Data
     @Builder

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

@@ -7,6 +7,7 @@
 	     <id column="id_" jdbcType="BIGINT" property="id" />
 		 <result column="music_sheet_id_" jdbcType="BIGINT" property="musicSheetId" />
 		 <result column="music_subject_" jdbcType="VARCHAR" property="musicSubjectId" />
+		 <result column="musical_instrument_id_" jdbcType="VARCHAR" property="musicalInstrumentId" />
 		 <result column="audio_file_url_" jdbcType="VARCHAR" property="audioFileUrl" />
 		 <result column="sort_number_" jdbcType="TINYINT" property="sortNumber" />
 		 <result column="speed_" jdbcType="TINYINT" property="speed" />
@@ -15,7 +16,7 @@
 	</resultMap>
 
 	<sql id="Base_Column_List">
-		id_, music_sheet_id_, music_subject_, audio_file_url_, sort_number_,speed_, create_time_, create_by_
+		id_, music_sheet_id_, music_subject_, audio_file_url_, sort_number_,speed_,musical_instrument_id_, create_time_, create_by_
 	</sql>
 
 	<delete id="delByMusicSheetId">

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetAuthRecordMapper.xml

@@ -66,6 +66,15 @@
             </if>
             <if test="param.authStatus != null">
                 and msar.audit_state_ = #{param.authStatus}
+                <if test="param.authStatus == 'PASS'">
+                    AND ms.state_ = 1
+                </if>
+                <if test="param.authStatus == 'OUT_SALE'">
+                    AND ms.state_ = 0
+                </if>
+            </if>
+            <if test="param.createBy != null">
+                and ms.create_by_ = #{param.createBy}
             </if>
             <if test="param.startTime != null">
                 and ms.create_time_ &gt; #{param.startTime}

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

@@ -60,7 +60,6 @@
         t.payment_type_ as paymentType,
         t.provider_type_ as providerType,
         t.state_ as state,
-        t.audit_status_ as auditStatus,
         t.sort_number_ as sortNumber,
         t.top_flag_ as topFlag,
         t.exquisite_flag_ as exquisiteFlag,
@@ -78,7 +77,6 @@
         t.del_flag_ as delFlag,
         t.audit_version_ as auditVersion,
         t.source_type_ as sourceType,
-        t.submit_audit_time_ as submitAuditTime,
         t.accompaniment_type_ as accompanimentType,
         t.remark_ as remark,
         t.first_tone_ as firstTone,
@@ -129,10 +127,6 @@
 
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.MusicSheetVo">
         select <include refid="Base_Column_List"/>
-        ,(select group_concat(mt.name_) from music_tag mt
-            where find_in_set(mt.id_,t.music_tag_) and mt.del_flag_ = 0  and mt.state_ = 1) as musicTagNames
-        ,(select group_concat(s.name_) from subject s
-            where find_in_set(s.id_,t.music_subject_) and s.del_flag_ = 0 ) as subjectNames
         from music_sheet t
         left join sys_user su on t.create_by_ = su.id_
         <if test="param.sortByAlbumIdDesc != null">
@@ -318,6 +312,7 @@
             ,msa.sort_number_ as accompanimentSortNumber
             ,msa.create_time_ as accompanimentCreateTime
             ,msa.track_ as track
+            ,msa.musical_instrument_id_ as musicalInstrumentId
             ,su.username_ as userName
             ,su.avatar_ as userAvatar
             ,(
@@ -393,6 +388,7 @@
         <result column="musicJianSvg" jdbcType="VARCHAR" property="musicJianSvg"/>
         <result column="musicFirstSvg" jdbcType="VARCHAR" property="musicFirstSvg"/>
         <result column="musicSheetType" jdbcType="VARCHAR" property="musicSheetType"/>
+        <result column="musicSheetJson" jdbcType="VARCHAR" property="musicSheetJson"/>
         <collection property="background" ofType="com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment">
             <id column="accompanimentId" jdbcType="BIGINT" property="id"/>
             <result column="accompanimentMusicSheetId" jdbcType="BIGINT" property="musicSheetId"/>
@@ -402,6 +398,7 @@
             <result column="accompanimentCreateTime" jdbcType="TIMESTAMP" property="createTime"/>
             <result column="accompanimentMetronomeUrl" jdbcType="VARCHAR" property="metronomeUrl"/>
             <result column="track" jdbcType="VARCHAR" property="track"/>
+            <result column="musicalInstrumentId" jdbcType="VARCHAR" property="musicalInstrumentId"/>
         </collection>
     </resultMap>
 
@@ -779,8 +776,11 @@
         ,s2.ai_default_frequency_ as aiDefaultFrequency
         ,su.real_name_ as realName
         ,msar.update_time_ as auditTime
+        ,msar.create_time_ as submitAuditTime
+        ,msar.audit_state_ as auditStatus
         ,su2.username_ as auditName
         ,msar.reason_ as auditReason
+        ,msar.music_sheet_json_ as musicSheetJson
         from music_sheet_auth_record  msar
         left join music_sheet t on t.id_ = msar.music_sheet_id_
         left join sys_user su on su.id_ = t.create_by_