|
@@ -1,19 +1,15 @@
|
|
package com.ym.mec.student.controller;
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
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.*;
|
|
import com.ym.mec.biz.dal.dto.DegreeRegistrationActivityDto;
|
|
import com.ym.mec.biz.dal.dto.DegreeRegistrationActivityDto;
|
|
import com.ym.mec.biz.dal.dto.SporadicPayDto;
|
|
import com.ym.mec.biz.dal.dto.SporadicPayDto;
|
|
-import com.ym.mec.biz.dal.entity.DegreeRegistration;
|
|
|
|
-import com.ym.mec.biz.dal.entity.Employee;
|
|
|
|
-import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
|
|
|
|
-import com.ym.mec.biz.dal.entity.Student;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
|
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
|
|
import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
|
|
import com.ym.mec.biz.service.DegreeRegistrationService;
|
|
import com.ym.mec.biz.service.DegreeRegistrationService;
|
|
@@ -62,6 +58,9 @@ public class DegreeController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private OrganizationDao organizationDao;
|
|
private OrganizationDao organizationDao;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
|
|
+
|
|
@ApiOperation(value = "考级报名支付")
|
|
@ApiOperation(value = "考级报名支付")
|
|
@PostMapping("/pay")
|
|
@PostMapping("/pay")
|
|
public HttpResponseResult pay(@RequestBody DegreeRegistrationActivityDto degreeRegistration) throws Exception {
|
|
public HttpResponseResult pay(@RequestBody DegreeRegistrationActivityDto degreeRegistration) throws Exception {
|
|
@@ -127,7 +126,7 @@ public class DegreeController extends BaseController {
|
|
@GetMapping("/getParams")
|
|
@GetMapping("/getParams")
|
|
public HttpResponseResult getParams(){
|
|
public HttpResponseResult getParams(){
|
|
SysUser user = sysUserFeignService.queryUserInfo();
|
|
SysUser user = sysUserFeignService.queryUserInfo();
|
|
- if(Objects.isNull(user)){
|
|
|
|
|
|
+ if(Objects.isNull(user)||Objects.isNull(user.getId())){
|
|
return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -141,20 +140,39 @@ public class DegreeController extends BaseController {
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
-// DegreeRegistration degreeRegistration = degreeRegistrationDao.getWithUserIdAndActivityTag(user.getId(), DegreeRegistrationService.ACTIVITY_TAG);
|
|
|
|
-
|
|
|
|
Student student = studentDao.get(user.getId());
|
|
Student student = studentDao.get(user.getId());
|
|
result.put("userInfo", user);
|
|
result.put("userInfo", user);
|
|
result.put("isNewUser", student.getIsNewUser());
|
|
result.put("isNewUser", student.getIsNewUser());
|
|
result.put("organs", organizationDao.getActivityOrgans());
|
|
result.put("organs", organizationDao.getActivityOrgans());
|
|
result.put("sporadicChargeInfo", sporadicChargeInfoService.queryDetailPage(queryInfo));
|
|
result.put("sporadicChargeInfo", sporadicChargeInfoService.queryDetailPage(queryInfo));
|
|
-// if(Objects.isNull(degreeRegistration)||degreeRegistration.getStatus()==0){
|
|
|
|
-// result.put("isApplied", 0);
|
|
|
|
-// }else if(degreeRegistration.getStatus()==1){
|
|
|
|
-// result.put("isApplied", 1);
|
|
|
|
-// }else if(degreeRegistration.getStatus()==2){
|
|
|
|
-// result.put("isApplied", 2);
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
|
|
+ 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);
|
|
return succeed(result);
|
|
}
|
|
}
|
|
}
|
|
}
|