|
@@ -3,22 +3,31 @@ package com.ym.mec.web.controller.education;
|
|
|
|
|
|
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.dao.EmployeeDao;
|
|
|
+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.*;
|
|
|
-import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
+import com.ym.mec.biz.dal.entity.Organization;
|
|
|
+import com.ym.mec.biz.dal.entity.VipGroupActivity;
|
|
|
import com.ym.mec.biz.dal.page.ActivityStudentQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.CloudTeacherActiveQueryInfo;
|
|
|
-import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.biz.service.OrganizationService;
|
|
|
+import com.ym.mec.biz.service.StudentService;
|
|
|
+import com.ym.mec.biz.service.SysUserService;
|
|
|
+import com.ym.mec.biz.service.VipGroupActivityService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
-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.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
@@ -42,49 +51,23 @@ public class ActivityController extends BaseController {
|
|
|
@Autowired
|
|
|
private VipGroupActivityService vipGroupActivityService;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
@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(String organId){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null) {
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
- Employee employee = employeeDao.get(sysUser.getId());
|
|
|
- if (organId == null) {
|
|
|
- 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("非法请求");
|
|
|
- }
|
|
|
- }
|
|
|
+ organId = organizationService.getEmployeeOrgan(organId);
|
|
|
return succeed(vipGroupActivityService.queryWaitCourseActivity(null,organId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取活动待排课学员数量")
|
|
|
@RequestMapping("/getActivityWaitCourseStudentNum")
|
|
|
public Object getActivityWaitCourseStudentNum(Integer activityId){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
ActivityWaitCourseStudentNumDto courseStudentNum = vipGroupActivityService.getActivityWaitCourseStudentNum(null, activityId);
|
|
|
VipGroupActivity vipGroupActivity = courseStudentNum.getVipGroupActivity();
|
|
|
- Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ Employee employee = employeeDao.get(sysUserService.getUserId());
|
|
|
List<Integer> activityOrgans = Arrays.stream(vipGroupActivity.getOrganId().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
|
if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
courseStudentNum.setEmployeeAndActivityOrganIds(StringUtils.join(activityOrgans,","));
|
|
@@ -99,14 +82,22 @@ public class ActivityController extends BaseController {
|
|
|
@ApiOperation(value = "获取活动学员课排课次数")
|
|
|
@RequestMapping("/getActivityStudentCanCourseNum")
|
|
|
public Object getActivityStudentCanCourseNum(ActivityStudentQueryInfo queryInfo){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
return succeed(vipGroupActivityService.getActivityStudentCanCourseNum(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分部双11活动统计")
|
|
|
+ @GetMapping("/organDoubleEleven2022Statis")
|
|
|
+ public HttpResponseResult organDoubleEleven2022Statis(OrganDoubleEleven2021StatisDto queryInfo){
|
|
|
+ return succeed(vipGroupActivityService.organDoubleEleven2022Statis(queryInfo));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "双11活动统计")
|
|
|
+ @GetMapping("/doubleEleven2022Statis")
|
|
|
+ public HttpResponseResult doubleEleven2022Statis(){
|
|
|
+ return succeed(vipGroupActivityService.doubleEleven2022Statis());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分部双11活动统计")
|
|
|
@GetMapping("/organDoubleEleven2021Statis")
|
|
|
public HttpResponseResult organDoubleEleven2021Statis(OrganDoubleEleven2021StatisDto queryInfo){
|
|
|
return succeed(vipGroupActivityService.organDoubleEleven2021Statis(queryInfo));
|