|
@@ -1,63 +1,61 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.entity.TenantConfig;
|
|
|
import com.ym.mec.biz.dal.enums.ClientTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
|
|
|
+import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.biz.service.TeacherService;
|
|
|
import com.ym.mec.biz.service.TenantConfigService;
|
|
|
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.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
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;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RequestMapping("${app-config.url.teacher:}/sysMusicScoreAccompaniment")
|
|
|
@Api(tags = "曲库伴奏服务")
|
|
|
@RestController
|
|
|
public class SysMusicScoreAccompanimentController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
|
|
|
- @Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
+ private SysUserService sysUserService;
|
|
|
+ @Resource
|
|
|
private TeacherService teacherService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TenantConfigService tenantConfigService;
|
|
|
|
|
|
@ApiOperation(value = "获取伴奏声部列表")
|
|
|
@GetMapping("/querySubjectIds")
|
|
|
- public Object querySubjectIds(Integer categoriesId) {
|
|
|
+ public HttpResponseResult<List<Subject>> querySubjectIds(Integer categoriesId) {
|
|
|
return succeed(sysMusicScoreAccompanimentService.querySubjectIds(categoriesId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@GetMapping("/queryPage")
|
|
|
- public Object queryPage(SysExamSongQueryInfo queryInfo) {
|
|
|
+ public HttpResponseResult<List<SysMusicScoreAccompaniment>> 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.setCreateUserId(sysUserService.getUserId());
|
|
|
queryInfo.setShowFlag(1);
|
|
|
return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
|
|
|
}
|
|
@@ -69,11 +67,8 @@ public class SysMusicScoreAccompanimentController extends BaseController {
|
|
|
if(StringUtils.isEmpty(type)){
|
|
|
queryInfo.setType("ALL");
|
|
|
}
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- throw new BizException("请登录");
|
|
|
- }
|
|
|
- Teacher teacher = teacherService.get(sysUser.getId());
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
+ Teacher teacher = teacherService.get(user.getId());
|
|
|
if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
queryInfo.setOrganId(teacher.getTeacherOrganId() + "");
|
|
|
}
|
|
@@ -83,11 +78,11 @@ public class SysMusicScoreAccompanimentController extends BaseController {
|
|
|
if(queryInfo.getClientType() == null){
|
|
|
queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
|
|
|
}
|
|
|
- queryInfo.setCreateUserId(sysUser.getId());
|
|
|
+ queryInfo.setCreateUserId(user.getId());
|
|
|
queryInfo.setShowFlag(1);
|
|
|
queryInfo.setEnable(true);
|
|
|
|
|
|
- TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>().eq("tenant_id_", sysUser.getTenantId()));
|
|
|
+ TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>().eq("tenant_id_", user.getTenantId()));
|
|
|
|
|
|
queryInfo.setCategoriesIds(tenantConfig.getTeachingMaterialId());
|
|
|
|