|
@@ -3,27 +3,26 @@ 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.dao.TeacherDao;
|
|
|
-import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
|
|
|
-import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
|
|
|
-import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
|
|
|
-import com.ym.mec.biz.dal.entity.*;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
|
|
|
-import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.page.*;
|
|
|
-import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
+import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
|
|
|
+import com.ym.mec.biz.service.GroupClassService;
|
|
|
+import com.ym.mec.biz.service.PracticeGroupService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
-import com.ym.mec.common.exception.BizException;
|
|
|
+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.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @Author Joburgess
|
|
@@ -40,6 +39,8 @@ public class PracticeGroupManageController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private GroupClassService groupService;
|
|
|
|
|
|
@ApiOperation(value = "全查询")
|
|
|
@GetMapping("/queryAll")
|
|
@@ -49,15 +50,15 @@ public class PracticeGroupManageController extends BaseController {
|
|
|
if (sysUser == null) {
|
|
|
return failed("用户信息获取失败");
|
|
|
}
|
|
|
- if(!sysUser.getIsSuperAdmin()){
|
|
|
+ if (!sysUser.getIsSuperAdmin()) {
|
|
|
Employee employee = employeeDao.get(sysUser.getId());
|
|
|
if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
- }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
|
|
|
return failed("用户所在分部异常");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
- if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
|
|
|
return failed("非法请求");
|
|
|
}
|
|
|
}
|
|
@@ -68,7 +69,15 @@ public class PracticeGroupManageController extends BaseController {
|
|
|
@ApiOperation(value = "获取陪练课课程计划")
|
|
|
@GetMapping(value = "/findPracticeGroupCourseSchedules")
|
|
|
@PreAuthorize("@pcs.hasPermissions('practiceGroupManage/findPracticeGroupCourseSchedules')")
|
|
|
- public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo){
|
|
|
+ public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo) {
|
|
|
return succeed(practiceGroupService.findPracticeGroupCourseSchedules(queryInfo));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "关闭课程组")
|
|
|
+ @PostMapping(value = "/cancelGroup")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/cancelGroup')")
|
|
|
+ public HttpResponseResult cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount) {
|
|
|
+ groupService.cancelGroup(groupId, groupType, refundAmount);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
}
|