|
@@ -447,12 +447,9 @@ func getChartDataByEdbInfo(edbInfoMapping *data_manage.ChartEdbInfoMapping, req
|
|
|
startDate = "2020-01-01"
|
|
|
}
|
|
|
startDateTime, _ = time.ParseInLocation(utils.FormatDate, startDate, time.Local)
|
|
|
- endDateTime = edbEndDateTime
|
|
|
} else {
|
|
|
startConf := req.AutoDateConf.StartDateConf
|
|
|
- endConf := req.AutoDateConf.EndDateConf
|
|
|
startDate := ""
|
|
|
- endDate := ""
|
|
|
if startConf.BaseDateType == 0 { //
|
|
|
startDate = edbEndDate
|
|
|
} else if startConf.BaseDateType == 1 {
|
|
@@ -468,7 +465,20 @@ func getChartDataByEdbInfo(edbInfoMapping *data_manage.ChartEdbInfoMapping, req
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ startDateTime, _ = time.ParseInLocation(utils.FormatDate, startDate, time.Local)
|
|
|
+ }
|
|
|
|
|
|
+ if req.AutoDateConf.IsAutoEndDate == 0 { //固定设置
|
|
|
+ endDate := req.AutoDateConf.EndDate
|
|
|
+ if endDate == "" {
|
|
|
+ err = fmt.Errorf("智能划分截止日期处理失败:请输入截止日期")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // todo 如果截止日期比指标日期还要大,则用指标的最新日期
|
|
|
+ endDateTime, _ = time.ParseInLocation(utils.FormatDate, endDate, time.Local)
|
|
|
+ } else {
|
|
|
+ endConf := req.AutoDateConf.EndDateConf
|
|
|
+ endDate := ""
|
|
|
if endConf.BaseDateType == 0 { //
|
|
|
endDate = edbEndDate
|
|
|
} else if endConf.BaseDateType == 2 {
|
|
@@ -484,10 +494,9 @@ func getChartDataByEdbInfo(edbInfoMapping *data_manage.ChartEdbInfoMapping, req
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- startDateTime, _ = time.ParseInLocation(utils.FormatDate, startDate, time.Local)
|
|
|
endDateTime, _ = time.ParseInLocation(utils.FormatDate, endDate, time.Local)
|
|
|
}
|
|
|
+
|
|
|
dateList = append(dateList, &data_manage.ChartRangeAnalysisDateDataItem{
|
|
|
StartDate: startDateTime,
|
|
|
EndDate: endDateTime})
|
|
@@ -552,7 +561,7 @@ func getChartDataByEdbInfo(edbInfoMapping *data_manage.ChartEdbInfoMapping, req
|
|
|
case 2:
|
|
|
for i, v := range newDataList {
|
|
|
if utils.CompareFloatByOpStrings(req.UnNormalDataConf.Formula, v.Value, req.UnNormalDataConf.Value) {
|
|
|
- newDataList[i].Value = req.UnNormalDataConf.Value
|
|
|
+ newDataList[i].Value = req.UnNormalDataConf.ReplaceValue
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -848,7 +857,7 @@ func AddChartInfo(req data_manage.AddChartInfoReq, source int, sysUser *system.A
|
|
|
chartInfo.IsSetName = 0
|
|
|
timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
|
|
|
chartInfo.UniqueCode = utils.MD5(utils.CHART_PREFIX + "_" + timestamp)
|
|
|
- chartInfo.ChartType = 9 // 区间计算图
|
|
|
+ chartInfo.ChartType = 1 // 区间计算图
|
|
|
chartInfo.Calendar = "公历"
|
|
|
chartInfo.DateType = 6
|
|
|
chartInfo.StartDate = req.StartDate
|