Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop

This commit is contained in:
邹宗楠
2022-08-24 13:59:49 +08:00
10 changed files with 164 additions and 73 deletions

View File

@@ -3,7 +3,6 @@ package localjx
import (
"errors"
"fmt"
"git.rosy.net.cn/baseapi/platformapi/tiktok"
"math"
"regexp"
"strings"
@@ -326,15 +325,15 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
case model.PayTypeTL:
if subAppID == tiktok.TiktokAppId || subAppID == tiktok.TiktokJXDJAppID {
subAppID = model.JXC4AppId // 京西商城
}
//if subAppID == tiktok.TiktokAppId || subAppID == tiktok.TiktokJXDJAppID {
// subAppID = model.JXC4AppId // 京西商城
//}
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
case model.PayTypeTicTok:
if orderPay, err = pay4OrderByTT(ctx, order, vendorPayType); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTT(ctx, order, vendorPayType, subAppID); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -1017,7 +1016,11 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
// 订单超过一千配送费优惠(门店运费)
discountPrice, err := cms.GetStoreVendorMaps(ctx, nil, jxOrder.StoreID, -1)
if len(discountPrice) == 1 && outJxOrder.OrderPrice >= int64(discountPrice[0].DeliveryFeeDeductionSill) {
outJxOrder.FreightPrice = outJxOrder.FreightPrice - int64(discountPrice[0].DeliveryFeeDeductionFee)
if outJxOrder.FreightPrice-int64(discountPrice[0].DeliveryFeeDeductionFee) >= 0 {
outJxOrder.FreightPrice = outJxOrder.FreightPrice - int64(discountPrice[0].DeliveryFeeDeductionFee)
} else {
outJxOrder.FreightPrice = 0
}
}
// ?????????????????????? 测试
if storeDetail.ID == 668470 || storeDetail.ID == 668469 {
@@ -1553,6 +1556,7 @@ func changeOrderStatus(vendorOrderID string, status int, remark string) (err err
StatusTime: time.Now(),
Remark: remark,
}
globals.SugarLogger.Debug("检测数据orderStatus.Status", status, orderStatus.Status)
jxutils.CallMsgHandlerAsync(func() {
err = partner.CurOrderManager.OnOrderStatusChanged("", orderStatus)
}, jxutils.ComposeUniversalOrderID(vendorOrderID, model.VendorIDJX))