同步错误返回

This commit is contained in:
苏尹岚
2019-11-28 11:47:19 +08:00
parent 49c42986ef
commit 2a486ea2ba
3 changed files with 46 additions and 21 deletions

View File

@@ -337,6 +337,27 @@ func GetErrMsg2FailedSingleList(storeSkuList []*partner.StoreSkuInfo, err error)
return failedList
}
func GetErrMsg2FailedSyncSingleList(storeSkuList []*dao.StoreSkuSyncInfo, err error) (failedList []*partner.StoreSkuInfoWithErr) {
if err != nil {
if errExt, ok := err.(*utils.ErrorWithCode); ok {
storeSkuInfo := &partner.StoreSkuInfo{
SkuID: storeSkuList[0].SkuID,
VendorSkuID: storeSkuList[0].VendorSkuID,
NameID: storeSkuList[0].NameID,
VendorNameID: storeSkuList[0].VendorNameID,
VendorPrice: storeSkuList[0].VendorPrice,
Status: storeSkuList[0].Status,
}
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
StoreSkuInfo: storeSkuInfo,
ErrMsg: errExt.ErrMsg(),
}
failedList = append(failedList, storeSkuInfoWithErr)
}
}
return failedList
}
func UnselectStoreSkuSyncListByVendorSkuIDs(storeSkuList []*dao.StoreSkuSyncInfo, vendorSkuIDs []string) (selectedStoreSkuList []*dao.StoreSkuSyncInfo) {
if len(vendorSkuIDs) > 0 {
vendorSkuIDMap := jxutils.StringList2Map(vendorSkuIDs)