|
@@ -1,6 +1,10 @@
|
|
|
package com.ym.mec.web.controller.education;
|
|
|
|
|
|
+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.dao.EmployeeDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.enums.ClientTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
|
|
@@ -14,6 +18,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RequestMapping("eduMusicScore")
|
|
|
@Api(tags = "智能陪练")
|
|
|
@RestController
|
|
@@ -22,6 +29,10 @@ public class EduMusicScoreController extends BaseController {
|
|
|
private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
|
|
|
@Autowired
|
|
|
private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private EmployeeDao employeeDao;
|
|
|
|
|
|
@ApiOperation(value = "树状列表")
|
|
|
@GetMapping("/queryTree")
|
|
@@ -39,6 +50,10 @@ public class EduMusicScoreController extends BaseController {
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@GetMapping("/queryPageLimit")
|
|
|
public Object queryPageLimit(SysExamSongQueryInfo queryInfo) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
String type = queryInfo.getType();
|
|
|
if(StringUtils.isEmpty(type)){
|
|
|
queryInfo.setType("ALL");
|
|
@@ -47,6 +62,17 @@ public class EduMusicScoreController extends BaseController {
|
|
|
queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
|
|
|
}
|
|
|
queryInfo.setShowFlag(1);
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }else if(org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ return failed("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ return failed("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
return succeed(sysMusicScoreAccompanimentService.queryScorePage(queryInfo));
|
|
|
}
|
|
|
|