|
@@ -4,7 +4,9 @@ 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.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.entity.HttpResponseResult;
|
|
@@ -37,6 +39,8 @@ public class PracticeGroupManageController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private GroupClassService groupService;
|
|
|
|
|
|
@ApiOperation(value = "全查询")
|
|
|
@GetMapping("/queryAll")
|
|
@@ -46,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("非法请求");
|
|
|
}
|
|
|
}
|
|
@@ -65,15 +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 = "/cancelPracticeGroup")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/cancelPracticeGroup')")
|
|
|
- public HttpResponseResult cancelPracticeGroup(Long groupId, BigDecimal refundAmount){
|
|
|
- practiceGroupService.cancelPracticeGroup(groupId,refundAmount);
|
|
|
+ @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();
|
|
|
}
|
|
|
}
|