- 重要修改相关的函数新增trackInfo参数,追踪修改人.接口类型改变

This commit is contained in:
gazebo
2019-07-28 12:34:52 +08:00
parent 437711eb38
commit da9c8a11c2
13 changed files with 152 additions and 100 deletions

View File

@@ -97,7 +97,7 @@ type StoreSkuBatchUpdateResponse struct {
// 根据商家商品编码和商家门店编码批量修改门店价格接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=205&apiid=fcbf346648a54d03b92dec8fa62ea643
func (a *API) UpdateVendorStationPrice(outStationNo, stationNo string, skuPriceInfoList []*SkuPriceInfo) (responseList []*StoreSkuBatchUpdateResponse, err error) {
func (a *API) UpdateVendorStationPrice(trackInfo string, outStationNo, stationNo string, skuPriceInfoList []*SkuPriceInfo) (responseList []*StoreSkuBatchUpdateResponse, err error) {
jdParams := map[string]interface{}{
"skuPriceInfoList": skuPriceInfoList,
}
@@ -106,7 +106,7 @@ func (a *API) UpdateVendorStationPrice(outStationNo, stationNo string, skuPriceI
} else {
jdParams["stationNo"] = stationNo
}
result, err := a.AccessAPINoPage("venderprice/updateStationPrice", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "0"))
result, err := a.AccessAPINoPage2("venderprice/updateStationPrice", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "0"), trackInfo)
if result != nil {
var err2 error
if responseList, err2 = a.handleBatchOpResult(len(skuPriceInfoList), result, "json2"); err2 != nil && err == nil {
@@ -119,13 +119,13 @@ func (a *API) UpdateVendorStationPrice(outStationNo, stationNo string, skuPriceI
// 根据到家商品编码和到家门店编码修改门店价格接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=205&apiid=45f83ef7c6e74dad94b6b68d3c50b673
// 单商品用此接口
func (a *API) UpdateStationPrice(skuId int64, stationNo string, price int) (string, error) {
func (a *API) UpdateStationPrice(trackInfo string, skuId int64, stationNo string, price int) (string, error) {
jdParams := map[string]interface{}{
"skuId": skuId,
"stationNo": stationNo,
"price": price,
}
result, err := a.AccessAPINoPage("price/updateStationPrice", jdParams, nil, nil, nil)
result, err := a.AccessAPINoPage2("price/updateStationPrice", jdParams, nil, nil, nil, trackInfo)
if err == nil && result != nil {
return utils.Interface2String(result), nil
}
@@ -165,7 +165,7 @@ func (a *API) handleBatchOpResult(batchCount int, result interface{}, tagName st
// 根据商家商品编码和商家门店编码批量修改现货库存接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=200&apiid=10812f9fc7ee4564b552f19270a7e92e
func (a *API) BatchUpdateCurrentQtys(outStationNo, stationNo string, skuStockList []*SkuStock, userPin string) (responseList []*StoreSkuBatchUpdateResponse, err error) {
func (a *API) BatchUpdateCurrentQtys(trackInfo, outStationNo, stationNo string, skuStockList []*SkuStock, userPin string) (responseList []*StoreSkuBatchUpdateResponse, err error) {
if (outStationNo == "" && stationNo == "") || (outStationNo != "" && stationNo != "") {
return nil, errors.New("outStationNo and stationNo can not all be empty or have value")
}
@@ -178,7 +178,7 @@ func (a *API) BatchUpdateCurrentQtys(outStationNo, stationNo string, skuStockLis
} else {
jdParams["stationNo"] = stationNo
}
result, err := a.AccessAPINoPage("stock/batchUpdateCurrentQtys", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"))
result, err := a.AccessAPINoPage2("stock/batchUpdateCurrentQtys", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"), trackInfo)
if result != nil {
var err2 error
if responseList, err2 = a.handleBatchOpResult(len(skuStockList), result, ""); err2 != nil && err == nil {
@@ -191,14 +191,14 @@ func (a *API) BatchUpdateCurrentQtys(outStationNo, stationNo string, skuStockLis
// 根据商家商品编码和商家门店编码更新门店现货库存接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=200&apiid=a78664d4ead349da95d2f4576ed18d7f
// 此接口基本可以不用
func (a *API) StockUpdate(outStationNo string, outSkuID string, currentQty int) error {
func (a *API) StockUpdate(trackInfo string, outStationNo string, outSkuID string, currentQty int) error {
// !这个接口的stationNo与skuId好像本身就写错了的
jdParams := map[string]interface{}{
"stationNo": outStationNo,
"skuId": outSkuID,
"currentQty": currentQty,
}
_, err := a.AccessAPINoPage("stock/update", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "", "0"))
_, err := a.AccessAPINoPage2("stock/update", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "", "0"), trackInfo)
if err == nil {
return nil
}
@@ -208,13 +208,13 @@ func (a *API) StockUpdate(outStationNo string, outSkuID string, currentQty int)
// 根据到家商品编码和到家门店编码更新门店现货库存
// https://openo2o.jddj.com/staticnew/widgets/resources.html?groupid=200&apiid=af70e699d4974e1683128742018f6381
// 单商品用此接口
func (a *API) UpdateCurrentQty(stationNo string, skuID int64, currentQty int) error {
func (a *API) UpdateCurrentQty(trackInfo string, stationNo string, skuID int64, currentQty int) error {
jdParams := map[string]interface{}{
"stationNo": stationNo,
"skuId": skuID,
"currentQty": currentQty,
}
_, err := a.AccessAPINoPage("update/currentQty", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "", "0"))
_, err := a.AccessAPINoPage2("update/currentQty", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "", "0"), trackInfo)
if err == nil {
return nil
}
@@ -224,11 +224,11 @@ func (a *API) UpdateCurrentQty(stationNo string, skuID int64, currentQty int) er
// 根据到家商品编码和到家门店编码批量修改门店商品可售状态接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=200&apiid=b783a508e2cf4aca94681e4eed9af5bc
// 尽量不用这个接口用下面那个原因是这个不支持设置操作人BatchUpdateVendibility可以
func (a *API) UpdateVendibility(listBaseStockCenterRequest []*QueryStockRequest) (responseList []*StoreSkuBatchUpdateResponse, err error) {
func (a *API) UpdateVendibility(trackInfo string, listBaseStockCenterRequest []*QueryStockRequest) (responseList []*StoreSkuBatchUpdateResponse, err error) {
jdParams := map[string]interface{}{
"listBaseStockCenterRequest": listBaseStockCenterRequest,
}
result, err := a.AccessAPINoPage("stock/updateVendibility", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"))
result, err := a.AccessAPINoPage2("stock/updateVendibility", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"), trackInfo)
if result != nil {
var err2 error
if responseList, err2 = a.handleBatchOpResult(len(listBaseStockCenterRequest), result, ""); err2 != nil && err == nil {
@@ -240,7 +240,7 @@ func (a *API) UpdateVendibility(listBaseStockCenterRequest []*QueryStockRequest)
// 根据商家商品编码和门店编码批量修改门店商品可售状态接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=200&apiid=ac6f559ebabf4b70bc423687638e07c1
func (a *API) BatchUpdateVendibility(outStationNo, stationNo string, stockVendibilityList []*StockVendibility, userPin string) (responseList []*StoreSkuBatchUpdateResponse, err error) {
func (a *API) BatchUpdateVendibility(trackInfo, outStationNo, stationNo string, stockVendibilityList []*StockVendibility, userPin string) (responseList []*StoreSkuBatchUpdateResponse, err error) {
if (outStationNo == "" && stationNo == "") || (outStationNo != "" && stationNo != "") {
return nil, errors.New("outStationNo and stationNo can not all be empty or have value")
}
@@ -253,7 +253,7 @@ func (a *API) BatchUpdateVendibility(outStationNo, stationNo string, stockVendib
} else {
jdParams["stationNo"] = stationNo
}
result, err := a.AccessAPINoPage("stock/batchUpdateVendibility", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"))
result, err := a.AccessAPINoPage2("stock/batchUpdateVendibility", jdParams, nil, nil, genNoPageResultParser("retCode", "retMsg", "data", "0"), trackInfo)
if result != nil {
var err2 error
if responseList, err2 = a.handleBatchOpResult(len(stockVendibilityList), result, ""); err2 != nil && err == nil {