|
@@ -1435,40 +1435,44 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
|
|
|
return
|
|
|
}
|
|
|
for i := range markerLines {
|
|
|
-
|
|
|
-
|
|
|
- edbInfo, err := data_manage.GetEdbInfoById(markerLines[i].EdbInfoId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "指标计算标识线获取指标信息异常"
|
|
|
- br.ErrMsg = "指标计算标识线获取指标信息异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- dataList, err := data_manage.GetEdbDataList(edbInfo.Source, edbInfo.SubSource, edbInfo.EdbInfoId, markerLines[i].StartDate.Date, markerLines[i].EndDate.Date)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "指标计算标识线获取指标数据异常"
|
|
|
- br.ErrMsg = "指标计算标识线获取指标数据异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- value, err := data.MarkerLineCalculate(markerLines[i], dataList, chartInfo)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "标识线配置异常"
|
|
|
- br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
- return
|
|
|
+ if markerLines[i].EdbType == 0 && markerLines[i].TimeIntervalType == 0 {
|
|
|
+
|
|
|
+ if edbList[0].IsAxis == 1 {
|
|
|
+ value, err := data.MarkerLineCalculate(markerLines[i], edbList[0].DataList, chartInfo)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "标识线配置异常"
|
|
|
+ br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ markerLines[i].Value = value
|
|
|
+ } else {
|
|
|
+
|
|
|
+ edbInfo, err := data_manage.GetEdbInfoById(markerLines[i].EdbInfoId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "指标计算标识线获取指标信息异常"
|
|
|
+ br.ErrMsg = "指标计算标识线获取指标信息异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if markerLines[i].TimeIntervalType != 0 {
|
|
|
+ startDate = markerLines[i].StartDate.Date
|
|
|
+ endDate = markerLines[i].EndDate.Date
|
|
|
+ }
|
|
|
+ dataList, err := data_manage.GetEdbDataList(edbInfo.Source, edbInfo.SubSource, edbInfo.EdbInfoId, startDate, endDate)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "指标计算标识线获取指标数据异常"
|
|
|
+ br.ErrMsg = "指标计算标识线获取指标数据异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ value, err := data.MarkerLineCalculate(markerLines[i], dataList, chartInfo)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "标识线配置异常"
|
|
|
+ br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ markerLines[i].Value = value
|
|
|
}
|
|
|
- markerLines[i].Value = value
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
markerLineStr, err := json.Marshal(markerLines)
|
|
@@ -3412,30 +3416,8 @@ func (this *ChartInfoController) PreviewBarChartInfo() {
|
|
|
return
|
|
|
}
|
|
|
for i := range markerLines {
|
|
|
- if markerLines[i].EdbType == 1 {
|
|
|
-
|
|
|
- edbInfo, err := data_manage.GetEdbInfoById(markerLines[i].EdbInfoId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "指标计算标识线获取指标信息异常"
|
|
|
- br.ErrMsg = "指标计算标识线获取指标信息异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- dataList, err := data_manage.GetEdbDataList(edbInfo.Source, edbInfo.SubSource, edbInfo.EdbInfoId, markerLines[i].StartDate.Date, markerLines[i].EndDate.Date)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "指标计算标识线获取指标数据异常"
|
|
|
- br.ErrMsg = "指标计算标识线获取指标数据异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- value, err := data.MarkerLineCalculate(markerLines[i], dataList, chartInfo)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "标识线配置异常"
|
|
|
- br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- markerLines[i].Value = value
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
+ if markerLines[i].EdbType == 0 && markerLines[i].TimeIntervalType == 0 {
|
|
|
+
|
|
|
if edbList[0].IsAxis == 1 {
|
|
|
value, err := data.MarkerLineCalculate(markerLines[i], edbList[0].DataList, chartInfo)
|
|
|
if err != nil {
|
|
@@ -3444,6 +3426,27 @@ func (this *ChartInfoController) PreviewBarChartInfo() {
|
|
|
return
|
|
|
}
|
|
|
markerLines[i].Value = value
|
|
|
+ } else {
|
|
|
+
|
|
|
+ edbInfo, err := data_manage.GetEdbInfoById(markerLines[i].EdbInfoId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "指标计算标识线获取指标信息异常"
|
|
|
+ br.ErrMsg = "指标计算标识线获取指标信息异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ dataList, err := data_manage.GetEdbDataList(edbInfo.Source, edbInfo.SubSource, edbInfo.EdbInfoId, "", "")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "指标计算标识线获取指标数据异常"
|
|
|
+ br.ErrMsg = "指标计算标识线获取指标数据异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ value, err := data.MarkerLineCalculate(markerLines[i], dataList, chartInfo)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "标识线配置异常"
|
|
|
+ br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ markerLines[i].Value = value
|
|
|
}
|
|
|
}
|
|
|
}
|