This commit is contained in:
邹宗楠
2023-12-25 15:18:07 +08:00
parent 4dcf546ddf
commit 3e6a3f98f8
3 changed files with 32 additions and 5 deletions

View File

@@ -324,7 +324,9 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
// 对于多门店平台来说storeSkuList中只有SkuID与VendorSkuID有意义
func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo, isCreate bool) (failedList []*partner.StoreSkuInfoWithErr, err error) {
globals.SugarLogger.Debugf("================storeSkuList %d", len(storeSkuList))
if storeID == 668545 {
globals.SugarLogger.Debugf("================storeSkuList %d : %s", len(storeSkuList), vendorStoreID)
}
var syncType string
foodDataList := make([]map[string]interface{}, len(storeSkuList))
if isCreate {
@@ -442,6 +444,10 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
}
}
if storeID == 668545 {
globals.SugarLogger.Debugf("================lenfoodDataList %d", len(foodDataList))
globals.SugarLogger.Debugf("================lenfoodDataList %s", utils.Format4Output(foodDataList, false))
}
if globals.EnableMtwmStoreWrite {
if len(foodDataList) == 1 {
foodDataList[0]["skus"] = string(utils.MustMarshal(foodDataList[0]["skus"]))
@@ -449,7 +455,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDMTWM], syncType)
}
} else if len(foodDataList) > 0 {
globals.SugarLogger.Debugf("================lenfoodDataList %d", len(foodDataList))
failedFoodList, err2 := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID).RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList)
if err = err2; err == nil {
if err = putils.GenPartialFailedErr(failedFoodList, len(failedFoodList)); err != nil {