|
@@ -1,15 +1,10 @@
|
|
package com.ym.mec.web.controller;
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
|
-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.entity.VipGroupCategory;
|
|
|
|
-import com.ym.mec.biz.service.VipGroupCategoryService;
|
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -17,9 +12,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
|
+import com.ym.mec.biz.dal.entity.VipGroupCategory;
|
|
|
|
+import com.ym.mec.biz.service.VipGroupCategoryService;
|
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
|
|
|
@Api(tags = "vip课类别")
|
|
@Api(tags = "vip课类别")
|
|
@RequestMapping("vipGroupCategory")
|
|
@RequestMapping("vipGroupCategory")
|
|
@@ -43,27 +41,18 @@ public class VipGroupCategoryController extends BaseController {
|
|
@ApiOperation("全查询")
|
|
@ApiOperation("全查询")
|
|
@GetMapping(value = "/queryAll")
|
|
@GetMapping(value = "/queryAll")
|
|
@PreAuthorize("@pcs.hasPermissions('vipGroupCategory/queryAll')")
|
|
@PreAuthorize("@pcs.hasPermissions('vipGroupCategory/queryAll')")
|
|
- public Object queryAll(String organId) {
|
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- return failed("用户信息获取失败");
|
|
|
|
- }
|
|
|
|
- if (!sysUser.getIsSuperAdmin()) {
|
|
|
|
- Employee employee = employeeDao.get(sysUser.getId());
|
|
|
|
- if (StringUtils.isEmpty(organId)) {
|
|
|
|
- organId = employee.getOrganIdList();
|
|
|
|
- }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
|
- return failed("用户所在分部异常");
|
|
|
|
- }else {
|
|
|
|
- List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
|
- if(!list.containsAll(Arrays.asList(organId.split(",")))){
|
|
|
|
- return failed("非法请求");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return succeed(vipGroupCategoryService.findAllByOrgan(organId));
|
|
|
|
|
|
+ public Object queryAll(QueryInfo queryInfo) {
|
|
|
|
+ return succeed(vipGroupCategoryService.queryPage(queryInfo));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("获取教师课酬")
|
|
|
|
+ @PostMapping(value = "/findTeacherDefaultSalary")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('vipGroupCategory/findTeacherDefaultSalary')")
|
|
|
|
+ public Object findTeacherDefaultSalary(Integer userId) {
|
|
|
|
+ return succeed(vipGroupCategoryService.findTeacherSalary(userId));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@ApiOperation("新增")
|
|
@ApiOperation("新增")
|
|
@PostMapping(value = "/add")
|
|
@PostMapping(value = "/add")
|
|
@PreAuthorize("@pcs.hasPermissions('vipGroupCategory/add')")
|
|
@PreAuthorize("@pcs.hasPermissions('vipGroupCategory/add')")
|