|
@@ -106,7 +106,7 @@ public class MusicGroupController extends BaseController {
|
|
|
if (sysUser == null) {
|
|
|
return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
}
|
|
|
- return succeed(musicGroupService.findTeachersByStuId(sysUser.getId(),search));
|
|
|
+ return succeed(musicGroupService.findTeachersByStuId(sysUser.getId(), search));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -154,18 +154,22 @@ public class MusicGroupController extends BaseController {
|
|
|
if (studentRegistration.getPaymentStatus() != PaymentStatusEnum.OPEN) {
|
|
|
return failed("乐团还未开启缴费,请等待通知");
|
|
|
}
|
|
|
- if (studentRegistration.getTemporaryCourseFee() == null) {
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY && musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
|
|
|
- return failed("乐团在" + musicGroup.getStatus().getMsg() + ",不能缴费");
|
|
|
- }
|
|
|
-
|
|
|
- if(musicGroup.getStatus() == MusicGroupStatusEnum.PAY){
|
|
|
- Date now = new Date();
|
|
|
- if (DateUtil.daysBetween(musicGroup.getPaymentExpireDate(), now) > 1) {
|
|
|
- return failed("乐团缴费时间已截止");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (studentRegistration.getTemporaryCourseFee() == null) {
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY && musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
|
|
|
+ return failed("乐团在" + musicGroup.getStatus().getMsg() + ",不能缴费");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
|
|
|
+ Date now = new Date();
|
|
|
+ MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
|
|
|
+ if (regCalender != null) {
|
|
|
+ musicGroup.setPaymentExpireDate(regCalender.getDeadlinePaymentDate());
|
|
|
+ }
|
|
|
+ if (DateUtil.daysBetween(musicGroup.getPaymentExpireDate(), now) > 1) {
|
|
|
+ return failed("乐团缴费时间已截止");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
studentRegistration.setOwnershipType(musicGroup.getOwnershipType());
|
|
|
studentRegistration.setChargeTypeId(musicGroup.getChargeTypeId());
|
|
|
|
|
@@ -174,7 +178,7 @@ public class MusicGroupController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "查询续费信息")
|
|
|
@GetMapping("/queryRenewInfo")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
|
|
|
public HttpResponseResult queryRenewInfo(String musicGroupId) throws Exception {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
Integer userId = sysUser.getId();
|
|
@@ -191,9 +195,9 @@ public class MusicGroupController extends BaseController {
|
|
|
throw new BizException("已缴费");
|
|
|
}
|
|
|
MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
|
|
|
- if(userLastCalenderDetail == null){
|
|
|
+ if (userLastCalenderDetail == null) {
|
|
|
MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
|
|
|
- String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER)?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
|
|
|
+ String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER) ? "当前续费时间已截止,如有问题请联系指导老师" : "当前续费未开始,如有问题请联系指导老师";
|
|
|
throw new BizException(tips);
|
|
|
}
|
|
|
|
|
@@ -210,38 +214,38 @@ public class MusicGroupController extends BaseController {
|
|
|
model.put("amount", amount);
|
|
|
model.put("nextPaymentDate", musicGroupStudentFee.getNextPaymentDate());
|
|
|
model.put("musicGroupSubjectPlan", musicGroupSubjectPlan);
|
|
|
- model.put("balance",studentRegistration.getBalance());
|
|
|
+ model.put("balance", studentRegistration.getBalance());
|
|
|
|
|
|
return succeed(model);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "续费")
|
|
|
- @GetMapping("/renew")
|
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "isUseBalancePayment", value = "是否使用余额付款", required = true, dataType = "Boolean") })
|
|
|
- public HttpResponseResult renew(String musicGroupId, Boolean isUseBalancePayment, boolean isRepeatPay) throws Exception {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- Integer userId = sysUser.getId();
|
|
|
-
|
|
|
- if (isUseBalancePayment == null) {
|
|
|
- isUseBalancePayment = false;
|
|
|
- }
|
|
|
- if (isRepeatPay == false) {
|
|
|
+ @ApiOperation(value = "续费")
|
|
|
+ @GetMapping("/renew")
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "isUseBalancePayment", value = "是否使用余额付款", required = true, dataType = "Boolean")})
|
|
|
+ public HttpResponseResult renew(String musicGroupId, Boolean isUseBalancePayment, boolean isRepeatPay) throws Exception {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Integer userId = sysUser.getId();
|
|
|
+
|
|
|
+ if (isUseBalancePayment == null) {
|
|
|
+ isUseBalancePayment = false;
|
|
|
+ }
|
|
|
+ if (isRepeatPay == false) {
|
|
|
// 判断是否存在支付中的记录
|
|
|
List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.MUSIC, musicGroupId, userId, DealStatusEnum.ING,
|
|
|
OrderTypeEnum.RENEW);
|
|
|
- if (list.size() > 0) {
|
|
|
- return failed(HttpStatus.CONTINUE, "您有待支付的订单");
|
|
|
- }
|
|
|
- }
|
|
|
+ if (list.size() > 0) {
|
|
|
+ return failed(HttpStatus.CONTINUE, "您有待支付的订单");
|
|
|
+ }
|
|
|
+ }
|
|
|
MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
|
|
|
- if(userLastCalenderDetail == null){
|
|
|
+ if (userLastCalenderDetail == null) {
|
|
|
MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
|
|
|
- String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER)?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
|
|
|
+ String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER) ? "当前续费时间已截止,如有问题请联系指导老师" : "当前续费未开始,如有问题请联系指导老师";
|
|
|
throw new BizException(tips);
|
|
|
}
|
|
|
return succeed(musicGroupService.renew(musicGroupId, userId, isUseBalancePayment));
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "退团")
|
|
|
@PostMapping("/quitMusicGroup")
|
|
@@ -274,7 +278,7 @@ public class MusicGroupController extends BaseController {
|
|
|
return failed(HttpStatus.CONTINUE, "您有待支付的订单");
|
|
|
}
|
|
|
Map payMap = musicGroupService.pay(registerPayDto);
|
|
|
- if(payMap.containsKey("tradeState")){
|
|
|
+ if (payMap.containsKey("tradeState")) {
|
|
|
return failed(HttpStatus.CREATED, "恭喜您,报名成功!");
|
|
|
}
|
|
|
|
|
@@ -296,7 +300,7 @@ public class MusicGroupController extends BaseController {
|
|
|
return failed("您已支付成功,请勿重复支付");
|
|
|
}
|
|
|
Map payMap = musicGroupService.rePay(registerPayDto);
|
|
|
- if(payMap.containsKey("tradeState")){
|
|
|
+ if (payMap.containsKey("tradeState")) {
|
|
|
return failed(HttpStatus.CREATED, "恭喜您,报名成功!");
|
|
|
}
|
|
|
return succeed(payMap);
|