a
This commit is contained in:
@@ -65,6 +65,8 @@ const (
|
||||
MaxBatchSize4BatchUpdateOutSkuId = 50
|
||||
MaxPageSize4QuerySku = 50
|
||||
MaxSkuIDsCount4QueryListBySkuIds = 25
|
||||
|
||||
ErrMustUPC = "处方药商品请根据商品UPC码批量新增商品接口创建"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -140,6 +142,14 @@ type CreateByUpcParam struct {
|
||||
IsSale bool `json:"isSale"` // 门店商品可售状态,true为可售,false为不可售,默认为可售。
|
||||
}
|
||||
|
||||
type CreateByUpcParam2 struct {
|
||||
Upc string `json:"upc"` // 商品UPC码
|
||||
OutSkuId string `json:"outSkuId"` // 商家商品编码,商家系统中唯一编码,限1-35字符,与到家商品编码一对一对应
|
||||
JdPrice string `json:"jdPrice"` // 商家商品价格(单位:元),用于初始商品门店价格,所有的商品门店价格都会初始化成该值。后续修改商品门店价格需要通过价格类接口修改。
|
||||
ShopCategoryID int64 `json:"shopCategoryId"` // 商家店内分类编码,店内分类编码通过查询商家店内分类信息接口获取
|
||||
IsSale bool `json:"isSale"` // 门店商品可售状态,true为可售,false为不可售,默认为可售。
|
||||
}
|
||||
|
||||
type CreateByUpcPair struct {
|
||||
Upc string
|
||||
SkuId int64
|
||||
@@ -670,6 +680,17 @@ func (a *API) BatchAddSku(batchSkuRequestList []*CreateByUpcParam) (pairs []*Cre
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *API) BatchAddSkuByUPC(batchSkuRequestList []*CreateByUpcParam2) (pairs []*CreateByUpcPair, err error) {
|
||||
_, err = a.AccessAPINoPage("pms/batchAddSku", map[string]interface{}{
|
||||
"traceId": utils.GetUUID(),
|
||||
"openBatchAddSkuRequests": batchSkuRequestList,
|
||||
}, nil, nil, nil)
|
||||
if err == nil {
|
||||
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *API) GetSpuStatus(outSpuId string) (resultStatus int, err error) {
|
||||
result, err := a.AccessAPINoPage("pms/getSpuStatus", map[string]interface{}{
|
||||
"outSuperId": outSpuId,
|
||||
|
||||
@@ -276,3 +276,17 @@ func TestQueren(t *testing.T) {
|
||||
// }
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestBatchAddSkuByUPC(t *testing.T) {
|
||||
_, err := api.BatchAddSkuByUPC([]*CreateByUpcParam2{
|
||||
&CreateByUpcParam2{
|
||||
OutSkuId: "6048265",
|
||||
Upc: "6911672042530",
|
||||
JdPrice: "29800",
|
||||
ShopCategoryID: 5485102,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ func (a *API) SaveQualify(stationNo string, actionType int, qualifyList []*Quali
|
||||
"stationNo": stationNo,
|
||||
"actionType": actionType,
|
||||
"qualifyList": utils.Format4Output(qualifyList, true),
|
||||
"type": 1,
|
||||
"type": 0,
|
||||
"degrade": "no",
|
||||
}, true, "")
|
||||
return err
|
||||
|
||||
@@ -606,7 +606,7 @@ func maxUncrossedLines(A []int, B []int) (s int) {
|
||||
}
|
||||
|
||||
func TestShopList(t *testing.T) {
|
||||
result, err := api.ShopList(2)
|
||||
result, err := api.ShopList(25)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user