Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop

This commit is contained in:
richboo111
2024-01-30 10:29:40 +08:00

View File

@@ -1,6 +1,7 @@
package cms package cms
import ( import (
"encoding/json"
"fmt" "fmt"
"git.rosy.net.cn/baseapi/platformapi/ebaiapi" "git.rosy.net.cn/baseapi/platformapi/ebaiapi"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
@@ -258,6 +259,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
if v.SkuId == "" { if v.SkuId == "" {
v.SkuId = storeSku.AppFoodCode v.SkuId = storeSku.AppFoodCode
} }
salesCycle, _ := json.Marshal(v.AvailableTimes)
mapSkuList := utils.Struct2MapByJson(v) mapSkuList := utils.Struct2MapByJson(v)
if v.BoxNum == "" { if v.BoxNum == "" {
delete(mapSkuList, "box_num") delete(mapSkuList, "box_num")
@@ -265,6 +267,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
if v.BoxPrice == "" { if v.BoxPrice == "" {
delete(mapSkuList, "box_price") delete(mapSkuList, "box_price")
} }
mapSkuList["available_times"] = string(salesCycle)
skus = append(skus, mapSkuList) skus = append(skus, mapSkuList)
} }
foodData["skus"] = skus foodData["skus"] = skus
@@ -306,7 +309,6 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
if len(foodDataList)%10 != 0 { if len(foodDataList)%10 != 0 {
count += 1 count += 1
} }
globals.SugarLogger.Debugf("===============data := %s", utils.Format4Output(foodDataList, false))
for i := 0; i < count; i++ { for i := 0; i < count; i++ {
if i == count-1 { if i == count-1 {
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:]) failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])