This commit is contained in:
邹宗楠
2026-01-23 13:47:21 +08:00
parent e54c3d04a8
commit 09e9c310b4
2 changed files with 24 additions and 18 deletions

View File

@@ -2,10 +2,14 @@ package defsch
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/server/web"
"math"
"math/rand"
"strings"
"time"
"git.rosy.net.cn/jx-callback/business/model/dao"
@@ -499,23 +503,24 @@ func (s *DefScheduler) QueryOrderWaybillFeeInfoEx(ctx *jxcontext.Context, vendor
}
// 隐私地址获取(美团)
//if vendorID == model.VendorIDMTWM && strings.Contains(order.ConsigneeAddress, "地址已隐藏") {
// var apiObj *mtwmapi.API
// switch order.VendorOrgCode {
// case beego.AppConfig.DefaultString("mtwmAppID2", ""): // 5873
// store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
// apiObj = api.Mtwm2API
// apiObj.SetToken(store.MtwmToken)
// default: // 589 4123
// apiObj = api.MtwmAPI
// }
// address, err := apiObj.GetOrderAddress(utils.Str2Int64(order.VendorOrderID), 3)
// if err != nil {
// return nil, err
// }
//
//}
if vendorID == model.VendorIDMTWM && (strings.Contains(order.ConsigneeAddress, "地址已隐藏") || strings.Contains(order.ConsigneeAddress, "(***)")) {
var apiObj *mtwmapi.API
switch order.VendorOrgCode {
case beego.AppConfig.DefaultString("mtwmAppID2", ""): // 5873
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
apiObj = api.Mtwm2API
apiObj.SetToken(store.MtwmToken)
default: // 589 4123
apiObj = api.MtwmAPI
}
address, err := apiObj.GetOrderAddress(utils.Str2Int64(order.VendorOrderID), 3)
if err != nil {
return nil, err
}
addressList := strings.Split(order.ConsigneeAddress, "@#")
order.ConsigneeAddress = address + "@#" + addressList[1]
dao.UpdateEntity(db, order, "ConsigneeAddress")
}
// 美团配送订单兑现
waybillList, err := partner.CurOrderManager.GetOrderWaybillInfo(ctx, vendorOrderID, vendorID, true, false)
if err != nil {

View File

@@ -332,7 +332,8 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *mtwmapi.CallbackMsg) (order
switch refundData.Status {
case "21", "27", "10", "17":
orderStatus.Status = model.AfsOrderStatusFinished
case "22", "28", "11", "18":
time.Sleep(100 * time.Millisecond)
case "22", "28", "11", "18", "30":
orderStatus.Status = model.AfsOrderStatusFailed
}
orderStatus.VendorStatus += "," + refundData.Status