|
@@ -178,6 +178,7 @@ func (this *BaseFromUsdaFasController) UsdaFasIndexData() {
|
|
|
}
|
|
|
edbInfoMap := make(map[string]*data_manage.EdbInfo)
|
|
|
dataMap := make(map[string][]*data_manage.BaseFromUsdaFasData)
|
|
|
+ total := 0
|
|
|
if len(edbCodeList) > 0 {
|
|
|
edbInfoList, err := data_manage.GetEdbInfoByEdbCodeList(utils.DATA_SOURCE_USDA_FAS, edbCodeList)
|
|
|
if err != nil {
|
|
@@ -212,13 +213,15 @@ func (this *BaseFromUsdaFasController) UsdaFasIndexData() {
|
|
|
dataMap[v.IndexCode] = append(dataMap[v.IndexCode], v)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ total, err = data_manage.GetUsdaFasIndexDataTimePageCount(edbCodeList)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败"
|
|
|
+ br.ErrMsg = "获取指标数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
- total, err := data_manage.GetUsdaFasIndexDataTimePageCount(edbCodeList)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败"
|
|
|
- br.ErrMsg = "获取指标数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
|
|
|
resultList := make([]*data_manage.BaseFromUsdaFasIndexList, 0)
|
|
@@ -1241,3 +1244,41 @@ func (this *BaseFromUsdaFasController) ExportUsdaFasList() {
|
|
|
br.Success = true
|
|
|
br.Msg = "success"
|
|
|
}
|
|
|
+
|
|
|
+// GetFrequency
|
|
|
+// @Title 美国农业部数据频度
|
|
|
+// @Description 美国农业部数据频度接口
|
|
|
+// @Param ClassifyId query string true "分类Id"
|
|
|
+// @Success 200 {object} data_manage.LzFrequency
|
|
|
+// @router /usda_fas/frequency [get]
|
|
|
+func (this *BaseFromUsdaFasController) GetFrequency() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ sysUser := this.SysUser
|
|
|
+ if sysUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,SysUser Is Empty"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ classifyId, _ := this.GetInt("ClassifyId")
|
|
|
+ if classifyId < 0 {
|
|
|
+ br.Msg = "请选择分类"
|
|
|
+ br.ErrMsg = "请选择分类"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ frequencyList, err := data_manage.GetUsdaFasFrequencyByClassifyId(classifyId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取频度失败"
|
|
|
+ br.ErrMsg = "获取频度失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = frequencyList
|
|
|
+}
|