|
@@ -449,6 +449,7 @@ func (this *CorrelationChartClassifyController) DeleteChartClassify() {
|
|
|
}
|
|
|
}
|
|
|
resp := new(data_manage.AddChartInfoResp)
|
|
|
+
|
|
|
//删除图表
|
|
|
if req.ChartInfoId > 0 {
|
|
|
chartInfo, err := data_manage.GetChartInfoById(req.ChartInfoId)
|
|
@@ -492,13 +493,23 @@ func (this *CorrelationChartClassifyController) DeleteChartClassify() {
|
|
|
}
|
|
|
|
|
|
source := chartInfo.Source // 相关性图表(滚动相关性)
|
|
|
- //删除图表及关联指标
|
|
|
+
|
|
|
+ // 删除图表及关联指标
|
|
|
err = data_manage.DeleteChartInfoAndData(chartInfo.ChartInfoId)
|
|
|
if err != nil {
|
|
|
br.Msg = "删除失败"
|
|
|
br.ErrMsg = "删除失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ // 删除图表关联
|
|
|
+ e = correlationServ.RemoveCorrelationRelate(chartInfo.ChartInfoId)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "删除失败"
|
|
|
+ br.ErrMsg = fmt.Sprintf("删除相关性图表关联失败, %v", e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//删除ES
|
|
|
{
|
|
|
go data.EsDeleteChartInfo(chartInfo.ChartInfoId)
|
|
@@ -532,8 +543,8 @@ func (this *CorrelationChartClassifyController) DeleteChartClassify() {
|
|
|
condition += " AND level=1 "
|
|
|
//pars = append(pars, chartInfo.ChartClassifyId)
|
|
|
|
|
|
- condition += " AND chart_classify_id>? ORDER BY chart_classify_id ASC LIMIT 1 "
|
|
|
- pars = append(pars, chartInfo.ChartClassifyId)
|
|
|
+ condition += " AND chart_classify_id > ? AND source = ? ORDER BY chart_classify_id ASC LIMIT 1 "
|
|
|
+ pars = append(pars, chartInfo.ChartClassifyId, source)
|
|
|
|
|
|
classifyItem, err := data_manage.GetChartClassifyByCondition(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -555,14 +566,6 @@ func (this *CorrelationChartClassifyController) DeleteChartClassify() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 删除图表关联
|
|
|
- e = correlationServ.RemoveCorrelationRelate(chartInfo.ChartInfoId)
|
|
|
- if e != nil {
|
|
|
- br.Msg = "删除失败"
|
|
|
- br.ErrMsg = fmt.Sprintf("删除相关性图表关联失败, %v", e)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
//新增操作日志
|
|
|
{
|
|
|
chartLog := new(data_manage.ChartInfoLog)
|