|
@@ -5641,6 +5641,24 @@ func (this *EdbInfoController) EdbInfoSmmSearch() {
|
|
|
br.Msg = "无符合指标或指标代码错误"
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ edbCodeStr := ""
|
|
|
+ for i, _ := range edbCodeArr {
|
|
|
+ edbCodeStr += "'" + edbCodeArr[i] + "'" + ","
|
|
|
+ }
|
|
|
+ edbCodeStr = strings.Trim(edbCodeStr, ",")
|
|
|
+ smmInfoList, err := data_manage.GetBaseFromSmmIndexByIndexCodes(edbCodeStr)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取有色指标详情失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ smmInfoMap := make(map[string]*data_manage.BaseFromSmmIndex)
|
|
|
+ for _, v := range smmInfoList {
|
|
|
+ smmInfoMap[v.IndexCode] = v
|
|
|
+ }
|
|
|
+
|
|
|
searchItemList := make([]*data_manage.EdbInfoSearch, 0)
|
|
|
|
|
|
resp := new(data_manage.EdbInfoSearchResp)
|
|
@@ -5666,8 +5684,10 @@ func (this *EdbInfoController) EdbInfoSmmSearch() {
|
|
|
searchItem.DataList = dataItems
|
|
|
searchItem.StartDate = minDate
|
|
|
searchItem.EndDate = maxDate
|
|
|
-
|
|
|
- searchItem.DataList = dataItems
|
|
|
+ searchItem.Frequency = smmInfoMap[edbCode].Frequency
|
|
|
+ searchItem.Unit = smmInfoMap[edbCode].Unit
|
|
|
+ searchItem.EdbName = smmInfoMap[edbCode].IndexName
|
|
|
+ searchItem.EdbCode = smmInfoMap[edbCode].IndexCode
|
|
|
|
|
|
searchItemList = append(searchItemList, searchItem)
|
|
|
} else {
|
|
@@ -5696,21 +5716,17 @@ func (this *EdbInfoController) EdbInfoSmmSearch() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- edbCodeStr := ""
|
|
|
- for i, _ := range edbCodeArr {
|
|
|
- edbCodeStr += "'" + edbCodeArr[i] + "'" + ","
|
|
|
- }
|
|
|
- edbCodeStr = strings.Trim(edbCodeStr, ",")
|
|
|
- smmInfoList, err := data_manage.GetBaseFromSmmIndexByIndexCodes(edbCodeStr)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取有色指标详情失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
for _, smmInfo := range smmInfoList {
|
|
|
if smmInfo != nil {
|
|
|
searchItem := new(data_manage.EdbInfoSearch)
|
|
|
-
|
|
|
+ minDate, maxDate, err := data_manage.GetEdbDataYsMaxAndMinDate(smmInfo.IndexCode)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取YS日期信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ searchItem.StartDate = minDate
|
|
|
+ searchItem.EndDate = maxDate
|
|
|
searchItem.Frequency = smmInfo.Frequency
|
|
|
searchItem.Unit = smmInfo.Unit
|
|
|
searchItem.EdbName = smmInfo.IndexName
|