Merge remote-tracking branch 'origin/mark' into don

This commit is contained in:
Rosy-zhudan
2019-09-18 09:17:48 +08:00
8 changed files with 160 additions and 50 deletions

View File

@@ -32,7 +32,9 @@ type ActOrderRuleParam struct {
type ActStoreSkuParam struct {
model.ActStoreSku
ErrMsg string `json:"errMsg"`
ActualActPrice int64 `json:"actualActPrice,omitempty"` // 单品级活动用,创建活动时商品的活动价格
ErrMsg string `json:"errMsg,omitempty"`
}
type ActDetail struct {
@@ -153,6 +155,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
}
if err2 := checkDiscountValidation(act.Type, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice)); err2 != nil {
v.ErrMsg = err2.Error()
v.ActualActPrice = actSkuMap.ActualActPrice
wrongSkuList = append(wrongSkuList, v)
} else {
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
@@ -275,7 +278,11 @@ func AddActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actSto
func checkDiscountValidation(actType int, pricePercentage int) (err error) {
if actType == model.ActSkuDirectDown && (pricePercentage < minDiscount4SkuDirectDown || pricePercentage > 99) {
err = fmt.Errorf("%s活动折扣必须大于:%d, 且必须有折扣", model.ActTypeName[actType], minDiscount4SkuDirectDown)
if pricePercentage < minDiscount4SkuDirectDown {
err = fmt.Errorf("%s活动折扣必须大于:%d", model.ActTypeName[actType], minDiscount4SkuDirectDown)
} else if pricePercentage > 99 {
err = fmt.Errorf("%s活动必须有折扣", model.ActTypeName[actType])
}
} else if actType == model.ActSkuSecKill && pricePercentage > maxDiscount4SkuSecKill {
err = fmt.Errorf("%s活动折扣必须小于:%d", model.ActTypeName[actType], maxDiscount4SkuSecKill)
}

View File

@@ -356,7 +356,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
isAdded2Update := false
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
if (model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) || (model.IsSyncStatusSeq(sku.StoreSkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
if dao.IsVendorThingIDEmpty(sku.VendorCatID) {
if false { //dao.IsVendorThingIDEmpty(sku.VendorCatID) {
globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d但没有平台分类ID", sku.StoreID, sku.SkuID)
} else {
isAdded2Update = true