dengsixing 3 years ago
parent
commit
c89d2e1d70
16 changed files with 68 additions and 65 deletions
  1. 16 13
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/controller/pay/OrderWechatPayController.java
  2. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayDownload.java
  3. 3 3
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayEntity.java
  4. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayExpansion.java
  5. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayIncrement.java
  6. 3 3
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayRecharge.java
  7. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalDownload.java
  8. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalEntity.java
  9. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalExpansion.java
  10. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalIncrement.java
  11. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalRecharge.java
  12. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatDownload.java
  13. 3 3
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatEntity.java
  14. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatExpansion.java
  15. 5 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatIncrement.java
  16. 3 3
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatRecharge.java

+ 16 - 13
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/controller/pay/OrderWechatPayController.java

@@ -1,10 +1,9 @@
 package com.fdkankan.platform.order.controller.pay;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.config.RedisDefaultConfig;
 import com.fdkankan.common.constant.Constant;
 import com.fdkankan.common.constant.ConstantUrl;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.controller.BaseController;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.sdk.UrlUtils;
@@ -16,13 +15,25 @@ import com.fdkankan.platform.order.entity.ExpansionOrder;
 import com.fdkankan.platform.order.entity.IncrementOrder;
 import com.fdkankan.platform.order.entity.VirtualOrder;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
-import com.fdkankan.platform.order.service.*;
+import com.fdkankan.platform.order.service.ICommerceOrderService;
+import com.fdkankan.platform.order.service.IExpansionOrderService;
+import com.fdkankan.platform.order.service.IIncrementOrderService;
+import com.fdkankan.platform.order.service.IOrderService;
+import com.fdkankan.platform.order.service.IVirtualOrderService;
+import com.fdkankan.platform.order.service.PayOrderService;
 import com.fdkankan.platform.user.factory.PayFactory;
 import com.fdkankan.platform.user.strategy.OrderStrategyFactory;
 import com.fdkankan.platform.user.vo.ResponseOrder;
 import com.fdkankan.platform.user.vo.ResponseOrderItem;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
+import java.io.BufferedOutputStream;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -32,14 +43,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import java.io.BufferedOutputStream;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
 /**
  * 支付中心-微信支付模块
  */
