Przeglądaj źródła

Merge remote-tracking branch 'origin/developerC' into developerC

Aslee 3 lat temu
rodzic
commit
919c129907

+ 1 - 1
src/main/java/com/caimei365/order/components/HeliPayUtil.java

@@ -130,7 +130,7 @@ public class HeliPayUtil {
             //普通订单
             OrderVo order = orderCommonMapper.getOrderByShopOrderId(heliDto.getShopOrderId());
             orderId = order.getOrderNo() + "T" + time + environment;
-            pay.setP9_orderAmount(heliDto.getPayAmount().toString());
+            pay.setP9_orderAmount(heliDto.getPayAmount());
             pay.setP12_notifyUrl(notifyUrl);
             String product = "采美订单" + order.getOrderNo();
             pay.setP15_goodsName(product);

+ 9 - 0
src/main/java/com/caimei365/order/controller/HeliPayApi.java

@@ -206,6 +206,9 @@ public class HeliPayApi {
     @ApiOperation("合利宝支付宝扫码支付")
     @PostMapping("/scan/pay")
     public ResponseJson<JSONObject> payByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getShopOrderId()) {
             return ResponseJson.error("子订单Id不能为空!", null);
         }
@@ -218,6 +221,9 @@ public class HeliPayApi {
     @ApiOperation("合利宝微信小程序/公众号支付")
     @PostMapping("/online")
     public ResponseJson<JSONObject> payOnline(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getShopOrderId()) {
             return ResponseJson.error("子订单Id不能为空!", null);
         }
@@ -230,6 +236,9 @@ public class HeliPayApi {
     @ApiOperation("合利宝网银支付")
     @PostMapping("/union")
     public ResponseJson<String> link(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getOrderId()) {
             return ResponseJson.error("订单Id不能为空!", null);
         }

+ 60 - 31
src/main/java/com/caimei365/order/controller/HeliPayNonOrderApi.java

@@ -44,7 +44,10 @@ public class HeliPayNonOrderApi {
      */
     @ApiOperation("二手发布-微信线上支付(旧:/PayOrder/appletsSecondHandPay)(/PayOrder/secondHandPay[WEIXIN])")
     @PostMapping("/second/wechat")
-    public ResponseJson<JSONObject> paySecondByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> paySecondByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getProductId()) {
             return ResponseJson.error("二手商品Id不能为空!", null);
         }
@@ -55,7 +58,7 @@ public class HeliPayNonOrderApi {
     }
 
     /**
-     * 二手发布-微信/支付宝二维码
+     * 二手发布-支付宝二维码
      *
      * @param heliDto {
      *                productId      二手发布商品id
@@ -64,7 +67,10 @@ public class HeliPayNonOrderApi {
      */
     @ApiOperation("二手发布-支付宝线上支付(旧:/PayOrder/secondHandPay[ALIPAY])")
     @PostMapping("/second/scan")
-    public ResponseJson<JSONObject> paySecondByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> paySecondByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getProductId()) {
             return ResponseJson.error("二手商品Id不能为空!", null);
         }
@@ -109,21 +115,25 @@ public class HeliPayNonOrderApi {
         }
         return payNonOrderService.couponCheck(couponRecordId);
     }
-     /**
+
+    /**
      * 购买优惠券-微信线上支付
      *
      * @param heliDto {
-     *                     couponId      购买优惠券Id
-     *                     userId        userId
-     *                     couponRecordId  购买记录id
-     *                     returnUrl     页面回调地址
-     *                     code          微信小程序code
-     *                     state         微信公众号state参数
-     *                     }
+     *                couponId      购买优惠券Id
+     *                userId        userId
+     *                couponRecordId  购买记录id
+     *                returnUrl     页面回调地址
+     *                code          微信小程序code
+     *                state         微信公众号state参数
+     *                }
      */
     @ApiOperation("购买价值优惠券-微信支付")
     @PostMapping("/coupon/wechat")
-    public ResponseJson<JSONObject> payCouponByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> payCouponByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getCouponRecordId()) {
             return ResponseJson.error("购买记录id不能为空!", null);
         }
@@ -144,21 +154,27 @@ public class HeliPayNonOrderApi {
 
     @ApiOperation("购买价值优惠券-网银线上支付")
     @PostMapping("/coupon/union")
-    public ResponseJson<String> payCouponByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<String> payCouponByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getVipRecordId()) {
             return ResponseJson.error("购买记录id不能为空!", null);
         }
-        if (StringUtils.isEmpty(heliDto.getReturnUrl())) {
-            return ResponseJson.error("回调地址不能为空!", null);
-        }
         if (StringUtils.isEmpty(heliDto.getBankCode())) {
             return ResponseJson.error("银行编码不能为空!", null);
         }
         if (StringUtils.isEmpty(heliDto.getUserType())) {
             return ResponseJson.error("银行用户类型不能为空!", null);
         }
-        if(null==heliDto.getSource()){
-            return ResponseJson.error("领取渠道不能为空!",null);
+        if (null == heliDto.getSource()) {
+            return ResponseJson.error("领取渠道不能为空!", null);
+        }
+        if (null == heliDto.getCouponId()) {
+            return ResponseJson.error("优惠券Id不能为空!", null);
+        }
+        if (null == heliDto.getUserId()) {
+            return ResponseJson.error("userId不能为空!", null);
         }
         return payNonOrderService.couponUnionPay(heliDto, headers);
     }
