ActMap添加VendorOrgCode

京东活动依赖VendorOrgCode
This commit is contained in:
gazebo
2019-12-10 14:17:05 +08:00
parent bf597331f4
commit 1e4700057b
7 changed files with 63 additions and 57 deletions

View File

@@ -115,7 +115,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
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)
if err != nil {
globals.SugarLogger.Errorf("updateActPrice4StoreSkuNameNew can not get sku promotion info for error:%v", err)
globals.SugarLogger.Errorf("GetEffectiveActStoreSkuInfo can not get sku promotion info for error:%v", err)
return nil, nil, nil, err
}
if len(effectActStoreSkuList) > 0 {
@@ -402,7 +402,7 @@ func PreCreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, actRu
return preCreateActInfo, nil
}
func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, actRules []*ActOrderRuleParam, actStoreSku []*ActStoreSkuParam, isAsync bool) (hint string, err error) {
func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOrgCode string, actRules []*ActOrderRuleParam, actStoreSku []*ActStoreSkuParam, isAsync bool) (hint string, err error) {
if err = checkActValidation(act, vendorIDs); err != nil {
return "", err
}
@@ -437,8 +437,9 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, actRules
var actMapList []*model.ActMap
for _, vendorID := range validVendorIDs {
actMap := &model.ActMap{
ActID: act.ID,
VendorID: vendorID,
ActID: act.ID,
VendorID: vendorID,
VendorOrgCode: vendorOrgCode,
}
if !(vendorID == model.VendorIDJX || act.Type == model.ActSkuFake) {
actMap.SyncStatus = model.SyncFlagNewMask