|
@@ -23,6 +23,7 @@ import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.mec.util.http.HttpUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -313,7 +314,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
|
|
|
Date date = new Date();
|
|
|
-
|
|
|
+
|
|
|
if(registerPayDto.getIsUseBalancePayment() || amount.doubleValue() == 0){
|
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
|
if(userCashAccount == null){
|
|
@@ -322,25 +323,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
|
// 更新订单信息
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
|
|
|
-
|
|
|
- sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
-
|
|
|
- //更新下次续费时间
|
|
|
- /*musicGroupStudentFee.setUpdateTime(date);
|
|
|
- musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
- musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
- musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
|
|
|
- musicGroupStudentFeeDao.update(musicGroupStudentFee);*/
|
|
|
|
|
|
- Map<String,Object> result=new HashMap<>();
|
|
|
- result.put("orderNo",studentPaymentOrder.getOrderNo());
|
|
|
+ sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
|
|
|
- return result;
|
|
|
+ Map<String,String> notifyMap=new HashMap<>();
|
|
|
+ notifyMap.put("tradeState", "1");
|
|
|
+ notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
|
|
|
+ notifyMap.put("channelType", channelType);
|
|
|
+ notifyMap.put("orderNo", "");
|
|
|
+ studentPaymentOrderService.updateOrder(notifyMap);
|
|
|
+ return notifyMap;
|
|
|
}else{
|
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
@@ -351,10 +346,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
Map payMap = payService.getPayMap(
|
|
|
- orderAmount,
|
|
|
+ amount,
|
|
|
orderNo,
|
|
|
"http://mstutest.dayaedu.com/api-student/studentOrder/notify",
|
|
|
"http://mstutest.dayaedu.com/#/paymentresult?orderNo=" + orderNo,
|
|
@@ -468,22 +463,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
|
// 更新订单信息
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
|
|
|
sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
-
|
|
|
- //更新下次续费时间
|
|
|
- /*musicGroupStudentFee.setUpdateTime(date);
|
|
|
- musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
- musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
- musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
|
|
|
- musicGroupStudentFeeDao.update(musicGroupStudentFee);*/
|
|
|
- Map<String,Object> result=new HashMap<>();
|
|
|
- result.put("orderNo",studentPaymentOrder.getOrderNo());
|
|
|
- return result;
|
|
|
+
|
|
|
+ Map<String,String> notifyMap=new HashMap<>();
|
|
|
+ notifyMap.put("tradeState", "1");
|
|
|
+ notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
|
|
|
+ notifyMap.put("channelType", channelType);
|
|
|
+ notifyMap.put("orderNo", "");
|
|
|
+ studentPaymentOrderService.updateOrder(notifyMap);
|
|
|
+ return notifyMap;
|
|
|
}else{
|
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
@@ -496,7 +487,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
Map payMap = payService.getPayMap(
|
|
|
- orderAmount,
|
|
|
+ amount,
|
|
|
orderNo,
|
|
|
"http://mstutest.dayaedu.com/api-student/studentOrder/notify",
|
|
|
"http://mstutest.dayaedu.com/#/paymentresult?orderNo=" + orderNo,
|