Procházet zdrojové kódy

bugfix订单支付

chao před 3 roky
rodič
revize
0c70879514

+ 1 - 1
src/main/java/com/caimei365/order/controller/PayOrderApi.java

@@ -290,7 +290,7 @@ public class PayOrderApi {
     /**
      * 二手发布银联线上支付
      * @param secondPayDto {
-     *               productId       二手发布商品id
+     *               productId     二手发布商品id
      *               returnUrl     页面回调地址
      *               bankCode      银行编码(银联支付使用)
      *               userType      用户类型(银联支付使用)企业:ENTERPRISE,个人:USER

+ 4 - 0
src/main/java/com/caimei365/order/model/po/OrderProductPo.java

@@ -175,6 +175,10 @@ public class OrderProductPo implements Serializable {
      * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2阶梯价
      */
     private Integer actProduct;
+    /**
+     * 商品类型(0正常商品,1协商赠品,2促销赠品)
+     */
+    private Integer productType;
     /**
      * 阶梯价列表(临时用,保存订单阶梯价格)
      */

+ 7 - 7
src/main/java/com/caimei365/order/service/impl/PayOrderServiceImpl.java

@@ -537,9 +537,9 @@ public class PayOrderServiceImpl implements PayOrderService {
                 json.put("openId", payParam.getOpenId());
             }
             String environment = "";
-            if (payParam.getNotifyUrl().contains("8008")) {
+            if (payParam.getNotifyUrl().contains("18002")) {
                 environment = "DEV";
-            } else if (payParam.getNotifyUrl().contains("spi-b")) {
+            } else if (payParam.getNotifyUrl().contains("core-b")) {
                 environment = "BETA";
             }
             // 商户订单号
@@ -1001,21 +1001,19 @@ public class PayOrderServiceImpl implements PayOrderService {
                 json.put("openId", payParam.getOpenId());
             }
             String environment = "";
-            if (payParam.getNotifyUrl().contains("8008")) {
+            if (payParam.getNotifyUrl().contains("18002")) {
                 environment = "DEV";
-            } else if (payParam.getNotifyUrl().contains("spi-b")) {
+            } else if (payParam.getNotifyUrl().contains("core-b")) {
                 environment = "BETA";
             }
             // 商户订单号
             String orderId = payParam.getProductId() + "T" + time + environment;
             json.put("orderId", orderId);
             //商品名称
-            String product = "采美订单" + payParam.getProductId();
+            String product = "采美订单" + orderId;
             json.put("product", product);
             String attach = payParam.getProductId() + "," + payParam.getPayType();
             json.put("attach", attach);
-            String sign = PayUtil.getPaySign(json, PayUtil.merKey);
-            json.put("sign", sign);
             // 二手发布默认100元,默认私账
             List<Map<String, String>> list = new ArrayList<>();
             Map<String, String> map = new HashMap<>(3);
@@ -1025,6 +1023,8 @@ public class PayOrderServiceImpl implements PayOrderService {
             list.add(map);
             String splitBillDetail = JSONObject.toJSONString(list);
             json.put("splitBillDetail", splitBillDetail);
+            String sign = PayUtil.getPaySign(json, PayUtil.merKey);
+            json.put("sign", sign);
             // 私钥加密
             String data = RSAUtil.privateEncrypt(json.toJSONString(), PayUtil.merKey);
             // 提交

+ 1 - 0
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -459,6 +459,7 @@ public class SubmitServiceImpl implements SubmitService {
                 product.setCostPrice(costPrice);
                 product.setNum(productNum);
                 product.setPresentNum(presentNum);
+                product.setProductType(productType);
                 // 是否是促销赠品
                 if (productType == 2) {
                     // 促销赠品数+1

+ 1 - 0
src/main/resources/mapper/OrderCommonMapper.xml

@@ -246,6 +246,7 @@
         shopOrderIds,
         orderSource,
         orderNo,
+        organizeID AS organizeId,
         userID AS userId,
         clubID AS clubId,
         buyUserID AS buyUserId,

+ 2 - 2
src/main/resources/mapper/SubmitMapper.xml

@@ -33,13 +33,13 @@
                                     totalAmount, totalFee, shouldPayFee, productUnit, num, presentNum, discountFee, includedTax,
                                     invoiceType, taxRate, addedValueTax, totalAddedValueTax, singleShouldPayTotalTax, shouldPayTotalTax,
                                     shopProductAmount, singleShopFee, shopFee, singleOtherFee, otherFee, singleCmFee, cmFee,
-                                    payStatus, buyAgainFlag, notOutStore, isActProduct)
+                                    payStatus, buyAgainFlag, notOutStore, isActProduct, productType)
         VALUES (#{orderId},#{orderNo},#{shopOrderId},#{shopOrderNo},#{orderPromotionsId},#{productId},#{shopId},#{name},
                 #{image},#{price},#{price},#{shopName},#{costPrice},#{normalPrice},#{ladderPriceFlag},#{discountPrice},#{discount},
                 #{totalAmount},#{totalFee},#{shouldPayFee},#{productUnit},#{num},#{presentNum},#{discountFee},#{includedTax},
                 #{invoiceType},#{taxRate},#{addedValueTax},#{totalAddedValueTax},#{singleShouldPayTotalTax},#{shouldPayTotalTax},
                 #{shopProductAmount},#{singleShopFee},#{shopFee},#{singleOtherFee},#{otherFee},#{singleCmFee},#{cmFee},
-                #{payStatus},#{buyAgainFlag},#{notOutStore},#{actProduct})
+                #{payStatus},#{buyAgainFlag},#{notOutStore},#{actProduct},#{productType})
     </insert>
     <insert id="insertOrderPromotions" keyColumn="id" keyProperty="id" parameterType="com.caimei365.order.model.vo.PromotionsVo" useGeneratedKeys="true">
         INSERT INTO cm_promotions_order (orderId, promotionsId, name, description, type, mode, touchPrice, reducedPrice, status, beginTime, endTime)