1
This commit is contained in:
@@ -3,14 +3,12 @@ package cms
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"git.rosy.net.cn/jx-callback/globals/api/apimanager"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"time"
|
||||
|
||||
@@ -244,13 +242,11 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := fromApi.RetailListAll(fromStore.VendorStoreID, i)
|
||||
globals.SugarLogger.Debugf("---------v.Children 1:= %s", utils.Format4Output(fromFoodList, false))
|
||||
if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
||||
}
|
||||
|
||||
errDataList, err := BatchInitSkuMT2MT(ctx, fromFoodList, toApi, toStore.VendorStoreID, i)
|
||||
globals.SugarLogger.Debugf("---------v.Children 2:= %s", utils.Format4Output(errDataList, false))
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("BatchInitData : %v", err)
|
||||
}
|
||||
@@ -288,7 +284,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
||||
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) ([]*mtwmapi.AppFoodResult, error) {
|
||||
errList := make([]*mtwmapi.AppFoodResult, 0, 0)
|
||||
foodDataList := make([]map[string]interface{}, len(fromSku))
|
||||
apiObj := apimanager.CurAPIManager.GetAPI(model.VendorIDJD, "320406").(*jdapi.API)
|
||||
//apiObj := apimanager.CurAPIManager.GetAPI(model.VendorIDJD, "320406").(*jdapi.API)
|
||||
|
||||
for k, storeSku := range fromSku {
|
||||
foodData := make(map[string]interface{})
|
||||
@@ -327,12 +323,12 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
|
||||
delete(mapSkuList, "min_order_count")
|
||||
if v.Upc != "" {
|
||||
upc = v.Upc
|
||||
} else if toApi.QuerySkuIsNeedUpc(storeSku.TagID) {
|
||||
} /* else if toApi.QuerySkuIsNeedUpc(storeSku.TagID) {
|
||||
upcList, _ := apiObj.GetJdUpcCodeByName(storeSku.Name, "", 1, 20)
|
||||
if len(upcList) != 0 {
|
||||
upc = upcList[0].UpcCode
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//mapSkuList["available_times"] = string(salesCycle)
|
||||
mapSkuList["available_times"] = v.AvailableTimes
|
||||
//if v.MinOrderCount != "" {
|
||||
|
||||
Reference in New Issue
Block a user