|
@@ -12,7 +12,7 @@ import (
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-type BaseFromRzdSController struct {
|
|
|
+type BaseFromRzdController struct {
|
|
|
BaseAuthController
|
|
|
}
|
|
|
|
|
@@ -20,7 +20,7 @@ type BaseFromRzdSController struct {
|
|
|
// @Title 新增睿姿得指标
|
|
|
// @Description 新增粮油商务网指标
|
|
|
// @router /add [post]
|
|
|
-func (this *BaseFromRzdSController) Add() {
|
|
|
+func (this *BaseFromRzdController) Add() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -65,7 +65,7 @@ func (this *BaseFromRzdSController) Add() {
|
|
|
// @Description 刷新粮油商务网指标接口
|
|
|
// @Success 200 {object} models.RefreshEdbInfoReq
|
|
|
// @router /refresh [post]
|
|
|
-func (this *BaseFromLyController) Refresh() {
|
|
|
+func (this *BaseFromRzdController) Refresh() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -140,12 +140,12 @@ func (this *BaseFromLyController) Refresh() {
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// GetLyClassifyByName
|
|
|
-// @Title 获取分类
|
|
|
+// AddRzdClassify
|
|
|
+// @Title 新增分类
|
|
|
// @Description 获取分类
|
|
|
-// @Success 200 {object} models.BaseFromLyClassify
|
|
|
-// @router /get/ly/classify/by/name [post]
|
|
|
-func (this *BaseFromLyController) GetLyClassifyByName() {
|
|
|
+// @Success 200 {object} models.BaseFromRzdClassify
|
|
|
+// @router /add/rzd/classify [post]
|
|
|
+func (this *BaseFromRzdController) AddRzdClassify() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -157,21 +157,28 @@ func (this *BaseFromLyController) GetLyClassifyByName() {
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
var reqData struct {
|
|
|
- CategoryName string `json:"CategoryName"`
|
|
|
+ ClassifyName string `json:"ClassifyName"`
|
|
|
+ ParentId int `json:"parentId"`
|
|
|
}
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
if err != nil {
|
|
|
br.ErrMsg = "无法解析请求体"
|
|
|
return
|
|
|
}
|
|
|
- categoryName := reqData.CategoryName
|
|
|
+ categoryName := reqData.ClassifyName
|
|
|
if categoryName == "" {
|
|
|
br.Msg = "请输入分类!"
|
|
|
br.ErrMsg = "请输入分类"
|
|
|
return
|
|
|
}
|
|
|
+ rzdClassify := models.BaseFromRzdClassify{
|
|
|
+ ClassifyName: categoryName,
|
|
|
+ ParentId: reqData.ParentId,
|
|
|
+ CreateTime: utils.GetCurrentTime(),
|
|
|
+ ModifyTime: utils.GetCurrentTime(),
|
|
|
+ }
|
|
|
|
|
|
- lyClassify, err := models.GetLyClassifyByName(categoryName)
|
|
|
+ lyClassify, err := models.AddRzdClassify(rzdClassify)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -182,12 +189,12 @@ func (this *BaseFromLyController) GetLyClassifyByName() {
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// GetLyIndexRecordByUrl
|
|
|
-// @Title 根据url获取指标已读取记录
|
|
|
-// @Description 根据url获取指标已读取记录
|
|
|
-// @Success 200 {object} models.BaseFromLyIndexRecord
|
|
|
-// @router /get/ly/index/record/by/url [post]
|
|
|
-func (this *BaseFromLyController) GetLyIndexRecordByUrl() {
|
|
|
+// GetRzdClassifyByName
|
|
|
+// @Title 获取分类
|
|
|
+// @Description 获取分类
|
|
|
+// @Success 200 {object} models.BaseFromRzdClassify
|
|
|
+// @router /get/rzd/classify/by/name [post]
|
|
|
+func (this *BaseFromRzdController) GetRzdClassifyByName() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -199,72 +206,37 @@ func (this *BaseFromLyController) GetLyIndexRecordByUrl() {
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
var reqData struct {
|
|
|
- Url string `json:"Url"`
|
|
|
+ ClassifyName string `json:"ClassifyName"`
|
|
|
}
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
if err != nil {
|
|
|
br.ErrMsg = "无法解析请求体"
|
|
|
return
|
|
|
}
|
|
|
- url := reqData.Url
|
|
|
- if url == "" {
|
|
|
- br.Msg = "请输入地址链接!"
|
|
|
- br.ErrMsg = "请输入地址链接"
|
|
|
+ categoryName := reqData.ClassifyName
|
|
|
+ if categoryName == "" {
|
|
|
+ br.Msg = "请输入分类!"
|
|
|
+ br.ErrMsg = "请输入分类"
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- lyIndexRecord, err := models.GetLyIndexRecordByUrl(url)
|
|
|
+ lyClassify, err := models.GetRzdClassifyByName(categoryName)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
- br.Data = lyIndexRecord
|
|
|
+ br.Data = lyClassify
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// AddLyIndexRecord
|
|
|
-// @Title 维护指标数据读取进度到数据库
|
|
|
-// @Description 维护指标数据读取进度到数据库
|
|
|
-// @Success 200 string "处理成功"
|
|
|
-// @router /add/ly/index/record [post]
|
|
|
-func (this *BaseFromLyController) AddLyIndexRecord() {
|
|
|
- br := new(models.BaseResponse).Init()
|
|
|
- var cacheKey string
|
|
|
- defer func() {
|
|
|
- if br.ErrMsg == "" {
|
|
|
- br.IsSendEmail = false
|
|
|
- }
|
|
|
- _ = utils.Rc.Delete(cacheKey)
|
|
|
- this.Data["json"] = br
|
|
|
- this.ServeJSON()
|
|
|
- }()
|
|
|
- var req models.BaseFromLyIndexRecord
|
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "参数解析异常!"
|
|
|
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- id, err := models.AddLyIndexRecord(&req)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Data = id
|
|
|
- br.Msg = "处理成功"
|
|
|
-}
|
|
|
-
|
|
|
-// AddLyDataList
|
|
|
-// @Title 新增指标数据
|
|
|
-// @Description 新增指标数据列表
|
|
|
+// AddBatchRzdData
|
|
|
+// @Title 新增数据源指标数据
|
|
|
+// @Description 新增数据源指标数据
|
|
|
// @Success 200 string "处理成功"
|
|
|
-// @router /add/ly/data/list [post]
|
|
|
-func (this *BaseFromLyController) AddLyDataList() {
|
|
|
+// @router /add/batch/rzd/data [post]
|
|
|
+func (this *BaseFromRzdController) AddBatchRzdData() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -275,7 +247,7 @@ func (this *BaseFromLyController) AddLyDataList() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- var req []models.BaseFromLyData
|
|
|
+ var req []models.BaseFromRzdData
|
|
|
fmt.Println(string(this.Ctx.Input.RequestBody))
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
if err != nil {
|
|
@@ -284,7 +256,7 @@ func (this *BaseFromLyController) AddLyDataList() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- err = models.AddLyDataList(req)
|
|
|
+ err = models.AddRzdDataList(req)
|
|
|
if err != nil {
|
|
|
br.Msg = "新增指标数据失败!"
|
|
|
br.ErrMsg = "新增指标数据失败,Err:" + err.Error()
|
|
@@ -296,12 +268,12 @@ func (this *BaseFromLyController) AddLyDataList() {
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
|
|
|
-// AddLyIndex
|
|
|
+// AddRzdIndex
|
|
|
// @Title 新增指标
|
|
|
// @Description 新增指标
|
|
|
// @Success 200 string "处理成功"
|
|
|
-// @router /add/ly/index [post]
|
|
|
-func (this *BaseFromLyController) AddLyIndex() {
|
|
|
+// @router /add/rzd/index [post]
|
|
|
+func (this *BaseFromRzdController) AddRzdIndex() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -312,7 +284,7 @@ func (this *BaseFromLyController) AddLyIndex() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- var req models.BaseFromLyIndex
|
|
|
+ var req models.BaseFromRzdIndex
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
if err != nil {
|
|
|
br.Msg = "参数解析异常!"
|
|
@@ -320,7 +292,7 @@ func (this *BaseFromLyController) AddLyIndex() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- indexId, err := models.AddLyIndex(&req)
|
|
|
+ indexId, err := models.AddRzdIndex(&req)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -331,12 +303,12 @@ func (this *BaseFromLyController) AddLyIndex() {
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
|
|
|
-// GetLyDataByIndexIdAndDataTime
|
|
|
-// @Title 根据指标id和时间获取指标数据
|
|
|
-// @Description 根据指标id和时间获取指标数据
|
|
|
+// GetRzdIndexDataByIndexIdAndDataTime
|
|
|
+// @Title 根据指标code和时间获取指标数据
|
|
|
+// @Description 根据指标code和时间获取指标数据
|
|
|
// @Success 200 {object} models.BaseFromLyData
|
|
|
-// @router /get/ly/data/by/index/id/and/data/time [post]
|
|
|
-func (this *BaseFromLyController) GetLyDataByIndexIdAndDataTime() {
|
|
|
+// @router /get/rzd/index/data/by/code/and/time [post]
|
|
|
+func (this *BaseFromRzdController) GetRzdIndexDataByIndexIdAndDataTime() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -371,75 +343,23 @@ func (this *BaseFromLyController) GetLyDataByIndexIdAndDataTime() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- lyData, err := models.GetLyDataByIndexIdAndDataTime(indexId, dataTime)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Data = lyData
|
|
|
- br.Msg = "获取成功"
|
|
|
-}
|
|
|
-
|
|
|
-// GetLyDataByIndexIdAndDataTimeYM
|
|
|
-// @Title 根据指标id和年月时间获取指标数据
|
|
|
-// @Description 根据指标id和年月时间获取指标数据
|
|
|
-// @Success 200 {object} models.BaseFromLyData
|
|
|
-// @router /get/ly/data/by/index/id/and/data/time/ym [post]
|
|
|
-func (this *BaseFromLyController) GetLyDataByIndexIdAndDataTimeYM() {
|
|
|
- br := new(models.BaseResponse).Init()
|
|
|
- var cacheKey string
|
|
|
- defer func() {
|
|
|
- if br.ErrMsg == "" {
|
|
|
- br.IsSendEmail = false
|
|
|
- }
|
|
|
- _ = utils.Rc.Delete(cacheKey)
|
|
|
- this.Data["json"] = br
|
|
|
- this.ServeJSON()
|
|
|
- }()
|
|
|
- var reqData struct {
|
|
|
- IndexId int `json:"IndexId"`
|
|
|
- YearMonth string `json:"YearMonth"`
|
|
|
- }
|
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
- if err != nil {
|
|
|
- br.ErrMsg = "无法解析请求体"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- indexId := reqData.IndexId
|
|
|
- if indexId == 0 {
|
|
|
- br.Msg = "请输入指标id!"
|
|
|
- br.ErrMsg = "请输入指标id"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- yearMonth := reqData.YearMonth
|
|
|
-
|
|
|
- if yearMonth == "" {
|
|
|
- br.Msg = "请输入时间!"
|
|
|
- br.ErrMsg = "请输入时间"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- lyData, err := models.GetLyDataByIndexIdAndDataTimeYM(indexId, yearMonth)
|
|
|
+ rzdData, err := models.GetRzdDataByIndexCodeAndDataTime(indexId, dataTime)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
- br.Data = lyData
|
|
|
+ br.Data = rzdData
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// UpdateLyDataById
|
|
|
+// UpdateRzdDataById
|
|
|
// @Title 更新数据源指标数据
|
|
|
// @Description 更新数据源指标数据
|
|
|
// @Success 200 string "处理成功"
|
|
|
-// @router /update/ly/data/by/id [post]
|
|
|
-func (this *BaseFromLyController) UpdateLyDataById() {
|
|
|
+// @router /update/rzd/data/by/id [post]
|
|
|
+func (this *BaseFromRzdController) UpdateRzdDataById() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -474,7 +394,7 @@ func (this *BaseFromLyController) UpdateLyDataById() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- err = models.UpdateLyDataById(id, value)
|
|
|
+ err = models.UpdateRzdDataById(id, value)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -484,63 +404,12 @@ func (this *BaseFromLyController) UpdateLyDataById() {
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
|
|
|
-// GetLyEdbDataByIndexCodeAndDataTime
|
|
|
-// @Title 根据指标编码和模糊日期获取指标库数据
|
|
|
-// @Description 根据指标编码和模糊日期获取指标库数据
|
|
|
-// @Success 200 {object} []models.EdbDataLy
|
|
|
-// @router /get/ly/edb/data/by/index/code/and/data/time [post]
|
|
|
-func (this *BaseFromLyController) GetLyEdbDataByIndexCodeAndDataTime() {
|
|
|
- br := new(models.BaseResponse).Init()
|
|
|
- var cacheKey string
|
|
|
- defer func() {
|
|
|
- if br.ErrMsg == "" {
|
|
|
- br.IsSendEmail = false
|
|
|
- }
|
|
|
- _ = utils.Rc.Delete(cacheKey)
|
|
|
- this.Data["json"] = br
|
|
|
- this.ServeJSON()
|
|
|
- }()
|
|
|
- var reqData struct {
|
|
|
- IndexCode string `json:"IndexCode"`
|
|
|
- DataTime string `json:"DataTime"`
|
|
|
- }
|
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
- if err != nil {
|
|
|
- br.ErrMsg = "无法解析请求体"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- indexCode := reqData.IndexCode
|
|
|
- if indexCode == "" {
|
|
|
- br.Msg = "请输入指标id!"
|
|
|
- br.ErrMsg = "请输入指标id"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- dataTime := reqData.DataTime
|
|
|
- if dataTime == "" {
|
|
|
- br.Msg = "请输入时间!"
|
|
|
- br.ErrMsg = "请输入时间"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- lyEdbData, err := models.GetLyEdbDataByIndexCodeAndDataTime(indexCode, dataTime)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Data = lyEdbData
|
|
|
- br.Msg = "获取成功"
|
|
|
-}
|
|
|
-
|
|
|
-// GetLyEdbDataByIndexCodeAndExactDataTime
|
|
|
+// GetRzdEdbDataByIndexCodeAndDataTime
|
|
|
// @Title 根据指标编码和精确日期获取指标库数据
|
|
|
// @Description 根据指标编码和精确日期获取指标库数据
|
|
|
// @Success 200 {object} []models.EdbDataLy
|
|
|
-// @router /get/ly/edb/data/by/index/code/and/exact/data/time [post]
|
|
|
-func (this *BaseFromLyController) GetLyEdbDataByIndexCodeAndExactDataTime() {
|
|
|
+// @router /get/edb/rzd/data/by/code/and/time [post]
|
|
|
+func (this *BaseFromRzdController) GetRzdEdbDataByIndexCodeAndDataTime() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -586,12 +455,12 @@ func (this *BaseFromLyController) GetLyEdbDataByIndexCodeAndExactDataTime() {
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// UpdateLyEdbDataById
|
|
|
+// UpdateRzdEdbDataById
|
|
|
// @Title 更新指标库数据 须根据指标编码和日期更新 仅适合月度数据
|
|
|
// @Description 更新指标库数据 须根据指标编码和日期更新 仅适合月度数据
|
|
|
// @Success 200 string "处理成功"
|
|
|
-// @router /update/ly/edb/data/by/id [post]
|
|
|
-func (this *BaseFromLyController) UpdateLyEdbDataById() {
|
|
|
+// @router /update/rzd/edb/data/by/id [post]
|
|
|
+func (this *BaseFromRzdController) UpdateRzdEdbDataById() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -626,7 +495,7 @@ func (this *BaseFromLyController) UpdateLyEdbDataById() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- err = models.UpdateLyEdbDataById(id, value)
|
|
|
+ err = models.UpdateRzdEdbDataById(id, value)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -636,55 +505,12 @@ func (this *BaseFromLyController) UpdateLyEdbDataById() {
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
|
|
|
-// GetLyIndexByCode
|
|
|
+// GetRzdIndexByCode
|
|
|
// @Title 查询指标编码是否存在
|
|
|
// @Description 查询指标编码是否存在
|
|
|
// @Success 200 {object} models.BaseFromLyIndex
|
|
|
-// @router /get/ly/index/by/code [post]
|
|
|
-func (this *BaseFromLyController) GetLyIndexByCode() {
|
|
|
- br := new(models.BaseResponse).Init()
|
|
|
- var cacheKey string
|
|
|
- defer func() {
|
|
|
- if br.ErrMsg == "" {
|
|
|
- br.IsSendEmail = false
|
|
|
- }
|
|
|
- _ = utils.Rc.Delete(cacheKey)
|
|
|
- this.Data["json"] = br
|
|
|
- this.ServeJSON()
|
|
|
- }()
|
|
|
- var reqData struct {
|
|
|
- IndexCode string `json:"IndexCode"`
|
|
|
- }
|
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
- if err != nil {
|
|
|
- br.ErrMsg = "无法解析请求体"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- indexCode := reqData.IndexCode
|
|
|
- if indexCode == "" {
|
|
|
- br.Msg = "请输入指标id!"
|
|
|
- br.ErrMsg = "请输入指标id"
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- lyIndex, err := models.GetLyIndexByCode(indexCode)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Data = lyIndex
|
|
|
- br.Msg = "获取成功"
|
|
|
-}
|
|
|
-
|
|
|
-// GetEdbInfoByIndexCode
|
|
|
-// @Title 根据指标code获取指标信息
|
|
|
-// @Description 根据指标code获取指标信息
|
|
|
-// @Success 200 {object} models.EdbInfo
|
|
|
-// @router /get/edb/info/by/index/code [post]
|
|
|
-func (this *BaseFromLyController) GetEdbInfoByIndexCode() {
|
|
|
+// @router /get/rzd/index/by/code [post]
|
|
|
+func (this *BaseFromRzdController) GetRzdIndexByCode() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -695,10 +521,8 @@ func (this *BaseFromLyController) GetEdbInfoByIndexCode() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
-
|
|
|
var reqData struct {
|
|
|
IndexCode string `json:"IndexCode"`
|
|
|
- Source int `json:"Source"`
|
|
|
}
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &reqData)
|
|
|
if err != nil {
|
|
@@ -712,30 +536,24 @@ func (this *BaseFromLyController) GetEdbInfoByIndexCode() {
|
|
|
br.ErrMsg = "请输入指标id"
|
|
|
return
|
|
|
}
|
|
|
- source := reqData.Source
|
|
|
- if source == 0 {
|
|
|
- br.Msg = "请输入来源!"
|
|
|
- br.ErrMsg = "请输入来源"
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- lyEdbData, err := models.GetEdbInfoByEdbCode(source, indexCode)
|
|
|
+ rzdIndex, err := models.GetRzdIndexByCode(indexCode)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
- br.Data = lyEdbData
|
|
|
+ br.Data = rzdIndex
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
-// AddBatchLyEdbData
|
|
|
-// @Title 批量增加粮油指标库数据
|
|
|
-// @Description 批量增加粮油指标库数据
|
|
|
+// AddBatchRzdEdbData
|
|
|
+// @Title 批量增加睿咨得指标库数据
|
|
|
+// @Description 批量增加睿咨得指标库数据
|
|
|
// @Success 200 string "处理成功"
|
|
|
-// @router /add/batch/ly/edb/data [post]
|
|
|
-func (this *BaseFromLyController) AddBatchLyEdbData() {
|
|
|
+// @router /add/batch/rzd/edb/data [post]
|
|
|
+func (this *BaseFromRzdController) AddBatchRzdEdbData() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
var cacheKey string
|
|
|
defer func() {
|
|
@@ -746,7 +564,7 @@ func (this *BaseFromLyController) AddBatchLyEdbData() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- var req []models.EdbDataLy
|
|
|
+ var req []models.EdbDataRzd
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
if err != nil {
|
|
|
br.Msg = "参数解析异常!"
|
|
@@ -754,7 +572,7 @@ func (this *BaseFromLyController) AddBatchLyEdbData() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- err = models.AddLyEdbDataList(req)
|
|
|
+ err = models.AddRzdEdbDataList(req)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|