暂时不拉银豹,京东订单修改

This commit is contained in:
苏尹岚
2020-07-01 11:57:56 +08:00
parent c443b873c4
commit 39178f2528
4 changed files with 35 additions and 31 deletions

View File

@@ -23,6 +23,10 @@ var (
sensitiveWordRegexp = regexp.MustCompile(`商品名称中含有敏感词(\[.*\])`)
)
const (
addErr1 = "商品已存在"
)
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
if globals.EnableYbStoreWrite {
storeSku := storeSkuList[0]
@@ -34,6 +38,14 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
result, err = api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
}
if err != nil {
// if strings.Contains(err.Error(), addErr1) {
// queryProductByBarcodeResult, err := api.YinBaoAPI.QueryProductByBarcodes([]string{storeSku.YbBarCode})
// if err != nil && len(queryProductByBarcodeResult) > 0 {
// if queryProductByBarcodeResult[0].Enable == model.SkuStatusDeleted {
// api.YinBaoAPI.SaveProduct(userId, keyword, saveProductParam)
// }
// }
// }
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
} else {
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)