|
@@ -167,12 +167,11 @@ func (this *LineFeaturesChartInfoController) MultipleGraphPreview() {
|
|
|
chartInfo.ChartName = edbInfoMapping.EdbName
|
|
|
|
|
|
// 曲线图表信息
|
|
|
+ curveConf := req.Curve
|
|
|
+ startDate, endDate := utils.GetDateByDateType(curveConf.DateType, curveConf.StartDate, curveConf.EndDate)
|
|
|
{
|
|
|
tmpChartInfo := *chartInfo
|
|
|
|
|
|
- curveConf := req.Curve
|
|
|
- startDate, endDate := utils.GetDateByDateType(curveConf.DateType, curveConf.StartDate, curveConf.EndDate)
|
|
|
-
|
|
|
// 获取图表中的指标数据
|
|
|
edbList, _, _, _, err, errMsg := data.GetChartEdbData(tmpChartInfo.ChartInfoId, tmpChartInfo.ChartType, tmpChartInfo.Calendar, startDate, endDate, []*data_manage.ChartEdbInfoMapping{edbInfoMapping}, tmpChartInfo.ExtraConfig)
|
|
|
if err != nil {
|
|
@@ -225,7 +224,7 @@ func (this *LineFeaturesChartInfoController) MultipleGraphPreview() {
|
|
|
tmpChartInfo.ChartName = fmt.Sprintf("%s%d期滚动标准差", edbInfoMapping.EdbName, req.StandardDeviation.CalculateValue)
|
|
|
|
|
|
// 获取图表中的指标数据
|
|
|
- edbList, dataResp, err, errMsg := lineFeatureServ.GetStandardDeviationData(0, edbInfoMapping, req.StandardDeviation.CalculateValue)
|
|
|
+ edbList, dataResp, err, errMsg := lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbInfoMapping, req.StandardDeviation.CalculateValue)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
if errMsg != `` {
|
|
@@ -279,7 +278,7 @@ func (this *LineFeaturesChartInfoController) MultipleGraphPreview() {
|
|
|
tmpChartInfo.ChartName = fmt.Sprintf("%s%d%s百分位", edbInfoMapping.EdbName, req.Percentile.CalculateValue, req.Percentile.CalculateUnit)
|
|
|
|
|
|
// 获取图表中的指标数据
|
|
|
- edbList, dataResp, err, errMsg := lineFeatureServ.GetPercentileData(0, edbInfoMapping, req.Percentile.CalculateValue, req.Percentile.CalculateUnit)
|
|
|
+ edbList, dataResp, err, errMsg := lineFeatureServ.GetPercentileData(0, startDate, endDate, edbInfoMapping, req.Percentile.CalculateValue, req.Percentile.CalculateUnit)
|
|
|
if err != nil && errMsg != `` {
|
|
|
br.Msg = errMsg
|
|
|
br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
|
|
@@ -572,6 +571,9 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
var chartInfo *data_manage.ChartInfo
|
|
|
var errMsg string
|
|
|
isSendEmail := true
|
|
|
+
|
|
|
+ curveConf := req.Curve
|
|
|
+ startDate, endDate := utils.GetDateByDateType(curveConf.DateType, curveConf.StartDate, curveConf.EndDate)
|
|
|
switch req.Source {
|
|
|
case utils.CHART_MULTIPLE_GRAPH_CURVE: // 曲线图
|
|
|
curveConf := req.Curve
|
|
@@ -653,7 +655,7 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
}
|
|
|
extraConfig = fmt.Sprint(standardDeviationConf.CalculateValue)
|
|
|
|
|
|
- _, dataResp, err, errMsg := lineFeatureServ.GetStandardDeviationData(0, edbInfoMapping, req.StandardDeviation.CalculateValue)
|
|
|
+ _, dataResp, err, errMsg := lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbInfoMapping, req.StandardDeviation.CalculateValue)
|
|
|
if err != nil {
|
|
|
br.Msg = "保存失败"
|
|
|
if errMsg != `` {
|
|
@@ -682,7 +684,7 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
extraConfig = string(extraConfigByte)
|
|
|
|
|
|
// 获取图表中的指标数据
|
|
|
- _, dataResp, err, errMsg := lineFeatureServ.GetPercentileData(0, edbInfoMapping, req.Percentile.CalculateValue, req.Percentile.CalculateUnit)
|
|
|
+ _, dataResp, err, errMsg := lineFeatureServ.GetPercentileData(0, startDate, endDate, edbInfoMapping, req.Percentile.CalculateValue, req.Percentile.CalculateUnit)
|
|
|
if err != nil && errMsg != `` {
|
|
|
br.Msg = errMsg
|
|
|
br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
|
|
@@ -727,6 +729,9 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
}
|
|
|
if chartInfoId <= 0 {
|
|
|
addChartReq := data_manage.AddChartInfoReq{
|
|
|
+ DateType: curveConf.DateType,
|
|
|
+ StartDate: curveConf.StartDate,
|
|
|
+ EndDate: curveConf.StartDate,
|
|
|
ChartClassifyId: req.ClassifyId,
|
|
|
ChartName: req.ChartName,
|
|
|
ChartType: utils.CHART_TYPE_CURVE,
|
|
@@ -744,6 +749,9 @@ func (this *LineFeaturesChartInfoController) MultipleGraphConfigSaveChart() {
|
|
|
ChartName: req.ChartName,
|
|
|
ChartClassifyId: req.ClassifyId,
|
|
|
ChartType: utils.CHART_TYPE_CURVE,
|
|
|
+ DateType: curveConf.DateType,
|
|
|
+ StartDate: curveConf.StartDate,
|
|
|
+ EndDate: curveConf.StartDate,
|
|
|
Calendar: "公历",
|
|
|
LeftMin: fmt.Sprint(leftMinVal),
|
|
|
LeftMax: fmt.Sprint(leftMaxVal),
|
|
@@ -1802,7 +1810,8 @@ func (this *LineFeaturesChartInfoController) Detail() {
|
|
|
br.ErrMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- edbList, resultResp, err, errMsg = lineFeatureServ.GetStandardDeviationData(0, edbMapping, calculateValue)
|
|
|
+ startDate, endDate := utils.GetDateByDateType(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate)
|
|
|
+ edbList, resultResp, err, errMsg = lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbMapping, calculateValue)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_PERCENTILE:
|
|
|
var percentileConfig request.Percentile
|
|
|
err = json.Unmarshal([]byte(chartInfo.ExtraConfig), &percentileConfig)
|
|
@@ -1811,7 +1820,8 @@ func (this *LineFeaturesChartInfoController) Detail() {
|
|
|
br.ErrMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- edbList, resultResp, err, errMsg = lineFeatureServ.GetPercentileData(0, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit)
|
|
|
+ startDate, endDate := utils.GetDateByDateType(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate)
|
|
|
+ edbList, resultResp, err, errMsg = lineFeatureServ.GetPercentileData(0, startDate, endDate, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_FREQUENCY:
|
|
|
var frequencyDistributionConfig request.FrequencyDistribution
|
|
|
err = json.Unmarshal([]byte(chartInfo.ExtraConfig), &frequencyDistributionConfig)
|
|
@@ -2274,7 +2284,8 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
errMsg = "格式化配置项失败,Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
- edbList, resultResp, err, msg = lineFeatureServ.GetStandardDeviationData(0, edbMapping, calculateValue)
|
|
|
+ startDate, endDate := utils.GetDateByDateType(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate)
|
|
|
+ edbList, resultResp, err, msg = lineFeatureServ.GetStandardDeviationData(0, startDate, endDate, edbMapping, calculateValue)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_PERCENTILE:
|
|
|
var percentileConfig request.Percentile
|
|
|
err = json.Unmarshal([]byte(chartInfo.ExtraConfig), &percentileConfig)
|
|
@@ -2283,7 +2294,8 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
errMsg = "格式化配置项失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- edbList, resultResp, err, msg = lineFeatureServ.GetPercentileData(0, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit)
|
|
|
+ startDate, endDate := utils.GetDateByDateType(chartInfo.DateType, chartInfo.StartDate, chartInfo.EndDate)
|
|
|
+ edbList, resultResp, err, msg = lineFeatureServ.GetPercentileData(0, startDate, endDate, edbMapping, percentileConfig.CalculateValue, percentileConfig.CalculateUnit)
|
|
|
case utils.CHART_SOURCE_LINE_FEATURE_FREQUENCY:
|
|
|
var frequencyDistributionConfig request.FrequencyDistribution
|
|
|
err = json.Unmarshal([]byte(chartInfo.ExtraConfig), &frequencyDistributionConfig)
|
|
@@ -2597,3 +2609,43 @@ func (this *LineFeaturesChartInfoController) SearchByEs() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// fix 统计分析/统计特征的标准差、百分位图表时间范围与曲线图一致
|
|
|
+//func init() {
|
|
|
+// condition := ` AND source in (7,8) `
|
|
|
+// list, err := data_manage.GetChartInfoListByCondition(condition, []interface{}{}, 0, 1000)
|
|
|
+// if err != nil {
|
|
|
+// fmt.Println("err:", err)
|
|
|
+// return
|
|
|
+// }
|
|
|
+//
|
|
|
+// for _, v := range list {
|
|
|
+// item, tmpErr := data_manage.GetMultipleGraphConfigChartMappingByChartId(v.ChartInfoId)
|
|
|
+// if tmpErr != nil {
|
|
|
+// fmt.Println("tmpErr:", tmpErr)
|
|
|
+// continue
|
|
|
+// }
|
|
|
+//
|
|
|
+// multipleGraphConfig, e := data_manage.GetMultipleGraphConfigById(item.MultipleGraphConfigId)
|
|
|
+// if e != nil {
|
|
|
+// fmt.Println("获取批量配置信息失败:", e)
|
|
|
+// continue
|
|
|
+// }
|
|
|
+//
|
|
|
+// var configSave request.ConfigSave
|
|
|
+// err = json.Unmarshal([]byte(multipleGraphConfig.Curve), &configSave)
|
|
|
+// if err != nil {
|
|
|
+// fmt.Println("格式化配置项失败,Err:" + err.Error())
|
|
|
+// return
|
|
|
+// }
|
|
|
+//
|
|
|
+// v.StartDate = configSave.Curve.StartDate
|
|
|
+// v.EndDate = configSave.Curve.EndDate
|
|
|
+// v.DateType = configSave.Curve.DateType
|
|
|
+// err = v.Update([]string{"StartDate", "EndDate", "DateType"})
|
|
|
+//
|
|
|
+// if err != nil {
|
|
|
+// fmt.Println(v.ChartInfoId, "修复历史数据失败:", err)
|
|
|
+// }
|
|
|
+// }
|
|
|
+//}
|