1
This commit is contained in:
@@ -1523,7 +1523,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
|
||||
}
|
||||
if vendorID == model.VendorIDDD { //抖店绑定店铺时 检查并补充创建
|
||||
globals.SugarLogger.Debugf("vendorID ==============%d", vendorID)
|
||||
if err2 := tiktok_store.CreateAndBindAllV2(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix), userName); err2 != nil {
|
||||
if err2 := tiktok_store.CreateOrUpdateAll(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix)); err2 != nil {
|
||||
errList.AddErr(err2)
|
||||
}
|
||||
}
|
||||
@@ -5898,9 +5898,89 @@ func UpdateStorePoiStatus(ctx *jxcontext.Context) error {
|
||||
//抖音定时任务
|
||||
//func UpdateStoreRelInformation(ctx *jxcontext.Context) error {
|
||||
// var (
|
||||
// db = dao.GetDB()
|
||||
// storeIDs []string
|
||||
// temp map[int64]string
|
||||
// db = dao.GetDB()
|
||||
// errList = errlist.New()
|
||||
// tempIDs map[string][]string
|
||||
// FreightTemplate = &model.FreightTemplate{}
|
||||
// )
|
||||
//storeList,_:=dao.GetStoreList(db,[]int{model.VendorIDDD},nil,[]int{model.store})
|
||||
// vendorOrgCodes, _ := dao.GetVendorOrgCode(db, model.VendorIDDD, "", "platform")
|
||||
// for _, v := range vendorOrgCodes {
|
||||
// if temp, err = tiktok_store.GetAllVendorStoreMap(ctx, v.VendorOrgCode); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// //tempIDs[v.VendorOrgCode] = temp
|
||||
// }
|
||||
//
|
||||
// if handler, ok := partner.GetPurchasePlatformFromVendorID(model.VendorIDDD).(partner.IStoreHandler); ok {
|
||||
// rootTask := tasksch.NewParallelTask("UpdateStoreRelInformation 根据平台门店ID同步本地相关信息", tasksch.NewParallelConfig().SetParallelCount(1), ctx,
|
||||
// func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
// vendorOrgCodes, _ := dao.GetVendorOrgCode(db, model.VendorIDDD, "", "platform")
|
||||
// for _, v := range vendorOrgCodes {
|
||||
// if temp, err = tiktok_store.GetAllVendorStoreMap(ctx, v.VendorOrgCode); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// //tempIDs[v.VendorOrgCode] = temp
|
||||
// }
|
||||
//
|
||||
// subTask := tasksch.NewSeqTask("UpdateStoreRelInformation 根据平台门店ID同步本地相关信息", ctx,
|
||||
// func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
// switch step {
|
||||
// case 0:
|
||||
// for i, j := range tempIDs {
|
||||
// for _, v := range j {
|
||||
// //(1)仓库以及电子围栏
|
||||
// if bindWarehouse, err := tiktok_store.GetWarehouseByStore(i, utils.Str2Int64(v)); err != nil {
|
||||
// errList.AddErr(fmt.Errorf("同步任务: 获取门店(%s)绑定的仓库以及电子围栏失败:%v", v, err))
|
||||
// } else if len(bindWarehouse[utils.Str2Int64(i)][0].OutFenceIds) > 0 {
|
||||
// tempStr := ""
|
||||
// for k, v := range bindWarehouse[utils.Str2Int64(i)][0].OutFenceIds {
|
||||
// tempStr += v
|
||||
// if k != len(bindWarehouse[utils.Str2Int64(i)][0].OutFenceIds) {
|
||||
// tempStr += ","
|
||||
// }
|
||||
// }
|
||||
// FreightTemplate.FenceID = tempStr
|
||||
// FreightTemplate.WarehouseID = bindWarehouse[utils.Str2Int64(i)][0].WarehouseId
|
||||
// }
|
||||
// //(2)运费模板
|
||||
// if bindFreightIDs, err := tiktok_store.GetStoreFreight(i, utils.Str2Int64(v)); err != nil {
|
||||
// globals.SugarLogger.Debugf("同步任务: 获取门店(%s) 绑定运费模板出错:%v", v, err)
|
||||
// errList.AddErr(fmt.Errorf("同步任务: 获取门店(%s) 绑定运费模板出错:%v", v, err))
|
||||
// } else {
|
||||
// FreightTemplate.TemplateID = bindFreightIDs
|
||||
// }
|
||||
// //(3)限售模板
|
||||
// if bindTradeLimitID, err := tiktok_store.GetStoreSaleLimit(i, utils.Str2Int64(v)); err != nil {
|
||||
// globals.SugarLogger.Debugf("同步任务: 获取门店(%s) 限售模板出错:%v", v, err)
|
||||
// errList.AddErr(fmt.Errorf("同步任务: 获取门店(%s) 限售模板出错:%v", v, err))
|
||||
// } else {
|
||||
// FreightTemplate.TradeLimitID = bindTradeLimitID
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if _, err := dao.UpdateEntity(db, FreightTemplate, "TemplateID", "WarehouseID", "FenceID", "TradeLimitID "); err != nil {
|
||||
// if err1 := dao.CreateEntity(db, FreightTemplate); err != nil {
|
||||
// errList.AddErr(fmt.Errorf("同步进数据库错误信息:%v", err1))
|
||||
// } else {
|
||||
// errList.AddErr(fmt.Errorf("同步进数据库错误信息:%v", err))
|
||||
// }
|
||||
// }
|
||||
// dao.WrapAddIDCULDEntity(FreightTemplate, "同步任务操作")
|
||||
// }
|
||||
// return nil, err
|
||||
// }, 4)
|
||||
// return retVal, err
|
||||
// }, storeIDs)
|
||||
// }
|
||||
//
|
||||
// //task := tasksch.NewSeqTask(fmt.Sprintf("平台:抖店小时达 UpdateStoreRelInformation"), ctx,
|
||||
// // func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
// //
|
||||
// // }, 3)
|
||||
// //tasksch.ManageTask(task).Run()
|
||||
// return nil
|
||||
//}
|
||||
|
||||
@@ -5949,8 +6029,3 @@ func GetVendorOrgCode(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID i
|
||||
}
|
||||
return storeMap, dao.GetEntitiesByKV(db, &storeMap, cond, false)
|
||||
}
|
||||
|
||||
//批量绑定抖店平台门店
|
||||
func BatchBindVendorStore(ctx *jxcontext.Context) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user