This commit is contained in:
邹宗楠
2023-08-04 14:19:15 +08:00
parent 1ab610a281
commit a9b60adfb1

View File

@@ -281,20 +281,29 @@ func Init() {
// }, []string{"13:00:00"})
//}
globals.SugarLogger.Debugf("===============1")
if beego.BConfig.RunMode != "jxgy" {
ScheduleTimerFunc("RefreshSyncSkuListTao", func() {
globals.SugarLogger.Debugf("===============2")
syncStoreSkuTao()
}, []string{
"14:12:00",
"14:15:00",
"14:17:00",
"14:19:00",
"14:21:00",
"14:23:00",
"14:25:00",
"14:28:00",
"16:25:00",
"18:25:00",
"19:25:00",
"20:25:00",
"21:25:00",
"22:25:00",
"23:25:00",
"00:25:00",
"01:25:00",
"02:25:00",
"03:25:00",
"04:25:00",
"05:25:00",
"06:25:00",
"07:25:00",
"08:25:00",
"10:25:00",
"12:25:00",
})
}
@@ -886,25 +895,21 @@ var beijin = []int{
// syncStoreSkuTao 同步商品到淘鲜达
func syncStoreSkuTao() {
//syncFlag := 0
globals.SugarLogger.Debugf("=====================================3 %s", utils.Format4Output(beijin, false))
syncFlag := 0
task := tasksch.NewParallelTask("syncStoreSkuTao ", nil, jxcontext.AdminCtx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)
errList := errlist.New()
//db := dao.GetDB()
db := dao.GetDB()
switch step {
case 0:
fmt.Println("111111111111111111111111111")
if err := ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "淘鲜达消息:", utils.Format4Output(beijin[syncLen:syncLen+5], false)); err != nil {
globals.SugarLogger.Debugf("SendUserMessage := %s", utils.Format4Output(err, false))
}
enterprise_msg.SendUserMessage("18981810340", "淘鲜达同步消息", utils.Format4Output(beijin[syncLen:syncLen+5], false), utils.Format4Output(beijin[syncLen:syncLen+5], false))
//globals.SugarLogger.Debugf("===============4")
//_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, []int{model.VendorIDTaoVegetable}, beijin[syncLen:syncLen+5], false, nil, nil, syncFlag, true, true)
//errList.AddErr(err)
_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, []int{model.VendorIDTaoVegetable}, beijin[syncLen:syncLen+5], false, nil, nil, syncFlag, true, true)
errList.AddErr(err)
case 1:
fmt.Println("222222222222222222222222")
errList.AddErr(err)
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
}