根据平台反酸价格增加参数
This commit is contained in:
@@ -3585,7 +3585,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
|||||||
return hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus, vendorID int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus, vendorID int, ignoreLow, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
jdMap = make(map[int][]*JdStoreSkus)
|
jdMap = make(map[int][]*JdStoreSkus)
|
||||||
@@ -3650,7 +3650,16 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
|
|||||||
for kk, vv := range v {
|
for kk, vv := range v {
|
||||||
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
||||||
if len(result) > 0 && err == nil {
|
if len(result) > 0 && err == nil {
|
||||||
if result[0].UnitPrice > vv {
|
if ignoreLow {
|
||||||
|
if result[0].UnitPrice > vv {
|
||||||
|
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||||
|
StoreID: k,
|
||||||
|
NameID: kk,
|
||||||
|
UnitPrice: vv,
|
||||||
|
}
|
||||||
|
param = append(param, storeSkuBindInfo)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||||
StoreID: k,
|
StoreID: k,
|
||||||
NameID: kk,
|
NameID: kk,
|
||||||
@@ -3695,7 +3704,16 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
|
|||||||
for kk, vv := range v {
|
for kk, vv := range v {
|
||||||
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
||||||
if len(result) > 0 && err == nil {
|
if len(result) > 0 && err == nil {
|
||||||
if result[0].UnitPrice > vv {
|
if ignoreLow {
|
||||||
|
if result[0].UnitPrice > vv {
|
||||||
|
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||||
|
StoreID: k,
|
||||||
|
NameID: kk,
|
||||||
|
UnitPrice: vv,
|
||||||
|
}
|
||||||
|
param = append(param, storeSkuBindInfo)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||||
StoreID: k,
|
StoreID: k,
|
||||||
NameID: kk,
|
NameID: kk,
|
||||||
|
|||||||
@@ -675,6 +675,7 @@ func (c *StoreSkuController) SendSeckillSkusCountMsg() {
|
|||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param payload formData string true "json数据,JdStoreSkus对象"
|
// @Param payload formData string true "json数据,JdStoreSkus对象"
|
||||||
// @Param vendorID formData int true "厂商ID"
|
// @Param vendorID formData int true "厂商ID"
|
||||||
|
// @Param ignoreLow formData bool true "是否忽略低价商品"
|
||||||
// @Param isAsync formData bool true "是否异步,缺省是同步"
|
// @Param isAsync formData bool true "是否异步,缺省是同步"
|
||||||
// @Param isContinueWhenError formData bool true "单个同步失败是否继续,缺省false"
|
// @Param isContinueWhenError formData bool true "单个同步失败是否继续,缺省false"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
@@ -686,7 +687,7 @@ func (c *StoreSkuController) RefreshJxPriceByVendor() {
|
|||||||
if err = jxutils.Strings2Objs(params.Payload, &skuBindInfos); err != nil {
|
if err = jxutils.Strings2Objs(params.Payload, &skuBindInfos); err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
}
|
}
|
||||||
retVal, err = cms.RefreshJxPriceByVendor(params.Ctx, skuBindInfos, params.VendorID, params.IsAsync, params.IsContinueWhenError)
|
retVal, err = cms.RefreshJxPriceByVendor(params.Ctx, skuBindInfos, params.VendorID, params.IgnoreLow, params.IsAsync, params.IsContinueWhenError)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user