Browse Source

Merge branch 'feature/eta2.5.9_inspection_stat' into debug

xyxie 4 days ago
parent
commit
1aeacd3c8c
2 changed files with 10 additions and 0 deletions
  1. 9 0
      services/edb_inspection.go
  2. 1 0
      utils/constants.go

+ 9 - 0
services/edb_inspection.go

@@ -274,6 +274,15 @@ func AddEdbInspectionRecord(cont context.Context) (err error) {
 					errMsgList = append(errMsgList, fmt.Sprintf("添加消息记录失败: recordId=%d, adminId=%d, edb_code=%s, err=%v", 
 						record.InspectionRecordId, adminId, edbInfo.EdbCode, err))
 					continue
+				}else {
+					// 发送消息
+					cacheKey := fmt.Sprintf("%s%d", utils.CACHE_EDB_INSPECTION_MESSAGE, adminId)
+					err := utils.Rc.LPush(cacheKey, message)
+					if err != nil {
+						errMsgList = append(errMsgList, fmt.Sprintf("添加巡检消息通知失败: recordId=%d, adminId=%d, edb_code=%s, err=%v", 
+							record.InspectionRecordId, adminId, edbInfo.EdbCode, err))
+						continue
+					}
 				}
 			}
 		}

+ 1 - 0
utils/constants.go

@@ -158,6 +158,7 @@ const (
 const (
 	CACHE_CREATE_REPORT_IMGPDF_QUEUE = "eta_report:report_img_pdf_queue" // 生成报告长图PDF队列
 	CACHE_ETA_REPORT_KNOWLEDGE       = "eta:report:knowledge:op:"        //eta报告入知识库处理
+	CACHE_EDB_INSPECTION_MESSAGE            = "eta:edb:inspection:message:"          //巡检消息队列
 )
 
 // 商户号