diff --git a/business/partner/purchase/tiktok_store/warehouse.go b/business/partner/purchase/tiktok_store/warehouse.go index 31867ae73..e1dee7422 100644 --- a/business/partner/purchase/tiktok_store/warehouse.go +++ b/business/partner/purchase/tiktok_store/warehouse.go @@ -118,19 +118,20 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e if err = dao.GetRow(db, &localStore, sqlStr, sqlParam...); err == nil { globals.SugarLogger.Debug("localStore.DeliveryRangeType==============", localStore.DeliveryRangeType) if localStore.DeliveryRangeType == LocalShapeCircular { - circular = warehouse_createFence_request.Circular{ - Center: &warehouse_createFence_request.Center{ - Longitude: utils.Int2Float64(localStore.Lng), - Latitude: utils.Int2Float64(localStore.Lat), + param = &warehouse_createFence_request.WarehouseCreateFenceParam{ + FenceInfo: &warehouse_createFence_request.FenceInfo{ + OutFenceId: utils.Int64ToStr(storeID), + Shape: tiktok_api.ShapeCircular, + Circular: &warehouse_createFence_request.Circular{ + Center: &warehouse_createFence_request.Center{ + Longitude: utils.Int2Float64(localStore.Lng), + Latitude: utils.Int2Float64(localStore.Lat), + }, + Radius: utils.Str2Float64(localStore.DeliveryRange), + }, }, - Radius: utils.Str2Float64(localStore.DeliveryRange), } - globals.SugarLogger.Debugf("Latitude============%f,%f,%f", circular.Center.Latitude, circular.Center.Longitude, circular.Radius) - globals.SugarLogger.Debugf("circular=====%v", circular) - param.FenceInfo.Circular = &circular - param.FenceInfo.Shape = tiktok_api.ShapeCircular globals.SugarLogger.Debug("圆:lat,lng", circular.Center.Latitude, circular.Center.Longitude) - } else if localStore.DeliveryRangeType == LocalShapePolygon { tempStr := strings.Split(localStore.DeliveryRange, ";") for v := len(tempStr) - 1; v >= 0; v-- { @@ -141,11 +142,17 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e } vertex = append(vertex, vertices) } - param.FenceInfo.Polygon.Vertices = vertex - param.FenceInfo.Shape = tiktok_api.ShapePolygon + param = &warehouse_createFence_request.WarehouseCreateFenceParam{ + FenceInfo: &warehouse_createFence_request.FenceInfo{ + OutFenceId: utils.Int64ToStr(storeID), + Shape: tiktok_api.ShapePolygon, + Polygon: &warehouse_createFence_request.Polygon{ + Vertices: vertex, + }, + }, + } globals.SugarLogger.Debug("多边形:vertex", param.FenceInfo.Polygon.Vertices) } - param.FenceInfo.OutFenceId = utils.Int64ToStr(storeID) //绑定基于此id resp, err := getAPI(appOrgCode, 0, "").CreateFence(param) if err != nil { return "", err