This commit is contained in:
richboo111
2023-01-04 18:32:37 +08:00
parent 1bbebdb773
commit adad91cd52
9 changed files with 231 additions and 61 deletions

View File

@@ -69,7 +69,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
if v.WaybillVendorID == model.VendorIDDada || v.WaybillVendorID == model.VendorIDFengNiao || v.WaybillVendorID == model.VendorIDDD {
riderInfo, err = handlerInfo.Handler.GetRiderInfo(v.VendorOrderID, 0, v.VendorWaybillID)
if err != nil {
globals.SugarLogger.Debug("Get Order waybill rider info err FN/DADA :%v", err)
globals.SugarLogger.Debug("Get Order waybill rider info err FN/DADA/DYPS :%v", err)
}
} else if v.WaybillVendorID == model.VendorIDMTPS {
if v.VendorWaybillID != "" {

View File

@@ -62,9 +62,6 @@ func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorSt
VendorStoreID: utils.Int64ToStr(storeInfo.StoreDetail.Store.StoreId),
CourierStatus: int(storeInfo.StoreDetail.Store.State),
}
globals.SugarLogger.Debugf("storeDetail.Store.Lng====%d,storeDetail.Store.Lat==========%d", storeDetail.Store.Lng, storeDetail.Store.Lat)
} else {
globals.SugarLogger.Debugf("GetStoreDetail err=========%s", err)
}
globals.SugarLogger.Debugf("DYPS GetStore storeDetail====%s", utils.Format4Output(storeDetail, false))
return storeDetail, err
@@ -101,7 +98,6 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee
return nil, err
}
delivery.OnWaybillCreated(bill)
globals.SugarLogger.Debugf("DYPS CreateWaybill bill======%s", utils.Format4Output(bill, false))
return bill, nil
}
@@ -127,7 +123,6 @@ func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInf
if err != nil {
return nil, errors.New("获取抖音平台账号信息失败,请重试")
}
globals.SugarLogger.Debugf("relInfo.VendorStoreID======%s,order.VendorOrderID======%s", relInfo.VendorStoreID, order.VendorOrderID)
if dispatcherFee, err := getAPI(relInfo.VendorOrgCode).GetDispatcherInfo(utils.Str2Int64(relInfo.VendorStoreID), order.VendorOrderID, tiktok_api.DispatcherFeeTypeCall); err == nil {
deliveryFeeInfo = &partner.WaybillFeeInfo{}
deliveryFeeInfo.DeliveryFee = dispatcherFee
@@ -189,7 +184,6 @@ func CreateVirtualMobile(shopOrderID int64) (*superm_createVirtualMobile_respons
//订单状态回调
func OnWaybillMsg(tag, orderId string, data interface{}) (response *tiktok_api.CallbackResponse) {
req := data.(tiktok_api.ShipmentInfoData)
globals.SugarLogger.Debugf("DYPS OnWaybillMsg req============%s", utils.Format4Output(req, false))
param := &model.Waybill{
VendorOrderID: utils.Int64ToStr(req.ShopOrderID),
VendorWaybillID: req.TrackNo,
@@ -206,7 +200,6 @@ func OnWaybillMsg(tag, orderId string, data interface{}) (response *tiktok_api.C
param.StatusTime = time.Now()
}
dispatcherFee := getDispatcherFee(req.ShopID, utils.Int64ToStr(req.ShopOrderID), tiktok_api.DispatcherFeeTypeCall)
globals.SugarLogger.Debugf("DYPS OnWaybillMsg dispatcherFee=%d req.ShipmentStatus=%d", dispatcherFee, req.ShipmentStatus)
switch req.ShipmentStatus {
case tiktok_api.ShipmentStatusCalling: //1 骑手呼叫中
param.DesiredFee = dispatcherFee

View File

@@ -0,0 +1,80 @@
package uupt
const (
//errCode 错误码说明
ErrorParameter1 = -101 //参数格式校验错误
ErrorParameter2 = -199 //参数格式校验错误
ErrorTimestamp = -102 //timestamp错误
ErrorAppID = -103 //appid无效
ErrorSignatureCheck = -104 //签名校验失败
ErrorOpenIDInvalid = -105 //openid无效
ErrorUnableParseOrigin = -1001 //无法解析起始地
ErrorUnableParseDestination = -1002 //无法解析目的地
ErrorCantGetCityInformation = -1003 //无法获取订单城市相关信息
ErrorOrderCategory = -1004 //订单小类出现错误
ErrorNoUserInformation = -1005 //没有用户信息
ErrorCouponID = -1006 //优惠券ID错误
ErrorPriceToken1 = -2001 //price_token无效
ErrorPriceToken2 = -2002 //price_token无效
ErrorPushType = -2003 //push_type错误
ErrorSpecialType = -2004 //special_type错误
ErrorCallMeWithTake = -2005 //callMe_withTake错误
ErrorOrderPrice = -2006 //order_price错误
ErrorBalancePayMoney = -2007 //balance_payMoney错误
ErrorOrderTotalMoney = -2008 //订单总金额错误
ErrorPayMoney = -2009 //支付金额错误
ErrorUserNotMatch = -2010 //用户不一致
ErrorWrongPhone = -2011 //手机号错误
ErrorNotExistBind = -2012 //不存在绑定关系
ErrorCancelReasonCantEmpty = -4001 //取消原因不能为空
ErrorOrderNumber1 = -4002 //订单编号无效
ErrorOrderNumber2 = -5001 //订单编号无效
ErrorOrderNumber3 = -5002 //订单编号无效
ErrorOrderNumber4 = -5003 //订单编号无效
ErrorFrequencyTooFast = -10001 //发送频率过快,请稍候重试
ErrorNeedCommitVerificationCode = -106 //接口返回base64图片需要提交对应图片验证码
)
var ErrCode = map[int]string{
ErrorParameter1: "参数格式校验错误",
ErrorParameter2: "参数格式校验错误",
ErrorTimestamp: "timestamp错误",
ErrorAppID: "appid无效",
ErrorSignatureCheck: "签名校验失败",
ErrorOpenIDInvalid: "openid无效",
ErrorUnableParseOrigin: "无法解析起始地",
ErrorUnableParseDestination: "无法解析目的地",
ErrorCantGetCityInformation: "无法获取订单城市相关信息",
ErrorOrderCategory: "订单小类出现错误",
ErrorNoUserInformation: "没有用户信息",
ErrorCouponID: "优惠券ID错误",
ErrorPriceToken1: "price_token无效",
ErrorPriceToken2: "price_token无效",
ErrorPushType: "push_type错误",
ErrorSpecialType: "special_type错误",
ErrorCallMeWithTake: "callMe_withTake错误",
ErrorOrderPrice: "order_price错误",
ErrorBalancePayMoney: "balance_payMoney错误",
ErrorOrderTotalMoney: "订单总金额错误",
ErrorPayMoney: "支付金额错误",
ErrorUserNotMatch: "用户不一致",
ErrorWrongPhone: "手机号错误",
ErrorNotExistBind: "不存在绑定关系",
ErrorCancelReasonCantEmpty: "取消原因不能为空",
ErrorOrderNumber1: "订单编号无效",
ErrorOrderNumber2: "订单编号无效",
ErrorOrderNumber3: "订单编号无效",
ErrorOrderNumber4: "订单编号无效",
ErrorFrequencyTooFast: "发送频率过快,请稍候重试",
ErrorNeedCommitVerificationCode: "接口返回base64图片需要提交对应图片验证码",
}
var (
curDeliveryHandler *DeliveryHandler
)
type DeliveryHandler struct {
}
func init() {
//if api.
}