|
@@ -24,6 +24,7 @@ import com.ym.mec.util.http.HttpUtil;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -319,7 +320,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
studentPaymentOrder.setVersion(0);
|
|
studentPaymentOrder.setVersion(0);
|
|
|
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
-
|
|
|
|
|
|
+
|
|
if(registerPayDto.getIsUseBalancePayment() || amount.doubleValue() == 0){
|
|
if(registerPayDto.getIsUseBalancePayment() || amount.doubleValue() == 0){
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
if(userCashAccount == null){
|
|
if(userCashAccount == null){
|
|
@@ -328,25 +329,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
// 更新订单信息
|
|
// 更新订单信息
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
|
|
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{
|
|
}else{
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
@@ -357,17 +352,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
Map payMap = payService.getPayMap(
|
|
Map payMap = payService.getPayMap(
|
|
- orderAmount,
|
|
|
|
|
|
+ amount,
|
|
orderNo,
|
|
orderNo,
|
|
- "http://mstutest.dayaedu.com/api-student/studentOrder/notify",
|
|
|
|
- "http://mstutest.dayaedu.com/#/paymentresult?orderNo=" + orderNo,
|
|
|
|
|
|
+ baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
|
+ baseApiUrl+"/#/paymentresult?orderNo=" + orderNo,
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
userId);
|
|
userId);
|
|
-
|
|
|
|
|
|
+
|
|
studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
|
|
studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
@@ -474,22 +470,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
|
|
// 更新订单信息
|
|
// 更新订单信息
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
|
|
|
sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
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{
|
|
}else{
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
@@ -501,11 +493,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
Map payMap = payService.getPayMap(
|
|
Map payMap = payService.getPayMap(
|
|
- orderAmount,
|
|
|
|
|
|
+ amount,
|
|
orderNo,
|
|
orderNo,
|
|
- "http://mstutest.dayaedu.com/api-student/studentOrder/notify",
|
|
|
|
- "http://mstutest.dayaedu.com/#/paymentresult?orderNo=" + orderNo,
|
|
|
|
|
|
+ baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
|
+ baseApiUrl+"/#/paymentresult?orderNo=" + orderNo,
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
"乐团报名缴费",
|
|
userId);
|
|
userId);
|
|
@@ -1165,10 +1158,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
|
|
|
try {
|
|
try {
|
|
- Map<String, Object> payMap = payService.getPayMap(amount, studentPaymentOrder.getOrderNo(), "https://pay.dayaedu.com/api/yqpay/notify",
|
|
|
|
- "http://dev.dayaedu.com", "续费", "乐团续费",userId);
|
|
|
|
|
|
+
|
|
|
|
+ Map<String, Object> payMap = payService.getPayMap(amount, studentPaymentOrder.getOrderNo(),
|
|
|
|
+ baseApiUrl+"/api-student/studentOrder/notify",
|
|
|
|
+ baseApiUrl+"/#/paymentresult?orderNo=" + studentPaymentOrder.getOrderNo(),
|
|
|
|
+ "续费", "乐团续费",userId);
|
|
studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
|
|
studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|