aa
This commit is contained in:
@@ -982,6 +982,20 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if len(actMap) == 0 {
|
||||||
|
//
|
||||||
|
// return 0, fmt.Errorf("活动%d不存在或已被取消", actID)
|
||||||
|
//}
|
||||||
|
//errList := errlist.New()
|
||||||
|
//for vendorID, act := range actMap {
|
||||||
|
// if vendorID == model.VendorIDEBAI && act.CreateType != model.ActCreateTypeAPI {
|
||||||
|
// errList.AddErr(fmt.Errorf("饿百平台不支持修改或取消网页活动"))
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//if errList.GetErrListAsOne() != nil {
|
||||||
|
// return 0, errList.GetErrListAsOne()
|
||||||
|
//}
|
||||||
|
|
||||||
actStoreSkuMap, err := dao.GetActStoreSkuVendorInfo(db, actID, nil, nil, nil)
|
actStoreSkuMap, err := dao.GetActStoreSkuVendorInfo(db, actID, nil, nil, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -2095,3 +2109,7 @@ func GetActMtwmVendor(ctx *jxcontext.Context, storeIDs, skuIDs []int, keyword, b
|
|||||||
func GetActMtwmVendorSku(ctx *jxcontext.Context, storeID int, keyword string, actType, offset, pageSize int) (page *model.PagedInfo, err error) {
|
func GetActMtwmVendorSku(ctx *jxcontext.Context, storeID int, keyword string, actType, offset, pageSize int) (page *model.PagedInfo, err error) {
|
||||||
return dao.GetActMtwmVendorSkuPage(dao.GetDB(), storeID, keyword, actType, offset, pageSize)
|
return dao.GetActMtwmVendorSkuPage(dao.GetDB(), storeID, keyword, actType, offset, pageSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DeleteActStoreSkuVendor(ctx *jxcontext.Context, db *dao.DaoDB, actStoreSkuParam []*ActStoreSkuParam) (err error) {
|
||||||
|
return fmt.Errorf("暂不支持直接取消平台活动,开发中……")
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package act
|
package act
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/testinit"
|
"git.rosy.net.cn/jx-callback/globals/testinit"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
|
||||||
@@ -67,50 +64,50 @@ func TestCreateActOnAlpha(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateActOnDev(t *testing.T) {
|
func TestCreateActOnDev(t *testing.T) {
|
||||||
actStoreSkuList := []*ActStoreSkuParam{
|
//actStoreSkuList := []*ActStoreSkuParam{
|
||||||
&ActStoreSkuParam{
|
// &ActStoreSkuParam{
|
||||||
ActStoreSku: model.ActStoreSku{
|
// ActStoreSku: model.ActStoreSku{
|
||||||
StoreID: 100884,
|
// StoreID: 100884,
|
||||||
SkuID: 22716,
|
// SkuID: 22716,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
&ActStoreSkuParam{
|
// &ActStoreSkuParam{
|
||||||
ActStoreSku: model.ActStoreSku{
|
// ActStoreSku: model.ActStoreSku{
|
||||||
StoreID: 100884,
|
// StoreID: 100884,
|
||||||
SkuID: 22717,
|
// SkuID: 22717,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
&ActStoreSkuParam{
|
// &ActStoreSkuParam{
|
||||||
ActStoreSku: model.ActStoreSku{
|
// ActStoreSku: model.ActStoreSku{
|
||||||
StoreID: 100920,
|
// StoreID: 100920,
|
||||||
SkuID: 22714,
|
// SkuID: 22714,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
&ActStoreSkuParam{
|
// &ActStoreSkuParam{
|
||||||
ActStoreSku: model.ActStoreSku{
|
// ActStoreSku: model.ActStoreSku{
|
||||||
StoreID: 100920,
|
// StoreID: 100920,
|
||||||
SkuID: 22715,
|
// SkuID: 22715,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
// &ActStoreSkuParam{
|
// // &ActStoreSkuParam{
|
||||||
// ActStoreSku: model.ActStoreSku{
|
// // ActStoreSku: model.ActStoreSku{
|
||||||
// StoreID: 100119,
|
// // StoreID: 100119,
|
||||||
// SkuID: 26595,
|
// // SkuID: 26595,
|
||||||
// },
|
// // },
|
||||||
// },
|
// // },
|
||||||
}
|
//}
|
||||||
// t.Log(utils.Format4Output(actStoreSkuList, true))
|
// t.Log(utils.Format4Output(actStoreSkuList, true))
|
||||||
actID, err := CreateAct(jxcontext.AdminCtx, &model.Act{
|
//actID, err := CreateAct(jxcontext.AdminCtx, &model.Act{
|
||||||
Name: "测试活动",
|
// Name: "测试活动",
|
||||||
PricePercentage: 80,
|
// PricePercentage: 80,
|
||||||
Type: model.ActSkuDirectDown,
|
// Type: model.ActSkuDirectDown,
|
||||||
BeginAt: time.Now().Add(-24 * time.Hour),
|
// BeginAt: time.Now().Add(-24 * time.Hour),
|
||||||
EndAt: time.Now().Add(10 * 24 * time.Hour),
|
// EndAt: time.Now().Add(10 * 24 * time.Hour),
|
||||||
}, []int{model.VendorIDJD, model.VendorIDMTWM /*, model.VendorIDEBAI*/}, nil, actStoreSkuList, false)
|
//}, []int{model.VendorIDJD, model.VendorIDMTWM /*, model.VendorIDEBAI*/}, nil, actStoreSkuList, false)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
t.Fatal(err)
|
// t.Fatal(err)
|
||||||
}
|
//}
|
||||||
globals.SugarLogger.Debug(actID)
|
//globals.SugarLogger.Debug(actID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCancelAct(t *testing.T) {
|
func TestCancelAct(t *testing.T) {
|
||||||
@@ -192,18 +189,18 @@ func TestSyncAct(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestForceUpdateVendorPrice(t *testing.T) {
|
func TestForceUpdateVendorPrice(t *testing.T) {
|
||||||
hint, err := ForceUpdateVendorPrice(jxcontext.AdminCtx, model.VendorIDJD, model.ActSkuDirectDown, []*ActStoreSkuParam{
|
//hint, err := ForceUpdateVendorPrice(jxcontext.AdminCtx, model.VendorIDJD, model.ActSkuDirectDown, []*ActStoreSkuParam{
|
||||||
&ActStoreSkuParam{
|
// &ActStoreSkuParam{
|
||||||
ActStoreSku: model.ActStoreSku{
|
// ActStoreSku: model.ActStoreSku{
|
||||||
StoreID: 100118,
|
// StoreID: 100118,
|
||||||
SkuID: 22509,
|
// SkuID: 22509,
|
||||||
ActPrice: 9900,
|
// ActPrice: 9900,
|
||||||
},
|
// },
|
||||||
VendorPrice: 19900,
|
// VendorPrice: 19900,
|
||||||
},
|
// },
|
||||||
}, false)
|
//}, false)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
t.Fatal(err)
|
// t.Fatal(err)
|
||||||
}
|
//}
|
||||||
t.Log(hint)
|
//t.Log(hint)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,6 +246,9 @@ func (c *PurchaseHandler) RefundOrder(ctx *jxcontext.Context, order *model.Goods
|
|||||||
// 发起部分退款
|
// 发起部分退款
|
||||||
func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.GoodsOrder, refundSkuList []*model.OrderSku, reason string) (err error) {
|
func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.GoodsOrder, refundSkuList []*model.OrderSku, reason string) (err error) {
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
|
if order.Status > model.OrderStatusEndBegin {
|
||||||
|
return fmt.Errorf("饿百暂不支持售后退款!")
|
||||||
|
}
|
||||||
err = api.EbaiAPI.OrderPartRefund(order.VendorOrderID, orderSkus2AfsSkus(refundSkuList))
|
err = api.EbaiAPI.OrderPartRefund(order.VendorOrderID, orderSkus2AfsSkus(refundSkuList))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -288,8 +288,13 @@ func (c *ActController) UpdateActStoreSkuBind() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(actStoreSkuDeleteList) > 0 {
|
if len(actStoreSkuDeleteList) > 0 {
|
||||||
if _, err = act.DeleteActStoreSkuBind(params.Ctx, db, params.ActID, actStoreSkuDeleteList); err != nil {
|
//可能是平台直接创建的活动,尝试直接取消一下
|
||||||
return
|
if params.ActID < 1000 {
|
||||||
|
act.DeleteActStoreSkuVendor(params.Ctx, db, actStoreSkuDeleteList)
|
||||||
|
} else {
|
||||||
|
if _, err = act.DeleteActStoreSkuBind(params.Ctx, db, params.ActID, actStoreSkuDeleteList); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user