This commit is contained in:
苏尹岚
2021-03-01 18:14:36 +08:00
parent 34af8ec1ed
commit 1c49fcb1d7
4 changed files with 37 additions and 2 deletions

View File

@@ -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,

View File

@@ -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)
}
}

View File

@@ -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

View File

@@ -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)
}