This commit is contained in:
邹宗楠
2024-01-30 09:46:14 +08:00
parent 594028c189
commit f7955d673c
2 changed files with 4 additions and 6 deletions

View File

@@ -34,11 +34,9 @@ func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *
courierVendorIDMap := jxutils.IntList2Map(courierVendorIDs) courierVendorIDMap := jxutils.IntList2Map(courierVendorIDs)
excludeCourierVendorIDMap := jxutils.IntList2Map(excludeCourierVendorIDs) excludeCourierVendorIDMap := jxutils.IntList2Map(excludeCourierVendorIDs)
errList := errlist.New() errList := errlist.New()
globals.SugarLogger.Debugf("===excludeCourierVendorIDMap===========:%s", utils.Format4Output(excludeCourierVendorIDMap, false))
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode) store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
for _, storeCourier := range storeCourierList { for _, storeCourier := range storeCourierList {
globals.SugarLogger.Debugf("===excludeCourierVendorIDMap===========:%s", utils.Format4Output(excludeCourierVendorIDMap[storeCourier.VendorID], false))
switch storeCourier.Status { switch storeCourier.Status {
case model.YES: case model.YES:
if (courierVendorIDs == nil || courierVendorIDMap[storeCourier.VendorID] == 1) && if (courierVendorIDs == nil || courierVendorIDMap[storeCourier.VendorID] == 1) &&

View File

@@ -243,14 +243,14 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
} }
// BatchInitSkuMT2MT 批量创建商品 // BatchInitSkuMT2MT 批量创建商品
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, i int) error { func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) error {
foodDataList := make([]map[string]interface{}, len(fromSku)) foodDataList := make([]map[string]interface{}, len(fromSku))
for _, storeSku := range fromSku { for k, storeSku := range fromSku {
foodData := make(map[string]interface{}) foodData := make(map[string]interface{})
if storeSku.AppFoodCode != "" { if storeSku.AppFoodCode != "" {
foodData[mtwmapi.KeyAppFoodCode] = storeSku.AppFoodCode foodData[mtwmapi.KeyAppFoodCode] = storeSku.AppFoodCode
} else { } else {
foodData[mtwmapi.KeyAppFoodCode] = time.Now().UnixNano() + int64(i*3) foodData[mtwmapi.KeyAppFoodCode] = time.Now().UnixNano() + int64(k*3)
} }
skus := make([]interface{}, 0) skus := make([]interface{}, 0)
@@ -299,7 +299,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
foodData["upc"] = "no_upc" foodData["upc"] = "no_upc"
} }
foodDataList[i] = foodData foodDataList[k] = foodData
} }
count := len(foodDataList) / 10 count := len(foodDataList) / 10