Browse Source

增加错误报警机制

xyxie 9 months ago
parent
commit
8022f98620
1 changed files with 13 additions and 1 deletions
  1. 13 1
      services/data/edb_info_relation.go

+ 13 - 1
services/data/edb_info_relation.go

@@ -165,7 +165,12 @@ func SaveSandBoxEdbInfoRelation(sandBoxId int, sandBoxContent string) (err error
 
 // SaveCalendarEdbInfoRelation 添加/编辑 事件日历指标引用
 func SaveCalendarEdbInfoRelation(chartPermissionId int, matterDate string, editMatters, removeMatters []*fe_calendar.FeCalendarMatter) (err error) {
-
+	defer func() {
+		if err != nil {
+			err = fmt.Errorf("添加/编辑 事件日历指标引用失败,%s", err.Error())
+			go alarm_msg.SendAlarmMsg(err.Error(), 3)
+		}
+	}()
 	//整理相关的事件ID
 	matterIds := make([]int, 0)
 	updateMatterMap := make(map[int]*fe_calendar.FeCalendarMatter)
@@ -283,6 +288,7 @@ func SaveCalendarEdbInfoRelation(chartPermissionId int, matterDate string, editM
 				EdbCode:            edbInfo.EdbCode,
 				CreateTime:         nowTime,
 				ModifyTime:         nowTime,
+				RelationTime:       matter.CreateTime,
 			}
 			tmp.RelationCode = fmt.Sprintf("%d_%d_%d_%d", tmp.EdbInfoId, tmp.ReferObjectId, tmp.ReferObjectType, tmp.ReferObjectSubType)
 			addList = append(addList, tmp)
@@ -540,6 +546,12 @@ func getCalculateEdbInfoByEdbInfoId(allEdbMappingMap map[int][]*data_manage.EdbI
 
 // SaveExcelEdbInfoRelation 添加/编辑表格时同步修改指标引用关联记录
 func SaveExcelEdbInfoRelation(excelInfoId, source int, addChildExcel bool) (err error) {
+	defer func() {
+		if err != nil {
+			err = fmt.Errorf("添加/编辑表格时同步修改指标引用关联记录失败,%s", err.Error())
+			go alarm_msg.SendAlarmMsg(err.Error(), 3)
+		}
+	}()
 	//查询和指标相关的时间序列表格和混合表格
 	if !utils.InArrayByInt([]int{utils.TIME_TABLE, utils.MIXED_TABLE, utils.BALANCE_TABLE}, source) {
 		return