Sfoglia il codice sorgente

展示推送消息时间

xyxie 6 giorni fa
parent
commit
f564e629a4
2 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. 7 3
      controllers/report_ice_message.go
  2. 3 0
      models/report_message_config.go

+ 7 - 3
controllers/report_ice_message.go

@@ -429,11 +429,12 @@ func (c *ReportIceMessageController) IceMsgPush() {
 		return
 	}
 
-	if successCount > 0 {
+	if successCount >= 0 {
+		sendTime := time.Now()
 		// 更新报告表的推送记录
 		if classifyType == 1 {
 			reportInfo.MsgIsSend = 1
-			reportInfo.MsgSendTime = time.Now()
+			reportInfo.MsgSendTime = sendTime
 			err = reportInfo.Update([]string{"MsgIsSend", "MsgSendTime"})
 			if err != nil {
 				br.Msg = "更新推送记录失败"
@@ -442,7 +443,7 @@ func (c *ReportIceMessageController) IceMsgPush() {
 			}
 		}else if classifyType == 2 {
 			pptInfo.MsgIsSend = 1
-			pptInfo.MsgSendTime = time.Now()
+			pptInfo.MsgSendTime = sendTime
 			err = pptInfo.Update([]string{"MsgIsSend", "MsgSendTime"})
 			if err != nil {
 				br.Msg = "更新推送记录失败"
@@ -453,6 +454,9 @@ func (c *ReportIceMessageController) IceMsgPush() {
 		br.Msg = "推送成功"
 		br.Success = true
 		br.Ret = 200
+		br.Data = &models.ReportIceMsgPushResp{
+			MsgSendTime: sendTime,
+		}
 	}else{
 		br.Msg = "推送失败"
 		br.ErrMsg = "推送失败,Err:" + err.Error()

+ 3 - 0
models/report_message_config.go

@@ -222,6 +222,9 @@ type ReportIceMsgPushReq struct {
 	ReportId   int  `description:"研报ID"`
 	PptId      int  `description:"PPT ID"`
 }
+type ReportIceMsgPushResp struct {
+	MsgSendTime time.Time `description:"消息发送时间"`
+}
 
 func (m *ReportMessageConfig) GetListByClassifyIdList(classifyIdList []int) (list []*ReportMessageConfig, err error) {
 	sql := fmt.Sprintf(`SELECT * FROM %s WHERE classify_id IN (?)`, m.TableName())