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

This commit is contained in:
richboo111
2023-03-06 14:12:03 +08:00
10 changed files with 143 additions and 72 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"git.rosy.net.cn/baseapi/utils"
"strconv"
"strings"
"time"
@@ -226,10 +225,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify) (resp *fnpsapi.CallbackRespon
dao.GetRow(dao.GetDB(), &good, sql, sqlParams)
order.OrderVendorID = good.VendorID
orderStatus, err := strconv.Atoi(order.VendorStatus)
if err != nil {
return fnpsapi.Err2CallbackResponse(err, "")
}
orderStatus := utils.Str2Int64(order.VendorStatus)
switch orderStatus {
case fnpsapi.OrderStatusAcceptCreate, fnpsapi.OrderStatusAccept: // 0 创建订单
order.DesiredFee = GetDesiredFee(order.VendorOrderID)

View File

@@ -128,7 +128,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
}
// 目前只推送美团骑手信息
switch v.VendorID {
case model.VendorIDMTWM: // 美团
case model.VendorIDMTWM: // 美团
paramsMap := utils.Struct2Map(riderInfo, "", true)
if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.VendorID); handler != nil {
if err := handler.GetOrderRider(v.VendorOrgCode, v.VendorStoreID, paramsMap); err != nil {
@@ -136,16 +136,24 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
}
}
case model.VendorIDELM: // 饿了么
continue
case model.VendorIDEBAI: // 饿百发单
continue
case model.VendorIDJD: // 京东发单
continue
case model.VendorIDGD: // 美团发单
continue
case model.VendorIDYB: // 银豹发单
continue
case model.VendorIDJDShop: // 京东商城
continue
case model.VendorIDWSC: // 微盟微商城
continue
case model.VendorIDDD: // 抖店小时达
continue
default:
globals.SugarLogger.Errorf("Order source error, non system order")
return
continue
}
}
return

View File

@@ -291,11 +291,9 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
sql := `SELECT * FROM goods_order WHERE vendor_order_id = ? ORDER BY order_created_at DESC LIMIT 1 OFFSET 0`
sqlParams := []interface{}{req.OriginID}
dao.GetRow(dao.GetDB(), &good, sql, sqlParams)
globals.SugarLogger.Debugf("uupt OnWaybillMsg good=====%s ", utils.Format4Output(good, false))
param.OrderVendorID = good.VendorID
//查询运单价格
if uuPrice, err := api.UuAPI.GetOrderDetail(req.OrderCode); err != nil {
globals.SugarLogger.Debugf("uuGetPrice err====%v", err)
reallyPrice = 0
} else {
reallyPrice = int64((utils.Str2Float64(uuPrice.OrderPrice) - utils.Str2Float64(uuPrice.PriceOff)) * 100)
@@ -325,7 +323,6 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
default:
globals.SugarLogger.Warnf("onWaybillMsg unknown State:%v", req.State)
}
globals.SugarLogger.Debugf("UUPT onWaybillMsg param=====%s", utils.Format4Output(param, false))
if err := partner.CurOrderManager.OnWaybillStatusChanged(param); err != nil {
return uuptapi.Err2CallbackResponse(err)
}