|
@@ -8,6 +8,7 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.AppMusicSheetVo;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.MusicSheetDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.MusicSheetRenderDto;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.ReasonDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.MusicSheetRelatedQueryInfo;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicSheetSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
|
|
@@ -131,37 +132,6 @@ public class MusicSheetController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/* @ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
|
|
|
- @PostMapping(value="/create", consumes="application/json", produces="application/json")
|
|
|
- public HttpResponseResult<Object> create(@Valid @RequestBody MusicSheetDto musicSheetDto) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null || sysUser.getId() == null) {
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
-
|
|
|
- if (ChargeTypeEnum.CHARGE.getCode().equals(musicSheetDto.getChargeType().getCode())
|
|
|
- && musicSheetDto.getMusicPrice()==null){
|
|
|
- return failed("此曲谱为收费曲谱,需要提供价格");
|
|
|
- }
|
|
|
- if (musicSheetDto.getNotation() == null) {
|
|
|
- musicSheetDto.setNotation(YesOrNoEnum.NO);
|
|
|
- }
|
|
|
-
|
|
|
- if (musicSheetDto.getProviderType() == null) {
|
|
|
- musicSheetDto.setProviderType(SourceTypeEnum.PLATFORM);
|
|
|
- }
|
|
|
- musicSheetDto.setUserId(sysUser.getId());
|
|
|
- musicSheetDto.setAuditStatus(AuthStatusEnum.DOING);
|
|
|
- musicSheetDto.setSubmitAuditTime(new Date());
|
|
|
- musicSheetDto.setSourceType(SourceTypeEnum.TEACHER);
|
|
|
-
|
|
|
- musicSheetDto.setFavoriteCount(0);
|
|
|
- musicSheetDto.setCreateBy(sysUser.getId());
|
|
|
- musicSheetDto.setCreateTime(new Date());
|
|
|
- musicSheetService.saveMusicSheet(musicSheetDto,sysUser.getId());
|
|
|
- return succeed("新增曲谱成功");
|
|
|
- }*/
|
|
|
-
|
|
|
@ApiOperation(value = "新增/修改", notes = "曲目表- 传入 MusicSheetWrapper.MusicSheet")
|
|
|
@PreAuthorize("@auditsvc.hasPermissions('music/sheet/save', {'BACKEND'})")
|
|
|
@PostMapping("music/sheet/save")
|
|
@@ -169,35 +139,6 @@ public class MusicSheetController extends BaseController {
|
|
|
return succeed(cbsMusicScoreService.musicSheetAdd(addMusicSheet));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
|
|
|
- @PostMapping(value="/update", consumes="application/json", produces="application/json")
|
|
|
- public HttpResponseResult<Object> update(@Valid @RequestBody MusicSheetDto musicSheet) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null || sysUser.getId() == null) {
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
- if (musicSheet.getId()==null){
|
|
|
- return failed("缺少ID");
|
|
|
- }
|
|
|
- if (musicSheet.getNotation() == null) {
|
|
|
- musicSheet.setNotation(YesOrNoEnum.NO);
|
|
|
- }
|
|
|
- musicSheet.setUserId(sysUser.getId());
|
|
|
- musicSheet.setSubmitAuditTime(new Date());
|
|
|
- musicSheet.setCreateTime(new Date());
|
|
|
- musicSheet.setCreateBy(sysUser.getId());
|
|
|
- musicSheet.setUpdateBy(sysUser.getId());
|
|
|
- musicSheet.setUpdateTime(new Date());
|
|
|
- musicSheet.setSubmitAuditTime(new Date());
|
|
|
- musicSheet.setAuditStatus(AuthStatusEnum.DOING);
|
|
|
- if ( musicSheetService.saveMusicSheet(musicSheet,sysUser.getId())){
|
|
|
- return succeed("修改成功");
|
|
|
- } else {
|
|
|
- return failed("修改失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value = "曲目分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
|
|
|
@PostMapping(value="/list", consumes="application/json", produces="application/json")
|
|
|
public HttpResponseResult<PageInfo<MusicSheetVo>> list(@RequestBody StudentMusicSheetSearch query) {
|
|
@@ -205,7 +146,6 @@ public class MusicSheetController extends BaseController {
|
|
|
if (sysUser == null || sysUser.getId() == null) {
|
|
|
return failed("用户信息获取失败");
|
|
|
}
|
|
|
-
|
|
|
// 老师课查看所有曲目
|
|
|
if (query.getMyself() == null || query.getMyself()) {
|
|
|
// 设置只查老师用户 状态为启用
|
|
@@ -229,7 +169,6 @@ public class MusicSheetController extends BaseController {
|
|
|
|
|
|
// 检查app版本
|
|
|
query.setAuditVersion(appVersionInfoService.getAppAuditVersion(query.getPlatform(),query.getVersion()));
|
|
|
-
|
|
|
// 只能看通过审核 并且 启用的 曲目
|
|
|
query.setState(YesOrNoEnum.YES);
|
|
|
query.setAuditStatus(AuthStatusEnum.PASS);
|
|
@@ -242,24 +181,21 @@ public class MusicSheetController extends BaseController {
|
|
|
return succeed(PageUtil.pageInfo(musicSheetVoIPage));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 启用/停用
|
|
|
- */
|
|
|
@PostMapping("/state/{id}")
|
|
|
@ApiOperation(value = "启用/停用", notes = "传入id")
|
|
|
- public HttpResponseResult<Boolean> state(@ApiParam(value = "曲目编号", required = true) @PathVariable Long id) {
|
|
|
- if (StringUtil.isEmpty(id)) {
|
|
|
+ public HttpResponseResult<Boolean> state(@ApiParam(value = "曲目编号", required = true) @PathVariable Long id, @RequestBody ReasonDto reasonDto) {
|
|
|
+ if (id == null) {
|
|
|
return failed("参数不能为空");
|
|
|
}
|
|
|
MusicSheet musicSheet = musicSheetService.getById(id);
|
|
|
if (musicSheet == null) {
|
|
|
return failed("未找到曲目");
|
|
|
}
|
|
|
-
|
|
|
- if (musicSheet.getState().equals(YesOrNoEnum.NO)) {
|
|
|
- return failed("曲目已被下架");
|
|
|
+ if (YesOrNoEnum.YES.equals(musicSheet.getState()) &&
|
|
|
+ musicSheet.getSourceType().equals(SourceTypeEnum.TEACHER) && StringUtil.isEmpty(reasonDto.getReason())) {
|
|
|
+ return failed("请填写下架原因");
|
|
|
}
|
|
|
- return status(musicSheetService.state(id, "", ClientEnum.TEACHER));
|
|
|
+ return status(musicSheetService.state(id,reasonDto.getReason(),ClientEnum.SYSTEM));
|
|
|
}
|
|
|
|
|
|
/**
|