@@ -167,16 +183,19 @@ public class HeliPayNonOrderApi {
      * 购买价值优惠券-微信/支付宝二维码
      *
      * @param heliDto {
-     *                     couponId      购买优惠券Id
-     *                     userId        userId
-     *                     couponRecordId  购买记录id
-     *                     returnUrl     页面回调地址
-     *                     state         微信公众号state参数
+     *                couponId      购买优惠券Id
+     *                userId        userId
+     *                couponRecordId  购买记录id
+     *                returnUrl     页面回调地址
+     *                state         微信公众号state参数
      *                }
      */
     @ApiOperation("购买价值优惠券-支付宝线上支付")
     @PostMapping("/coupon/scan")
-    public ResponseJson<JSONObject> payCouponByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> payCouponByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getCouponRecordId()) {
             return ResponseJson.error("购买记录id不能为空!", null);
         }
@@ -203,6 +222,7 @@ public class HeliPayNonOrderApi {
         }
         return payNonOrderService.couponCallback(res);
     }
+
     /**
      * 二手发布-网银支付回调
      */
@@ -217,13 +237,13 @@ public class HeliPayNonOrderApi {
 
     @ApiOperation("升级超级会员-网银线上支付")
     @PostMapping("/vip/union")
-    public ResponseJson<String> paySuperVipByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<String> paySuperVipByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getVipRecordId()) {
             return ResponseJson.error("会员购买记录Id不能为空!", null);
         }
-        if (StringUtils.isEmpty(heliDto.getReturnUrl())) {
-            return ResponseJson.error("回调地址不能为空!", null);
-        }
         if (StringUtils.isEmpty(heliDto.getBankCode())) {
             return ResponseJson.error("银行编码不能为空!", null);
         }
@@ -235,7 +255,10 @@ public class HeliPayNonOrderApi {
 
     @ApiOperation("二手发布-网银线上支付(旧:/PayOrder/secondHandPay[UNIONPAY])")
     @PostMapping("/second/union")
-    public ResponseJson<String> paySecondByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<String> paySecondByUnionPay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getProductId()) {
             return ResponseJson.error("二手商品Id不能为空!", null);
         }
@@ -263,7 +286,10 @@ public class HeliPayNonOrderApi {
      */
     @ApiOperation("升级超级会员-微信线上支付")
     @PostMapping("/vip/wechat")
-    public ResponseJson<JSONObject> paySuperVipByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> paySuperVipByWeChat(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getVipRecordId()) {
             return ResponseJson.error("会员购买记录Id不能为空!", null);
         }
@@ -283,7 +309,10 @@ public class HeliPayNonOrderApi {
      */
     @ApiOperation("升级超级会员-支付宝线上支付")
     @PostMapping("/vip/scan")
-    public ResponseJson<JSONObject> paySuperVipByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) {
+    public ResponseJson<JSONObject> paySuperVipByAlipay(HeliDto heliDto, @RequestHeader HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
+        if (StringUtils.isBlank(heliDto.getPayType())) {
+            return ResponseJson.error("支付类型不能为空!", null);
+        }
         if (null == heliDto.getVipRecordId()) {
             return ResponseJson.error("会员购买记录Id不能为空!", null);
         }

+ 9 - 9
src/main/java/com/caimei365/order/service/HeliPayNonOrderService.java

@@ -18,7 +18,7 @@ import java.security.spec.InvalidKeySpecException;
 public interface HeliPayNonOrderService {
     ResponseJson<PayCouponDto> getCouponRecord(PayCouponDto payCouponDto, HttpHeaders headers);
 
-    ResponseJson<JSONObject> payCouponByWeChat(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> payCouponByWeChat(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
     String couponCallback(NotifyResponseVo res) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
     /**
@@ -30,7 +30,7 @@ public interface HeliPayNonOrderService {
      *               state         微信公众号state参数
      * }
      */
-    ResponseJson<JSONObject> paySecondByWeChat(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> paySecondByWeChat(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
     /**
      * 二手发布支付宝线上支付
      * @param heliDto {
@@ -38,7 +38,7 @@ public interface HeliPayNonOrderService {
      *               returnUrl     页面回调地址
      * }
      */
-    ResponseJson<JSONObject> paySecondByAlipay(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> paySecondByAlipay(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
     /**
      * 二手发布支付回调
@@ -54,7 +54,7 @@ public interface HeliPayNonOrderService {
      *               state         微信公众号state参数
      * }
      */
-    ResponseJson<JSONObject> paySuperVipByWeChat(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> paySuperVipByWeChat(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
     /**
      * 升级超级会员-支付宝线上支付
      * @param heliDto {
@@ -62,16 +62,16 @@ public interface HeliPayNonOrderService {
      *               returnUrl     页面回调地址
      * }
      */
-    ResponseJson<JSONObject> paySuperVipByAlipay(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> paySuperVipByAlipay(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
     /**
      * 升级超级会员-支付回调
      */
     String paymentSuperVipCallback(NotifyResponseVo data) throws NoSuchAlgorithmException, InvalidKeySpecException, IntrospectionException, InvocationTargetException, IllegalAccessException;
 
-    ResponseJson<String> unionPay(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<String> unionPay(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
-    ResponseJson<String> unionPaySecond(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<String> unionPaySecond(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
     /**
      * 升级超级会员-网银支付回调
@@ -82,9 +82,9 @@ public interface HeliPayNonOrderService {
      */
     String unionSecondCallback(UnionResVo res) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
-    ResponseJson<JSONObject> payCouponByAlipay(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<JSONObject> payCouponByAlipay(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
-    ResponseJson<String> couponUnionPay(HeliDto heliDto, HttpHeaders headers);
+    ResponseJson<String> couponUnionPay(HeliDto heliDto, HttpHeaders headers) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 
     String unionCouponCallback(UnionResVo data) throws IntrospectionException, InvocationTargetException, IllegalAccessException;
 

Plik diff jest za duży
+ 490 - 535
src/main/java/com/caimei365/order/service/impl/HeliPayNonOrderServiceImpl.java


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików