删除京东商商品修改
This commit is contained in:
@@ -401,6 +401,7 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
|
||||
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100)))
|
||||
}
|
||||
v.EarningPrice = int64(earningPrice)
|
||||
// v.StoreSubID = 0
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ var (
|
||||
SendMsgTypeSuggestRequest: []string{
|
||||
"石锋",
|
||||
// "x",
|
||||
"周扬",
|
||||
"苏尹岚",
|
||||
// "周扬",
|
||||
// "苏尹岚",
|
||||
},
|
||||
}
|
||||
needConfirmRequestMap = map[string]int{
|
||||
|
||||
@@ -1286,11 +1286,10 @@ func DeleteSku(ctx *jxcontext.Context, skuID int, userName string) (num int64, e
|
||||
return 0, err
|
||||
}
|
||||
dao.Commit(db)
|
||||
if _, err = SetStoreSkuSyncStatus2(db, nil, partner.GetSingleStoreVendorIDs(), []int{skuID}, model.SyncFlagDeletedMask); err == nil {
|
||||
}
|
||||
if num == 1 {
|
||||
_, err = CurVendorSync.SyncSku(ctx, db, -1, sku.ID, false, false, userName)
|
||||
}
|
||||
err = deleteJdsSku(db, skuID)
|
||||
return num, err
|
||||
}
|
||||
|
||||
@@ -2504,3 +2503,11 @@ func getImgFromNet(db *dao.DaoDB, upc string) (img string) {
|
||||
img = result.Img
|
||||
return img
|
||||
}
|
||||
|
||||
func deleteJdsSku(db *dao.DaoDB, skuID int) (err error) {
|
||||
storeBinds, err := dao.GetStoresSkusInfo(db, []int{model.JdShopMainStoreID}, []int{skuID})
|
||||
if err == nil {
|
||||
err = api.JdShopAPI.DeleteSku(storeBinds[0].JdsID)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
storeCatMap.ID = catInfo.MapID
|
||||
var failedList []*partner.StoreSkuInfoWithErr
|
||||
if catInfo.IsExdSpec == model.YES {
|
||||
if vendorID == model.VendorIDJD || vendorID == model.VendorIDMTWM || vendorID == model.VendorIDYB {
|
||||
if vendorID != model.VendorIDEBAI {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,11 +141,11 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
func (p *PurchaseHandler) DeleteStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
if globals.EnableJdShopWrite && vendorStoreID == model.JdShopMainVendorStoreID {
|
||||
for _, v := range storeSkuList {
|
||||
err = api.JdShopAPI.DeleteSku(utils.Str2Int64(v.VendorSkuID))
|
||||
// err = api.JdShopAPI.UpOrDown(utils.Str2Int64(v.VendorSkuID2), 2)
|
||||
// if err == nil {
|
||||
// err = api.JdShopAPI.DeleteWare(utils.Str2Int(v.VendorSkuID2))
|
||||
// }
|
||||
// err = api.JdShopAPI.DeleteSku(utils.Str2Int64(v.VendorSkuID))
|
||||
err = api.JdShopAPI.UpOrDown(utils.Str2Int64(v.VendorSkuID2), 2)
|
||||
if err == nil {
|
||||
err = api.JdShopAPI.DeleteWare(utils.Str2Int(v.VendorSkuID2))
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDJDShop], "删除商品")
|
||||
|
||||
Reference in New Issue
Block a user