From 8f8a8d304f98dc0260c2c993a9f0adbde8b73214 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 13:36:08 +0800 Subject: [PATCH 1/4] BuyerCancelOrder --- routers/commentsRouter_controllers.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 579cfa30e..86bfd00cc 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -583,6 +583,15 @@ func init() { 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.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.ControllerComments{ Method: "CreateOrder", From 26ca0bc01d175874ff659db786200f217e4652e0 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 14:29:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BA=AC=E8=A5=BF=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9A=82=E6=97=B6=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=90=8E=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jx/localjx/order.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index 1f3d219a7..334a5a492 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -170,7 +170,8 @@ func BuyerCancelOrder(ctx *jxcontext.Context, orderID int64, reason string) (can canceled = true } } 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 From a69b5b3772fce98187ea1a8d6ceeac65f98d02c6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 15:17:08 +0800 Subject: [PATCH 3/4] +Act.OverlapRule --- business/jxstore/act/act.go | 2 +- business/model/act.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index f80ada794..70a24c64c 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -167,7 +167,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac storeIDs := jxutils.IntMap2List(storeIDMap) 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) if err != nil { globals.SugarLogger.Errorf("GetEffectiveActStoreSkuInfo can not get sku promotion info for error:%v", err) diff --git a/business/model/act.go b/business/model/act.go index 5ea7c0125..5094dd643 100644 --- a/business/model/act.go +++ b/business/model/act.go @@ -28,6 +28,9 @@ const ( ActCreateTypeAPI = 1 ActCreateTypeCallback = 2 ActCreateTypeSpider = 3 + + OverlapRuleNormal = 0 // 不允许重叠(重叠会报错) + OverlapRuleReplace = 1 // 相同活动类型,或秒杀替换直降 ) var ( @@ -63,6 +66,7 @@ type Act struct { LimitCount int `json:"limitCount"` // 每单限购数量 Source string `orm:"size(255)" json:"source"` CreateType int `json:"createType"` + OverlapRule int `json:"overlapRule"` PricePercentage int `json:"pricePercentage"` // 单品级活动才有效 BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"` EndAt time.Time `orm:"type(datetime);index" json:"endAt"` From 7183d58554fe4f120fb7469a6b313fc5cf039966 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 15:21:52 +0800 Subject: [PATCH 4/4] up --- controllers/act.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/controllers/act.go b/controllers/act.go index 8d05ff4de..249714de6 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -25,6 +25,7 @@ type ActController struct { // @Param pricePercentage formData int true "活动价格比例" // @Param advertising formData string true "广告语" // @Param actStoreSkuList formData string true "活动门店商品信息" +// @Param overlapRule formData int false "活动重叠规则" // @Param limitDaily formData int false "是否按日0-不限,>0限购单数(秒杀需填)" // @Param limitUser formData int false "是否用户限购0-不限,1-限购" // @Param limitCount formData int false "限购件数 0-不限,如账号限购、设备限购有一个为1,则限购件数必须大于0的整数" @@ -42,11 +43,12 @@ func (c *ActController) PreCreateAct() { if err == nil { if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.ActStoreSkuList, &actStoreSkuList); err == nil { actObj := &model.Act{ - Name: params.Name, - Type: params.Type, - LimitUser: params.LimitUser, - LimitDaily: params.LimitDaily, - LimitCount: params.LimitCount, + Name: params.Name, + Type: params.Type, + LimitUser: params.LimitUser, + LimitDaily: params.LimitDaily, + LimitCount: params.LimitCount, + OverlapRule: params.OverlapRule, // Source:, CreateType: model.ActCreateTypeAPI, PricePercentage: params.PricePercentage,