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

This commit is contained in:
richboo111
2023-06-12 14:16:05 +08:00
24 changed files with 251 additions and 170 deletions

View File

@@ -80,13 +80,14 @@ func (c *DeliveryHandler) OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
}
func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {
order := c.callbackMsg2Waybill(msg)
order, goodsOrder := c.callbackMsg2Waybill(msg)
store, _ := dao.GetStoreDetail(dao.GetDB(), goodsOrder.JxStoreID, goodsOrder.VendorID, goodsOrder.VendorOrgCode)
switch msg.OrderStatus {
case dadaapi.OrderStatusWaitingForAccept:
dadaOrder, err := api.DadaAPI.QueryOrderInfo(msg.OrderID)
if err == nil {
order.ActualFee = jxutils.StandardPrice2Int(dadaOrder.ActualFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee) + int64(store.FreightMarkup)
}
order.Status = model.WaybillStatusNew
case dadaapi.OrderStatusAccepted:
@@ -94,7 +95,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
order.Remark = order.CourierName + "" + order.CourierMobile
if dadaOrder, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
order.ActualFee = jxutils.StandardPrice2Int(dadaOrder.ActualFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee) + int64(store.FreightMarkup)
}
case dadaapi.OrderStatusReturningInOrder:
order.Status = model.WaybillStatusCourierArrived
@@ -161,7 +162,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
return err
}
func (c *DeliveryHandler) callbackMsg2Waybill(msg *dadaapi.CallbackMsg) (retVal *model.Waybill) {
func (c *DeliveryHandler) callbackMsg2Waybill(msg *dadaapi.CallbackMsg) (retVal *model.Waybill, goods *model.GoodsOrder) {
retVal = &model.Waybill{
VendorWaybillID: msg.ClientID,
WaybillVendorID: model.VendorIDDada,
@@ -179,12 +180,11 @@ func (c *DeliveryHandler) callbackMsg2Waybill(msg *dadaapi.CallbackMsg) (retVal
retVal.StatusTime = utils.Timestamp2Time(updateTime)
retVal.VendorOrderID, retVal.OrderVendorID = jxutils.SplitUniversalOrderID(msg.OrderID)
var good *model.GoodsOrder
sql := `SELECT * FROM goods_order WHERE vendor_order_id = ? ORDER BY order_created_at DESC LIMIT 1 OFFSET 0`
sqlParams := []interface{}{msg.OrderID}
dao.GetRow(dao.GetDB(), &good, sql, sqlParams)
retVal.OrderVendorID = good.VendorID
return retVal
dao.GetRow(dao.GetDB(), &goods, sql, sqlParams)
retVal.OrderVendorID = goods.VendorID
return retVal, goods
}
func StoreDetail2ShopInfo(storeDetail *dao.StoreDetail2) (shopInfo *dadaapi.ShopInfo) {

View File

@@ -148,7 +148,7 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S
// 蜂鸟门店状态改变
func OnStoreStatus(msg *fnpsapi.ChainstoreStatusNotify) (retVal *fnpsapi.CallbackResponse) {
return curDeliveryHandler.OnStoreStatus(msg)
return CurDeliveryHandler.OnStoreStatus(msg)
}
// 修改本地门店审核状态

View File

@@ -5,6 +5,7 @@ import (
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"strings"
"time"
@@ -35,7 +36,7 @@ const (
)
var (
curDeliveryHandler *DeliveryHandler
CurDeliveryHandler *DeliveryHandler
complaintReson2FnResonMap = map[int]int{
model.ComplaintReasons1: ComplaintReasonsFn160,
model.ComplaintReasons2: ComplaintReasonsFn130,
@@ -53,10 +54,8 @@ type DeliveryHandler struct {
}
func init() {
if api.FnAPI != nil {
curDeliveryHandler = new(DeliveryHandler)
partner.RegisterDeliveryPlatform(curDeliveryHandler, true)
}
CurDeliveryHandler = new(DeliveryHandler)
partner.RegisterDeliveryPlatform(CurDeliveryHandler, true)
}
func (c *DeliveryHandler) GetVendorID() int {
@@ -249,14 +248,17 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
}
order.VendorOrderID, order.OrderVendorID = jxutils.SplitUniversalOrderID(cc.PartnerOrderCode)
order.OrderVendorID = good.VendorID
store, _ := dao.GetStoreDetail(dao.GetDB(), good.JxStoreID, good.VendorID, good.VendorOrgCode)
orderStatus := utils.Str2Int64(order.VendorStatus)
switch orderStatus {
case fnpsapi.OrderStatusAcceptCreate, fnpsapi.OrderStatusAccept: // 0 创建订单
order.DesiredFee, order.ActualFee = GetDesiredFee(order.VendorOrderID)
order.Status = model.WaybillStatusNew //5 带调度
order.DesiredFee += int64(store.FreightMarkup) // 运营加价
order.Status = model.WaybillStatusNew //5 带调度
case fnpsapi.OrderStatusAssigned: //20分配骑手
//order.DesiredFee, order.ActualFee = GetDesiredFee(order.VendorOrderID)
order.DesiredFee, order.ActualFee = GetDesiredFee(order.VendorOrderID)
order.DesiredFee += int64(store.FreightMarkup)
order.Status = model.WaybillStatusCourierAssigned //12
order.Remark = order.CourierName + "" + order.CourierMobile
case fnpsapi.OrderStatusArrived: // 80 到店
@@ -323,7 +325,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
// 异常报备
func OnWaybillExceptFn(msg *fnpsapi.AbnormalReportNotify) (retVal *fnpsapi.CallbackResponse) {
return curDeliveryHandler.OnWaybillExcept(msg)
return CurDeliveryHandler.OnWaybillExcept(msg)
}
func (c *DeliveryHandler) OnWaybillExcept(msg *fnpsapi.AbnormalReportNotify) (retVal *fnpsapi.CallbackResponse) {
@@ -487,3 +489,31 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
}
return vendorPrice, nil
}
func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (lng, lat float64, err error) {
order, err := api.FnAPI.GetKnightInfo(&fnpsapi.GetOrderDetailReq{
PartnerOrderCode: vendorOrderID,
})
if err == nil {
lng = utils.Str2Float64WithDefault(order.CarrierDriverLongitude, 0)
lat = utils.Str2Float64WithDefault(order.CarrierDriverLatitude, 0)
}
return lng, lat, err
}
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
return api.FnAPI.AddTip(&fnpsapi.AddTipRes{
OrderId: "",
PartnerOrderCode: vendorOrderID,
AddTipAmountCent: tipFee,
ThirdIndexId: time.Now().Unix(),
})
}
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
order, err := api.FnAPI.QueryOrder(vendorOrderID)
if err == nil {
tipFee = order.OrderTipAmountCent
}
return tipFee, err
}

View File

@@ -85,7 +85,7 @@ func (c *DeliveryHandler) OnWaybillExcept(msg *mtpsapi.CallbackOrderExceptionMsg
}
func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *mtpsapi.CallbackResponse) {
order := c.callbackMsg2Waybill(msg)
order, goodsOrder := c.callbackMsg2Waybill(msg)
// 多次取消,只处理第一次
if msg.Status == mtpsapi.OrderStatusCanceled {
orderStatus, _ := orderman.FixedOrderManager.GetWayBillStatusList(msg.OrderID, msg.MtPeisongID, model.VendorIDMTPS)
@@ -96,6 +96,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
}
}
store, _ := dao.GetStoreDetail(dao.GetDB(), goodsOrder.JxStoreID, goodsOrder.VendorID, goodsOrder.VendorOrgCode)
switch msg.Status {
case mtpsapi.OrderStatusWaitingForSchedule:
data, err := api.MtpsAPI.QueryOrderStatus(msg.DeliveryID, msg.MtPeisongID)
@@ -104,6 +105,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
}
order.DesiredFee = utils.Float64TwoInt64(utils.MustInterface2Float64(data["delivery_fee"]) * 100)
order.ActualFee = utils.Float64TwoInt64(utils.MustInterface2Float64(data["pay_amount"]) * 100)
order.DesiredFee += int64(store.FreightMarkup)
order.Status = model.WaybillStatusNew
case mtpsapi.OrderStatusAccepted: // 已接单
data, err := api.MtpsAPI.QueryOrderStatus(msg.DeliveryID, msg.MtPeisongID)
@@ -112,6 +114,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
}
order.DesiredFee = utils.Float64TwoInt64(utils.MustInterface2Float64(data["delivery_fee"]) * 100)
order.ActualFee = utils.Float64TwoInt64(utils.MustInterface2Float64(data["pay_amount"]) * 100)
order.DesiredFee += int64(store.FreightMarkup)
order.Status = model.WaybillStatusCourierAssigned
order.Remark = order.CourierName + "" + order.CourierMobile
case mtpsapi.OrderStatusPickedUp: // 已取货
@@ -230,7 +233,7 @@ func signParams(params url.Values) string {
return fmt.Sprintf("%x", sha1.Sum([]byte(finalStr)))
}
func (c *DeliveryHandler) callbackMsg2Waybill(msg *mtpsapi.CallbackOrderMsg) (retVal *model.Waybill) {
func (c *DeliveryHandler) callbackMsg2Waybill(msg *mtpsapi.CallbackOrderMsg) (retVal *model.Waybill, good2 *model.GoodsOrder) {
retVal = &model.Waybill{
VendorWaybillID: msg.MtPeisongID,
VendorWaybillID2: utils.Int64ToStr(msg.DeliveryID),
@@ -250,7 +253,7 @@ func (c *DeliveryHandler) callbackMsg2Waybill(msg *mtpsapi.CallbackOrderMsg) (re
} else {
retVal.OrderVendorID = good.VendorID
}
return retVal
return retVal, good
}
// 老方法是自己计算
@@ -548,3 +551,13 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
}
return 0, err
}
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
// 无法获取已经添加的小费金额
return fmt.Errorf("美团暂不支持添加小费")
//return api.MtpsAPI.AddTip(vendorOrderID, vendorWaybillID, tipFee)
}
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
return tipFee, err
}

View File

@@ -140,9 +140,10 @@ func (d DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee i
return nil, err
}
//+0.2
// 系统加价
desiredFee := utils.Float64TwoInt(sfTotalPrice) + utils.WayBillDeliveryMarkUp
// 运营加价
desiredFee += store.FreightMarkup
bill = &model.Waybill{
VendorOrderID: order.VendorOrderID,
OrderVendorID: order.VendorID,
@@ -222,8 +223,6 @@ func (d DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo
}
deliveryFeeInfo = &partner.WaybillFeeInfo{}
price, err := api.SfPsAPI.PreCreateOrder(param)
//+0.2
//deliveryFee := utils.Float64TwoInt(price) + utils.WayBillDeliveryMarkUp
deliveryFeeInfo.DeliveryFee = utils.Float64TwoInt64(price)
globals.SugarLogger.Debugf("GetWaybillFee deliveryFeeInfo.DeliveryFee=%d", deliveryFeeInfo.DeliveryFee)
return deliveryFeeInfo, err
@@ -343,8 +342,7 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
order.CourierMobile = sfOrder.RiderPhone
}
//+0.2
sfTotalPrice := utils.Float64TwoInt(sfOrder.TotalPrice) + utils.WayBillDeliveryMarkUp
sfTotalPrice := utils.Float64TwoInt(sfOrder.TotalPrice)
sfActualPrice := utils.Float64TwoInt64(sfOrder.RealPayMoney)
globals.SugarLogger.Debugf("SFPS OnWaybillMsg,sfTotalPrice=%d,sfActualPrice=%d", sfTotalPrice, sfActualPrice)
@@ -354,6 +352,9 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
dao.GetRow(dao.GetDB(), &good, sql, sqlParams)
order.OrderVendorID = good.VendorID
store, _ := dao.GetStoreDetail(dao.GetDB(), good.JxStoreID, good.VendorID, good.VendorOrgCode)
sfTotalPrice += store.FreightMarkup
orderStatus := utils.Str2Int64(order.VendorStatus)
switch orderStatus {
case sfps2.OrderStatusNewOrder: //1订单创建

View File

@@ -341,6 +341,10 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
} else {
reallyPrice = int64(utils.Str2Float64(uuPrice.OrderPrice) * 100)
}
store, _ := dao.GetStoreDetail(dao.GetDB(), good.JxStoreID, good.VendorID, good.VendorOrgCode)
reallyPrice += int64(store.FreightMarkup)
actualFee := int64((utils.Str2Float64(uuPrice.OrderPrice)-utils.Str2Float64(uuPrice.PriceOff))*100) - int64(utils.WayBillDeliveryMarkUp)
switch req.State {
case uuptapi.StateConfirmSuccess:

View File

@@ -95,7 +95,9 @@ type IPurchasePlatformOrderHandler interface {
}
type IAddWaybillTip interface {
// GetWaybillTip 获取添加小费
GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error)
// UpdateWaybillTip 添加小费
UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error)
}

