|
@@ -15,10 +15,11 @@ import (
|
|
|
lineFeatureServ "eta/eta_api/services/data/line_feature"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
- "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
)
|
|
|
|
|
|
// LineFeaturesChartInfoController 统计特征图表管理
|
|
@@ -170,12 +171,12 @@ func (this *LineFeaturesChartInfoController) MultipleGraphPreview() {
|
|
|
|
|
|
// 曲线图表信息
|
|
|
curveConf := req.Curve
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbInfoMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbInfoMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxDate)
|
|
|
{
|
|
|
tmpChartInfo := *chartInfo
|
|
|
// 获取图表中的指标数据
|
|
@@ -434,12 +435,12 @@ func (this *LineFeaturesChartInfoController) MultipleGraphPreviewCurve() {
|
|
|
tmpChartInfo := *chartInfo
|
|
|
|
|
|
curveConf := req.Curve
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbInfoMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbInfoMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxDate)
|
|
|
|
|
|
// 获取图表中的指标数据
|
|
|
edbList, _, _, _, err, errMsg := data.GetChartEdbData(tmpChartInfo.ChartInfoId, tmpChartInfo.ChartType, tmpChartInfo.Calendar, startDate, endDate, []*data_manage.ChartEdbInfoMapping{edbInfoMapping}, tmpChartInfo.ExtraConfig, tmpChartInfo.SeasonExtraConfig)
|
|
@@ -584,12 +585,12 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
isSendEmail := true
|
|
|
|
|
|
curveConf := req.Curve
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbInfoMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbInfoMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(curveConf.DateType, curveConf.StartDate, curveConf.EndDate, curveConf.StartYear, maxDate)
|
|
|
switch req.Source {
|
|
|
case utils.CHART_MULTIPLE_GRAPH_CURVE: // 曲线图
|
|
|
curveConf := req.Curve
|
|
@@ -1830,12 +1831,12 @@ func (this *LineFeaturesChartInfoController) Detail() {
|
|
|
br.ErrMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxDate)
|
|
|
edbList, resultResp, err, errMsg = lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbMapping, calculateValue)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_PERCENTILE:
|
|
|
var percentileConfig request.Percentile
|
|
@@ -1845,12 +1846,12 @@ func (this *LineFeaturesChartInfoController) Detail() {
|
|
|
br.ErrMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxDate)
|
|
|
edbList, resultResp, err, errMsg = lineFeatureServ.GetPercentileData(0, startDate, endDate, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit, percentileConfig.PercentType)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_FREQUENCY:
|
|
|
var frequencyDistributionConfig request.FrequencyDistribution
|
|
@@ -2459,12 +2460,12 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
errMsg = "格式化配置项失败,Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxDate)
|
|
|
edbList, resultResp, err, msg = lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbMapping, calculateValue)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_PERCENTILE:
|
|
|
var percentileConfig request.Percentile
|
|
@@ -2474,12 +2475,12 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
errMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- maxYear := 0
|
|
|
+ var maxDate time.Time
|
|
|
if edbMapping.LatestDate != "" {
|
|
|
latestDateT, _ := time.Parse(utils.FormatDate, edbMapping.LatestDate)
|
|
|
- maxYear = latestDateT.Year()
|
|
|
+ maxDate = latestDateT
|
|
|
}
|
|
|
- startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxYear)
|
|
|
+ startDate, endDate := utils.GetDateByDateTypeV2(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate, chartInfo.StartYear, maxDate)
|
|
|
edbList, resultResp, err, msg = lineFeatureServ.GetPercentileData(0, startDate, endDate, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit, percentileConfig.PercentType)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_FREQUENCY:
|
|
|
var frequencyDistributionConfig request.FrequencyDistribution
|