From d7263034f3b64cb687cb67d5ef8c40fb9868cb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 31 May 2024 13:34:11 +0800 Subject: [PATCH] 1 --- business/partner/delivery/fn/store.go | 8 ++++---- business/partner/delivery/fn/waybill.go | 8 ++++---- business/partner/delivery/rider.go | 8 ++++---- business/partner/purchase/tiktok_store/warehouse.go | 9 +++++---- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/business/partner/delivery/fn/store.go b/business/partner/delivery/fn/store.go index 435126034..d569eaeda 100644 --- a/business/partner/delivery/fn/store.go +++ b/business/partner/delivery/fn/store.go @@ -42,8 +42,8 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S createStore := &fnpsapi.CreateStoreBaseInfo{ ContactPhone: storeDetail.Tel1, Address: storeDetail.Address, - Longitude: utils.Int2Float64(storeDetail.Lng) / 1000000, - Latitude: utils.Int2Float64(storeDetail.Lat) / 1000000, + Longitude: jxutils.IntCoordinate2Standard(storeDetail.Lng), + Latitude: jxutils.IntCoordinate2Standard(storeDetail.Lat), PositionSource: 3, OutShopCode: utils.Int2Str(storeDetail.ID), CategoryID: "51", @@ -119,8 +119,8 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S ChainStoreID: fnStore.ChainStoreID, ContactPhone: storeDetail.Tel1, Address: storeDetail.Address, - Longitude: utils.Int2Float64(storeDetail.Lng) / 1000000, - Latitude: utils.Int2Float64(storeDetail.Lat) / 1000000, + Longitude: jxutils.IntCoordinate2Standard(storeDetail.Lng), + Latitude: jxutils.IntCoordinate2Standard(storeDetail.Lat), PositionSource: 3, OutShopCode: utils.Int2Str(storeDetail.ID), CategoryID: "51", diff --git a/business/partner/delivery/fn/waybill.go b/business/partner/delivery/fn/waybill.go index 0645931b4..82876aba7 100644 --- a/business/partner/delivery/fn/waybill.go +++ b/business/partner/delivery/fn/waybill.go @@ -121,8 +121,8 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee OrderType: 1, PositionSource: 3, ReceiverAddress: order.ConsigneeAddress, - ReceiverLongitude: utils.Int2Float64(order.ConsigneeLng) / 1000000, - ReceiverLatitude: utils.Int2Float64(order.ConsigneeLat) / 1000000, + ReceiverLongitude: jxutils.IntCoordinate2Standard(order.ConsigneeLng), + ReceiverLatitude: jxutils.IntCoordinate2Standard(order.ConsigneeLat), GoodsTotalAmountCent: order.SalePrice, GoodsActualAmountCent: order.ActualPayPrice, GoodsWeight: utils.Int2Float64(order.Weight) / 1000, @@ -198,8 +198,8 @@ func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInf OrderType: 1, PositionSource: 3, ReceiverAddress: order.ConsigneeAddress, - ReceiverLongitude: utils.Int2Float64(order.ConsigneeLng) / 1000000, - ReceiverLatitude: utils.Int2Float64(order.ConsigneeLat) / 1000000, + ReceiverLongitude: jxutils.IntCoordinate2Standard(order.ConsigneeLng), + ReceiverLatitude: jxutils.IntCoordinate2Standard(order.ConsigneeLat), GoodsTotalAmountCent: order.SalePrice, GoodsActualAmountCent: order.ActualPayPrice, GoodsWeight: utils.Int2Float64(order.Weight) / 1000, diff --git a/business/partner/delivery/rider.go b/business/partner/delivery/rider.go index 9cfda9ca7..48d0508d9 100644 --- a/business/partner/delivery/rider.go +++ b/business/partner/delivery/rider.go @@ -658,15 +658,15 @@ func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWayb return nil, err } if order.Status >= model.OrderStatusEndBegin { - riderInfo.Longitude = utils.Float64ToStr(utils.Int2Float64(order.ConsigneeLng) / 1000000) - riderInfo.Latitude = utils.Float64ToStr(utils.Int2Float64(order.ConsigneeLat) / 1000000) + riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng)) + riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat)) } else { store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode) if err != nil { return nil, err } - riderInfo.Longitude = utils.Float64ToStr(utils.Int2Float64(store.Lng) / 1000000) - riderInfo.Latitude = utils.Float64ToStr(utils.Int2Float64(store.Lat) / 1000000) + riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lng)) + riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lat)) } } diff --git a/business/partner/purchase/tiktok_store/warehouse.go b/business/partner/purchase/tiktok_store/warehouse.go index 390bdec73..633c2287c 100644 --- a/business/partner/purchase/tiktok_store/warehouse.go +++ b/business/partner/purchase/tiktok_store/warehouse.go @@ -3,6 +3,7 @@ package tiktok_store import ( "errors" "fmt" + "git.rosy.net.cn/jx-callback/business/jxutils" "strconv" "strings" @@ -133,8 +134,8 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e Shape: tiktok_api.ShapeCircular, Circular: &warehouse_createFence_request.Circular{ Center: &warehouse_createFence_request.Center{ - Longitude: float64(localStore.Lng) / float64(1000000), - Latitude: float64(localStore.Lat) / float64(1000000), + Longitude: jxutils.IntCoordinate2Standard(localStore.Lng), + Latitude: jxutils.IntCoordinate2Standard(localStore.Lat), }, Radius: utils.Str2Float64(localStore.DeliveryRange), }, @@ -202,8 +203,8 @@ func UpdateFenceByStore(appOrgCode, outFenceID, storeID string) error { Shape: tiktok_api.ShapeCircular, Circular: &warehouse_setFence_request.Circular{ Center: &warehouse_setFence_request.Center{ - Longitude: float64(localStore.Lng) / float64(1000000), - Latitude: float64(localStore.Lat) / float64(1000000), + Longitude: jxutils.IntCoordinate2Standard(localStore.Lng), + Latitude: jxutils.IntCoordinate2Standard(localStore.Lat), }, Radius: utils.Str2Float64(localStore.DeliveryRange), },