|
@@ -58,8 +58,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public StudentPaymentOrder findMusicGroupApplyOrderByStatus(Integer userId,String musicGroupId, DealStatusEnum status) {
|
|
|
- return studentPaymentOrderDao.findMusicGroupApplyOrderByStatus(userId,musicGroupId, status);
|
|
|
+ public StudentPaymentOrder findMusicGroupApplyOrderByStatus(Integer userId, String musicGroupId, DealStatusEnum status) {
|
|
|
+ return studentPaymentOrderDao.findMusicGroupApplyOrderByStatus(userId, musicGroupId, status);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -73,25 +73,25 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<StudentPaymentOrder> findOrdersByStatus(DealStatusEnum status,String paymentChannel) {
|
|
|
- return studentPaymentOrderDao.findOrdersByStatus(status,paymentChannel);
|
|
|
+ public List<StudentPaymentOrder> findOrdersByStatus(DealStatusEnum status, String paymentChannel) {
|
|
|
+ return studentPaymentOrderDao.findOrdersByStatus(status, paymentChannel);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<StudentPaymentOrder> findOrdersOverTime(List<String> orderNoList, DealStatusEnum status, Date beforeTime) {
|
|
|
- return studentPaymentOrderDao.findOrdersOverTime(orderNoList,status,beforeTime);
|
|
|
+ return studentPaymentOrderDao.findOrdersOverTime(orderNoList, status, beforeTime);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void queryOrderStatus() throws Exception {
|
|
|
- yqPayQuery();
|
|
|
- adaPayQuery();
|
|
|
+ yqPayQuery();
|
|
|
+ adaPayQuery();
|
|
|
}
|
|
|
|
|
|
private void yqPayQuery() throws Exception {
|
|
|
List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
|
|
|
|
|
|
- if(payingOrders.size() ==0){
|
|
|
+ if (payingOrders.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
List<String> orderNoList = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.toList());
|
|
@@ -117,7 +117,12 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
rpMap.put("channelType", channelType);
|
|
|
|
|
|
if (Arrays.asList(statusArr).contains(rpMap.get("tradeState"))) {
|
|
|
- updateOrder(rpMap); //更新订单
|
|
|
+ try {
|
|
|
+ updateOrder(rpMap); //更新订单
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
if (orderNoList.contains(rpMap.get("merOrderNo"))) {
|
|
|
orderNoList.remove(rpMap.get("merOrderNo"));
|
|
@@ -129,7 +134,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
private void adaPayQuery() throws Exception {
|
|
|
List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "ADAPAY");
|
|
|
- if(payingOrders.size()==0){
|
|
|
+ if (payingOrders.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -195,14 +200,19 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> ordersOverTime = findOrdersOverTime(orderNoList, DealStatusEnum.ING, beforeDate);
|
|
|
for (StudentPaymentOrder order : ordersOverTime) {
|
|
|
- order.setStatus(DealStatusEnum.FAILED);
|
|
|
- order.setMemo("超时未支付关闭");
|
|
|
- if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
|
|
|
- studentRegistrationService.updateApplyOrder(order);
|
|
|
- } else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)) {
|
|
|
- vipGroupService.orderCallback(order);
|
|
|
- } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
|
|
|
- musicGroupService.renewForCallback(order);
|
|
|
+ try {
|
|
|
+ order.setStatus(DealStatusEnum.FAILED);
|
|
|
+ order.setMemo("超时未支付关闭");
|
|
|
+ if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
|
|
|
+ studentRegistrationService.updateApplyOrder(order);
|
|
|
+ } else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)) {
|
|
|
+ vipGroupService.orderCallback(order);
|
|
|
+ } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
|
|
|
+ musicGroupService.renewForCallback(order);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ continue;
|
|
|
}
|
|
|
}
|
|
|
|