This commit is contained in:
邹宗楠
2023-05-22 16:58:14 +08:00
parent 784d60912c
commit c011092a2b
5 changed files with 31 additions and 26 deletions

View File

@@ -3,6 +3,7 @@ package delivery
import (
"crypto/rand"
"fmt"
"git.rosy.net.cn/jx-callback/business/jxutils"
"math/big"
"time"
@@ -279,6 +280,14 @@ func UpdateOrder2Complete() {
}
func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill.VendorOrderID, fakeWayBill.OrderVendorID)
storeId := 0
if order.StoreID != 0 {
storeId = order.StoreID
} else {
storeId = order.JxStoreID
}
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
switch fakeWayBill.Status {
case 5: // 呼叫骑手
riderInfo.LogisticsContext = "呼叫骑手,新建运单"
@@ -294,6 +303,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
riderInfo.LogisticsContext = model.RiderWaitGetGoods
riderInfo.LogisticsStatus = 10
riderInfo.OpCode = tiktok_api.TiktokLogisticsORDERRECEIVED
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
// 下一状态以及推送时间
fakeWayBill.Status = model.WaybillStatusCourierArrived
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierArrived)
@@ -301,6 +312,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
riderInfo.LogisticsContext = model.RiderToStore
riderInfo.LogisticsStatus = 15
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERARRIVED
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
// 下一状态以及推送时间
fakeWayBill.Status = model.WaybillStatusDelivering
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivering)
@@ -308,6 +321,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
riderInfo.LogisticsContext = model.RiderGetOrderDelivering
riderInfo.LogisticsStatus = 20
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERPICKUP
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
// 下一状态以及推送时间
fakeWayBill.Status = model.WaybillStatusDelivered
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivered)
@@ -315,6 +330,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
riderInfo.LogisticsContext = model.RiderGetOrderDelivered
riderInfo.LogisticsStatus = 40
riderInfo.OpCode = tiktok_api.TiktokLogisticsDELIVERED
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat))
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng))
// 下一状态以及推送时间
fakeWayBill.Status = model.WaybillStatusFailed
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusFailed)