plf пре 4 година
родитељ
комит
34aaeaf573

+ 3 - 1
pay/src/main/java/com/caimei/module/pay/service/PayService.java

@@ -7,6 +7,8 @@ import com.caimei.module.base.entity.vo.OrderPayLinkVo;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
 
 /**
  * Description
@@ -107,5 +109,5 @@ public interface PayService {
      * @param data 回调参数
      * @return SUCCESS告诉第三方回调成功
      */
-    String delayedSplittingCallback(String data) throws Exception;
+    String delayedSplittingCallback(String data) throws InvalidKeySpecException, NoSuchAlgorithmException;
 }

+ 17 - 8
pay/src/main/java/com/caimei/module/pay/service/impl/PayServiceImpl.java

@@ -21,6 +21,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -156,7 +158,9 @@ public class PayServiceImpl implements PayService {
             //商品名称
             String product = "采美订单" + order.getOrderNo();
             json.put("product", product);
-            String attach = order.getOrderID() + "," + payment.getPayType();
+            //支付类型
+            String payType = getPayType(payment);
+            String attach = order.getOrderID() + "," + payType;
             json.put("attach", attach);
             //分账详情
             /*splitBillDetail = splitBillDetail(order, payment);
@@ -477,7 +481,7 @@ public class PayServiceImpl implements PayService {
         payDao.updateSelective(order);
         //修改支付链接状态
         OrderPayLinkVo orderPayLink = payDao.findOrderPayLink(order.getOrderID(), amount);
-        if (null != orderPayLink && "GATEWAY_UNIONPAY".equals(payType)) {
+        if (null != orderPayLink && ("12".equals(payType) || "17".equals(payType))) {
             orderPayLink.setPayStatus("1");
             payDao.updateOrderPayLink(orderPayLink);
         }
@@ -485,7 +489,7 @@ public class PayServiceImpl implements PayService {
         String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date());
         DiscernReceiptVo discernReceipt = new DiscernReceiptVo();
         discernReceipt.setPayWay("1");
-        discernReceipt.setPayType(getPayType(payType));
+        discernReceipt.setPayType(payType);
         discernReceipt.setReceiptType("1");
         discernReceipt.setReceiptStatus("3");
         discernReceipt.setReceiptAmount(amount);
@@ -566,7 +570,8 @@ public class PayServiceImpl implements PayService {
     /**
      * 支付状态转换
      */
-    private String getPayType(String payType) {
+    private String getPayType(Payment payment) {
+        String payType = payment.getPayType();
         if ("ALIPAY_H5".equals(payType)) {
             //支付宝H5
             return "14";
@@ -576,9 +581,12 @@ public class PayServiceImpl implements PayService {
         } else if ("MINIAPP_WEIXIN".equals(payType)) {
             //微信小程序支付
             return "15";
-        } else {
-            //银
+        } else if ("GATEWAY_UNIONPAY".equals(payType) && "ENTERPRISE".equals(payment.getUserType())) {
+            //企业网
             return "12";
+        } else {
+            //个人网银
+            return "17";
         }
     }
 
@@ -794,7 +802,7 @@ public class PayServiceImpl implements PayService {
         SeconHandProduct seconHandProduct = new SeconHandProduct();
         seconHandProduct.setPayAmount(amount.doubleValue());
         seconHandProduct.setPayFormData(json.toJSONString());
-        seconHandProduct.setPayType(getPayType(payType));
+        seconHandProduct.setPayType(payType);
         seconHandProduct.setProductID(productId);
         payDao.updateSeconHand(seconHandProduct);
         //修改分账付款状态
@@ -865,7 +873,7 @@ public class PayServiceImpl implements PayService {
     }
 
     @Override
-    public String delayedSplittingCallback(String data) throws Exception {
+    public String delayedSplittingCallback(String data) throws InvalidKeySpecException, NoSuchAlgorithmException {
         //公钥解密
         JSONObject json = PayUtils.decryptDataPublic(data, publicKey);
         log.info("公钥解密>>>>>>" + json);
@@ -933,6 +941,7 @@ public class PayServiceImpl implements PayService {
                 payShop.setDelFlag("0");
                 payShop.setApplyTime(currentTime);
                 payShop.setReviewTime(currentTime);
+                payShop.setPayTime(currentTime);
                 payDao.insertPayShop(payShop);
 
                 PayShopRecordVo shopRecord = new PayShopRecordVo();