合并饿鲜达库bug修改
This commit is contained in:
@@ -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) {
|
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
|
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
|
||||||
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
|
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
|
||||||
if err != nil {
|
if err != nil || skus == nil {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
skuNameExt := &model.SkuName{}
|
skuNameExt := &model.SkuName{}
|
||||||
@@ -1498,7 +1498,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
|||||||
WHERE a.upc = ?
|
WHERE a.upc = ?
|
||||||
`
|
`
|
||||||
sqlParams2 := []interface{}{
|
sqlParams2 := []interface{}{
|
||||||
skus.UpcIds,
|
skus.UpcIds[0],
|
||||||
}
|
}
|
||||||
dao.GetRow(db, skuNameExt, sql2, sqlParams2)
|
dao.GetRow(db, skuNameExt, sql2, sqlParams2)
|
||||||
prefix, _, _, specUnit, unit, specQuality := jxutils.SplitSkuName(v.GoodsName)
|
prefix, _, _, specUnit, unit, specQuality := jxutils.SplitSkuName(v.GoodsName)
|
||||||
@@ -1524,16 +1524,6 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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{
|
skuName := &model.SkuName{
|
||||||
Prefix: prefix,
|
Prefix: prefix,
|
||||||
Name: v.GoodsName,
|
Name: v.GoodsName,
|
||||||
@@ -1546,11 +1536,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
|||||||
Upc: &v.UpcID,
|
Upc: &v.UpcID,
|
||||||
Status: model.SkuStatusNormal,
|
Status: model.SkuStatusNormal,
|
||||||
}
|
}
|
||||||
if skuCat.ID != 0 {
|
|
||||||
skuName.CategoryID = skuCat.ID
|
|
||||||
} else {
|
|
||||||
skuName.CategoryID = 35 //默认给了个分类
|
skuName.CategoryID = 35 //默认给了个分类
|
||||||
}
|
|
||||||
dao.WrapAddIDCULDEntity(skuName, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(skuName, ctx.GetUserName())
|
||||||
err = dao.CreateEntity(db, skuName)
|
err = dao.CreateEntity(db, skuName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -191,6 +191,12 @@ type tUpdateSkuSpecTag struct {
|
|||||||
IsSpec int `json:"isSpec"`
|
IsSpec int `json:"isSpec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MatterStock struct {
|
||||||
|
SkuID int `json:"skuID"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Stock int `json:"stock"`
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
maxStoreNameBind = 10000 // 最大门店SkuName bind个数
|
maxStoreNameBind = 10000 // 最大门店SkuName bind个数
|
||||||
maxStoreNameBind2 = 10000 // 最大门店乘SkuName个数
|
maxStoreNameBind2 = 10000 // 最大门店乘SkuName个数
|
||||||
@@ -3927,3 +3933,8 @@ func ReturnStoreSkuBind(ctx *jxcontext.Context, snapshotAt string, storeIDs, sku
|
|||||||
dao.CreateMultiEntities(db, storeSkus)
|
dao.CreateMultiEntities(db, storeSkus)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshMatterStock(ctx *jxcontext.Context, skuID int) (matterStock []*MatterStock, err error) {
|
||||||
|
// api.JdEclpAPI.SearchShopStock(searchShopStockParam)
|
||||||
|
return matterStock, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
|
|||||||
ConsigneeMobile: order.ConsigneeMobile,
|
ConsigneeMobile: order.ConsigneeMobile,
|
||||||
ConsigneeAddress: order.ConsigneeAddress,
|
ConsigneeAddress: order.ConsigneeAddress,
|
||||||
OrderMark: jdeclpapi.OrderMark,
|
OrderMark: jdeclpapi.OrderMark,
|
||||||
IsvGoodsNo: strings.Join(goodsNos, ","),
|
GoodsNo: strings.Join(goodsNos, ","),
|
||||||
Price: strings.Join(prices, ","),
|
Price: strings.Join(prices, ","),
|
||||||
Quantity: strings.Join(quantities, ","),
|
Quantity: strings.Join(quantities, ","),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -747,3 +747,16 @@ func (c *StoreSkuController) ReturnStoreSkuBind() {
|
|||||||
return retVal, "", err
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user