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

This commit is contained in:
苏尹岚
2020-01-07 18:26:12 +08:00
5 changed files with 23 additions and 7 deletions

View File

@@ -167,7 +167,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 act.OverlapRule == model.OverlapRuleNormal {
effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, act.Type, storeIDs, skuIDs, act.BeginAt, act.EndAt) effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, act.Type, storeIDs, skuIDs, act.BeginAt, act.EndAt)
if err != nil { if err != nil {
globals.SugarLogger.Errorf("GetEffectiveActStoreSkuInfo can not get sku promotion info for error:%v", err) globals.SugarLogger.Errorf("GetEffectiveActStoreSkuInfo can not get sku promotion info for error:%v", err)

View File

@@ -28,6 +28,9 @@ const (
ActCreateTypeAPI = 1 ActCreateTypeAPI = 1
ActCreateTypeCallback = 2 ActCreateTypeCallback = 2
ActCreateTypeSpider = 3 ActCreateTypeSpider = 3
OverlapRuleNormal = 0 // 不允许重叠(重叠会报错)
OverlapRuleReplace = 1 // 相同活动类型,或秒杀替换直降
) )
var ( var (
@@ -63,6 +66,7 @@ type Act struct {
LimitCount int `json:"limitCount"` // 每单限购数量 LimitCount int `json:"limitCount"` // 每单限购数量
Source string `orm:"size(255)" json:"source"` Source string `orm:"size(255)" json:"source"`
CreateType int `json:"createType"` CreateType int `json:"createType"`
OverlapRule int `json:"overlapRule"`
PricePercentage int `json:"pricePercentage"` // 单品级活动才有效 PricePercentage int `json:"pricePercentage"` // 单品级活动才有效
BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"` BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"`
EndAt time.Time `orm:"type(datetime);index" json:"endAt"` EndAt time.Time `orm:"type(datetime);index" json:"endAt"`

View File

@@ -170,7 +170,8 @@ func BuyerCancelOrder(ctx *jxcontext.Context, orderID int64, reason string) (can
canceled = true canceled = true
} }
} else { } else {
err = changeOrderStatus(utils.Int64ToStr(orderID), model.OrderStatusApplyCancel, fmt.Sprintf("用户%s主动取消", ctx.GetUserName())) err = fmt.Errorf("暂不支持自行取消订单,请联系商家取消")
// err = changeOrderStatus(utils.Int64ToStr(orderID), model.OrderStatusApplyCancel, fmt.Sprintf("用户%s主动取消", ctx.GetUserName()))
} }
} }
return canceled, err return canceled, err

View File

@@ -25,6 +25,7 @@ type ActController struct {
// @Param pricePercentage formData int true "活动价格比例" // @Param pricePercentage formData int true "活动价格比例"
// @Param advertising formData string true "广告语" // @Param advertising formData string true "广告语"
// @Param actStoreSkuList formData string true "活动门店商品信息" // @Param actStoreSkuList formData string true "活动门店商品信息"
// @Param overlapRule formData int false "活动重叠规则"
// @Param limitDaily formData int false "是否按日0-不限,>0限购单数秒杀需填" // @Param limitDaily formData int false "是否按日0-不限,>0限购单数秒杀需填"
// @Param limitUser formData int false "是否用户限购0-不限1-限购" // @Param limitUser formData int false "是否用户限购0-不限1-限购"
// @Param limitCount formData int false "限购件数 0-不限如账号限购、设备限购有一个为1则限购件数必须大于0的整数" // @Param limitCount formData int false "限购件数 0-不限如账号限购、设备限购有一个为1则限购件数必须大于0的整数"
@@ -42,11 +43,12 @@ func (c *ActController) PreCreateAct() {
if err == nil { if err == nil {
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.ActStoreSkuList, &actStoreSkuList); err == nil { if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.ActStoreSkuList, &actStoreSkuList); err == nil {
actObj := &model.Act{ actObj := &model.Act{
Name: params.Name, Name: params.Name,
Type: params.Type, Type: params.Type,
LimitUser: params.LimitUser, LimitUser: params.LimitUser,
LimitDaily: params.LimitDaily, LimitDaily: params.LimitDaily,
LimitCount: params.LimitCount, LimitCount: params.LimitCount,
OverlapRule: params.OverlapRule,
// Source:, // Source:,
CreateType: model.ActCreateTypeAPI, CreateType: model.ActCreateTypeAPI,
PricePercentage: params.PricePercentage, PricePercentage: params.PricePercentage,

View File

@@ -583,6 +583,15 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
beego.ControllerComments{
Method: "BuyerCancelOrder",
Router: `/BuyerCancelOrder`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"], beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "CreateOrder", Method: "CreateOrder",