kobe6258 7 months ago
parent
commit
f87919ccd1

+ 3 - 2
domian/report/report_service.go

@@ -622,7 +622,7 @@ func htStatus(status int, isDelete int) reportDao.ReportStatus {
 	if isDelete == 1 || status != ht.Publish {
 		return reportDao.StatusUnPublish
 	}
-	return reportDao.StatusUnPublish
+	return reportDao.StatusPublish
 }
 func SyncHTReportList(list []ht.HTReport) (noRecord bool, err error) {
 	var reports []reportDao.Report
@@ -646,7 +646,8 @@ func SyncHTReportList(list []ht.HTReport) (noRecord bool, err error) {
 					logger.Error("HT获取eta品种id失败:%v", err)
 					coverSrc = 0
 				}
-				ids, err := mediaDao.GetIdsByPermissionId(permissionId)
+				var ids []int
+				ids, err = mediaDao.GetIdsByPermissionId(permissionId)
 				if err != nil {
 					logger.Error("获取图片资源失败:%v", err)
 					coverSrc = 0

+ 1 - 1
task/eta/author/eta_author_task.go

@@ -55,6 +55,6 @@ func convert(author eta.ReportAuthor) financial_analyst.FinancialAnalystDTO {
 	}
 }
 func init() {
-	authorTask := base.NewTask(taskName, cron, new(AuthorTask), base.PROD)
+	authorTask := base.NewTask(taskName, cron, new(AuthorTask), base.DEV)
 	base.RegisterTask(&authorTask)
 }

+ 1 - 1
task/message/notice_task.go

@@ -38,6 +38,6 @@ type NoticeTask struct {
 }
 
 func init() {
-	reportTask := base.NewTask(taskName, cron, new(NoticeTask), base.PROD)
+	reportTask := base.NewTask(taskName, cron, new(NoticeTask), base.DEV)
 	base.RegisterTask(&reportTask)
 }

+ 6 - 6
task/report/report_update_task.go

@@ -60,14 +60,14 @@ func (re *ReportUpdateTask) Execute(taskDetail *base.TaskDetail) error {
 		for i := 0; i < len(htReportList); i++ {
 			key := redis.GenerateReportRefreshKey("HT", htReportList[i].Id, int64(htReportList[i].PublishTime))
 			if rd().SetIfNotExist(key, "processed", 3600) {
-				logger.Info("同步eta报告 ID :%d,修改时间:%v", htReportList[i].Id, int64(htReportList[i].PublishTime))
+				logger.Info("同步HT报告 ID :%d,修改时间:%v", htReportList[i].Id, int64(htReportList[i].PublishTime))
 				filterReportList = append(filterReportList, htReportList[i])
 			} else {
-				logger.Info("过滤ETA重复的消息 ID :%d,修改时间:%v", htReportList[i].Id, int64(htReportList[i].PublishTime))
+				logger.Info("过滤HT重复的消息 ID :%d,修改时间:%v", htReportList[i].Id, int64(htReportList[i].PublishTime))
 			}
 		}
 		if err != nil {
-			logger.Error("获取ETA研报列表失败:%v", err)
+			logger.Error("获取HT研报列表失败:%v", err)
 		}
 		if len(filterReportList) > 0 {
 			for i := 0; i < len(filterReportList); i++ {
@@ -83,7 +83,7 @@ func (re *ReportUpdateTask) Execute(taskDetail *base.TaskDetail) error {
 					var PermissionName string
 					err = getPermissionNameById(plate.Id, &PermissionName)
 					if err != nil {
-						logger.Error("获取ETA研报列表失败:%v", err)
+						logger.Error("获取HT研报列表失败:%v", err)
 						filterReportList[i].PermissionName = ""
 					} else {
 						filterReportList[i].PermissionName = PermissionName
@@ -93,13 +93,13 @@ func (re *ReportUpdateTask) Execute(taskDetail *base.TaskDetail) error {
 			var stop bool
 			stop, err = report.SyncHTReportList(filterReportList)
 			if err != nil {
-				logger.Error("同步ETA研报列表失败:%v", err)
+				logger.Error("同步HT研报列表失败:%v", err)
 			}
 			if stop {
 				logger.Info(contants.TaskFormat, "同步HT研报库结束")
 			}
 		} else {
-			logger.Info(contants.TaskFormat, "同步ETA研报库结束")
+			logger.Info(contants.TaskFormat, "同步HT研报库结束")
 		}
 	}()
 	wg.Wait()