京东商城门店库存修改

This commit is contained in:
苏尹岚
2020-05-21 10:38:56 +08:00
parent d678e943f0
commit 9271052a9e
2 changed files with 5 additions and 6 deletions

View File

@@ -1526,11 +1526,6 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
}
request.AddCookie(c)
client := &http.Client{}
deadline := 1
d := time.Now().Add(time.Duration(deadline) * time.Second) // deadline max
ctx2, cancel := context.WithDeadline(context.Background(), d)
defer cancel()
request.WithContext(ctx2)
fmt.Println(request)
response, _ := client.Do(request)
defer response.Body.Close()

View File

@@ -169,7 +169,11 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, vendorOr
if vendorStoreID == model.JdShopMainVendorStoreID {
err = api.JdShopAPI.UpdateSkuStock(utils.Str2Int(v.VendorSkuID), stock)
} else {
err = api.JdShopAPI.UpdateSkuSiteStock(utils.Str2Int(v.VendorSkuID), stock, utils.Str2Int(vendorStoreID))
storeSkus, err2 := dao.GetStoresSkusInfo(dao.GetDB(), []int{storeID}, []int{v.SkuID})
err = err2
if len(storeSkus) > 0 {
err = api.JdShopAPI.UpdateSkuSiteStock(storeSkus[0].JdsID, stock, utils.Str2Int(vendorStoreID))
}
}
}
if err != nil {