This commit is contained in:
邹宗楠
2025-07-31 13:35:32 +08:00
parent 539c61e348
commit bba31a84a2
2 changed files with 31 additions and 37 deletions

View File

@@ -73,4 +73,6 @@ type ProductListV2Param struct {
UpdateEndTime int64 `json:"update_end_time"`
// 小时达商家使用的门店id
StoreId int64 `json:"store_id"`
// 商品ID,最大一百个
ProductId []string `json:"product_id"`
}

View File

@@ -55,7 +55,7 @@ func TestGetSkuDetail(t *testing.T) {
// 查询商品详情本地商品id
func TestGetSkuDetailLocalId(t *testing.T) {
data, err := a.GetSkuDetail("3765731983553069079", "")
data, err := a.GetSkuDetail("3749491763019120942", "")
fmt.Println(err)
globals.SugarLogger.Debugf("====%s", utils.Format4Output(data, false))
}
@@ -175,49 +175,41 @@ func TestBatchDecrypt(t *testing.T) {
fmt.Println(err)
}
var c = []int64{
64251217,
64251215,
64251213,
64251212,
64251211,
}
var c = []int64{}
// 删除已经创建商品,重新同步
func TestDeleteSkuAndUploadSku(t *testing.T) {
var errList = make([]error, 0, 0)
for _, v := range c {
for i := 1; i < 100; i++ {
result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{
Status: 0,
CheckStatus: 3, // 1-未提交2-待审核3-审核通过4-审核未通过5-封禁7-审核通过待上架
Page: int64(i),
Size: 100,
StoreId: v,
})
if err != nil {
continue
}
if len(result.Data) == 0 {
break
}
for i2, v2 := range result.Data {
if v2.ProductId == 3592586515512991033 {
fmt.Println("aa")
}
var sonSkuid int64 = 0
if len(v2.SpecPrices) != 0 {
sonSkuid = v2.SpecPrices[0].Id
}
sql := fmt.Sprintf(` UPDATE store_sku_bind SET vendor_son_sku_id = "%d" WHERE dd_id = "%d";`, sonSkuid, v2.ProductId)
fmt.Println(i2-i2, sql)
}
}
//for _, v := range c {
//for i := 1; i < 100; i++ {
result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{
//Status: 0,
//CheckStatus: 3, // 1-未提交2-待审核3-审核通过4-审核未通过5-封禁7-审核通过待上架
Page: int64(1),
Size: 100,
ProductId: []string{
"3603821366169751183"},
})
if err != nil {
fmt.Println(err)
}
for i2, v2 := range result.Data {
if v2.ProductId == 3592586515512991033 {
fmt.Println("aa")
}
var sonSkuid int64 = 0
if len(v2.SpecPrices) != 0 {
sonSkuid = v2.SpecPrices[0].Id
}
sql := fmt.Sprintf(` UPDATE store_sku_bind SET vendor_son_sku_id = "%d" WHERE dd_id = "%d";`, sonSkuid, v2.ProductId)
fmt.Println(i2-i2, sql)
}
//}
//}
for _, v := range errList {
globals.SugarLogger.Debugf("err := %s", utils.Format4Output(v, false))
}