|
@@ -1,23 +1,25 @@
|
|
|
package com.ym.mec.teacher.controller;
|
|
|
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
-import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
-import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
|
|
|
-import com.ym.mec.biz.service.TeacherService;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
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.http.HttpStatus;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.TenantConfig;
|
|
|
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
|
|
|
+import com.ym.mec.biz.service.TeacherService;
|
|
|
+import com.ym.mec.biz.service.TenantConfigService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+
|
|
|
@RequestMapping("sysMusicScoreCategories")
|
|
|
@Api(tags = "曲库分类服务")
|
|
|
@RestController
|
|
@@ -29,6 +31,9 @@ public class SysMusicScoreCategoriesController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private TeacherService teacherService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TenantConfigService tenantConfigService;
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
@@ -44,15 +49,10 @@ public class SysMusicScoreCategoriesController extends BaseController {
|
|
|
if (sysUser == null) {
|
|
|
return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
}
|
|
|
- Teacher teacher = teacherService.get(sysUser.getId());
|
|
|
- if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
- queryInfo.setOrganId(teacher.getTeacherOrganId() + "");
|
|
|
- }
|
|
|
- if(StringUtils.isNotBlank(teacher.getFlowOrganRange())){
|
|
|
- queryInfo.setOrganId(queryInfo.getOrganId() + "," + teacher.getFlowOrganRange());
|
|
|
- }
|
|
|
- queryInfo.setEnable(true);
|
|
|
- return succeed(sysMusicScoreCategoriesService.queryTree(queryInfo));
|
|
|
+
|
|
|
+ TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>().eq("tenant_id_", sysUser.getTenantId()));
|
|
|
+
|
|
|
+ return succeed(sysMusicScoreCategoriesService.queryCategoriesTreeList(tenantConfig.getTeachingMaterialId()));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取分类详情")
|