Browse Source

测试报告的更新和删除

xyxie 1 week ago
parent
commit
eb719a11df
1 changed files with 4 additions and 2 deletions
  1. 4 2
      services/report_rai.go

+ 4 - 2
services/report_rai.go

@@ -119,6 +119,7 @@ func HandleInsertRaiReport(raiReportId int) (err error) {
 			}
 		}
 		state := reportInfo.State
+
 		// 报告已存在,更新报告
 		if (articleResult.PublishStatus == 2 || articleResult.PublishStatus == 4) && articleResult.IsActive {
 			// 报告状态为未发布,则更新报告
@@ -132,6 +133,7 @@ func HandleInsertRaiReport(raiReportId int) (err error) {
 				return
 			}
 			go UpdateReportEs(reportInfo.Id, 1)
+			return
 		}else {
 			// 报告状态为未发布,则更新报告
 			state = models.ReportStateUnpublished
@@ -153,7 +155,7 @@ func HandleInsertRaiReport(raiReportId int) (err error) {
 		reportInfo.State = state
 		reportInfo.Content = html.EscapeString(articleResult.Content.Body)
 		reportInfo.ContentSub = html.EscapeString(contentSub)
-		updateTime, _ := time.ParseInLocation(utils.FormatDate, articleResult.UpdateDate, time.Local)
+		updateTime, _ := time.ParseInLocation(utils.FormatDateTime, articleResult.UpdateDate, time.Local)
 		reportInfo.ModifyTime = updateTime
 
 		// 报告更新
@@ -215,7 +217,7 @@ func HandleInsertRaiReport(raiReportId int) (err error) {
 			item.Stage = 0
 			item.ContentSub = html.EscapeString(contentSub)
 			item.CreateTime = time.Now().Format(utils.FormatDateTime)
-			updateTime, _ := time.ParseInLocation(utils.FormatDate, articleResult.UpdateDate, time.Local)
+			updateTime, _ := time.ParseInLocation(utils.FormatDateTime, articleResult.UpdateDate, time.Local)
 			item.ModifyTime = updateTime
 			item.ReportVersion = 2
 			item.AdminId = 0