diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index d34ceb6d1..420553bf1 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -1,9 +1,6 @@ package jd import ( - "fmt" - "strings" - "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model/dao" @@ -67,7 +64,7 @@ func (p *PurchaseHandler) ReadStore(vendorStoreID string) (*model.Store, error) if err = err2; err == nil { retVal.DeliveryRangeType = int8(utils.MustInterface2Int64(result["deliveryRangeType"])) if retVal.DeliveryRangeType == model.DeliveryRangeTypePolygon { - retVal.DeliveryRange = JdRange2JxRange(utils.Interface2String(result["deliveryRange"])) + retVal.DeliveryRange = utils.Interface2String(result["deliveryRange"]) } else { retVal.DeliveryRange = utils.Int64ToStr(utils.MustInterface2Int64(result["deliveryRangeRadius"])) } @@ -111,7 +108,7 @@ func (p *PurchaseHandler) UpdateStore(storeID int, userName string) (err error) "county": store.JdDistrictCode, } if store.DeliveryRangeType == model.DeliveryRangeTypePolygon { - params["coordinatePoints"] = JxRange2JdRange(store.DeliveryRange) + params["coordinatePoints"] = store.DeliveryRange } else { params["deliveryRangeRadius"] = utils.Str2Int64(store.DeliveryRange) } @@ -182,33 +179,33 @@ func (p *PurchaseHandler) GetAllStoresFromRemote() ([]*model.Store, error) { return nil, err } -func JdRange2JxRange(jdRanges string) (jxRanges string) { - coords := strings.Split(jdRanges, ";") - intCoords := []string{} - for _, coord := range coords { - items := strings.Split(coord, ",") - if len(items) == 2 { - lng := jxutils.StandardCoordinate2Int(utils.Str2Float64(items[0])) - lat := jxutils.StandardCoordinate2Int(utils.Str2Float64(items[1])) - intCoords = append(intCoords, fmt.Sprintf("%d,%d", lng, lat)) - } - } - return strings.Join(intCoords, ";") -} +// func JdRange2JxRange(jdRanges string) (jxRanges string) { +// coords := strings.Split(jdRanges, ";") +// intCoords := []string{} +// for _, coord := range coords { +// items := strings.Split(coord, ",") +// if len(items) == 2 { +// lng := jxutils.StandardCoordinate2Int(utils.Str2Float64(items[0])) +// lat := jxutils.StandardCoordinate2Int(utils.Str2Float64(items[1])) +// intCoords = append(intCoords, fmt.Sprintf("%d,%d", lng, lat)) +// } +// } +// return strings.Join(intCoords, ";") +// } -func JxRange2JdRange(jxRanges string) (jdRanges string) { - coords := strings.Split(jxRanges, ";") - intCoords := []string{} - for _, coord := range coords { - items := strings.Split(coord, ",") - if len(items) == 2 { - lng := jxutils.IntCoordinate2Standard(int(utils.Str2Int64(items[0]))) - lat := jxutils.IntCoordinate2Standard(int(utils.Str2Int64(items[1]))) - intCoords = append(intCoords, fmt.Sprintf("%f,%f", lng, lat)) - } - } - return strings.Join(intCoords, ";") -} +// func JxRange2JdRange(jxRanges string) (jdRanges string) { +// coords := strings.Split(jxRanges, ";") +// intCoords := []string{} +// for _, coord := range coords { +// items := strings.Split(coord, ",") +// if len(items) == 2 { +// lng := jxutils.IntCoordinate2Standard(int(utils.Str2Int64(items[0]))) +// lat := jxutils.IntCoordinate2Standard(int(utils.Str2Int64(items[1]))) +// intCoords = append(intCoords, fmt.Sprintf("%f,%f", lng, lat)) +// } +// } +// return strings.Join(intCoords, ";") +// } func JdDeliveryType2Jx(deliveryType int) int8 { if deliveryType == 2938 { diff --git a/business/partner/purchase/jd/store_sku.go b/business/partner/purchase/jd/store_sku.go index 0f3f2ba56..234b76e6b 100644 --- a/business/partner/purchase/jd/store_sku.go +++ b/business/partner/purchase/jd/store_sku.go @@ -11,7 +11,7 @@ import ( ) // 京东到家,以有库存表示关注(认领) -func (p *PurchaseHandler) SyncStoreSku(storeID int, skuIDs []int, isForce bool, userName string) (err error) { +func (p *PurchaseHandler) SyncStoreSkus(storeID int, skuIDs []int, isForce bool, userName string) (err error) { db := dao.GetDB() var storeSkus []*model.StoreSkuBind sqlParams := []interface{}{