From a2a28d2b591d324ca11918f8f798c7d2cc2ec9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 9 Jun 2020 18:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E9=80=8F=E5=9B=BE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/tempop/tempop.go | 137 +++++++++++++++++- business/partner/purchase/jdshop/store_sku.go | 1 - 2 files changed, 131 insertions(+), 7 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 59bd8017c..45567ef95 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -8,8 +8,6 @@ import ( "strings" "time" - "git.rosy.net.cn/baseapi/platformapi/jdshopapi" - "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" "git.rosy.net.cn/jx-callback/business/partner/delivery" "github.com/360EntSecGroup-Skylar/excelize" @@ -1611,10 +1609,137 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // continue // } // } - _, err = api.JdShopAPI.AllOrders(&jdshopapi.AllOrdersParam{ - Current: 1, - PageSize: 10, - }) + var storeSkus []*model.StoreSkuBind + sql := ` + SELECT a.* FROM store_sku_bind a WHERE a.store_id = 102919 + AND a.jds_ware_id IN (14518860227, + 14518865342, + 14518857791, + 14518863440, + 14518850181, + 14518869426, + 14518865836, + 14518860282, + 14518862865, + 14518860089, + 14518861773, + 14518857091, + 14518859794, + 14518878413, + 14518874243, + 14518992990, + 14519010404, + 14519010010, + 14519006838, + 14519009822, + 14541114008, + 14542371664, + 14542409106, + 14542477967, + 14542585438, + 14542602011, + 14542586377, + 14542927723, + 14542946611, + 14542948535, + 14543031285, + 14543077206, + 14544951705, + 14546014638, + 14565258994, + 14565275855, + 14566133342, + 14566144059, + 14566419305, + 14566403990, + 14566408956, + 14567187277, + 14567793468, + 14567911336, + 14567910034, + 14567907049, + 14567904981, + 14567909664, + 14567907786, + 14568001774, + 14568152611, + 14568138877, + 14568146252, + 14568161923, + 14568508881, + 14568512475, + 14568524772, + 14568533264, + 14568540322, + 14568534834, + 14568546936, + 14568542882, + 14568806841, + 14576405495, + 14576832607, + 14576832017, + 14576946037, + 14576974106, + 14576993226, + 14579143223, + 14581769973, + 14581773059, + 14581773646, + 14581780520, + 14581782920, + 14581768094, + 14581788365, + 14581805504, + 14581919920, + 14581915051, + 14581920950, + 14581971709, + 14581979302, + 14581974927, + 14581974739, + 14581964099, + 14581974639, + 14581976637, + 14581979946, + 14581989815, + 14581987337, + 14581987251, + 14581981273, + 14581996123, + 14581984285, + 14581994544, + 14581996576, + 14582006319, + 14582000952, + 14582000668, + 14581993998, + 14581996999, + 14582016736, + 14582053303, + 14594027838, + 14594055255, + 14594104816, + 14594233747, + 14594245738, + 14594249079, + 14594296303, + 14594987858, + 14596828148, + 14600091528, + 14600094614, + 14600087648, + 14566414324) + ` + err = dao.GetRows(dao.GetDB(), &storeSkus, sql, nil) + for _, v := range storeSkus { + result, _ := api.JdShopAPI.SearchSkuList(v.JdsWareID) + for _, vv := range result { + if vv.SkuID != v.JdsID { + api.JdShopAPI.DeleteSku(vv.SkuID) + break + } + } + } return err } diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index ac189ba46..7efea8196 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -840,7 +840,6 @@ func buildUpdateSkusParam(storeSku *dao.StoreSkuSyncInfo, v *dao.StoreSkuSyncInf if !isCreate { result, err2 := api.JdShopAPI.FindSkuById(utils.Str2Int64(v.VendorSkuID)) err = err2 - fmt.Println("test2", specQuality, v.VendorSkuID, utils.Format4Output(result, false)) if specQuality != result.SaleAttrs[0].AttrValueAlias[0] { api.JdShopAPI.DeleteSku(utils.Str2Int64(v.VendorSkuID)) }