This commit is contained in:
邹宗楠
2023-04-20 16:07:25 +08:00
parent 0d27dbe771
commit 3f6ab1bd91
5 changed files with 31 additions and 35 deletions

View File

@@ -99,7 +99,6 @@ func AutoSettingFakeDelivery() {
if len(orderList) == model.NO {
return
}
globals.SugarLogger.Debugf("==================orderList=:%s", utils.Format4Output(orderList, false))
for _, v := range orderList {
//jxutils.CallMsgHandler(func() {

View File

@@ -2036,30 +2036,30 @@ func RrefreshMtwmVendorAct(ctx *jxcontext.Context) (err error) {
// 查询门店爆款商品,当门店存在爆款时,取消之前的力荐商品,将新的爆款设置为力荐商品
// 商品为手动设置力荐或者爆款活动在取消力荐之前被删除,那么无法取消被力荐的商品!
if k == mtwmapi.RetailActTypeSecKill && len(actList) > 0 && storeMap.VendorID == model.VendorIDMTWM {
allActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
activationActivitySkuIdList := make([]*partner.StoreSkuInfo, 0, 0) // 此门店正在进行的折扣(爆款)活动商品
loseActivitySkuIdList := make([]*partner.StoreSkuInfo, 0, 0) // 此门店已经结束的折扣(爆款)活动商品
for _, ac := range actList {
allActivitySkuIdList = append(allActivitySkuIdList, utils.Int64ToStr(ac.ItemID))
// 已经生效的爆款活动
if ac.Status == 1 && ac.SkuId != "" {
activationActivitySkuIdList = append(activationActivitySkuIdList, &partner.StoreSkuInfo{
SkuID: utils.Str2Int(ac.SkuId),
IsSpecialty: 1,
})
}
// 已经失效的爆款活动
if ac.Status == 0 && ac.SkuId != "" {
loseActivitySkuIdList = append(loseActivitySkuIdList, &partner.StoreSkuInfo{
SkuID: utils.Str2Int(ac.SkuId),
IsSpecialty: 0,
})
}
}
// 取消当前力荐商品
partner.GetPurchasePlatformFromVendorID(storeMap.VendorID).(partner.ISingleStoreStoreSkuHandler).UpdateStoreSkusSpecTag(ctx, storeMap.VendorOrgCode, storeMap.StoreID, storeMap.VendorStoreID, loseActivitySkuIdList)
// 重新推荐力荐商品
partner.GetPurchasePlatformFromVendorID(storeMap.VendorID).(partner.ISingleStoreStoreSkuHandler).UpdateStoreSkusSpecTag(ctx, storeMap.VendorOrgCode, storeMap.StoreID, storeMap.VendorStoreID, activationActivitySkuIdList)
//allActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
//activationActivitySkuIdList := make([]*partner.StoreSkuInfo, 0, 0) // 此门店正在进行的折扣(爆款)活动商品
//loseActivitySkuIdList := make([]*partner.StoreSkuInfo, 0, 0) // 此门店已经结束的折扣(爆款)活动商品
//for _, ac := range actList {
// allActivitySkuIdList = append(allActivitySkuIdList, utils.Int64ToStr(ac.ItemID))
// // 已经生效的爆款活动
// if ac.Status == 1 && ac.SkuId != "" {
// activationActivitySkuIdList = append(activationActivitySkuIdList, &partner.StoreSkuInfo{
// SkuID: utils.Str2Int(ac.SkuId),
// IsSpecialty: 1,
// })
// }
// // 已经失效的爆款活动
// if ac.Status == 0 && ac.SkuId != "" {
// loseActivitySkuIdList = append(loseActivitySkuIdList, &partner.StoreSkuInfo{
// SkuID: utils.Str2Int(ac.SkuId),
// IsSpecialty: 0,
// })
// }
//}
//// 取消当前力荐商品
//partner.GetPurchasePlatformFromVendorID(storeMap.VendorID).(partner.ISingleStoreStoreSkuHandler).UpdateStoreSkusSpecTag(ctx, storeMap.VendorOrgCode, storeMap.StoreID, storeMap.VendorStoreID, loseActivitySkuIdList)
//// 重新推荐力荐商品
//partner.GetPurchasePlatformFromVendorID(storeMap.VendorID).(partner.ISingleStoreStoreSkuHandler).UpdateStoreSkusSpecTag(ctx, storeMap.VendorOrgCode, storeMap.StoreID, storeMap.VendorStoreID, activationActivitySkuIdList)
}
}
return retVal, err

View File

@@ -203,7 +203,6 @@ func SyncSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs []int,
}
if err == nil && len(skuList) > 0 {
// todo 按vendorID orgCode合并操作SyncSkus=============
task := tasksch.NewParallelTask(
fmt.Sprintf("同步商品:%v,%v", nameIDs, skuIDs),
tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, cc, skuList)

View File

@@ -15,24 +15,24 @@ import (
)
// CopyOnStoreSkuToOther 将一个美团门店分类和商品复制到另一个门店
func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromStoreId, toStoreId int, isAsync bool) (hint string, err error) {
func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId int, isAsync bool) (hint string, err error) {
var (
db = dao.GetDB()
)
// 门店api加载
fromStore, err := dao.GetStoreDetail(db, fromStoreId, model.VendorIDMTWM, "")
// fromStore, err := dao.GetStoreDetail(db, fromStoreId, model.VendorIDMTWM, "")
if err != nil {
return "", err
}
toStore, err := dao.GetStoreDetail(db, fromStoreId, model.VendorIDMTWM, "")
toStore, err := dao.GetStoreDetail(db, toStoreId, model.VendorIDMTWM, "")
if err != nil {
return "", err
}
fromApi := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, fromStore.VendorOrgCode).(*mtwmapi.API)
//fromApi := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, toStore.VendorOrgCode).(*mtwmapi.API)
toApi := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, toStore.VendorOrgCode).(*mtwmapi.API)
taskName := fmt.Sprintf("将平台门店[%d],分类和商品复制到[%d]", fromStoreId, toStoreId)
taskName := fmt.Sprintf("将平台门店[%d],分类和商品复制到[%d]", fromVendorStoreId, toStoreId)
config := tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(false)
work := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)
@@ -45,7 +45,7 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromStoreId, toStoreId int, i
}
case 2:
// 同步分类
fromCategoryList, err := fromApi.RetailCatList(fromStore.VendorStoreID)
fromCategoryList, err := toApi.RetailCatList(utils.Int2Str(fromVendorStoreId))
if err != nil {
return nil, err
}
@@ -72,7 +72,7 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromStoreId, toStoreId int, i
case 3:
// 同步商品
fromFoodList, err1 := fromApi.RetailListAll(fromStore.VendorStoreID)
fromFoodList, err1 := toApi.RetailListAll(utils.Int2Str(fromVendorStoreId))
if err1 != nil {
return nil, err1
}

View File

@@ -288,7 +288,6 @@ func UpdateFakeWayBillToTiktok() {
if fakeWayBill[i].StatusTime.After(time.Now()) {
continue
}
globals.SugarLogger.Debugf("========fakeWayBill=====:%s", utils.Format4Output(fakeWayBill, false))
riderInfo := &mtpsapi.RiderInfo{
OrderId: fakeWayBill[i].VendorOrderID,
@@ -308,7 +307,6 @@ func UpdateFakeWayBillToTiktok() {
// 推送骑手信息
paramsMap := utils.Struct2Map(riderInfo, "", true)
handler := partner.GetPurchaseOrderHandlerFromVendorID(fakeWayBill[i].OrderVendorID)
globals.SugarLogger.Debugf("================handeler:%s", utils.Format4Output(handler == nil, false))
if handler != nil {
if err := handler.GetOrderRider(fakeWayBill[i].VendorOrgCode, "", paramsMap); err != nil {
globals.SugarLogger.Errorf("Fake Pull Rider Info Err :%s--%s--%v", riderInfo.OrderId, riderInfo.ThirdCarrierOrderId, err)