|
@@ -0,0 +1,139 @@
|
|
|
|
+package com.yonge.cooleshow.admin.controller.open;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.dayaedu.cbs.common.enums.school.EMusicSheetType;
|
|
|
|
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
|
|
|
|
+import com.microsvc.toolkit.common.response.template.R;
|
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
|
+import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.UserMusic;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.InstrumentService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.UserMusicService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetVo;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.InstrumentWrapper;
|
|
|
|
+import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
|
+import com.yonge.cooleshow.common.enums.YesOrNoEnum;
|
|
|
|
+import com.yonge.toolset.base.exception.BizException;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ * 曲谱表 web 控制层
|
|
|
|
+ * @author yzp
|
|
|
|
+ * @date 2022-03-26 00:21:46
|
|
|
|
+ * @version v1.0
|
|
|
|
+ **/
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("${app-config.url.admin:}/open/musicSheet")
|
|
|
|
+@Api(tags = "曲谱表 API接口")
|
|
|
|
+public class OpenMusicSheetCbsController extends BaseController {
|
|
|
|
+ @Resource
|
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private MusicSheetService musicSheetService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private InstrumentService instrumentService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserMusicService userMusicService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ * 查询单条
|
|
|
|
+ *
|
|
|
|
+ * @param id 详情ID
|
|
|
|
+ * @return R<MusicSheetVo.MusicSheet>
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "查询内容平台数据")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "id", dataType = "long")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("/cbsDetail/{id}")
|
|
|
|
+ public R<MusicSheetVo.MusicSheetDetail> cbsDetail(@PathVariable("id") Long id,
|
|
|
|
+ @RequestParam(required = false) String tenantAlbumId,
|
|
|
|
+ @RequestParam(required = false) Long userMusicId) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ MusicSheet musicSheet = musicSheetService.getDao().get(id);
|
|
|
|
+ if (Objects.isNull(musicSheet)) {
|
|
|
|
+ throw new BizException("曲目信息不存在");
|
|
|
|
+ }
|
|
|
|
+ if (musicSheet.getCbsMusicSheetId() ==null) {
|
|
|
|
+ throw new BizException("曲目信息异常");
|
|
|
|
+ }
|
|
|
|
+ CbsMusicSheetWrapper.MusicSheet cbsMusicSheet = musicSheetService.cbsDetail(musicSheet.getCbsMusicSheetId());
|
|
|
|
+ cbsMusicSheet.setBizId(id);
|
|
|
|
+
|
|
|
|
+ MusicSheetVo.MusicSheetDetail musicSheetDetail = JSON.parseObject(JSON.toJSONString(cbsMusicSheet), MusicSheetVo.MusicSheetDetail.class);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return R.from(musicSheetDetail);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|