|
@@ -681,7 +681,7 @@ func (this *ChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
err = nil
|
|
|
var isAdd bool
|
|
|
var chartInfoId int
|
|
|
- if multipleGraphConfigChartMapping == nil {
|
|
|
+ if multipleGraphConfigChartMapping == nil || multipleGraphConfigChartMapping.Id <= 0 {
|
|
|
isAdd = true
|
|
|
} else {
|
|
|
chartInfo, err := data_manage.GetChartInfoById(multipleGraphConfigChartMapping.ChartInfoId)
|
|
@@ -691,7 +691,7 @@ func (this *ChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
return
|
|
|
}
|
|
|
// 说明图还在,没有被删除
|
|
|
- if chartInfo != nil {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 {
|
|
|
chartInfoId = multipleGraphConfigChartMapping.ChartInfoId
|
|
|
req.ChartName = chartInfo.ChartName
|
|
|
req.ClassifyId = chartInfo.ChartClassifyId
|
|
@@ -1014,7 +1014,7 @@ func CopyMultipleGraphConfigSaveChart(req request.SaveMultipleGraphChartReq, thi
|
|
|
}
|
|
|
|
|
|
multipleGraphConfigChartMapping, err := data_manage.GetMultipleGraphConfigChartMappingByIdAndSource(req.MultipleGraphConfigId, req.Source)
|
|
|
- if err != nil && !utils.IsErrNoRow(err) {
|
|
|
+ if err != nil {
|
|
|
br.Msg = `保存失败`
|
|
|
br.ErrMsg = "获取配置与图表的关联关系失败,ERR:" + err.Error()
|
|
|
return
|
|
@@ -1022,13 +1022,18 @@ func CopyMultipleGraphConfigSaveChart(req request.SaveMultipleGraphChartReq, thi
|
|
|
|
|
|
// 原图
|
|
|
oldChartInfo, err := data_manage.GetChartInfoById(multipleGraphConfigChartMapping.ChartInfoId)
|
|
|
- if err != nil && !utils.IsErrNoRow(err) {
|
|
|
- br.Msg = `保存失败`
|
|
|
- br.ErrMsg = "获取图表信息失败,ERR:" + err.Error()
|
|
|
+ if err != nil {
|
|
|
+ if !utils.IsErrNoRow(err) {
|
|
|
+ br.Msg = `保存失败`
|
|
|
+ br.ErrMsg = "获取图表信息失败,ERR:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "原图不存在"
|
|
|
+ br.IsSendEmail = false
|
|
|
return
|
|
|
}
|
|
|
// 说明图还在,没有被删除
|
|
|
- if oldChartInfo == nil {
|
|
|
+ if oldChartInfo == nil || oldChartInfo.ChartInfoId <= 0 {
|
|
|
br.Msg = "原图不存在"
|
|
|
br.IsSendEmail = false
|
|
|
}
|
|
@@ -1279,7 +1284,7 @@ func (this *ChartInfoController) MultipleGraphConfigSaveEdb() {
|
|
|
err = nil
|
|
|
var isAdd bool
|
|
|
var edbInfoId int
|
|
|
- if multipleGraphConfigEdbMapping == nil {
|
|
|
+ if multipleGraphConfigEdbMapping == nil || multipleGraphConfigEdbMapping.MultipleGraphConfigId <= 0 {
|
|
|
isAdd = true
|
|
|
} else {
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(multipleGraphConfigEdbMapping.EdbInfoId)
|
|
@@ -1289,7 +1294,7 @@ func (this *ChartInfoController) MultipleGraphConfigSaveEdb() {
|
|
|
return
|
|
|
}
|
|
|
// 说明指标还在,没有被删除
|
|
|
- if edbInfo != nil && !req.IsSaveAs {
|
|
|
+ if edbInfo != nil && edbInfo.EdbInfoId > 0 && !req.IsSaveAs {
|
|
|
edbInfoId = multipleGraphConfigEdbMapping.EdbInfoId
|
|
|
req.EdbName = edbInfo.EdbName
|
|
|
req.ClassifyId = edbInfo.ClassifyId
|