|
@@ -1,55 +1,37 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
-import com.ym.mec.biz.service.impl.SysConfigServiceImpl;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.transaction.annotation.Isolation;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dto.DegreeRegistrationActivityDto;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
import com.ym.mec.biz.dal.entity.DegreeRegistration;
|
|
|
import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
|
|
|
import com.ym.mec.biz.service.DegreeRegistrationService;
|
|
|
import com.ym.mec.biz.service.SporadicChargeInfoService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.util.idcard.IdcardValidator;
|
|
|
+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.beans.factory.annotation.Value;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.transaction.annotation.Isolation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("degree")
|
|
|
@Api(tags = "考级报名服务")
|
|
@@ -75,9 +57,6 @@ public class DegreeController extends BaseController {
|
|
|
private StudentDao studentDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private SysConfigDao sysConfigDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
|
|
|
|
@Autowired
|
|
@@ -86,9 +65,6 @@ public class DegreeController extends BaseController {
|
|
|
@Value("${message.debugMode: false}")
|
|
|
private boolean debugMode;
|
|
|
|
|
|
- @Autowired
|
|
|
- private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
|
-
|
|
|
@ApiOperation(value = "考级报名支付")
|
|
|
@PostMapping("/pay")
|
|
|
public HttpResponseResult pay(@RequestBody DegreeRegistrationActivityDto degreeRegistration) throws Exception {
|
|
@@ -162,6 +138,7 @@ public class DegreeController extends BaseController {
|
|
|
studentDao.getLocked(degreeRegistration.getUserId());
|
|
|
List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(),
|
|
|
DegreeRegistrationService.ACTIVITY_TAG,degreeRegistration.getDegreeType(),degreeRegistration.getSporadicId());
|
|
|
+
|
|
|
long levelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
|
|
|
long theoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
|
|
|
|
|
@@ -222,32 +199,32 @@ public class DegreeController extends BaseController {
|
|
|
// result.put("levelApplied", levelNum>0?1:0);
|
|
|
// result.put("theoryLevelApplied", theoryLevelNum>0?1:0);
|
|
|
|
|
|
- List<StudentPaymentOrderDetail> historyOrderDetails = studentPaymentOrderDetailDao.getWithUserAndOrderType(user.getId(), OrderTypeEnum.DEGREE_REGISTRATION);
|
|
|
- int historyVipNum = 0, historyPracticeNum = 0, historyHighNum = 0;
|
|
|
- for (StudentPaymentOrderDetail historyOrderDetail : historyOrderDetails) {
|
|
|
- if(StringUtils.isBlank(historyOrderDetail.getGoodsIdList())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- Map<String, Integer> courseNumMap = JSON.parseObject(historyOrderDetail.getGoodsIdList(), Map.class);
|
|
|
- for (Map.Entry<String, Integer> stringIntegerEntry : courseNumMap.entrySet()) {
|
|
|
- switch (stringIntegerEntry.getKey()){
|
|
|
- case "VIP":
|
|
|
- historyVipNum = historyVipNum + stringIntegerEntry.getValue();
|
|
|
- break;
|
|
|
- case "PRACTICE":
|
|
|
- historyPracticeNum = historyPracticeNum + stringIntegerEntry.getValue();
|
|
|
- break;
|
|
|
- case "HIGH":
|
|
|
- historyHighNum = historyHighNum + stringIntegerEntry.getValue();
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Map<String, Integer> historyCourseInfo = new HashMap<>();
|
|
|
- historyCourseInfo.put(CourseSchedule.CourseScheduleType.VIP.getCode(), historyVipNum);
|
|
|
- historyCourseInfo.put(CourseSchedule.CourseScheduleType.PRACTICE.getCode(), historyPracticeNum);
|
|
|
- historyCourseInfo.put(CourseSchedule.CourseScheduleType.HIGH.getCode(), historyHighNum);
|
|
|
- result.put("historyCourseInfo", historyCourseInfo);
|
|
|
+// List<StudentPaymentOrderDetail> historyOrderDetails = studentPaymentOrderDetailDao.getWithUserAndOrderType(user.getId(), OrderTypeEnum.DEGREE_REGISTRATION);
|
|
|
+// int historyVipNum = 0, historyPracticeNum = 0, historyHighNum = 0;
|
|
|
+// for (StudentPaymentOrderDetail historyOrderDetail : historyOrderDetails) {
|
|
|
+// if(StringUtils.isBlank(historyOrderDetail.getGoodsIdList())){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// Map<String, Integer> courseNumMap = JSON.parseObject(historyOrderDetail.getGoodsIdList(), Map.class);
|
|
|
+// for (Map.Entry<String, Integer> stringIntegerEntry : courseNumMap.entrySet()) {
|
|
|
+// switch (stringIntegerEntry.getKey()){
|
|
|
+// case "VIP":
|
|
|
+// historyVipNum = historyVipNum + stringIntegerEntry.getValue();
|
|
|
+// break;
|
|
|
+// case "PRACTICE":
|
|
|
+// historyPracticeNum = historyPracticeNum + stringIntegerEntry.getValue();
|
|
|
+// break;
|
|
|
+// case "HIGH":
|
|
|
+// historyHighNum = historyHighNum + stringIntegerEntry.getValue();
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// Map<String, Integer> historyCourseInfo = new HashMap<>();
|
|
|
+// historyCourseInfo.put(CourseSchedule.CourseScheduleType.VIP.getCode(), historyVipNum);
|
|
|
+// historyCourseInfo.put(CourseSchedule.CourseScheduleType.PRACTICE.getCode(), historyPracticeNum);
|
|
|
+// historyCourseInfo.put(CourseSchedule.CourseScheduleType.HIGH.getCode(), historyHighNum);
|
|
|
+// result.put("historyCourseInfo", historyCourseInfo);
|
|
|
|
|
|
return succeed(result);
|
|
|
}
|