- fix bug in promotion.OnStoreStockMsg
This commit is contained in:
@@ -696,12 +696,13 @@ func RefreshJdPromotionLockStatus(promotionID int) (err error) {
|
||||
|
||||
func OnStoreStockMsg(msg *jdapi.CallbackStoreStockMsg) (retVal *jdapi.CallbackResponse) {
|
||||
var err error
|
||||
globals.SugarLogger.Debugf("OnStoreStockMsg msg:%s", utils.Format4Output(msg, false))
|
||||
// globals.SugarLogger.Debugf("OnStoreStockMsg IsJdStoreSkuLocked:%t", storeskulock.IsJdStoreSkuLocked(msg.StationNo, msg.SkuId))
|
||||
if (msg.Vendibility == 1 || !msg.Have) && storeskulock.IsJdStoreSkuLocked(msg.StationNo, msg.SkuId) {
|
||||
db := dao.GetDB()
|
||||
if msg.Vendibility == 1 {
|
||||
sku := &model.Sku{}
|
||||
sku.JdID = msg.SkuId
|
||||
if err = dao.GetEntity(db, sku); err == nil {
|
||||
if err = dao.GetEntity(db, sku, model.FieldJdID); err == nil {
|
||||
if msg.Vendibility == 1 {
|
||||
vendibility := &jdapi.StockVendibility{
|
||||
OutSkuId: utils.Int2Str(sku.ID),
|
||||
@@ -722,7 +723,6 @@ func OnStoreStockMsg(msg *jdapi.CallbackStoreStockMsg) (retVal *jdapi.CallbackRe
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return jdapi.Err2CallbackResponse(err, "")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user