根据名字查询京东门店等级修改

This commit is contained in:
苏尹岚
2019-12-16 16:14:55 +08:00
parent e53ccb4b42
commit 285d0df34f

View File

@@ -755,12 +755,11 @@ func (a *API) IsJdManagerUser(id int64) (isManager bool, err error) {
// 查询京东门店等级 // 查询京东门店等级
// 无法得到总数循环50页后放弃寻找。。 // 无法得到总数循环50页后放弃寻找。。
// https://sta-store.jddj.com/store/logquery?venderId=320406&stationNo=11733018&currentPage=1&pageSize=20 // https://sta-store.jddj.com/store/logquery?venderId=320406&stationNo=11733018&currentPage=1&pageSize=20
func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string) (level string, err error) { func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string, currentPage int) (level string, err error) {
for i := 1; i < 51; i++ {
jdParams := map[string]interface{}{ jdParams := map[string]interface{}{
"venderId": vendorOrgCode, "venderId": vendorOrgCode,
"stationNo": vendorStoreID, "stationNo": vendorStoreID,
"currentPage": i, "currentPage": currentPage,
"pageSize": 20, "pageSize": 20,
} }
body, err := a.AccessStorePage2("https://sta-store.jddj.com/store/logquery", jdParams, false, "") body, err := a.AccessStorePage2("https://sta-store.jddj.com/store/logquery", jdParams, false, "")
@@ -772,10 +771,6 @@ func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string) (level string
if len(levelList) > 0 { if len(levelList) > 0 {
level = levelList[0][1] level = levelList[0][1]
} }
if level != "" {
break
}
}
return level, err return level, err
} }
@@ -808,9 +803,8 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr
} }
productInfo := &ProductInfo{ productInfo := &ProductInfo{
OriginalName: v.(map[string]interface{})["name"].(string), OriginalName: v.(map[string]interface{})["name"].(string),
Name: v.(map[string]interface{})["name"].(string),
UpcCode: v.(map[string]interface{})["upcCode"].(string), UpcCode: v.(map[string]interface{})["upcCode"].(string),
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0)), Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000),
ImgList: ImgList, ImgList: ImgList,
} }
productInfos = append(productInfos, productInfo) productInfos = append(productInfos, productInfo)