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

This commit is contained in:
苏尹岚
2020-01-08 10:03:19 +08:00
6 changed files with 18 additions and 11 deletions

View File

@@ -2974,6 +2974,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuIDs []int, isAsync, isContin
} }
} }
skuBindInfo := &StoreSkuBindInfo{ skuBindInfo := &StoreSkuBindInfo{
StoreID: store.ID,
NameID: k, NameID: k,
UnitPrice: price, UnitPrice: price,
IsFocus: 1, IsFocus: 1,
@@ -2994,7 +2995,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuIDs []int, isAsync, isContin
case 2: case 2:
for _, v := range result1 { for _, v := range result1 {
tUpdate := v.(*tUpdateStoresSkus) tUpdate := v.(*tUpdateStoresSkus)
UpdateStoresSkus(ctx, []int{tUpdate.StoreID}, tUpdate.SkuBindInfos, false, isAsync, isContinueWhenError) UpdateStoresSkusByBind(ctx, tUpdate.SkuBindInfos, isAsync, isContinueWhenError)
} }
} }
return result, err return result, err

View File

@@ -1,9 +1,11 @@
package event package event
func AddOperateEvent() { import "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
func AddOperateEvent(ctx *jxcontext.Context) {
} }
func AddOperateEventDetail() { func AddOperateEventDetail(ctx *jxcontext.Context) {
} }

View File

@@ -65,6 +65,9 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
var priceReferSnapshotList []*model.PriceReferSnapshot var priceReferSnapshotList []*model.PriceReferSnapshot
db := dao.GetDB() db := dao.GetDB()
snapshotAt := utils.Time2Date(time.Now().AddDate(0, 0, -1)) snapshotAt := utils.Time2Date(time.Now().AddDate(0, 0, -1))
dao.DeletePriceReferHistory(db, utils.Time2Date(snapshotAt.AddDate(0, 0, -7)))
priceReferSnapshotDelete := &model.PriceReferSnapshot{SnapshotAt: snapshotAt}
dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt")
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
switch step { switch step {
case 0: case 0:
@@ -79,9 +82,6 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
} }
} }
}() }()
dao.DeletePriceReferHistory(db, utils.Time2Date(snapshotAt.AddDate(0, 0, -7)))
priceReferSnapshotDelete := &model.PriceReferSnapshot{SnapshotAt: snapshotAt}
dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt")
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
v := batchItemList[0].(*model.PriceReferSnapshot) v := batchItemList[0].(*model.PriceReferSnapshot)
dao.WrapAddIDCULDEntity(v, ctx.GetUserName()) dao.WrapAddIDCULDEntity(v, ctx.GetUserName())

View File

@@ -1096,6 +1096,7 @@ func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs, statuss []int, vendorOrd
} else if IsReverse == 1 { } else if IsReverse == 1 {
sql += " AND link_id <> 0" sql += " AND link_id <> 0"
} }
sql += " ORDER BY supplement_time DESC"
sql += " LIMIT ? OFFSET ?" sql += " LIMIT ? OFFSET ?"
sqlParams = append(sqlParams, pageSize, offset) sqlParams = append(sqlParams, pageSize, offset)
Begin(db) Begin(db)

View File

@@ -475,6 +475,7 @@ type PriceReferSnapshot struct {
func (*PriceReferSnapshot) TableUnique() [][]string { func (*PriceReferSnapshot) TableUnique() [][]string {
return [][]string{ return [][]string{
[]string{"CityCode", "SkuID", "SnapshotAt"},
[]string{"CityCode", "NameID", "SkuID", "SnapshotAt"}, []string{"CityCode", "NameID", "SkuID", "SnapshotAt"},
} }
} }

View File

@@ -76,6 +76,7 @@ func (c *ActController) PreCreateAct() {
// @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的整数"
@@ -94,11 +95,12 @@ func (c *ActController) CreateAct() {
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,