@@ -164,7 +167,7 @@ public class OrderWechatPayController extends BaseController {
                     }
                     //订单金额为国外金额就报错
                     if(expansion.getAbroad() == 1){
-                        throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+                        throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
                     }
                     String date = "1年";
                     if(expansion.getMonth() < 12){
@@ -193,7 +196,7 @@ public class OrderWechatPayController extends BaseController {
                     }
                     //订单金额为国外金额就报错
                     if(incrementOrderEntity.getAbroad() == 1){
-                        throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+                        throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
                     }
                     sb.append(Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年");
                     totalFee = incrementOrderEntity.getAmount().multiply(new BigDecimal(100));

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayDownload.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.alipay.sdk.AlipayGoodsDetail;
 import com.fdkankan.platform.order.entity.DownloadOrder;
@@ -31,11 +31,11 @@ public class AlipayDownload implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         DownloadOrder downloadOrderEntity = downloadOrderService.getById(order.getOrderId());
         if (downloadOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(downloadOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.DOWNLOAD_SUBJECT + ":" + downloadOrderEntity.getCount() + "次";
         List<AlipayGoodsDetail> goodsDetailList = new ArrayList<>();
@@ -51,11 +51,11 @@ public class AlipayDownload implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         DownloadOrder downloadOrderEntity = downloadOrderService.getById(order.getOrderId());
         if (downloadOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(downloadOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.DOWNLOAD_SUBJECT + ":" + downloadOrderEntity.getCount() + "次";
         String orderSn = downloadOrderEntity.getOrderSn();

+ 3 - 3
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayEntity.java

@@ -1,7 +1,7 @@
 package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.alipay.sdk.AlipayGoodsDetail;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -28,7 +28,7 @@ public class AlipayEntity implements Entity {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         ResponseOrder responseOrder = orderService.getOrderDetail(order.getOrderId());
         if (responseOrder.getId() == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         List<AlipayGoodsDetail> goodsDetailList = new ArrayList<>();
         List<ResponseOrderItem> items = responseOrder.getOrderItems();
@@ -52,7 +52,7 @@ public class AlipayEntity implements Entity {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         ResponseOrder responseOrder = orderService.getOrderDetail(order.getOrderId());
         if (responseOrder.getId() == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         List<ResponseOrderItem> items = responseOrder.getOrderItems();
         StringBuilder sb = new StringBuilder();

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayExpansion.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.alipay.sdk.AlipayGoodsDetail;
 import com.fdkankan.platform.order.entity.ExpansionOrder;
@@ -28,11 +28,11 @@ public class AlipayExpansion implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         ExpansionOrder expansion = expansionOrderService.getById(order.getOrderId());
         if (expansion == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(expansion.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String date = "1年";
         if(expansion.getMonth() < 12){
@@ -55,11 +55,11 @@ public class AlipayExpansion implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         ExpansionOrder expansion = expansionOrderService.getById(order.getOrderId());
         if (expansion == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(expansion.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String date = "1年";
         if(expansion.getMonth() < 12){

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayIncrement.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.alipay.sdk.AlipayGoodsDetail;
 import com.fdkankan.platform.order.entity.IncrementOrder;
@@ -31,11 +31,11 @@ public class AlipayIncrement implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         IncrementOrder incrementOrderEntity = iIncrementOrderService.getById(order.getOrderId());
         if (incrementOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(incrementOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
         List<AlipayGoodsDetail> goodsDetailList = new ArrayList<>();
@@ -51,11 +51,11 @@ public class AlipayIncrement implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         IncrementOrder incrementOrderEntity = iIncrementOrderService.getById(order.getOrderId());
         if (incrementOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(incrementOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
         String orderSn = incrementOrderEntity.getOrderSn();

+ 3 - 3
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/AlipayRecharge.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.alipay.sdk.AlipayGoodsDetail;
 import com.fdkankan.platform.order.entity.VirtualOrder;
@@ -29,7 +29,7 @@ public class AlipayRecharge implements Recharge {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         VirtualOrder virtualOrderEntity = virtualOrderService.getById(order.getOrderId());
         if (virtualOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.PAY_SUBJECT + ":" + virtualOrderEntity.getPoints();
         List<AlipayGoodsDetail> goodsDetailList = new ArrayList<>();
@@ -44,7 +44,7 @@ public class AlipayRecharge implements Recharge {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         VirtualOrder virtualOrderEntity = virtualOrderService.getById(order.getOrderId());
         if (virtualOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.PAY_SUBJECT + ":" + virtualOrderEntity.getPoints();
         String orderSn = virtualOrderEntity.getOrderSn();

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalDownload.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.PayPalDefaultConfig;
 import com.fdkankan.platform.order.entity.DownloadOrder;
@@ -40,7 +40,7 @@ public class PaypalDownload implements Expansion {
     private JSONObject getResult(RequestPlaceOrder order, String successUrl, String cancelUrl) throws Exception {
         DownloadOrder downloadOrderEntity = downloadOrderService.getById(order.getOrderId());
         if (downloadOrderEntity == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + downloadOrderEntity.getCount() + "次";
         String orderSn = downloadOrderEntity.getOrderSn();

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalEntity.java

@@ -1,7 +1,7 @@
 package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.PayPalDefaultConfig;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -47,7 +47,7 @@ public class PaypalEntity implements Entity {
     private JSONObject getResult(RequestPlaceOrder order, String successUrl, String cancelUrl) throws Exception {
         ResponseOrder responseOrder = orderService.getOrderDetail(order.getOrderId());
         if (responseOrder.getId() == null)
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
 
         List<ResponseOrderItem> items = responseOrder.getOrderItems();
         StringBuilder sb = new StringBuilder();

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalExpansion.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.PayPalDefaultConfig;
 import com.fdkankan.platform.order.entity.ExpansionOrder;
@@ -40,7 +40,7 @@ public class PaypalExpansion implements Expansion {
     private JSONObject getResult(RequestPlaceOrder order, String successUrl, String cancelUrl) throws Exception {
         ExpansionOrder expansion = expansionOrderService.getById(order.getOrderId());
         if (expansion == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String date = "1年";
         if(expansion.getMonth() < 12){

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalIncrement.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.PayPalDefaultConfig;
 import com.fdkankan.platform.order.entity.IncrementOrder;
@@ -40,7 +40,7 @@ public class PaypalIncrement implements Expansion {
     private JSONObject getResult(RequestPlaceOrder order, String successUrl, String cancelUrl) throws Exception {
         IncrementOrder incrementOrderEntity = incrementOrderService.getById(order.getOrderId());
         if (incrementOrderEntity == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
         String orderSn = incrementOrderEntity.getOrderSn();

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/PaypalRecharge.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.pay.paypal.PayPalDefaultConfig;
 import com.fdkankan.platform.order.entity.VirtualOrder;
@@ -42,7 +42,7 @@ public class PaypalRecharge implements Recharge {
     private JSONObject getResult(RequestPlaceOrder order, String successUrl, String cancelUrl) throws Exception {
         VirtualOrder virtualOrderEntity = virtualOrderService.getById(order.getOrderId());
         if (virtualOrderEntity == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.PAY_SUBJECT + ":" + virtualOrderEntity.getPoints();
         String orderSn = virtualOrderEntity.getOrderSn();

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatDownload.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.platform.order.entity.DownloadOrder;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -26,11 +26,11 @@ public class WechatDownload implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         DownloadOrder downloadOrderEntity = downloadOrderService.getById(order.getOrderId());
         if (downloadOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(downloadOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.DOWNLOAD_SUBJECT + ":" + downloadOrderEntity.getCount() + "次";
         BigDecimal totalFee = downloadOrderEntity.getAmount().multiply(new BigDecimal(100));
@@ -44,11 +44,11 @@ public class WechatDownload implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         DownloadOrder downloadOrderEntity = downloadOrderService.getById(order.getOrderId());
         if (downloadOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(downloadOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.DOWNLOAD_SUBJECT + ":" + downloadOrderEntity.getCount() + "次";
         BigDecimal totalFee = downloadOrderEntity.getAmount().multiply(new BigDecimal(100));

+ 3 - 3
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatEntity.java

@@ -1,7 +1,7 @@
 package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
 import com.fdkankan.platform.order.service.IOrderService;
@@ -27,7 +27,7 @@ public class WechatEntity implements Entity {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         ResponseOrder responseOrder = orderService.getOrderDetail(order.getOrderId());
         if (responseOrder.getId() == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         List<ResponseOrderItem> items = responseOrder.getOrderItems();
         StringBuilder sb = new StringBuilder();
@@ -47,7 +47,7 @@ public class WechatEntity implements Entity {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         ResponseOrder responseOrder = orderService.getOrderDetail(order.getOrderId());
         if (responseOrder.getId() == null) {
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
 
         List<ResponseOrderItem> items = responseOrder.getOrderItems();

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatExpansion.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.platform.order.entity.ExpansionOrder;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -26,11 +26,11 @@ public class WechatExpansion implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         ExpansionOrder expansion = expansionOrderService.getById(order.getOrderId());
         if (expansion == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(expansion.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String date = "1年";
         if(expansion.getMonth() < 12){
@@ -52,11 +52,11 @@ public class WechatExpansion implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         ExpansionOrder expansion = expansionOrderService.getById(order.getOrderId());
         if (expansion == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(expansion.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String date = "1年";
         if(expansion.getMonth() < 12){

+ 5 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatIncrement.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.platform.order.entity.IncrementOrder;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -26,11 +26,11 @@ public class WechatIncrement implements Expansion {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         IncrementOrder incrementOrderEntity = incrementOrderService.getById(order.getOrderId());
         if (incrementOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(incrementOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
         BigDecimal totalFee = incrementOrderEntity.getAmount().multiply(new BigDecimal(100));
@@ -44,11 +44,11 @@ public class WechatIncrement implements Expansion {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         IncrementOrder incrementOrderEntity = incrementOrderService.getById(order.getOrderId());
         if (incrementOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         //订单金额为国外金额就报错
         if(incrementOrderEntity.getAbroad() == 1){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8004);
         }
         String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
         BigDecimal totalFee = incrementOrderEntity.getAmount().multiply(new BigDecimal(100));

+ 3 - 3
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/factory/impl/WechatRecharge.java

@@ -2,7 +2,7 @@ package com.fdkankan.platform.user.factory.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.OrderConstant;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.platform.order.entity.VirtualOrder;
 import com.fdkankan.platform.order.request.RequestPlaceOrder;
@@ -26,7 +26,7 @@ public class WechatRecharge implements Recharge {
     public JSONObject scanPay(RequestPlaceOrder order) throws Exception {
         VirtualOrder virtualOrderEntity = virtualOrderService.getById(order.getOrderId());
         if (virtualOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.PAY_SUBJECT + ":" + virtualOrderEntity.getPoints();
         BigDecimal totalFee = new BigDecimal(virtualOrderEntity.getPoints()).multiply(new BigDecimal(100));
@@ -39,7 +39,7 @@ public class WechatRecharge implements Recharge {
     public JSONObject h5Pay(RequestPlaceOrder order, String ip) throws Exception {
         VirtualOrder virtualOrderEntity = virtualOrderService.getById(order.getOrderId());
         if (virtualOrderEntity == null){
-            throw new BusinessException(OrderConstant.FAILURE_CODE_8001, OrderConstant.FAILURE_MSG_8001);
+            throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
         }
         String subject = Constant.PAY_SUBJECT + ":" + virtualOrderEntity.getPoints();
         BigDecimal totalFee = new BigDecimal(virtualOrderEntity.getPoints()).multiply(new BigDecimal(100));