浏览代码

Merge remote-tracking branch 'origin/master'

zouxuan 3 年之前
父节点
当前提交
ec61b93772

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2565,7 +2565,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //关闭之前的订单
         if (calenderDetail.getPaymentOrderId() != null) {
             StudentPaymentOrder oldStudentPaymentOrder = studentPaymentOrderDao.get(calenderDetail.getPaymentOrderId());
-            if (oldStudentPaymentOrder != null) {
+            if (oldStudentPaymentOrder != null && oldStudentPaymentOrder.getStatus() == ING) {
                 
                 // 查询订单状态
                 PayStatus payStatus = studentPaymentOrderService.queryPayStatus(oldStudentPaymentOrder.getPaymentChannel(), oldStudentPaymentOrder.getOrderNo(), oldStudentPaymentOrder.getTransNo());

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -21,6 +21,7 @@ import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -127,6 +128,17 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             if (orderByOrderNo.getStatus() == SUCCESS) {
                 throw new BizException("您已支付请勿重复提交");
             }else if(orderByOrderNo.getStatus() == ING){
+            	
+            	// 查询订单状态
+                PayStatus payStatus = studentPaymentOrderService.queryPayStatus(orderByOrderNo.getPaymentChannel(), orderByOrderNo.getOrderNo(), orderByOrderNo.getTransNo());
+                if(payStatus != PayStatus.FAILED){
+                	if(payStatus == PayStatus.SUCCESSED){
+                		throw new BizException("订单已支付成功,请勿重复支付");
+                	}else if(payStatus == PayStatus.PAYING){
+                		throw new BizException("订单还在交易中,请稍后重试");
+                	}
+                }
+                
                 orderByOrderNo.setStatus(CLOSE);
                 studentPaymentOrderService.update(orderByOrderNo);
                 if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {

+ 16 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectChangeServiceImpl.java

@@ -118,20 +118,23 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
         if (isRepay) {
             StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.get(subjectChange.getOrderId().longValue());
             
-            // 查询订单状态
-            PayStatus payStatus = studentPaymentOrderService.queryPayStatus(studentPaymentOrder.getPaymentChannel(), studentPaymentOrder.getOrderNo(), studentPaymentOrder.getTransNo());
-            if(payStatus != PayStatus.FAILED){
-            	if(payStatus == PayStatus.SUCCESSED){
-            		throw new BizException("订单已支付成功,请勿重复支付");
-            	}else if(payStatus == PayStatus.PAYING){
-            		throw new BizException("订单还在交易中,请稍后重试");
-            	}
+            if(studentPaymentOrder != null && studentPaymentOrder.getStatus() == DealStatusEnum.ING){
+                
+                // 查询订单状态
+                PayStatus payStatus = studentPaymentOrderService.queryPayStatus(studentPaymentOrder.getPaymentChannel(), studentPaymentOrder.getOrderNo(), studentPaymentOrder.getTransNo());
+                if(payStatus != PayStatus.FAILED){
+                	if(payStatus == PayStatus.SUCCESSED){
+                		throw new BizException("订单已支付成功,请勿重复支付");
+                	}else if(payStatus == PayStatus.PAYING){
+                		throw new BizException("订单还在交易中,请稍后重试");
+                	}
+                }
+                
+                studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
+                studentPaymentOrder.setUpdateTime(date);
+                studentPaymentOrderService.update(studentPaymentOrder);
+                subjectChange.setStatus(SubjectChangeStatusEnum.WAIT_PAY);
             }
-            
-            studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
-            studentPaymentOrder.setUpdateTime(date);
-            studentPaymentOrderService.update(studentPaymentOrder);
-            subjectChange.setStatus(SubjectChangeStatusEnum.WAIT_PAY);
         }
 
         if (subjectChange.getStatus().equals(SubjectChangeStatusEnum.CANCELED)) {

+ 11 - 0
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.entity.StudentRepair;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.enums.PayStatus;
 import com.ym.mec.biz.dal.page.GoodsCategoryQueryInfo;
 import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.dal.page.GoodsSellQueryInfo;
@@ -17,8 +18,10 @@ import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
@@ -58,6 +61,14 @@ public class RepairController extends BaseController {
             List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.GOODS_SELL, null, studentGoodsSell.getUserId(), DealStatusEnum.ING,
                     OrderTypeEnum.GOODS_SELL);
             if (list.size() > 0) {
+            	StudentPaymentOrder applyOrder = list.get(list.size() - 1);
+            	// 查询订单状态
+                PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
+                if(payStatus == PayStatus.SUCCESSED){
+            		throw new BizException("订单已支付成功,请勿重复支付");
+            	}else if(payStatus == PayStatus.PAYING){
+            		throw new BizException("订单还在交易中,请稍后重试");
+            	}
                 return failed(HttpStatus.CONTINUE, "您有待支付的订单");
             }
         }