|
@@ -1,26 +1,22 @@
|
|
|
package com.ym.mec.web.controller.education;
|
|
|
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
-import com.ym.mec.biz.dal.dto.LuckStatisDto;
|
|
|
-import com.ym.mec.biz.dal.dto.OrderStatisDto;
|
|
|
-import com.ym.mec.biz.dal.dto.OrganMaxAmountDto;
|
|
|
-import com.ym.mec.biz.dal.entity.Organization;
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.page.CloudTeacherActiveQueryInfo;
|
|
|
-import com.ym.mec.biz.service.OrganizationService;
|
|
|
-import com.ym.mec.biz.service.StudentService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
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.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
@@ -41,6 +37,111 @@ public class ActivityController extends BaseController {
|
|
|
private OrganizationService organizationService;
|
|
|
@Autowired
|
|
|
private StudentService studentService;
|
|
|
+ @Autowired
|
|
|
+ private VipGroupActivityService vipGroupActivityService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
+ @Autowired
|
|
|
+ private VipGroupDefaultClassesUnitPriceDao vipGroupDefaultClassesUnitPriceDao;
|
|
|
+ @Autowired
|
|
|
+ private VipGroupService vipGroupService;
|
|
|
+ @Autowired
|
|
|
+ private PracticeGroupService practiceGroupService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取待排课的活动方案列表")
|
|
|
+ @RequestMapping("/queryWaitCourseActivity")
|
|
|
+ public Object queryWaitCourseActivity(){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ return succeed(vipGroupActivityService.queryWaitCourseActivity(null,employee.getOrganIdList()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取活动待排课学员数量")
|
|
|
+ @RequestMapping("/getActivityWaitCourseStudentNum")
|
|
|
+ public Object getActivityWaitCourseStudentNum(Integer activityId){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ return succeed(vipGroupActivityService.getActivityWaitCourseStudentNum(null,activityId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取活动学员课排课次数")
|
|
|
+ @RequestMapping("/getActivityStudentCanCourseNum")
|
|
|
+ public Object getActivityStudentCanCourseNum(Integer activityId){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ return succeed(vipGroupActivityService.getActivityStudentCanCourseNum(null,activityId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "管理端活动排课")
|
|
|
+ @PostMapping("/createVipGroup")
|
|
|
+ public Object createVipGroup(@RequestBody VipGroupApplyDto vipGroupApplyDto){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ VipGroupApplyBaseInfoDto applyBaseInfo = vipGroupApplyDto.getVipGroupApplyBaseInfo();
|
|
|
+ Integer userId = sysUser.getId();
|
|
|
+ applyBaseInfo.setUserId(userId);
|
|
|
+ Teacher teacher = teacherDao.get(userId);
|
|
|
+ if(Objects.isNull(teacher)){
|
|
|
+ return failed("请指定指导老师!");
|
|
|
+ }
|
|
|
+ Integer firstStudentId = applyBaseInfo.getFirstStudentId();
|
|
|
+ SysUser student = teacherDao.getUser(firstStudentId);
|
|
|
+ if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
|
|
|
+ return failed("学员信息异常");
|
|
|
+ }
|
|
|
+ applyBaseInfo.setOrganId(student.getOrganId());
|
|
|
+ for (CourseSchedule courseSchedule : vipGroupApplyDto.getCourseSchedules()) {
|
|
|
+ courseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(), applyBaseInfo.getSingleClassMinutes()));
|
|
|
+ }
|
|
|
+ VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(applyBaseInfo.getVipGroupCategoryId(), applyBaseInfo.getOrganId());
|
|
|
+ if(Objects.nonNull(vipGroupDefaultClassesUnitPrice)){
|
|
|
+ applyBaseInfo.setOnlineClassesUnitPrice(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice());
|
|
|
+ applyBaseInfo.setOfflineClassesUnitPrice(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
|
|
|
+ }
|
|
|
+
|
|
|
+ applyBaseInfo.setEducationalTeacherId(sysUser.getId());
|
|
|
+ return vipGroupService.createActivityVipGroup1(vipGroupApplyDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "管理端网管课活动排课")
|
|
|
+ @PostMapping("/createPracticeGroup")
|
|
|
+ public Object createPracticeGroup(@RequestBody PracticeGroupApplyDto practiceGroupApplyDto){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ PracticeGroupApplyBaseInfoDto applyBaseInfo = practiceGroupApplyDto.getPracticeGroupApplyBaseInfoDto();
|
|
|
+ Integer userId = sysUser.getId();
|
|
|
+ applyBaseInfo.setUserId(userId);
|
|
|
+ Teacher teacher = teacherDao.get(userId);
|
|
|
+ if(Objects.isNull(teacher)){
|
|
|
+ return failed("请指定指导老师!");
|
|
|
+ }
|
|
|
+ SysUser student = teacherDao.getUser(applyBaseInfo.getStudentId());
|
|
|
+ if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
|
|
|
+ return failed("学员信息异常");
|
|
|
+ }
|
|
|
+ applyBaseInfo.setOrganId(student.getOrganId());
|
|
|
+ for (CourseSchedule courseSchedule : practiceGroupApplyDto.getCourseSchedules()) {
|
|
|
+ courseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(), applyBaseInfo.getSingleClassMinutes()));
|
|
|
+ }
|
|
|
+ applyBaseInfo.setEducationalTeacherId(sysUser.getId());
|
|
|
+ return practiceGroupService.createActivityPracticeGroup(practiceGroupApplyDto);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "分部双11活动统计")
|
|
|
@GetMapping("/doubleEleven2020Statis")
|