View File

@@ -310,6 +310,10 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
giftSkus, discountMoney := getZengSkus(vendorOrderID, orderData)
order.DiscountMoney = discountMoney
order.Skus = append(order.Skus, giftSkus...)
// 包装袋金额设置
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
jxutils.RefreshOrderSkuRelated(order)
return order
}

View File

@@ -350,6 +350,9 @@ func Map2Order(orderData map[string]interface{}) (order *model.GoodsOrder) {
}
order.Skus = append(order.Skus, sku)
}
// 包装袋金额设置
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
jxutils.RefreshOrderSkuRelated(order)
return order
}

View File

@@ -323,7 +323,7 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
if order.ExpectedDeliveredTime.Sub(order.OrderCreatedAt) <= time.Hour+time.Minute {
order.BusinessType = model.BusinessTypeImmediate
}
// buildOrderTo102919(order)
order.PackagePrice = store.PackageSetting
return order, err
}

View File

@@ -92,7 +92,7 @@ func OnKSPayCallback(msg *kuaishou_mini.CallBackDetail, refund *kuaishou_mini.Re
func onKSPayFinished(msg *kuaishou_mini.CallBackDetail) (err error) {
orderPay := &model.OrderPay{
PayOrderID: msg.OutOrderNo,
PayType: model.PayTypeTicTok,
PayType: model.PayTypeKuaiShou,
}
orderPay.DeletedAt = utils.DefaultTimeValue
db := dao.GetDB()
@@ -162,7 +162,7 @@ func RefundOrderByKS(ctx *jxcontext.Context, orderPay *model.OrderPay, refundID
OutRefundNo: refundID,
Reason: refundDesc,
Attach: "",
NotifyUrl: "http://callback.jxc4.com/kuaishou/kuaiShouCallback",
NotifyUrl: "https://callback.jxc4.com/kuaishou/kuaiShouCallback",
RefundAmount: int64(orderPay.TotalFee),
Sign: "",
MultiCopiesGoodsInfo: "",

View File

@@ -1228,6 +1228,9 @@ func jxOrder2GoodsOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, deliveryAd
if IsDeliverySelf {
order.DeliveryType = model.OrderDeliveryTypeSelfTake
}
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
return order, err
}

View File

@@ -245,10 +245,8 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
ignoreSkuMap := make(map[int]int)
// detail := result["detail"].([]interface{})
multiSkuMap := make(map[int]int)
for _, product := range detail {
// product := product2.(map[string]interface{})
skuName := product["food_name"].(string)
skuID := utils.Interface2String(product["sku_id"])
sku := &model.OrderSku{
@@ -296,9 +294,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
if sku.SalePrice < 0 {
sku.SalePrice = jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"]))
}
// if product["isGift"].(bool) {
// sku.SkuType = 1
// }
order.Skus = append(order.Skus, sku)
multiSkuMap[sku.SkuID]++
}
@@ -308,6 +303,9 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
// 包装袋金额设置
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
jxutils.RefreshOrderSkuRelated(order)
return order
}

View File

@@ -107,11 +107,11 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
for _, sku := range refundData.FoodList {
orderSku := &model.OrderSkuFinancial{
// VendorID: model.VendorIDMTWM,
// AfsOrderID: afsOrder.AfsOrderID,
AfsOrderID: afsOrder.AfsOrderID,
// VendorOrderID: afsOrder.VendorOrderID,
// VendorStoreID: afsOrder.VendorStoreID,
// StoreID: afsOrder.StoreID,
// IsAfsOrder: 1,
IsAfsOrder: 1,
Count: sku.Count,
// ConfirmTime: afsOrder.AfsCreateAt,
@@ -120,6 +120,10 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
Name: sku.FoodName,
UserMoney: jxutils.StandardPrice2Int(sku.RefundPrice)*int64(sku.Count) + jxutils.StandardPrice2Int(sku.BoxPrice)*int64(sku.BoxNum),
}
if orderSku.VendorSkuID == "" || orderSku.VendorSkuID == "0" {
orderSku.VendorSkuID = sku.AppFoodCode
}
afsOrder.SkuUserMoney += orderSku.UserMoney
afsOrder.Skus = append(afsOrder.Skus, orderSku)
}

View File

@@ -174,9 +174,7 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
salePrice += sku.SalePrice
}
}
//order.TotalShopMoney = utils.Float64TwoInt64(float64(salePrice) * 0.95) // 抖音平台扣点金额0.05
//order.DeliveryType = model.OrderDeliveryTypeStoreSelf
autoTransport, err := GetStoreAutoCallRiderInfo(vendorOrgCode, []int64{utils.Str2Int64(vendorStoreIdRelly)})
if err != nil || len(autoTransport) == 0 {
order.DeliveryType = model.OrderDeliveryTypePlatform
@@ -195,20 +193,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
return nil, nil, err
}
// 订单不在门店营业时间来的订单,
//openTime := localStore.OpenTime1 // 门店开始营业时间
//closeTime := localStore.CloseTime1 // 门店结束营业时间
//if localStore.CloseTime2 != 0 {
// closeTime = localStore.CloseTime2
//}
//
//h, m, _ := order.ExpectedDeliveredTime.Clock()
//if order.ExpectedDeliveredTime.Day() == time.Now().Day() && utils.Str2Int16(fmt.Sprintf("%d%d", h, m)) >= openTime && utils.Str2Int16(fmt.Sprintf("%d%d", h, m)) < closeTime && localStore.Status == model.StoreStatusOpened {
// order.BusinessType = model.BusinessTypeImmediate
//} else {
// order.BusinessType = model.BusinessTypeDingshida
//}
if result.EarlyArrival { // 立即达
order.BusinessType = model.BusinessTypeImmediate
order.ExpectedDeliveredTime = getTimeFromTimestamp(result.TargetArrivalTime + 30*60) // 预计最晚送达时间
@@ -239,7 +223,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
// 抖音订单手机号和收货地址是否同城
order.PhoneAscription = ""
//ascription, err := phonedata.Find(order.ConsigneeMobile)
ascription, err := ascription_place.Find(order.ConsigneeMobile)
if err != nil {
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + err.Error()
@@ -250,7 +233,8 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
order.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + "归属信息不匹配:" + ascription.Province + ascription.City
}
}
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
jxutils.RefreshOrderSkuRelated(order)
return order, orderMap, nil
}
@@ -310,15 +294,6 @@ func (c *PurchaseHandler) onOrderMsg(msgId, orderId string, msg interface{}) (re
return tiktokShop.Err2CallbackResponse(nil, "")
}
// 取消订单:可能未支付取消订单,不做处理
//if msgId == tiktokShop.CallbackCancelOrderMsgTagId {
// if _, err := partner.CurOrderManager.LoadOrder(orderId, model.VendorIDDD); err != nil && strings.Contains(err.Error(), "找不到相应订单") {
// return tiktokShop.Err2CallbackResponse(nil, "")
// } else {
// return tiktokShop.Err2CallbackResponse(err, "")
// }
//}
// 组装订单状态变化
status, appOrgCode := c.callbackMsg2Status(msgId, orderId, msg)
// 校验重复消息