|
@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.adapay.Payment;
|
|
@@ -95,13 +96,14 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
|
public void queryOrderStatus() throws Exception {
|
|
|
- yqPayQuery();
|
|
|
- adaPayQuery();
|
|
|
+ yqPayQuery(null);
|
|
|
+ adaPayQuery(null);
|
|
|
}
|
|
|
|
|
|
- private void yqPayQuery() throws Exception {
|
|
|
- List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
|
|
|
-
|
|
|
+ private void yqPayQuery(List<StudentPaymentOrder> payingOrders) throws Exception {
|
|
|
+ if (payingOrders == null) {
|
|
|
+ payingOrders = findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
|
|
|
+ }
|
|
|
if (payingOrders.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
@@ -144,8 +146,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void adaPayQuery() throws Exception {
|
|
|
- List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "ADAPAY");
|
|
|
+ private void adaPayQuery(List<StudentPaymentOrder> payingOrders) throws Exception {
|
|
|
+ if (payingOrders == null) {
|
|
|
+ payingOrders = findOrdersByStatus(DealStatusEnum.ING, "ADAPAY");
|
|
|
+ }
|
|
|
if (payingOrders.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
@@ -329,8 +333,19 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean getOrderStatus(Long id) {
|
|
|
- return null;
|
|
|
- //StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(id);
|
|
|
+ public Boolean getOrderStatus(Long id) throws Exception {
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(id);
|
|
|
+ studentPaymentOrder.setStatus(DealStatusEnum.ING);
|
|
|
+ if(studentPaymentOrderDao.update(studentPaymentOrder) <= 0){
|
|
|
+ throw new BizException("订单状态更新失败,请重试");
|
|
|
+ }
|
|
|
+ List<StudentPaymentOrder> orderList = new ArrayList<>();
|
|
|
+ orderList.add(studentPaymentOrder);
|
|
|
+ if (studentPaymentOrder.getPaymentChannel().equals("ADAPAY")) {
|
|
|
+ adaPayQuery(orderList);
|
|
|
+ } else if (studentPaymentOrder.getPaymentChannel().equals("YQPAY")) {
|
|
|
+ yqPayQuery(orderList);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|