- format promotion to 活动
This commit is contained in:
@@ -254,7 +254,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync, isContinueW
|
||||
promotionSkuPrice.Price = skuBind.Price * promotionSkuPrice.Price / 100
|
||||
}
|
||||
if promotionSkuPrice.Price >= skuBind.Price {
|
||||
errMsg += fmt.Sprintf("促销价大于等于原价,storeID:%d, skuID:%d\n", skuBind.StoreID, skuBind.SkuID)
|
||||
errMsg += fmt.Sprintf("活动价大于等于原价,storeID:%d, skuID:%d\n", skuBind.StoreID, skuBind.SkuID)
|
||||
}
|
||||
if promotionSkuPrice.LimitSkuCount <= 0 {
|
||||
promotionSkuPrice.LimitSkuCount = DefaultLimitSkuCount
|
||||
@@ -343,7 +343,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync, isContinueW
|
||||
if vendorPromotionID == "" {
|
||||
promotionHandler := getPromotionHander(params.Type)
|
||||
if promotionHandler == nil {
|
||||
return "", errors.New("非法的促销类型")
|
||||
return "", errors.New("非法的活动类型")
|
||||
}
|
||||
infoId, err2 := promotionHandler.CreatePromotionInfos(params.Name, params.BeginAt, params.EndAt, utils.Int2Str(promotion.ID), params.Advertising)
|
||||
if err = err2; err != nil {
|
||||
@@ -621,7 +621,7 @@ func CancelJdPromotion(ctx *jxcontext.Context, promotionID int) (err error) {
|
||||
}
|
||||
promotionHandler := getPromotionHander(promotion.Type)
|
||||
if promotionHandler == nil {
|
||||
return errors.New("非法的促销类型")
|
||||
return errors.New("非法的活动类型")
|
||||
}
|
||||
if err = promotionHandler.CancelPromotion(utils.Str2Int64(promotion.VendorPromotionID), ""); err == nil {
|
||||
if _, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
|
||||
|
||||
@@ -45,10 +45,10 @@ type GoodsOrder struct {
|
||||
ModelTimeInfo `json:"-"`
|
||||
OriginalData string `orm:"type(text)" json:"-"`
|
||||
Skus []*OrderSku `orm:"-" json:"-"`
|
||||
SkuPmFee int64 `json:"-"` //门店商品促销总支出
|
||||
OrderPmFee int64 `json:"-"` //门店订单促销支出
|
||||
SkuPmSubsidy int64 `json:"-"` //平台商品促销总补贴
|
||||
OrderPmSubsidy int64 `json:"-"` //平台订单促销补贴
|
||||
SkuPmFee int64 `json:"-"` //门店商品活动总支出
|
||||
OrderPmFee int64 `json:"-"` //门店订单活动支出
|
||||
SkuPmSubsidy int64 `json:"-"` //平台商品活动总补贴
|
||||
OrderPmSubsidy int64 `json:"-"` //平台订单活动补贴
|
||||
BoxFee int64 `json:"-"` //餐盒费
|
||||
PlatformFeeRate int16 `json:"-"` //平台费
|
||||
BillStoreFreightFee int64 `json:"-"` //需要回调,门店所承担的运费
|
||||
@@ -78,7 +78,7 @@ type OrderSku struct {
|
||||
PromotionType int `json:"-"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换
|
||||
OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑
|
||||
SkuPmSubsidy int64 `json:"-"` //平台商品活动补贴
|
||||
SkuPmFee int64 `json:"-"` //门店商品促销支出
|
||||
SkuPmFee int64 `json:"-"` //门店商品活动支出
|
||||
}
|
||||
|
||||
// 同样商品在一个订单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠)
|
||||
|
||||
@@ -14,14 +14,14 @@ type PromotionController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
// @Title 创建促销
|
||||
// @Description 创建促销
|
||||
// @Title 创建活动
|
||||
// @Description 创建活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID formData int true "厂商ID,当前只支持京东:0 "
|
||||
// @Param name formData string true "促销名,必须唯一(所以名子上最好带上日期)"
|
||||
// @Param name formData string true "活动名,必须唯一(所以名子上最好带上日期)"
|
||||
// @Param beginAt formData string true "开始日期"
|
||||
// @Param endAt formData string true "结束日期"
|
||||
// @Param type formData int true "促销类型,3:直降,4:限时抢购"
|
||||
// @Param type formData int true "活动类型,3:直降,4:限时抢购"
|
||||
// @Param storeIDs formData string true "json数据,storeID列表[1,2,3]"
|
||||
// @Param skuPrices formData string true "json数据,价格信息列表"
|
||||
// @Param isAsync formData bool false "是否异步,缺省否(暂时只支持同步)"
|
||||
@@ -34,7 +34,7 @@ type PromotionController struct {
|
||||
func (c *PromotionController) CreatePromotion() {
|
||||
c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) {
|
||||
if params.VendorID != model.VendorIDJD {
|
||||
return nil, "", errors.New("当前只支持创建京东促销")
|
||||
return nil, "", errors.New("当前只支持创建京东活动")
|
||||
}
|
||||
beginAt, err := utils.TryStr2Time(params.BeginAt)
|
||||
if err != nil {
|
||||
@@ -64,7 +64,7 @@ func (c *PromotionController) CreatePromotion() {
|
||||
|
||||
// // @Title 发送文件给门店
|
||||
// // @Description 发送文件给门店,调用GET方法得到浏览器端参考的上传HTML实现,userfiles
|
||||
// // @Param type formData int true "促销类型,3:直降,4:限时抢购"
|
||||
// // @Param type formData int true "活动类型,3:直降,4:限时抢购"
|
||||
// // @Param isAsync formData bool false "是否异常,缺省否(暂时只支持同步)"
|
||||
// // @Success 200 {object} controllers.CallResult
|
||||
// // @Failure 200 {object} controllers.CallResult
|
||||
@@ -94,8 +94,8 @@ func (c *PromotionController) CreatePromotion() {
|
||||
// }
|
||||
// }
|
||||
|
||||
// @Title 创建促销
|
||||
// @Description 创建促销
|
||||
// @Title 根据历史订单信息发送活动消息
|
||||
// @Description 根据历史订单信息发送活动消息
|
||||
// @Param token header string true "认证token"
|
||||
// @Param advertising formData string true "广告语"
|
||||
// @Param days formData int false "多少天以内订单数据中的用户(-1:全部,0:60天,缺省0)"
|
||||
@@ -110,18 +110,18 @@ func (c *PromotionController) SendAdvertingByGoodsOrder() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询促销
|
||||
// @Description 查询促销
|
||||
// @Title 查询活动
|
||||
// @Description 查询活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Param keyword query string false "关键字"
|
||||
// @Param vendorID query int false "厂商ID,当前只支持京东:0 "
|
||||
// @Param promotionID query int false "活动id"
|
||||
// @Param vendorPromotionID query string false "厂商活动id"
|
||||
// @Param days query int false "多少天内创建的,缺省7天"
|
||||
// @Param name query string false "促销名,不完全匹配"
|
||||
// @Param name query string false "活动名,不完全匹配"
|
||||
// @Param beginAt query string false "开始日期,包括"
|
||||
// @Param endAt query string false "结束日期,包括"
|
||||
// @Param type query int false "促销类型,3:直降,4:限时抢购"
|
||||
// @Param type query int false "活动类型,3:直降,4:限时抢购"
|
||||
// @Param storeID query int false "包含门店"
|
||||
// @Param skuID query int false "包含sku"
|
||||
// @Param offset query int false "活动列表起始序号(以0开始,缺省为0)"
|
||||
@@ -136,8 +136,8 @@ func (c *PromotionController) GetPromotions() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 取消促销
|
||||
// @Description 取消促销
|
||||
// @Title 取消活动
|
||||
// @Description 取消活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Param promotionID formData int true "活动id"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
|
||||
Reference in New Issue
Block a user