|
@@ -2,24 +2,22 @@ package com.ym.mec.student.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dto.MemberPayParamDto;
|
|
|
import com.ym.mec.biz.dal.entity.MemberRankSetting;
|
|
|
-import com.ym.mec.biz.dal.enums.PeriodEnum;
|
|
|
import com.ym.mec.biz.dal.page.CloudTeacherOrderQueryInfo;
|
|
|
-import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.biz.service.CloudTeacherOrderService;
|
|
|
+import com.ym.mec.biz.service.MemberFeeSettingService;
|
|
|
+import com.ym.mec.biz.service.MemberRankPrivilegesService;
|
|
|
+import com.ym.mec.biz.service.MemberRankSettingService;
|
|
|
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.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RequestMapping("memberRank")
|
|
@@ -27,43 +25,43 @@ import java.util.List;
|
|
|
@RestController
|
|
|
public class MemberRankController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private MemberFeeSettingService memberFeeSettingService;
|
|
|
+ @Autowired
|
|
|
+ private MemberFeeSettingService memberFeeSettingService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private MemberRankSettingService memberRankSettingService;
|
|
|
+ @Autowired
|
|
|
+ private MemberRankSettingService memberRankSettingService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private MemberRankPrivilegesService memberRankPrivilegesService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private CloudTeacherOrderService cloudTeacherOrderService;
|
|
|
+ @Autowired
|
|
|
+ private MemberRankPrivilegesService memberRankPrivilegesService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private CloudTeacherOrderService cloudTeacherOrderService;
|
|
|
|
|
|
- @ApiOperation(value = "获取所有的收费标准")
|
|
|
- @GetMapping("/queryList")
|
|
|
- public Object getMemberDefaultFee() {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
- List<MemberRankSetting> result = memberRankSettingService.queryListByIsDefault(false);
|
|
|
+ @ApiOperation(value = "获取所有的收费标准")
|
|
|
+ @GetMapping("/queryList")
|
|
|
+ public Object getMemberDefaultFee() {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
|
|
|
- for (MemberRankSetting mrs : result) {
|
|
|
- mrs.setMemberFeeSetting(memberFeeSettingService.findByRankIdAndOrganId(sysUser.getOrganId(), mrs.getId()));
|
|
|
- mrs.setMemberPrivilegesItemList(memberRankPrivilegesService.queryByMemberRankId(mrs.getId()));
|
|
|
- }
|
|
|
- return succeed(result);
|
|
|
- }
|
|
|
+ List<MemberRankSetting> result = memberRankSettingService.queryListByIsDefault(false);
|
|
|
|
|
|
- @ApiOperation(value = "购买会员")
|
|
|
- @PostMapping("/buy")
|
|
|
- public Object buy(@RequestBody MemberPayParamDto memberPayParamDto) throws Exception {
|
|
|
- return memberRankSettingService.buy(memberPayParamDto);
|
|
|
- }
|
|
|
+ for (MemberRankSetting mrs : result) {
|
|
|
+ mrs.setMemberFeeSetting(memberFeeSettingService.findByRankIdAndOrganId(sysUser.getOrganId(), mrs.getId()));
|
|
|
+ mrs.setMemberPrivilegesItemList(memberRankPrivilegesService.queryByMemberRankId(mrs.getId()));
|
|
|
+ }
|
|
|
+ return succeed(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "购买会员")
|
|
|
+ @PostMapping("/buy")
|
|
|
+ public Object buy(@RequestBody MemberPayParamDto memberPayParamDto) throws Exception {
|
|
|
+ return memberRankSettingService.buy(memberPayParamDto);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 齐齐哈尔购买团练宝-默认激活
|
|
@@ -96,11 +94,22 @@ public class MemberRankController extends BaseController {
|
|
|
return memberRankSettingService.buy2Qqhe(memberPayParamDto);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "查询是否有待支付的活动订单")
|
|
|
+ @GetMapping("/queryBuy2Qqhe")
|
|
|
+ public Object queryBuy2Qqhe() {
|
|
|
+ return memberRankSettingService.queryBuy2Qqhe();
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "2021-09活动购买会员")
|
|
|
- @PostMapping("/activeBuy")
|
|
|
- public HttpResponseResult ActiveBuy(@RequestBody MemberPayParamDto memberPayParamDto) throws Exception {
|
|
|
- throw new BizException("活动已结束,谢谢关注");
|
|
|
+ @ApiOperation(value = "关闭活动订单")
|
|
|
+ @GetMapping("/closeBuy2Qqhe")
|
|
|
+ public Object closeBuy2Qqhe(String orderNo) {
|
|
|
+ return memberRankSettingService.closeBuy2Qqhe(orderNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "2021-09活动购买会员")
|
|
|
+ @PostMapping("/activeBuy")
|
|
|
+ public HttpResponseResult ActiveBuy(@RequestBody MemberPayParamDto memberPayParamDto) throws Exception {
|
|
|
+ throw new BizException("活动已结束,谢谢关注");
|
|
|
// Date nowTime = new Date();
|
|
|
// String startTimeStr = sysConfigDao.findConfigValue("cloud_teacher_active_start_time");
|
|
|
// Date startTime = DateUtil.stringToDate(startTimeStr);
|
|
@@ -131,27 +140,27 @@ public class MemberRankController extends BaseController {
|
|
|
// buyNum,
|
|
|
// giveNum,
|
|
|
// 202109,remark,memberPayParamDto.isRepay());
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "查询订单列表")
|
|
|
@GetMapping("/queryOrderPage")
|
|
|
public Object queryOrderPage(CloudTeacherOrderQueryInfo queryInfo) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (user == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- queryInfo.setStudentId(user.getId());
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ queryInfo.setStudentId(user.getId());
|
|
|
return succeed(cloudTeacherOrderService.queryPage(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取学员购买的云教练活动订单")
|
|
|
@GetMapping("/queryActiveOrderPage")
|
|
|
public Object queryActiveOrderPage() {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (user == null) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
- return succeed(cloudTeacherOrderService.queryActiveOrderPage(user.getId(),202109,null));
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ return succeed(cloudTeacherOrderService.queryActiveOrderPage(user.getId(), 202109, null));
|
|
|
}
|
|
|
|
|
|
}
|