修复取消结算活动时的bug
This commit is contained in:
@@ -105,6 +105,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
}
|
}
|
||||||
storeIDs := jxutils.IntMap2List(storeIDMap)
|
storeIDs := jxutils.IntMap2List(storeIDMap)
|
||||||
skuIDs := jxutils.IntMap2List(skuIDMap)
|
skuIDs := jxutils.IntMap2List(skuIDMap)
|
||||||
|
// 判断活动是否重叠的检查,当前忽略京东平台及所有结算信息
|
||||||
if !(len(vendorIDs) == 1 && vendorIDs[0] == model.VendorIDJD || act.Type == model.ActSkuFake) {
|
if !(len(vendorIDs) == 1 && vendorIDs[0] == model.VendorIDJD || act.Type == model.ActSkuFake) {
|
||||||
effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, storeIDs, skuIDs, act.BeginAt, act.EndAt)
|
effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, storeIDs, skuIDs, act.BeginAt, act.EndAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -150,7 +151,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
v.OriginalPrice = int64(jxPrice)
|
v.OriginalPrice = int64(jxPrice)
|
||||||
}
|
}
|
||||||
var err2 error
|
var err2 error
|
||||||
if act.Type != model.ActSkuFake {
|
if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格
|
||||||
if storeSkuInfo == nil {
|
if storeSkuInfo == nil {
|
||||||
v.ErrMsg = fmt.Sprintf("门店:%d没有关注商品:%d", v.StoreID, v.SkuID)
|
v.ErrMsg = fmt.Sprintf("门店:%d没有关注商品:%d", v.StoreID, v.SkuID)
|
||||||
wrongSkuList = append(wrongSkuList, v)
|
wrongSkuList = append(wrongSkuList, v)
|
||||||
@@ -697,11 +698,13 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
syncStatus = model.SyncFlagDeletedMask
|
syncStatus = model.SyncFlagDeletedMask
|
||||||
}
|
}
|
||||||
syncStatus |= act.SyncStatus
|
syncStatus |= act.SyncStatus
|
||||||
if _, err = dao.UpdateEntityLogically(db, partner.Act2ActMap(act),
|
if act.Type != model.ActSkuFake {
|
||||||
map[string]interface{}{
|
if _, err = dao.UpdateEntityLogically(db, partner.Act2ActMap(act),
|
||||||
model.FieldSyncStatus: syncStatus,
|
map[string]interface{}{
|
||||||
}, ctx.GetUserName(), nil); err != nil {
|
model.FieldSyncStatus: syncStatus,
|
||||||
return err
|
}, ctx.GetUserName(), nil); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isDeleteAll != isNeedCancelAct {
|
if isDeleteAll != isNeedCancelAct {
|
||||||
@@ -709,7 +712,7 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isNeedCancelAct && act.Type != model.ActSkuFake {
|
if isNeedCancelAct {
|
||||||
act := &model.Act{}
|
act := &model.Act{}
|
||||||
act.ID = actID
|
act.ID = actID
|
||||||
if _, err = dao.UpdateEntityLogically(db, act,
|
if _, err = dao.UpdateEntityLogically(db, act,
|
||||||
|
|||||||
Reference in New Issue
Block a user