1
This commit is contained in:
@@ -117,8 +117,8 @@ func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName
|
|||||||
partner.CurOrderManager.OnOrderMsg(order, "取消美团外卖,转用三方配送", err.Error())
|
partner.CurOrderManager.OnOrderMsg(order, "取消美团外卖,转用三方配送", err.Error())
|
||||||
}
|
}
|
||||||
// 查询订单状态,
|
// 查询订单状态,
|
||||||
orderStatus, _ := partner.GetPurchasePlatformFromVendorID(order.VendorID).OrderLogisticsStatus(utils.Str2Int64(order.VendorOrderID))
|
orderStatus, _ := partner.GetPurchasePlatformFromVendorID(order.VendorID).OrderLogisticsStatus(order.VendorOrderID)
|
||||||
if orderStatus == 100 { // 美团取消配送单
|
if orderStatus.LogisticsStatus == 100 { // 美团取消配送单
|
||||||
partner.CurOrderManager.OnOrderMsg(order, "美团外卖转自送成功.", "")
|
partner.CurOrderManager.OnOrderMsg(order, "美团外卖转自送成功.", "")
|
||||||
return nil
|
return nil
|
||||||
} else if strings.Contains(err.Error(), "包裹不存在") || strings.Contains(err.Error(), "运单不存在") || strings.Contains(err.Error(), "1071") || strings.Contains(err.Error(), "1014") || strings.Contains(err.Error(), "invalid character 'o' looking for beginning of value") {
|
} else if strings.Contains(err.Error(), "包裹不存在") || strings.Contains(err.Error(), "运单不存在") || strings.Contains(err.Error(), "1071") || strings.Contains(err.Error(), "1014") || strings.Contains(err.Error(), "invalid character 'o' looking for beginning of value") {
|
||||||
@@ -137,13 +137,13 @@ func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName
|
|||||||
} else if order.VendorID == model.VendorIDDD { //抖音配送
|
} else if order.VendorID == model.VendorIDDD { //抖音配送
|
||||||
localBill, _ := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
localBill, _ := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
||||||
// 获取抖音配送状态
|
// 获取抖音配送状态
|
||||||
tiktokWayBillStatus, _ := partner.GetPurchasePlatformFromVendorID(order.VendorID).OrderLogisticsStatus(utils.Str2Int64(order.VendorOrderID))
|
tiktokWayBillStatus, _ := partner.GetPurchasePlatformFromVendorID(order.VendorID).OrderLogisticsStatus(order.VendorOrderID)
|
||||||
if tiktokWayBillStatus >= tiktokShop.ShipmentStatusReceived {
|
if tiktokWayBillStatus.LogisticsStatus >= tiktokShop.ShipmentStatusReceived {
|
||||||
//取消抖音配送转自送
|
//取消抖音配送转自送
|
||||||
err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel)
|
err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel)
|
||||||
partner.CurOrderManager.OnOrderMsg(order, "取消抖音配送,转用门店自配送/三方配送", "抖音骑手已经接单,无法取消")
|
partner.CurOrderManager.OnOrderMsg(order, "取消抖音配送,转用门店自配送/三方配送", "抖音骑手已经接单,无法取消")
|
||||||
return err
|
return err
|
||||||
} else if tiktokWayBillStatus == -1 { // 先转自送,自送不成功取消平台配送.
|
} else if tiktokWayBillStatus.LogisticsStatus == -1 { // 先转自送,自送不成功取消平台配送.
|
||||||
if err := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName); err != nil {
|
if err := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName); err != nil {
|
||||||
partner.CurOrderManager.OnOrderMsg(order, "抖音转自送,平台无运力", "tiktokWayBillStatus = -1")
|
partner.CurOrderManager.OnOrderMsg(order, "抖音转自送,平台无运力", "tiktokWayBillStatus = -1")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,15 @@ package cms
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/autonavi"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
||||||
|
"math"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils/errlist"
|
"git.rosy.net.cn/baseapi/utils/errlist"
|
||||||
@@ -100,6 +101,9 @@ var (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AutonaviKeyList = []string{autonavi.AMAPCyclingPlanKey1, autonavi.AMAPCyclingPlanKey2, autonavi.AMAPCyclingPlanKey3, autonavi.AMAPCyclingPlanKey4, autonavi.AMAPCyclingPlanKey5}
|
||||||
|
AutonaviKeyIndex = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||||
@@ -586,8 +590,8 @@ func GetCityBankBranches(ctx *jxcontext.Context, cityCode int, bankCode string)
|
|||||||
return info, err
|
return info, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSToUWalkingDistance 获取商家与用户间步行距离
|
// GetSToURidingDistance 获取商家与用户间步行距离
|
||||||
func GetSToURidingDistance(sLng, sLat, uLng, uLat float64) (stepInfo interface{}, err error) {
|
func GetSToURidingDistance(sLng, sLat, uLng, uLat float64, orderId string) (stepInfo interface{}, err error) {
|
||||||
var coords []*baidunavi.Coordinate
|
var coords []*baidunavi.Coordinate
|
||||||
coords = append(coords, &baidunavi.Coordinate{
|
coords = append(coords, &baidunavi.Coordinate{
|
||||||
Lng: sLng,
|
Lng: sLng,
|
||||||
@@ -605,3 +609,109 @@ func GetSToURidingDistance(sLng, sLat, uLng, uLat float64) (stepInfo interface{}
|
|||||||
}
|
}
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSToURidingDistance2 获取商家与用户间步行距离
|
||||||
|
func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (wayBill *model.Waybill, err error) {
|
||||||
|
var (
|
||||||
|
origin = fmt.Sprintf("%f,%f", sLng, sLat)
|
||||||
|
destination = fmt.Sprintf("%f,%f", uLng, uLat)
|
||||||
|
db = dao.GetDB()
|
||||||
|
)
|
||||||
|
|
||||||
|
for {
|
||||||
|
// 骑手坐标
|
||||||
|
waybills, err := dao.GetWaybills(db, orderId, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, v := range waybills {
|
||||||
|
if v.Status == model.WaybillStatusCanceled {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//if v.Status >= model.WaybillStatusAccepted && v.Status <= model.WaybillStatusCanceled {
|
||||||
|
// 获取骑行路线图
|
||||||
|
if v.OriginalData == "" {
|
||||||
|
originalData, distance, durationTime, err := GetCyclingLine(origin, destination)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
v.OriginalData = strings.Join(originalData, ";")
|
||||||
|
v.Distance = distance
|
||||||
|
v.DurationTime = durationTime
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
|
||||||
|
// 如果是三方配送,更新骑手信息
|
||||||
|
if handler := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handler != nil {
|
||||||
|
riderInfo, _ := handler.Handler.GetRiderInfo(v.VendorOrderID, v.ID+1000000, v.VendorWaybillID)
|
||||||
|
if riderInfo != nil {
|
||||||
|
v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude)
|
||||||
|
if (v.CourierName == "" || v.CourierMobile == "") && riderInfo.CourierName != "" {
|
||||||
|
v.CourierName = riderInfo.CourierName
|
||||||
|
v.CourierMobile = riderInfo.CourierPhone
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果是平台配送,获取骑手信息
|
||||||
|
if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.WaybillVendorID); handler != nil {
|
||||||
|
riderInfo, _ := handler.OrderLogisticsStatus(v.VendorOrderID)
|
||||||
|
if riderInfo != nil {
|
||||||
|
v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude)
|
||||||
|
if (v.CourierName == "" || v.CourierMobile == "") && riderInfo.CourierName != "" {
|
||||||
|
v.CourierName = riderInfo.CourierName
|
||||||
|
v.CourierMobile = riderInfo.CourierPhone
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当这个运单为假物流/门店真实自送/获取运单骑手信息为空的时候使用假的骑手信息
|
||||||
|
if v.WaybillVendorID == model.VendorJXFakeWL || v.WaybillVendorID == model.VendorIDUnknown || v.CourierCoordinate == "" {
|
||||||
|
riderLine := strings.Split(v.OriginalData, ";") // 路线坐标点
|
||||||
|
|
||||||
|
courierDistance := float64(time.Now().Unix()-v.WaybillCreatedAt.Unix()) * (float64(v.Distance) / float64(v.DurationTime)) // 当前骑手骑行距离
|
||||||
|
nowCourierDrop := int64(math.Ceil((courierDistance / float64(v.Distance)) * float64(len(riderLine)))) // 当前骑手骑行距离,占中的骑行距离百分比.
|
||||||
|
if nowCourierDrop >= int64(len(riderLine)) {
|
||||||
|
v.CourierCoordinate = riderLine[nowCourierDrop-2]
|
||||||
|
}
|
||||||
|
if nowCourierDrop <= 0 {
|
||||||
|
v.CourierCoordinate = riderLine[0]
|
||||||
|
}
|
||||||
|
if v.Status == model.WaybillStatusDelivered {
|
||||||
|
v.CourierCoordinate = riderLine[len(riderLine)-1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dao.UpdateEntity(db, v, "OriginalData", "CourierCoordinate", "Distance", "DurationTime")
|
||||||
|
if v.CourierName == "" || v.CourierMobile == "" {
|
||||||
|
v.CourierName = "暂无骑手"
|
||||||
|
v.CourierMobile = "暂无电话"
|
||||||
|
}
|
||||||
|
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetCyclingLine 获取骑行路线
|
||||||
|
func GetCyclingLine(origin, destination string) (polyLineList []string, distance, duration int64, errCode error) {
|
||||||
|
for {
|
||||||
|
polyLineList, distance, duration, errCode = api.AutonaviAPI.GetCyclingPlan(origin, destination)
|
||||||
|
if errCode != nil {
|
||||||
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "高德地图骑行方案获取错误:", utils.Format4Output(errCode, false))
|
||||||
|
}
|
||||||
|
if errCode != nil && errCode.Error() == autonavi.DAILYQUERYOVERLIMIT {
|
||||||
|
AutonaviKeyIndex += model.YES
|
||||||
|
if AutonaviKeyIndex >= len(AutonaviKeyList) {
|
||||||
|
AutonaviKeyIndex = model.NO
|
||||||
|
}
|
||||||
|
api.AutonaviAPI.SetKey(AutonaviKeyList[AutonaviKeyIndex])
|
||||||
|
} else if errCode != nil {
|
||||||
|
return nil, 0, 0, errCode
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(polyLineList) > model.NO {
|
||||||
|
return polyLineList, distance, duration, errCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -178,11 +178,6 @@ func Init() {
|
|||||||
report.RefreshStoreManageState(jxcontext.AdminCtx, nil, []int{model.VendorIDJD})
|
report.RefreshStoreManageState(jxcontext.AdminCtx, nil, []int{model.VendorIDJD})
|
||||||
}, 5*time.Second, 1*time.Hour)
|
}, 5*time.Second, 1*time.Hour)
|
||||||
|
|
||||||
// 每五分钟轮询一次推送骑手信息坐标给美团
|
|
||||||
ScheduleTimerFuncByInterval(func() {
|
|
||||||
delivery.GetOrderRiderInfoToPlatform("", 0)
|
|
||||||
}, 10*time.Second, 5*time.Minute)
|
|
||||||
|
|
||||||
//每天晚上23:00更新抖店 审核状态
|
//每天晚上23:00更新抖店 审核状态
|
||||||
ScheduleTimerFunc("UpdateStorePoiStatus", func() {
|
ScheduleTimerFunc("UpdateStorePoiStatus", func() {
|
||||||
cms.UpdateStorePoiStatus(jxcontext.AdminCtx)
|
cms.UpdateStorePoiStatus(jxcontext.AdminCtx)
|
||||||
@@ -212,16 +207,21 @@ func Init() {
|
|||||||
"12:30:00",
|
"12:30:00",
|
||||||
})
|
})
|
||||||
|
|
||||||
// 每分钟轮询一次,推送骑手信息
|
// 每分钟轮询一次,推送骑手信息(假的订单)
|
||||||
ScheduleTimerFuncByInterval(func() {
|
ScheduleTimerFuncByInterval(func() {
|
||||||
delivery.UpdateFakeWayBillToTiktok()
|
delivery.UpdateFakeWayBillToTiktok()
|
||||||
}, 10*time.Second, 5*time.Second)
|
}, 10*time.Second, 5*time.Minute)
|
||||||
|
|
||||||
// (自动发单拣货,设置骑手)
|
// 每五分钟轮询一次推送骑手信息坐标给美团(真的订单)
|
||||||
|
ScheduleTimerFuncByInterval(func() {
|
||||||
|
delivery.GetOrderRiderInfoToPlatform("", 0)
|
||||||
|
}, 10*time.Second, 5*time.Minute)
|
||||||
|
|
||||||
|
// (自动发单拣货,设置骑手) 刷单用
|
||||||
ScheduleTimerFuncByInterval(func() {
|
ScheduleTimerFuncByInterval(func() {
|
||||||
auto_delivery.Init() // 初始化骑手列表
|
auto_delivery.Init() // 初始化骑手列表
|
||||||
auto_delivery.AutoSettingFakeDelivery()
|
auto_delivery.AutoSettingFakeDelivery()
|
||||||
}, 10*time.Second, 3*time.Minute)
|
}, 10*time.Second, 5*time.Minute)
|
||||||
|
|
||||||
// 定时任务更新负责人信息
|
// 定时任务更新负责人信息
|
||||||
ScheduleTimerFunc("RefreshStoreOperator", func() {
|
ScheduleTimerFunc("RefreshStoreOperator", func() {
|
||||||
|
|||||||
@@ -1494,12 +1494,13 @@ func GetWaybills(db *DaoDB, vendorOrderID string, vendors []int64) (waybills []*
|
|||||||
FROM waybill
|
FROM waybill
|
||||||
WHERE vendor_order_id = ?
|
WHERE vendor_order_id = ?
|
||||||
`
|
`
|
||||||
|
sqlParams := []interface{}{vendorOrderID}
|
||||||
if len(vendors) > model.NO {
|
if len(vendors) > model.NO {
|
||||||
sql += " AND waybill_vendor_id IN (" + GenQuestionMarks(len(vendors)) + ")"
|
sql += " AND waybill_vendor_id IN (" + GenQuestionMarks(len(vendors)) + ")"
|
||||||
|
sqlParams = append(sqlParams, vendors)
|
||||||
}
|
}
|
||||||
|
|
||||||
sql += ` ORDER BY waybill_created_at asc`
|
sql += ` ORDER BY waybill_created_at asc`
|
||||||
sqlParams := []interface{}{vendorOrderID}
|
|
||||||
sqlParams = append(sqlParams, vendors)
|
|
||||||
err = GetRows(db, &waybills, sql, sqlParams)
|
err = GetRows(db, &waybills, sql, sqlParams)
|
||||||
return waybills, err
|
return waybills, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,10 +244,14 @@ type Waybill struct {
|
|||||||
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
|
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
|
||||||
StatusTime time.Time `orm:"type(datetime)" json:"-"` // last status time
|
StatusTime time.Time `orm:"type(datetime)" json:"-"` // last status time
|
||||||
ModelTimeInfo `json:"-"`
|
ModelTimeInfo `json:"-"`
|
||||||
OriginalData string `orm:"type(text)" json:"-"`
|
OriginalData string `orm:"type(text)" json:"-"` // 用来保存门店到用户间的坐标点
|
||||||
Remark string `orm:"-" json:"-"` // 用于传递remark
|
Distance int64 `orm:"column(distance);size(16)" json:"distance"` // 门店和用户之间的推荐距离
|
||||||
PunctualFee int64 `orm:"column(punctual_fee)" json:"punctualFee"` // 对应美团外卖运单的准时保险费
|
CourierCoordinate string `orm:"column(courier_coordinate);size(32)" json:"courier_coordinate"` // 骑手坐标
|
||||||
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
DurationTime int64 `orm:"column(duration_time);size(16)" json:"duration_time"` // 骑行时间
|
||||||
|
|
||||||
|
Remark string `orm:"-" json:"-"` // 用于传递remark
|
||||||
|
PunctualFee int64 `orm:"column(punctual_fee)" json:"punctualFee"` // 对应美团外卖运单的准时保险费
|
||||||
|
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Waybill) TableUnique() [][]string {
|
func (w *Waybill) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package dada
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||||
@@ -130,7 +129,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
|
|||||||
|
|
||||||
// 抖音订单状态回传
|
// 抖音订单状态回传
|
||||||
func tiktokStatusPush(order *model.Waybill, status int) {
|
func tiktokStatusPush(order *model.Waybill, status int) {
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: order.CourierName,
|
CourierName: order.CourierName,
|
||||||
@@ -507,18 +506,18 @@ func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCod
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取骑手信息(订单详情)
|
// 获取骑手信息(订单详情)
|
||||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
order, err := api.DadaAPI.QueryOrderInfo(orderId)
|
order, err := api.DadaAPI.QueryOrderInfo(orderId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: mtPeisongId,
|
ThirdCarrierOrderId: mtPeisongId,
|
||||||
CourierName: order.TransporterName,
|
CourierName: order.TransporterName,
|
||||||
CourierPhone: order.TransporterPhone,
|
CourierPhone: order.TransporterPhone,
|
||||||
LogisticsProviderCode: mtpsapi.DaDaCode,
|
LogisticsProviderCode: utils.DaDaCode,
|
||||||
LogisticsStatus: order.StatusCode,
|
LogisticsStatus: order.StatusCode,
|
||||||
LogisticsContext: "",
|
LogisticsContext: "",
|
||||||
Latitude: order.TransporterLat,
|
Latitude: order.TransporterLat,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package fn
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||||
@@ -323,7 +322,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
|
|||||||
|
|
||||||
// 抖音订单状态回传
|
// 抖音订单状态回传
|
||||||
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: order.CourierName,
|
CourierName: order.CourierName,
|
||||||
@@ -393,7 +392,7 @@ func GetDesiredFee(vendorOrderID string) (desiredFee, acuteFee int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取骑手信息
|
// 获取骑手信息
|
||||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
// 获取订单状态
|
// 获取订单状态
|
||||||
order, err := api.FnAPI.QueryOrder(orderId)
|
order, err := api.FnAPI.QueryOrder(orderId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -406,12 +405,12 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: utils.Int64ToStr(order.TrackingId),
|
ThirdCarrierOrderId: utils.Int64ToStr(order.TrackingId),
|
||||||
CourierName: knightInfo.CarrierDriverName,
|
CourierName: knightInfo.CarrierDriverName,
|
||||||
CourierPhone: knightInfo.CarrierDriverPhone,
|
CourierPhone: knightInfo.CarrierDriverPhone,
|
||||||
LogisticsProviderCode: mtpsapi.FnPsCode,
|
LogisticsProviderCode: utils.FnPsCode,
|
||||||
LogisticsStatus: order.OrderStatus, // 默认正在配送中
|
LogisticsStatus: order.OrderStatus, // 默认正在配送中
|
||||||
Latitude: knightInfo.CarrierDriverLatitude,
|
Latitude: knightInfo.CarrierDriverLatitude,
|
||||||
Longitude: knightInfo.CarrierDriverLongitude,
|
Longitude: knightInfo.CarrierDriverLongitude,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package jdeclp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||||
@@ -104,7 +103,7 @@ func (c *DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, reson
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId string) (money int64, err error) {
|
func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId string) (money int64, err error) {
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pushMTPSToTiktok(msgStatus int, order *model.Waybill) {
|
func pushMTPSToTiktok(msgStatus int, order *model.Waybill) {
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: order.CourierName,
|
CourierName: order.CourierName,
|
||||||
@@ -471,7 +471,7 @@ func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCod
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取骑手信息 美团配送 deliveryId,mtPeisongId这两参数美团专属
|
// 获取骑手信息 美团配送 deliveryId,mtPeisongId这两参数美团专属
|
||||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
// 获取订单状态
|
// 获取订单状态
|
||||||
order, err := api.MtpsAPI.QueryOrderStatus(deliveryId, mtPeisongId)
|
order, err := api.MtpsAPI.QueryOrderStatus(deliveryId, mtPeisongId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -483,12 +483,12 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: utils.Interface2String(order["mt_peisong_id"]),
|
ThirdCarrierOrderId: utils.Interface2String(order["mt_peisong_id"]),
|
||||||
CourierName: utils.Interface2String(order["courier_name"]),
|
CourierName: utils.Interface2String(order["courier_name"]),
|
||||||
CourierPhone: utils.Interface2String(order["courier_phone"]),
|
CourierPhone: utils.Interface2String(order["courier_phone"]),
|
||||||
LogisticsProviderCode: mtpsapi.MTPsCode,
|
LogisticsProviderCode: utils.MTPsCode,
|
||||||
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
|
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
|
||||||
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lat)),
|
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lat)),
|
||||||
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lng)),
|
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lng)),
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ package delivery
|
|||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||||
@@ -16,7 +20,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
@@ -96,10 +99,6 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (v.WaybillVendorID == model.YES || v.WaybillVendorID == -1) && v.VendorID == model.VendorIDMTWM {
|
|
||||||
// continue
|
|
||||||
//}
|
|
||||||
|
|
||||||
if orderId == "" { // 订单id为空是,是定时轮询操作,不做此状态
|
if orderId == "" { // 订单id为空是,是定时轮询操作,不做此状态
|
||||||
waybillList, _ := dao.GetWaybills(dao.GetDB(), v.VendorOrderID, nil)
|
waybillList, _ := dao.GetWaybills(dao.GetDB(), v.VendorOrderID, nil)
|
||||||
if len(waybillList) > 0 && waybillList[0].Status > model.WaybillStatusEndBegin {
|
if len(waybillList) > 0 && waybillList[0].Status > model.WaybillStatusEndBegin {
|
||||||
@@ -108,7 +107,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
riderInfo := &mtpsapi.RiderInfo{}
|
riderInfo := &utils.RiderInfo{}
|
||||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handlerInfo != nil {
|
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handlerInfo != nil {
|
||||||
if v.WaybillVendorID == model.VendorIDDada || v.WaybillVendorID == model.VendorIDFengNiao || v.WaybillVendorID == model.VendorIDUUPT || v.WaybillVendorID == model.VendorIDSFPS {
|
if v.WaybillVendorID == model.VendorIDDada || v.WaybillVendorID == model.VendorIDFengNiao || v.WaybillVendorID == model.VendorIDUUPT || v.WaybillVendorID == model.VendorIDSFPS {
|
||||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(v.VendorOrderID, 0, v.VendorWaybillID)
|
riderInfo, err = handlerInfo.Handler.GetRiderInfo(v.VendorOrderID, 0, v.VendorWaybillID)
|
||||||
@@ -250,7 +249,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) {
|
func PullTiktokRiderInfo(riderInfo *utils.RiderInfo) {
|
||||||
switch riderInfo.LogisticsStatus {
|
switch riderInfo.LogisticsStatus {
|
||||||
case 5: // 呼叫骑手
|
case 5: // 呼叫骑手
|
||||||
riderInfo.LogisticsStatus = 0
|
riderInfo.LogisticsStatus = 0
|
||||||
@@ -311,7 +310,7 @@ func UpdateOrder2Complete() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *utils.RiderInfo) {
|
||||||
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill.VendorOrderID, fakeWayBill.OrderVendorID)
|
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill.VendorOrderID, fakeWayBill.OrderVendorID)
|
||||||
storeId := 0
|
storeId := 0
|
||||||
if order.StoreID != 0 {
|
if order.StoreID != 0 {
|
||||||
@@ -320,6 +319,13 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
|||||||
storeId = order.JxStoreID
|
storeId = order.JxStoreID
|
||||||
}
|
}
|
||||||
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
|
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
|
||||||
|
|
||||||
|
waybill2, err := cms.GetSToURidingDistance2(jxutils.IntCoordinate2Standard(storeDetail.Lng), jxutils.IntCoordinate2Standard(storeDetail.Lat), jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), fakeWayBill.VendorOrderID)
|
||||||
|
if err != nil {
|
||||||
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "高德地图骑行方案获取错误:", utils.Format4Output(err.Error(), false))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
courierCoordinate := strings.Split(waybill2.CourierCoordinate, ",")
|
||||||
switch fakeWayBill.Status {
|
switch fakeWayBill.Status {
|
||||||
case 5: // 呼叫骑手
|
case 5: // 呼叫骑手
|
||||||
riderInfo.LogisticsContext = "呼叫骑手,新建运单"
|
riderInfo.LogisticsContext = "呼叫骑手,新建运单"
|
||||||
@@ -334,11 +340,12 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
|||||||
fakeWayBill.Status = model.WaybillStatusCourierAssigned
|
fakeWayBill.Status = model.WaybillStatusCourierAssigned
|
||||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierAssigned)
|
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierAssigned)
|
||||||
case 12: // 骑手接单
|
case 12: // 骑手接单
|
||||||
|
|
||||||
riderInfo.LogisticsContext = model.RiderWaitGetGoods
|
riderInfo.LogisticsContext = model.RiderWaitGetGoods
|
||||||
riderInfo.LogisticsStatus = 10
|
riderInfo.LogisticsStatus = 10
|
||||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsORDERRECEIVED
|
riderInfo.OpCode = tiktok_api.TiktokLogisticsORDERRECEIVED
|
||||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
riderInfo.Latitude = courierCoordinate[1]
|
||||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
riderInfo.Longitude = courierCoordinate[0]
|
||||||
// 下一状态以及推送时间
|
// 下一状态以及推送时间
|
||||||
fakeWayBill.Status = model.WaybillStatusCourierArrived
|
fakeWayBill.Status = model.WaybillStatusCourierArrived
|
||||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierArrived)
|
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierArrived)
|
||||||
@@ -346,8 +353,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
|||||||
riderInfo.LogisticsContext = model.RiderToStore
|
riderInfo.LogisticsContext = model.RiderToStore
|
||||||
riderInfo.LogisticsStatus = 15
|
riderInfo.LogisticsStatus = 15
|
||||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERARRIVED
|
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERARRIVED
|
||||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
riderInfo.Latitude = courierCoordinate[1]
|
||||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
riderInfo.Longitude = courierCoordinate[0]
|
||||||
// 下一状态以及推送时间
|
// 下一状态以及推送时间
|
||||||
fakeWayBill.Status = model.WaybillStatusDelivering
|
fakeWayBill.Status = model.WaybillStatusDelivering
|
||||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivering)
|
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivering)
|
||||||
@@ -355,8 +362,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
|||||||
riderInfo.LogisticsContext = model.RiderGetOrderDelivering
|
riderInfo.LogisticsContext = model.RiderGetOrderDelivering
|
||||||
riderInfo.LogisticsStatus = 20
|
riderInfo.LogisticsStatus = 20
|
||||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERPICKUP
|
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERPICKUP
|
||||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
riderInfo.Latitude = courierCoordinate[1]
|
||||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
riderInfo.Longitude = courierCoordinate[0]
|
||||||
// 下一状态以及推送时间
|
// 下一状态以及推送时间
|
||||||
fakeWayBill.Status = model.WaybillStatusDelivered
|
fakeWayBill.Status = model.WaybillStatusDelivered
|
||||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivered)
|
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivered)
|
||||||
@@ -364,8 +371,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
|||||||
riderInfo.LogisticsContext = model.RiderGetOrderDelivered
|
riderInfo.LogisticsContext = model.RiderGetOrderDelivered
|
||||||
riderInfo.LogisticsStatus = 40
|
riderInfo.LogisticsStatus = 40
|
||||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsDELIVERED
|
riderInfo.OpCode = tiktok_api.TiktokLogisticsDELIVERED
|
||||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat))
|
riderInfo.Latitude = courierCoordinate[1]
|
||||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng))
|
riderInfo.Longitude = courierCoordinate[0]
|
||||||
// 下一状态以及推送时间
|
// 下一状态以及推送时间
|
||||||
fakeWayBill.Status = model.WaybillStatusFailed
|
fakeWayBill.Status = model.WaybillStatusFailed
|
||||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusFailed)
|
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusFailed)
|
||||||
@@ -398,7 +405,7 @@ func UpdateFakeWayBillToTiktok() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
riderInfo := &mtpsapi.RiderInfo{
|
riderInfo := &utils.RiderInfo{
|
||||||
OrderId: fakeWayBill[i].VendorOrderID,
|
OrderId: fakeWayBill[i].VendorOrderID,
|
||||||
ThirdCarrierOrderId: fakeWayBill[i].VendorOrderID,
|
ThirdCarrierOrderId: fakeWayBill[i].VendorOrderID,
|
||||||
CourierName: fakeWayBill[i].CourierName,
|
CourierName: fakeWayBill[i].CourierName,
|
||||||
@@ -438,7 +445,7 @@ func UpdateFakeWayBillToTiktok() {
|
|||||||
}
|
}
|
||||||
// 推送完成时加多加十分钟,相当于是配送中状态多存货十分钟
|
// 推送完成时加多加十分钟,相当于是配送中状态多存货十分钟
|
||||||
if fakeWayBill[i].Status == model.WaybillStatusDelivered {
|
if fakeWayBill[i].Status == model.WaybillStatusDelivered {
|
||||||
randTime += 1200
|
randTime += 600
|
||||||
}
|
}
|
||||||
fakeWayBill[i].StatusTime = time.Now().Add(time.Duration(randTime) * time.Second).Local()
|
fakeWayBill[i].StatusTime = time.Now().Add(time.Duration(randTime) * time.Second).Local()
|
||||||
fakeWayBill[i].WaybillFinishedAt = time.Now()
|
fakeWayBill[i].WaybillFinishedAt = time.Now()
|
||||||
@@ -552,8 +559,8 @@ func LoadingStoreOrderSettleAmount(startTime, endTime int64, jxStoreId []int) er
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWaybillId string) (riderInfo *mtpsapi.RiderInfo, err error) {
|
func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWaybillId string) (riderInfo *utils.RiderInfo, err error) {
|
||||||
riderInfo = &mtpsapi.RiderInfo{}
|
riderInfo = &utils.RiderInfo{}
|
||||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(wayBillVendorId); handlerInfo != nil {
|
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(wayBillVendorId); handlerInfo != nil {
|
||||||
if wayBillVendorId == model.VendorIDDada || wayBillVendorId == model.VendorIDFengNiao || wayBillVendorId == model.VendorIDUUPT {
|
if wayBillVendorId == model.VendorIDDada || wayBillVendorId == model.VendorIDFengNiao || wayBillVendorId == model.VendorIDUUPT {
|
||||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(vendorOrderId, 0, vendorWaybillId)
|
riderInfo, err = handlerInfo.Handler.GetRiderInfo(vendorOrderId, 0, vendorWaybillId)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import (
|
|||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
|
|
||||||
@@ -299,7 +298,7 @@ func (d DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId s
|
|||||||
return money, nil
|
return money, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
order, err := dao.GetWaybills(dao.GetDB(), orderId, []int64{model.VendorIDSFPS})
|
order, err := dao.GetWaybills(dao.GetDB(), orderId, []int64{model.VendorIDSFPS})
|
||||||
if len(order) == 0 || err != nil {
|
if len(order) == 0 || err != nil {
|
||||||
return nil, errors.New("顺丰 订单id无效,请检查")
|
return nil, errors.New("顺丰 订单id无效,请检查")
|
||||||
@@ -311,12 +310,12 @@ func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeison
|
|||||||
if sfRider == nil {
|
if sfRider == nil {
|
||||||
return nil, errors.New("顺丰派送暂无骑手信息")
|
return nil, errors.New("顺丰派送暂无骑手信息")
|
||||||
}
|
}
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: sfOrder.OrderID,
|
ThirdCarrierOrderId: sfOrder.OrderID,
|
||||||
CourierName: sfOrder.RiderName,
|
CourierName: sfOrder.RiderName,
|
||||||
CourierPhone: sfOrder.RiderPhone,
|
CourierPhone: sfOrder.RiderPhone,
|
||||||
LogisticsProviderCode: mtpsapi.SFPSCode,
|
LogisticsProviderCode: utils.SFPSCode,
|
||||||
LogisticsStatus: utils.Float64TwoInt(sfOrder.OrderStatus), // 默认正在配送中
|
LogisticsStatus: utils.Float64TwoInt(sfOrder.OrderStatus), // 默认正在配送中
|
||||||
Latitude: sfRider.RiderLat,
|
Latitude: sfRider.RiderLat,
|
||||||
Longitude: sfRider.RiderLng,
|
Longitude: sfRider.RiderLng,
|
||||||
@@ -452,7 +451,7 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
|
|||||||
}
|
}
|
||||||
|
|
||||||
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: order.CourierName,
|
CourierName: order.CourierName,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/uuptapi"
|
"git.rosy.net.cn/baseapi/platformapi/uuptapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
@@ -219,17 +218,17 @@ func (d DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, resonC
|
|||||||
return fmt.Errorf("UU跑腿暂不支持此操作")
|
return fmt.Errorf("UU跑腿暂不支持此操作")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||||
waybill, err := api.UuAPI.GetOrderDetail(orderId)
|
waybill, err := api.UuAPI.GetOrderDetail(orderId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
param := &mtpsapi.RiderInfo{
|
param := &utils.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: waybill.OrderCode,
|
ThirdCarrierOrderId: waybill.OrderCode,
|
||||||
CourierName: waybill.DriverName,
|
CourierName: waybill.DriverName,
|
||||||
CourierPhone: waybill.DriverMobile,
|
CourierPhone: waybill.DriverMobile,
|
||||||
LogisticsProviderCode: mtpsapi.UUPTCode,
|
LogisticsProviderCode: utils.UUPTCode,
|
||||||
LogisticsStatus: utils.Str2Int(waybill.State),
|
LogisticsStatus: utils.Str2Int(waybill.State),
|
||||||
}
|
}
|
||||||
if len(waybill.DriverLastloc) == 0 {
|
if len(waybill.DriverLastloc) == 0 {
|
||||||
@@ -407,7 +406,7 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
|
|||||||
}
|
}
|
||||||
|
|
||||||
func tiktokStatusPush(param *model.Waybill, orderStatus string) {
|
func tiktokStatusPush(param *model.Waybill, orderStatus string) {
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &utils.RiderInfo{
|
||||||
OrderId: param.VendorOrderID,
|
OrderId: param.VendorOrderID,
|
||||||
ThirdCarrierOrderId: param.VendorOrderID,
|
ThirdCarrierOrderId: param.VendorOrderID,
|
||||||
CourierName: param.CourierName,
|
CourierName: param.CourierName,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package partner
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
@@ -41,7 +41,7 @@ type IDeliveryPlatformHandler interface {
|
|||||||
//投诉骑手
|
//投诉骑手
|
||||||
ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error)
|
ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error)
|
||||||
// GetRiderInfo 获取骑手信息
|
// GetRiderInfo 获取骑手信息
|
||||||
GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error)
|
GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error)
|
||||||
// 三方配送时,呼叫骑手在取消.可能存在违约赔付!获取每单的违约金额!
|
// 三方配送时,呼叫骑手在取消.可能存在违约赔付!获取每单的违约金额!
|
||||||
// 蜂鸟:骑手接单后-取餐之前,每单扣除2元,超过20分钟不扣款
|
// 蜂鸟:骑手接单后-取餐之前,每单扣除2元,超过20分钟不扣款
|
||||||
// 达达:骑手接单后-到店之前,接单1-15分钟内,扣款2元,超过不扣款
|
// 达达:骑手接单后-到店之前,接单1-15分钟内,扣款2元,超过不扣款
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package partner
|
package partner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
)
|
)
|
||||||
@@ -48,25 +49,21 @@ type IPurchasePlatformOrderHandler interface {
|
|||||||
CanSwitch2SelfDeliver(order *model.GoodsOrder) (isCan bool, err error)
|
CanSwitch2SelfDeliver(order *model.GoodsOrder) (isCan bool, err error)
|
||||||
// 将订单从购物平台配送转为自送
|
// 将订单从购物平台配送转为自送
|
||||||
Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error)
|
Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error)
|
||||||
|
|
||||||
// 将订单从购物平台配送转为自送后又送达
|
// 将订单从购物平台配送转为自送后又送达
|
||||||
Swtich2SelfDelivered(order *model.GoodsOrder, userName string) (err error)
|
Swtich2SelfDelivered(order *model.GoodsOrder, userName string) (err error)
|
||||||
|
|
||||||
// 完全自送的门店表示开始配送
|
// 完全自送的门店表示开始配送
|
||||||
SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error)
|
SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error)
|
||||||
|
|
||||||
// 转自配送时取消非专送混合送门店取消理由
|
// 转自配送时取消非专送混合送门店取消理由
|
||||||
GetCancelDeliveryReason(order *model.GoodsOrder) (string, error)
|
GetCancelDeliveryReason(order *model.GoodsOrder) (string, error)
|
||||||
// 取消美团外卖理由转使用三方配送
|
// 取消美团外卖理由转使用三方配送
|
||||||
CancelLogisticsByWmOrderId(order *model.GoodsOrder, reasonCode, detailContent, appPoiCode, orderId string) error
|
CancelLogisticsByWmOrderId(order *model.GoodsOrder, reasonCode, detailContent, appPoiCode, orderId string) error
|
||||||
OrderLogisticsStatus(orderId int64) (int64, error)
|
// 获取运单状态
|
||||||
|
OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error)
|
||||||
// 完全自送的门店表示配送完成
|
// 完全自送的门店表示配送完成
|
||||||
SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error)
|
SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error)
|
||||||
|
|
||||||
GetOrderRealMobile(ctx *jxcontext.Context, order *model.GoodsOrder) (mobile string, err error)
|
GetOrderRealMobile(ctx *jxcontext.Context, order *model.GoodsOrder) (mobile string, err error)
|
||||||
|
|
||||||
ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error)
|
ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error)
|
||||||
|
|
||||||
AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error)
|
AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error)
|
||||||
CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error)
|
CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error)
|
||||||
// order.Skus要包含原始订单中的Sku信息,removedSkuList中是要移除的Sku信息
|
// order.Skus要包含原始订单中的Sku信息,removedSkuList中是要移除的Sku信息
|
||||||
|
|||||||
@@ -823,8 +823,20 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
status, err := api.EbaiAPI.OrderDeliveryGet(orderId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
data := &utils.RiderInfo{}
|
||||||
|
data.LogisticsStatus = int(utils.MustInterface2Int64(status["status"]))
|
||||||
|
data.CourierName = utils.Interface2String(status["name"])
|
||||||
|
data.CourierPhone = utils.Interface2String(status["phone"])
|
||||||
|
data.OrderId = utils.Interface2String(status["order_id"])
|
||||||
|
data.Latitude = utils.Float64ToStr(utils.MustInterface2Float64(status["latitude"]))
|
||||||
|
data.Longitude = utils.Float64ToStr(utils.MustInterface2Float64(status["longitude"]))
|
||||||
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -341,8 +341,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -661,8 +661,9 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -325,8 +325,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package jx
|
package jx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -152,8 +153,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package mtwm
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
"math"
|
"math"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
@@ -609,7 +608,7 @@ func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName
|
|||||||
|
|
||||||
err = api.OrderArrived(utils.Str2Int64(order.VendorOrderID))
|
err = api.OrderArrived(utils.Str2Int64(order.VendorOrderID))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
riderInfo := &mtpsapi.RiderInfo{
|
riderInfo := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: "",
|
CourierName: "",
|
||||||
@@ -915,15 +914,15 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), utils.Int64ToStr(orderId))
|
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), orderId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("获取本地门店账号信息失败,请重试")
|
return nil, errors.New("获取本地门店账号信息失败,请重试")
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err := getAPI(orderInfo.VendorOrgCode, 0, "").OrderLogisticsStatus(orderId)
|
status, err := getAPI(orderInfo.VendorOrgCode, 0, "").OrderLogisticsStatus(utils.Str2Int64(orderId))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return status, nil
|
return status, nil
|
||||||
|
|||||||
@@ -847,8 +847,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息(t+1)当前订单获取不到结算
|
// GetOrderSettleAccounts 获取订单结算信息(t+1)当前订单获取不到结算
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
|
||||||
order_getSettleBillDetailV3_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_getSettleBillDetailV3/request"
|
order_getSettleBillDetailV3_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_getSettleBillDetailV3/request"
|
||||||
order_logisticsAdd_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_logisticsAdd/request"
|
order_logisticsAdd_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_logisticsAdd/request"
|
||||||
order_orderDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_orderDetail/response"
|
order_orderDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_orderDetail/response"
|
||||||
@@ -634,7 +633,7 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
riderInfo := &mtpsapi.RiderInfo{
|
riderInfo := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: "",
|
CourierName: "",
|
||||||
@@ -652,7 +651,7 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
|
|||||||
|
|
||||||
// SelfDeliverDelivered 自配搜完成(暂无)
|
// SelfDeliverDelivered 自配搜完成(暂无)
|
||||||
func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
||||||
riderInfo := &mtpsapi.RiderInfo{
|
riderInfo := &utils.RiderInfo{
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
ThirdCarrierOrderId: order.VendorOrderID,
|
ThirdCarrierOrderId: order.VendorOrderID,
|
||||||
CourierName: "",
|
CourierName: "",
|
||||||
@@ -985,18 +984,27 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OrderLogisticsStatus 获取订单配送状态
|
// OrderLogisticsStatus 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), utils.Int64ToStr(orderId))
|
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), orderId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("获取本地门店账号信息失败,请重试")
|
return nil, errors.New("获取本地门店账号信息失败,请重试")
|
||||||
}
|
}
|
||||||
|
|
||||||
waybill, err := getAPI(orderInfo.VendorOrgCode, 0, "").GetShipmentInfo(utils.Str2Int64(orderInfo.VendorOrderID), 0, tiktokShop.ShipmentTypeInvoice)
|
waybill, err := getAPI(orderInfo.VendorOrgCode, 0, "").GetShipmentInfo(utils.Str2Int64(orderInfo.VendorOrderID), 0, tiktokShop.ShipmentTypeInvoice)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return waybill.ShipmentStatus, nil
|
result := &utils.RiderInfo{
|
||||||
|
OrderId: utils.Int64ToStr(waybill.ShopOrderID),
|
||||||
|
ThirdCarrierOrderId: waybill.TrackNo,
|
||||||
|
CourierName: waybill.RiderName,
|
||||||
|
CourierPhone: waybill.RiderPhone,
|
||||||
|
LogisticsStatus: int(waybill.ShipmentStatus),
|
||||||
|
Latitude: waybill.RiderLatitude,
|
||||||
|
Longitude: waybill.RiderLongitude,
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderTotalShopMoney 获取门店结算信息
|
// GetOrderTotalShopMoney 获取门店结算信息
|
||||||
|
|||||||
@@ -309,8 +309,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package yb
|
package yb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
@@ -103,8 +104,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单配送状态
|
// 获取订单配送状态
|
||||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||||
return 0, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOrderSettleAccounts 获取订单结算信息
|
// GetOrderSettleAccounts 获取订单结算信息
|
||||||
|
|||||||
@@ -367,6 +367,7 @@ func (c *CmsController) GetVendorOrgCodeInfo() {
|
|||||||
// @Param sLat query int true "商家纬度"
|
// @Param sLat query int true "商家纬度"
|
||||||
// @Param uLng query int true "用户经度"
|
// @Param uLng query int true "用户经度"
|
||||||
// @Param uLat query int true "用户纬度"
|
// @Param uLat query int true "用户纬度"
|
||||||
|
// @Param orderId query string true "订单id"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /GetSToURidingDistance [get]
|
// @router /GetSToURidingDistance [get]
|
||||||
@@ -376,7 +377,29 @@ func (c *CmsController) GetSToURidingDistance() {
|
|||||||
sLat := jxutils.IntCoordinate2Standard(params.SLat)
|
sLat := jxutils.IntCoordinate2Standard(params.SLat)
|
||||||
uLng := jxutils.IntCoordinate2Standard(params.ULng)
|
uLng := jxutils.IntCoordinate2Standard(params.ULng)
|
||||||
uLat := jxutils.IntCoordinate2Standard(params.ULat)
|
uLat := jxutils.IntCoordinate2Standard(params.ULat)
|
||||||
retVal, err = cms.GetSToURidingDistance(sLng, sLat, uLng, uLat)
|
retVal, err = cms.GetSToURidingDistance(sLng, sLat, uLng, uLat, params.OrderId)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title 得到商家与用户之间骑行路线规划
|
||||||
|
// @Description 得到商家与用户之间骑行路线规划
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param sLng query int true "商家经度"
|
||||||
|
// @Param sLat query int true "商家纬度"
|
||||||
|
// @Param uLng query int true "用户经度"
|
||||||
|
// @Param uLat query int true "用户纬度"
|
||||||
|
// @Param orderId query string true "订单id"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /GetSToURidingDistance2 [get]
|
||||||
|
func (c *CmsController) GetSToURidingDistance2() {
|
||||||
|
c.callGetSToURidingDistance(func(params *tCmsGetSToURidingDistanceParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
sLng := jxutils.IntCoordinate2Standard(params.SLng)
|
||||||
|
sLat := jxutils.IntCoordinate2Standard(params.SLat)
|
||||||
|
uLng := jxutils.IntCoordinate2Standard(params.ULng)
|
||||||
|
uLat := jxutils.IntCoordinate2Standard(params.ULat)
|
||||||
|
retVal, err = cms.GetSToURidingDistance2(sLng, sLat, uLng, uLat, params.OrderId)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -474,6 +474,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "GetSToURidingDistance2",
|
||||||
|
Router: `/GetSToURidingDistance2`,
|
||||||
|
AllowHTTPMethods: []string{"get"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
Method: "NewConfig",
|
Method: "NewConfig",
|
||||||
|
|||||||
Reference in New Issue
Block a user