|
@@ -74,7 +74,16 @@ func (this *BusinessChartController) List() {
|
|
|
for _, v := range chartList {
|
|
|
chartInfoIds = append(chartInfoIds, v.ChartInfoId)
|
|
|
}
|
|
|
-
|
|
|
+ descriptionList, err := chartOb.GetChartDescriptionListByChartInfoIds(chartInfoIds)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "ChartList GetChartDescriptionListByChartInfoIds err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ descriptionMap := make(map[int][]string)
|
|
|
+ for _, v := range descriptionList {
|
|
|
+ descriptionMap[v.ChartInfoId] = append(descriptionMap[v.ChartInfoId], v.Description)
|
|
|
+ }
|
|
|
edbMappingList, err := data_manage.GetChartEdbMappingList(chartInfoIds)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -95,13 +104,19 @@ func (this *BusinessChartController) List() {
|
|
|
edbInfoMap := make(map[int]*data_manage.BusinessChartEdbListItem)
|
|
|
// 根据chartInfoId 将edbInfoList 转换为chartMappingMap
|
|
|
for _, v := range edbInfoList {
|
|
|
+ endValue := v.EndValue
|
|
|
+ if v.EdbInfoType == 0 {
|
|
|
+ endValue = v.LatestValue
|
|
|
+ }
|
|
|
item := &data_manage.BusinessChartEdbListItem{
|
|
|
EdbInfoId: v.EdbInfoId,
|
|
|
EdbName: v.EdbName,
|
|
|
EdbCode: v.EdbCode,
|
|
|
+ EdbInfoType: v.EdbInfoType,
|
|
|
Frequency: v.Frequency,
|
|
|
Unit: v.Unit,
|
|
|
EndDate: v.EndDate,
|
|
|
+ EndValue: endValue,
|
|
|
LatestDate: v.LatestDate,
|
|
|
LatestValue: v.LatestValue,
|
|
|
UniqueCode: v.UniqueCode,
|
|
@@ -115,6 +130,12 @@ func (this *BusinessChartController) List() {
|
|
|
|
|
|
for _, v := range chartList {
|
|
|
v.EdbInfoList = chartMappingMap[v.ChartInfoId]
|
|
|
+ description, ok := descriptionMap[v.ChartInfoId]
|
|
|
+ if !ok {
|
|
|
+ v.Description = make([]string, 0)
|
|
|
+ } else {
|
|
|
+ v.Description = description
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
resp.List = chartList
|