同步错误返回
This commit is contained in:
@@ -163,10 +163,10 @@ func (p *PurchaseHandler) DeleteStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
opResult, err2 := api.EbaiAPI.SkuDelete(ctx.GetTrackInfo(), utils.Int2Str(storeID), partner.BareStoreSkuInfoList(storeSkuList).GetVendorSkuIDIntList(), nil)
|
||||
if err = err2; err2 != nil && opResult != nil {
|
||||
if len(storeSkuList) > len(opResult.FailedList) {
|
||||
failedList = putils.SelectStoreSkuListByOpResult(storeSkuList, opResult)
|
||||
// successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getFailedVendorSkuIDsFromOpResult(opResult))
|
||||
}
|
||||
// if len(storeSkuList) > len(opResult.FailedList) {
|
||||
failedList = putils.SelectStoreSkuListByOpResult(storeSkuList, opResult)
|
||||
// successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getFailedVendorSkuIDsFromOpResult(opResult))
|
||||
// }
|
||||
}
|
||||
}
|
||||
return failedList, err
|
||||
|
||||
@@ -294,6 +294,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
if len(foodDataList) == 1 {
|
||||
foodDataList[0]["skus"] = string(utils.MustMarshal(foodDataList[0]["skus"]))
|
||||
err = api.MtwmAPI.RetailInitData(ctx.GetTrackInfo(), vendorStoreID, utils.Int2Str(storeSkuList[0].SkuID), foodDataList[0])
|
||||
failedList = putils.GetErrMsg2FailedSyncSingleList(storeSkuList, err)
|
||||
} else if len(foodDataList) > 0 {
|
||||
failedFoodList, err2 := api.MtwmAPI.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList)
|
||||
if err = err2; err == nil {
|
||||
|
||||
@@ -309,7 +309,9 @@ func SelectStoreSkuListByResponseList(storeSkuList []*partner.StoreSkuInfo, resp
|
||||
responseMap := make(map[string]string)
|
||||
if len(responseList) > 0 {
|
||||
for _, v := range responseList {
|
||||
responseMap[v.OutSkuID] = v.Msg
|
||||
if v.Code != "0" {
|
||||
responseMap[v.OutSkuID] = v.Msg
|
||||
}
|
||||
}
|
||||
for _, v := range storeSkuList {
|
||||
if responseMap[utils.Int2Str(v.SkuID)] != "" {
|
||||
|
||||
Reference in New Issue
Block a user