合并饿鲜达库bug修改

This commit is contained in:
苏尹岚
2020-03-10 11:07:24 +08:00
parent 18e72079c5
commit 182b7dad31
4 changed files with 28 additions and 18 deletions

View File

@@ -1487,7 +1487,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
if err != nil {
if err != nil || skus == nil {
return result, err
}
skuNameExt := &model.SkuName{}
@@ -1498,7 +1498,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
WHERE a.upc = ?
`
sqlParams2 := []interface{}{
skus.UpcIds,
skus.UpcIds[0],
}
dao.GetRow(db, skuNameExt, sql2, sqlParams2)
prefix, _, _, specUnit, unit, specQuality := jxutils.SplitSkuName(v.GoodsName)
@@ -1524,16 +1524,6 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
}
}
} else {
skuCat := &model.SkuCategory{}
sql := `
SELECT *
FROM sku_category
WHERE ebai_category_id = ?
`
sqlParams := []interface{}{
skus.CategoryIDThird,
}
dao.GetRow(db, skuCat, sql, sqlParams)
skuName := &model.SkuName{
Prefix: prefix,
Name: v.GoodsName,
@@ -1546,11 +1536,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
Upc: &v.UpcID,
Status: model.SkuStatusNormal,
}
if skuCat.ID != 0 {
skuName.CategoryID = skuCat.ID
} else {
skuName.CategoryID = 35 //默认给了个分类
}
skuName.CategoryID = 35 //默认给了个分类
dao.WrapAddIDCULDEntity(skuName, ctx.GetUserName())
err = dao.CreateEntity(db, skuName)
if err != nil {

View File

@@ -191,6 +191,12 @@ type tUpdateSkuSpecTag struct {
IsSpec int `json:"isSpec"`
}
type MatterStock struct {
SkuID int `json:"skuID"`
Name string `json:"name"`
Stock int `json:"stock"`
}
const (
maxStoreNameBind = 10000 // 最大门店SkuName bind个数
maxStoreNameBind2 = 10000 // 最大门店乘SkuName个数
@@ -3927,3 +3933,8 @@ func ReturnStoreSkuBind(ctx *jxcontext.Context, snapshotAt string, storeIDs, sku
dao.CreateMultiEntities(db, storeSkus)
return err
}
func RefreshMatterStock(ctx *jxcontext.Context, skuID int) (matterStock []*MatterStock, err error) {
// api.JdEclpAPI.SearchShopStock(searchShopStockParam)
return matterStock, err
}

View File

@@ -633,7 +633,7 @@ func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
ConsigneeMobile: order.ConsigneeMobile,
ConsigneeAddress: order.ConsigneeAddress,
OrderMark: jdeclpapi.OrderMark,
IsvGoodsNo: strings.Join(goodsNos, ","),
GoodsNo: strings.Join(goodsNos, ","),
Price: strings.Join(prices, ","),
Quantity: strings.Join(quantities, ","),
})

View File

@@ -747,3 +747,16 @@ func (c *StoreSkuController) ReturnStoreSkuBind() {
return retVal, "", err
})
}
// @Title 物料库存刷新(物料店商品上下架)
// @Description 物料库存刷新(物料店商品上下架)
// @Param token header string true "认证token"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RefreshMatterStock [post]
func (c *StoreSkuController) RefreshMatterStock() {
c.callRefreshMatterStock(func(params *tStoreSkuRefreshMatterStockParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.RefreshMatterStock(params.Ctx, 0)
return retVal, "", err
})
}