|
@@ -1,18 +1,25 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
|
|
|
+import com.ym.mec.biz.dal.entity.TenantConfig;
|
|
|
import com.ym.mec.biz.service.CbsMusicScoreCategoriesService;
|
|
|
import com.ym.mec.biz.service.OrganizationService;
|
|
|
import com.ym.mec.biz.service.SysUserService;
|
|
|
+import com.ym.mec.biz.service.TenantConfigService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
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 javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RequestMapping("${app-config.url.web:}/sysMusicScoreCategories")
|
|
|
@Api(tags = "曲库分类服务")
|
|
@@ -27,6 +34,8 @@ public class SysMusicScoreCategoriesController extends BaseController {
|
|
|
// private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
|
|
|
@Resource
|
|
|
private OrganizationService organizationService;
|
|
|
+ @Resource
|
|
|
+ private TenantConfigService tenantConfigService;
|
|
|
// @Autowired
|
|
|
// private OrganizationService organizationService;
|
|
|
/*
|
|
@@ -74,7 +83,15 @@ public class SysMusicScoreCategoriesController extends BaseController {
|
|
|
@ApiOperation(value = "树状列表")
|
|
|
@GetMapping("/queryTree")
|
|
|
@PreAuthorize("@pcs.hasPermissions('sysMusicScoreCategories/queryTree')")
|
|
|
- public Object queryTree() {
|
|
|
+ public HttpResponseResult<List<SysMusicScoreCategories>> queryTree(String queryType) {
|
|
|
+ //queryType ALL 代表查询所有分类,不传代表按分部和机构配置的来筛选,TENANT 表示查询机构配置的分类
|
|
|
+ if ("ALL".equals(queryType)) {
|
|
|
+ return succeed(cbsMusicScoreCategoriesService.queryTreeByAppId());
|
|
|
+ }else if ("TENANT".equals(queryType)) {
|
|
|
+ SysUser user = sysUserService.getUser();
|
|
|
+ TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>().eq("tenant_id_", user.getTenantId()));
|
|
|
+ return succeed(cbsMusicScoreCategoriesService.queryCategoriesTreeList(tenantConfig.getTeachingMaterialId(),false));
|
|
|
+ }
|
|
|
SysUser user = sysUserService.getUser();
|
|
|
String teachingMaterialIds = organizationService.getTeachingMaterialIds(organizationService.getEmployeeOrgan(null),user.getTenantId());
|
|
|
return succeed(cbsMusicScoreCategoriesService.queryCategoriesTreeList(teachingMaterialIds,true));
|