Roc 5 月之前
父节点
当前提交
6e98710e08

+ 0 - 25
controllers/base_auth.go

@@ -12,22 +12,6 @@ import (
 	"eta_gn/eta_index_lib/utils"
 )
 
-type AfterHandle func(bodyByte []byte) error
-
-// AfterHandlerUrlMap 结束后待处理的url
-var AfterHandlerUrlMap = map[string][]AfterHandle{
-	"/edbapi/wind/refresh": {models.DeleteChartInfoDataRedis}, //指标刷新接口
-}
-
-func init() {
-	/*if utils.RunMode == "release" {
-		logDir := `/data/rdlucklog/` + utils.APP_NAME_EN
-		ApiLog = log.Init("20060102.api", logDir)
-	} else {
-		ApiLog = log.Init("20060102.api")
-	}*/
-}
-
 type BaseAuthController struct {
 	web.Controller
 	Lang string `description:"当前语言类型,中文:zh;英文:en;默认:zh"`
@@ -40,7 +24,6 @@ func (this *BaseAuthController) Prepare() {
 	fmt.Println("Url:", uri)
 	if method != "HEAD" {
 		if method == "POST" {
-			// 当前语言
 			{
 				lang := this.Ctx.Input.Header("Lang")
 				if lang == "" {
@@ -75,14 +58,6 @@ func (this *BaseAuthController) Prepare() {
 }
 
 func (c *BaseAuthController) ServeJSON(encoding ...bool) {
-	// 方法处理完后,需要后置处理的业务逻辑
-	//if handlerList, ok := AfterHandlerUrlMap[c.Ctx.Request.URL.Path]; ok {
-	//	for _, handler := range handlerList {
-	//		handler(c.Ctx.Input.RequestBody)
-	//	}
-	//}
-
-	//所有请求都做这么个处理吧,目前这边都是做编辑、刷新逻辑处理(新增的话,并没有指标id,不会有影响)
 	models.DeleteChartInfoDataRedis(c.Ctx.Input.RequestBody)
 
 	var (

+ 0 - 18
controllers/base_common.go

@@ -17,14 +17,6 @@ type BaseCommonController struct {
 }
 
 func (c *BaseCommonController) Prepare() {
-	//var requestBody string
-	//method := c.Ctx.Input.Method()
-	//if method == "GET" {
-	//	requestBody = c.Ctx.Request.RequestURI
-	//} else {
-	//	requestBody, _ = url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	//}
-	// 当前语言
 	{
 		lang := c.Ctx.Input.Header("Lang")
 		if lang == "" {
@@ -32,19 +24,9 @@ func (c *BaseCommonController) Prepare() {
 		}
 		c.Lang = lang
 	}
-
-	//ip := c.Ctx.Input.IP()
-	//utils.ApiLog.Info("uri:%s, requestBody:%s, responseBody:%s, ip:%s", c.Ctx.Input.URI(), requestBody, ip)
 }
 
 func (c *BaseCommonController) ServeJSON(encoding ...bool) {
-	// 方法处理完后,需要后置处理的业务逻辑
-	//if handlerList, ok := AfterHandlerUrlMap[c.Ctx.Request.URL.Path]; ok {
-	//	for _, handler := range handlerList {
-	//		handler(c.Ctx.Input.RequestBody)
-	//	}
-	//}
-
 	var (
 		hasIndent   = false
 		hasEncoding = false

+ 0 - 493
controllers/base_from_business.go

@@ -1,493 +0,0 @@
-package controllers
-
-import (
-	"encoding/json"
-	"eta_gn/eta_index_lib/logic"
-	"eta_gn/eta_index_lib/models"
-	"eta_gn/eta_index_lib/services"
-	"eta_gn/eta_index_lib/utils"
-	"fmt"
-	"strconv"
-	"strings"
-	"time"
-)
-
-// BusinessIndexController 自有数据(商家)
-type BusinessIndexController struct {
-	BaseAuthController
-}
-
-// HandleBusinessIndexData
-// @Title 处理外部指标(商家)的接口
-// @Description 处理外部指标(商家)的接口
-// @Success 200 {object} models.BaseFromBusinessIndexResp
-// @router /handle [post]
-func (c *BusinessIndexController) HandleBusinessIndexData() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-	body := c.Ctx.Input.RequestBody
-	var req models.AddBusinessIndexReq
-	err := json.Unmarshal(body, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-
-	// 如果没有传入指标编码的话,那么自动生成指标编码
-	if req.IndexCode == `` {
-		cacheKey := utils.CACHE_SELF_EDB_HANDLE
-		if utils.Rc.IsExist(cacheKey) {
-			br.Ret = 501
-			br.Success = true
-			br.Msg = "系统处理中,请稍后重试"
-			return
-		}
-
-		// 刷新指标
-		utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
-		defer func() {
-			_ = utils.Rc.Delete(cacheKey)
-		}()
-	}
-
-	businessIndex, err := services.HandleBusinessIndex(&req)
-	if err != nil {
-		fmt.Println("HandleBusinessIndexData Err:" + err.Error())
-		br.Msg = "处理失败"
-		br.ErrMsg = "处理失败,Err:" + err.Error()
-		return
-	}
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "处理成功"
-	br.Data = businessIndex
-}
-
-// DelIndex
-// @Title 删除外部指标(商家)的接口
-// @Description 删除外部指标(商家)的接口
-// @Success 200 string "删除成功"
-// @router /index/del [post]
-func (c *BusinessIndexController) DelIndex() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-	body := c.Ctx.Input.RequestBody
-	var req models.DelBusinessIndexReq
-	err := json.Unmarshal(body, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-
-	// 如果没有传入指标编码的话,那么自动生成指标编码
-	if len(req.IndexCodeList) < 0 {
-		br.Msg = "指标编码不允许为空"
-		return
-	}
-
-	joinEdbCodeList, needDelEdbCodeList, err, errMsg := services.DelBusinessIndex(req.IndexCodeList)
-	if err != nil {
-		br.Msg = errMsg
-		br.ErrMsg = "删除失败,Err:" + err.Error()
-		return
-	}
-
-	resp := services.DelBusinessIndexResp{
-		IsDeleteEdbCodeList: needDelEdbCodeList,
-		NoDeleteEdbCodeList: joinEdbCodeList,
-	}
-
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "删除成功"
-	br.Data = resp
-}
-
-// DelIndexData
-// @Title 删除外部指标(商家)的指定日期数据接口
-// @Description 删除外部指标(商家)的指定日期数据接口
-// @Success 200 string "删除成功"
-// @router /data/del [post]
-func (c *BusinessIndexController) DelIndexData() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-	body := c.Ctx.Input.RequestBody
-	var req models.DelBusinessIndexDataReq
-	err := json.Unmarshal(body, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-
-	// 如果没有传入指标编码的话,那么自动生成指标编码
-	if req.IndexCode == `` {
-		br.Msg = "指标编码不允许为空"
-		return
-	}
-	if req.StartDate == `` && req.EndDate == `` {
-		br.Msg = "开始日期和结束日期不允许同时为空"
-		return
-	}
-
-	err, errMsg := services.DelBusinessIndexData(req.IndexCode, req.StartDate, req.EndDate)
-	if err != nil {
-		br.Msg = errMsg
-		br.ErrMsg = "删除失败,Err:" + err.Error()
-		return
-	}
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "删除成功"
-}
-
-// Add
-// @Title 新增自有数据(商家)指标接口
-// @Description 新增自有数据(商家)指标接口
-// @Success 200 {object} models.AddEdbBaseInfoReq
-// @router /add [post]
-func (c *BusinessIndexController) Add() {
-	br := new(models.BaseResponse).Init()
-	var cacheKey string
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-	var req models.AddEdbBaseInfoReq
-	err := json.Unmarshal(c.Ctx.Input.RequestBody, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-	if req.EdbCode == "" {
-		br.Msg = "请输入指标编码!"
-		br.ErrMsg = "请输入指标编码,指标编码为空"
-		return
-	}
-	cacheKey = utils.CACHE_EDB_DATA_ADD + "_BusinessIndexController_" + req.EdbCode
-	if utils.Rc.IsExist(cacheKey) {
-		br.Ret = 501
-		br.Success = true
-		br.Msg = "系统处理中,请稍后重试"
-		return
-	}
-
-	utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
-	defer func() {
-		_ = utils.Rc.Delete(cacheKey)
-	}()
-
-	baseFromBusinessIndexObj := models.BaseFromBusinessIndex{}
-
-	businessIndexItem, err := baseFromBusinessIndexObj.GetIndexItem(req.EdbCode)
-	if err != nil {
-		br.Msg = "获取数据源中指标信息失败!"
-		br.ErrMsg = "获取数据源中指标信息失败 baseFromBusinessIndexObj.GetIndexItem,Err:" + err.Error()
-		return
-	}
-
-	// 添加指标
-	timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
-	uniqueCode := utils.MD5(utils.DATA_PREFIX + "_" + timestamp)
-	params := models.AddBaseParams{
-		EdbCode:         req.EdbCode,
-		EdbName:         req.EdbName,
-		Unit:            req.Unit,
-		ClassifyId:      req.ClassifyId,
-		SysUserId:       req.SysUserId,
-		SysUserRealName: req.SysUserRealName,
-		UniqueCode:      uniqueCode,
-	}
-	obj := models.Business{}
-	edbInfo, err, errMsg := obj.Add(params, businessIndexItem)
-	if err != nil {
-		br.Msg = "生成" + obj.GetSourceName() + "失败"
-		if errMsg != `` {
-			br.Msg = errMsg
-		}
-		br.ErrMsg = "生成" + obj.GetSourceName() + "失败 Err:" + err.Error()
-		return
-	}
-
-	if edbInfo == nil {
-		br.Msg = "生成" + obj.GetSourceName() + "失败2"
-		br.ErrMsg = "生成" + obj.GetSourceName() + "失败"
-		return
-	}
-
-	// 更新指标最大最小值
-	err = obj.UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
-	if err != nil {
-		br.Msg = "更新指标最大最小值失败"
-		br.ErrMsg = err.Error()
-		return
-	}
-
-	// 添加到es
-	go logic.UpdateEs(edbInfo.EdbInfoId)
-
-	resp := models.AddEdbInfoResp{
-		EdbInfoId:  edbInfo.EdbInfoId,
-		UniqueCode: edbInfo.UniqueCode,
-	}
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "保存成功"
-	br.Data = resp
-	br.IsAddLog = true
-}
-
-// Edit
-// @Title 编辑自有数据(商家)指标接口
-// @Description 编辑自有数据(商家)指标接口
-// @Success 200 {object} models.EditEdbBaseInfoReq
-// @router /edit [post]
-func (c *BusinessIndexController) Edit() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-
-	var req models.EditEdbBaseInfoReq
-	err := json.Unmarshal(c.Ctx.Input.RequestBody, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-	cacheKey := utils.CACHE_EDB_DATA_EDIT + "_BusinessIndexController_" + fmt.Sprint(req.EdbInfoId)
-	if utils.Rc.IsExist(cacheKey) {
-		br.Ret = 501
-		br.Success = true
-		br.Msg = "系统处理中,请稍后重试"
-		return
-	}
-
-	utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
-	defer func() {
-		_ = utils.Rc.Delete(cacheKey)
-	}()
-
-	if req.EdbInfoId <= 0 {
-		br.Msg = "参数错误"
-		br.ErrMsg = "指标ID:" + strconv.Itoa(req.EdbInfoId)
-		br.IsSendEmail = false
-		return
-	}
-
-	req.EdbName = strings.Trim(req.EdbName, " ")
-	if req.EdbName == "" {
-		br.Msg = "指标名称不能为空"
-		br.IsSendEmail = false
-		return
-	}
-
-	//if req.Frequency == "" {
-	//	br.Msg = "频率不能为空"
-	//	return
-	//}
-
-	if req.Unit == "" {
-		br.Msg = "单位不能为空"
-		br.IsSendEmail = false
-		return
-	}
-
-	if req.ClassifyId <= 0 {
-		br.Msg = "请选择分类"
-		br.IsSendEmail = false
-		return
-	}
-
-	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, req.EdbInfoId, req.EdbName, c.Lang)
-	if err != nil {
-		br.Msg = "判断指标名称是否存在失败"
-		br.ErrMsg = "判断指标名称是否存在失败,Err:" + err.Error()
-		return
-	}
-	if existEdbName {
-		br.Msg = "指标名称已存在,请重新填写"
-		br.ErrMsg = "指标名称已存在,请重新填写"
-		br.IsSendEmail = false
-		return
-	}
-
-	//判断公式,指标是否有改动
-	edbInfo, err := models.GetEdbInfoById(req.EdbInfoId)
-	if err != nil {
-		br.Msg = "修改失败"
-		br.Msg = "获取指标信息失败,GetEdbInfoById Err:" + err.Error()
-		return
-	}
-	if edbInfo == nil {
-		br.Msg = "修改失败"
-		br.Msg = "指标信息不存在,EdbInfoId:" + strconv.Itoa(req.EdbInfoId)
-		return
-	}
-
-	baseFromBusinessIndexObj := models.BaseFromBusinessIndex{}
-
-	businessIndexItem, err := baseFromBusinessIndexObj.GetIndexItem(edbInfo.EdbCode)
-	if err != nil {
-		br.Msg = "获取数据源中指标信息失败!"
-		br.ErrMsg = "获取数据源中指标信息失败 baseFromBusinessIndexObj.GetIndexItem,Err:" + err.Error()
-		return
-	}
-
-	// 额外赋值
-	switch c.Lang {
-	case utils.EnLangVersion:
-		req.EdbNameEn = req.EdbName
-		req.UnitEn = req.Unit
-
-		req.EdbName = edbInfo.EdbName
-		req.Unit = edbInfo.Unit
-	default:
-		req.EdbNameEn = edbInfo.EdbNameEn
-		req.UnitEn = edbInfo.UnitEn
-	}
-
-	// 编辑指标
-	params := models.EditBaseParams{
-		EdbCode:         edbInfo.EdbCode,
-		EdbName:         req.EdbName,
-		Unit:            req.Unit,
-		ClassifyId:      req.ClassifyId,
-		SysUserId:       req.SysUserId,
-		SysUserRealName: req.SysUserRealName,
-		Lang:            c.Lang,
-		EdbInfo:         edbInfo,
-		EdbNameEn:       req.EdbNameEn,
-		UnitEn:          req.UnitEn,
-	}
-	obj := models.Business{}
-	err, errMsg := obj.Edit(params, businessIndexItem)
-	if err != nil {
-		br.Msg = "修改" + obj.GetSourceName() + "失败"
-		if errMsg != `` {
-			br.Msg = errMsg
-		}
-		br.ErrMsg = "修改" + obj.GetSourceName() + "失败 Err:" + err.Error()
-		return
-	}
-
-	// 更新指标最大最小值
-	err = obj.UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
-	if err != nil {
-		br.Msg = "更新指标最大最小值失败"
-		br.ErrMsg = err.Error()
-		return
-	}
-
-	// 添加到es
-	go logic.UpdateEs(edbInfo.EdbInfoId)
-
-	resp := models.AddEdbInfoResp{
-		EdbInfoId:  edbInfo.EdbInfoId,
-		UniqueCode: edbInfo.UniqueCode,
-	}
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "保存成功"
-	br.Data = resp
-	br.IsAddLog = true
-}
-
-// Refresh
-// @Title 刷新计算指标接口
-// @Description 刷新计算指标接口
-// @Success 200 {object} models.RefreshEdbInfoReq
-// @router /refresh [post]
-func (c *BusinessIndexController) Refresh() {
-	br := new(models.BaseResponse).Init()
-	var cacheKey string
-	defer func() {
-		c.Data["json"] = br
-		c.ServeJSON()
-	}()
-	var req models.RefreshEdbInfoReq
-	err := json.Unmarshal(c.Ctx.Input.RequestBody, &req)
-	if err != nil {
-		br.Msg = "参数解析异常!"
-		br.ErrMsg = "参数解析失败,Err:" + err.Error()
-		return
-	}
-	if req.EdbCode == "" {
-		br.Msg = "请输入指标编码!"
-		br.ErrMsg = "请输入指标编码,指标编码为空"
-		return
-	}
-	if req.EdbInfoId <= 0 {
-		br.Msg = "请输入指标ID!"
-		br.ErrMsg = "请输入指标ID"
-		return
-	}
-	edbInfo, err := models.GetEdbInfoById(req.EdbInfoId)
-	if err != nil {
-		br.Msg = "指标不存在!"
-		br.ErrMsg = "指标不存在"
-		return
-	}
-
-	cacheKey = utils.CACHE_EDB_DATA_REFRESH + strconv.Itoa(edbInfo.Source) + "_" + req.EdbCode
-
-	if utils.Rc.IsExist(cacheKey) {
-		br.Ret = 501
-		br.Success = true
-		br.Msg = "系统处理中,请稍后重试"
-		return
-	}
-
-	// 刷新指标
-	utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
-	defer func() {
-		_ = utils.Rc.Delete(cacheKey)
-	}()
-
-	params := models.RefreshBaseParams{
-		EdbInfo:   edbInfo,
-		StartDate: req.StartDate,
-	}
-	obj := models.Business{}
-
-	err, errMsg := obj.Refresh(params)
-	if errMsg != `` {
-		br.Msg = "刷新指标失败!"
-		br.ErrMsg = "刷新指标失败,err:" + errMsg
-		return
-	}
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		br.Msg = "刷新指标信息失败!"
-		br.ErrMsg = "刷新指标信息失败 BusinessIndexController,Err:" + err.Error()
-		return
-	}
-
-	// 更新指标最大最小值
-	err = obj.UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
-	if err != nil {
-		br.Msg = "更新指标最大最小值失败"
-		br.ErrMsg = err.Error()
-		return
-	}
-
-	// 更新ES
-	go logic.UpdateEs(edbInfo.EdbInfoId)
-
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "刷新成功"
-}

+ 0 - 1
controllers/base_from_calculate.go

@@ -14,7 +14,6 @@ import (
 	"time"
 )
 
-// CalculateController 计算指标
 type CalculateController struct {
 	BaseAuthController
 }

+ 0 - 23
controllers/factor_edb_series/factor_edb_series.go

@@ -13,15 +13,10 @@ import (
 	"time"
 )
 
-// FactorEdbSeriesController 因子指标系列
 type FactorEdbSeriesController struct {
 	controllers.BaseAuthController
 }
 
-// Recalculate
-// @Title 因子指标系列-重计算
-// @Description 因子指标系列-重计算
-// @Success 200 {object} models.FactorEdbRecalculateReq
 // @router /recalculate [post]
 func (this *FactorEdbSeriesController) Recalculate() {
 	br := new(models.BaseResponse).Init()
@@ -56,7 +51,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 		_ = utils.Rc.Delete(cacheKey)
 	}()
 
-	// 获取指标信息
 	edbInfo, e := models.GetEdbInfoById(req.EdbInfoId)
 	if e != nil {
 		if e.Error() == utils.ErrNoRow() {
@@ -69,7 +63,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 		return
 	}
 
-	// 查询指标关联的系列
 	mappings := make([]*models.FactorEdbSeriesMapping, 0)
 	{
 		ob := new(models.FactorEdbSeriesMapping)
@@ -92,7 +85,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 		return
 	}
 
-	// 获取系列信息
 	seriesIds := make([]int, 0)
 	seriesExist := make(map[int]bool)
 	for _, v := range mappings {
@@ -125,7 +117,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 		}
 	}
 
-	// 获取指标原数据
 	edbData, e := models.GetEdbDataAllByEdbCode(edbInfo.EdbCode, edbInfo.Source, edbInfo.SubSource, 0)
 	if e != nil {
 		br.Msg = "操作失败"
@@ -143,7 +134,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 		if series == nil {
 			continue
 		}
-		// 系列无计算则忽略
 		if series.CalculateState != models.FactorEdbSeriesCalculateNone || series.CalculateStep == "" {
 			continue
 		}
@@ -154,7 +144,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 			return
 		}
 
-		// 重新计算相关数据
 		e = services.FactorEdbStepCalculate(v.FactorEdbSeriesId, v.EdbInfoId, v.EdbCode, edbData, calculates)
 		if e != nil {
 			br.Msg = "因子指标计算失败"
@@ -168,7 +157,6 @@ func (this *FactorEdbSeriesController) Recalculate() {
 	br.Msg = "操作成功"
 }
 
-// ChartRecalculate
 // @Title 图表数据-重计算
 // @Description 图表数据-重计算
 // @Success 200 {object} models.FactorEdbRecalculateReq
@@ -206,7 +194,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 		_ = utils.Rc.Delete(cacheKey)
 	}()
 
-	// 查询图表关联的系列指标
 	mappings := make([]*models.FactorEdbSeriesChartMapping, 0)
 	{
 		ob := new(models.FactorEdbSeriesChartMapping)
@@ -237,7 +224,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 		}
 	}
 
-	// 获取因子指标及系列信息
 	seriesIdItem := make(map[int]*models.FactorEdbSeries)
 	{
 		ob := new(models.FactorEdbSeries)
@@ -270,7 +256,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 		edbIdItem[v.EdbInfoId] = v
 	}
 
-	// 重新计算
 	calculateWorkers := make(chan struct{}, 10)
 	wg := sync.WaitGroup{}
 	calculateDataOb := new(models.FactorEdbSeriesCalculateData)
@@ -293,9 +278,7 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 			}()
 			calculateWorkers <- struct{}{}
 
-			// 相关性计算
 			if chartMapping.CalculateType == models.FactorEdbSeriesChartCalculateTypeCorrelation {
-				// 解析计算参数
 				if chartMapping.CalculatePars == "" {
 					utils.FileLog.Info(fmt.Sprintf("相关性-计算参数为空, MappingId: %d", chartMapping.FactorEdbSeriesChartMappingId))
 					return
@@ -306,7 +289,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 					return
 				}
 
-				// 获取标的指标信息及数据
 				baseEdb, e := models.GetEdbInfoById(calculatePars.BaseEdbInfoId)
 				if e != nil {
 					utils.FileLog.Info(fmt.Sprintf("相关性-获取标的指标失败, MappingId: %d, err: %v", chartMapping.FactorEdbSeriesChartMappingId, e))
@@ -321,7 +303,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 
 				dataListA := make([]*models.EdbInfoSearchData, 0)
 				{
-					// 标的指标数据日期区间
 					startDate := time.Now().AddDate(0, 0, -calculateDays).Format(utils.FormatDate)
 					endDate := time.Now().Format(utils.FormatDate)
 					startDateTime, _ := time.ParseInLocation(utils.FormatDate, startDate, time.Local)
@@ -346,7 +327,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 					}
 				}
 
-				// 获取指标数据
 				dataListB := make([]*models.EdbInfoSearchData, 0)
 				if series.CalculateState == models.FactorEdbSeriesCalculated {
 					cond := fmt.Sprintf(" AND %s = ? AND %s = ?", calculateDataOb.Cols().FactorEdbSeriesId, calculateDataOb.Cols().EdbInfoId)
@@ -379,14 +359,12 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 					}
 				}
 
-				// 计算相关性
 				xEdbIdValue, yDataList, e := logic.CalculateCorrelation(calculatePars.LeadValue, calculatePars.LeadUnit, baseEdb.Frequency, edb.Frequency, dataListA, dataListB)
 				if e != nil {
 					utils.FileLog.Info(fmt.Sprintf("相关性-计算失败, EdbInfoId: %d", edb.EdbInfoId))
 					return
 				}
 
-				// X及Y轴数据
 				yData := yDataList[0].Value
 				yLen := len(yData)
 				values := make([]models.FactorEdbSeriesCorrelationMatrixValues, len(xEdbIdValue))
@@ -401,7 +379,6 @@ func (this *FactorEdbSeriesController) ChartRecalculate() {
 					}
 				}
 
-				// 更新计算结果
 				b, e := json.Marshal(values)
 				if e != nil {
 					utils.FileLog.Info(fmt.Sprintf("相关性-计算结果JSON格式化失败, err: %v", e))

+ 0 - 3
controllers/open/edb_info.go

@@ -8,12 +8,10 @@ import (
 	"fmt"
 )
 
-// EdbInfoController 指标数据
 type EdbInfoController struct {
 	controllers.BaseAuthController
 }
 
-// Detail
 // @Title 指标详情接口
 // @Description  指标详情接口
 // @Success 200 {object} models.EdbInfoDetailReq
@@ -49,7 +47,6 @@ func (this *EdbInfoController) Detail() {
 	dataList := make([]*models.EdbInfoSearchData, 0)
 	switch edbInfo.EdbInfoType {
 	case 0:
-		//获取来源指标的数据
 		dataList, err = models.GetEdbDataListAll(edbInfo.Source, edbInfo.SubSource, models.FindEdbDataListAllCond{
 			EdbInfoId: edbInfo.EdbInfoId,
 		}, 1)

+ 0 - 118
docs/富宝数据API.md

@@ -1,118 +0,0 @@
-### 查询单个产品及数据(json)
-
-> get HTTP://{ip}:{port}/cooperation/wande/queryData.do
-
-#### 参数
-
-- `pid` 产品id
-
-#### 响应 
-
-```json5
-{
-	"code": 200,
-	"returnValue": {
-		"product": {
-			"alikeName": "147家钢厂废钢日耗",
-			"diffName": "华北",
-			"propValueStr": "区域:华北地区,报价类型:废钢日耗",
-			"pattern":"华北:147家钢厂废钢日耗"
-		},
-		"data": [{
-				"priceStr": "344460",
-				"uad": "涨2170",
-				"datadate": "2019-07-04 16:31:33"
-			},
-			{
-				"priceStr": "342290",
-				"uad": "跌4010",
-				"datadate": "2019-07-01 09:14:14"
-			}
-		]
-	}
-}
-```
-
-### 查询所有产品的数据(json)
-
-> get HTTP://{ip}:{port}/cooperation/wande/queryLastData.do
-
-#### 响应
-
-```json5
-{
-	"code": 200,
-	"returnValue": {
-		"data": [{
-				"priceStr": "2459.82",
-				"uad": "跌0.07%",
-				"datadate": "2019-07-08 16:14:08",
-				"pid": 13170
-			},
-			{
-				"priceStr": "2470.32",
-				"uad": "跌0.05%",
-				"datadate": "2019-07-08 16:14:08", 
-				"pid": 16865
-			}
-		]
-	}
-}
-
-```
-
-### 查询修正产品的数据(json)
-
-> get HTTP://{ip}:{port}/cooperation/wande/queryReviseData.do
-
-- 如果当天没有修正的价格,不返回returnValue
-- 如果当天有修正的价格,返回的returnValue中的key是产品的id,value[product产品类型,data价格数组]
-
-#### 响应
-
-```json5
-
-	{
-	"code": 200,
-	"returnValue": {
-		"23617": {
-			"product": {
-				"alikeName": "废钢日耗(按区)",
-				"diffName": "华北",
-				"propValueStr": "区域:华北地区,报价类型:废钢日耗"
-			},
-			"data": [{
-					"priceStr": "79000",
-					"uad": "跌500",
-					"datadate": "2019-07-11 15:59:23"
-				},
-				{
-					"priceStr": "79500",
-					"uad": "涨1800",
-					"datadate": "2019-07-04 00:00:00"
-				}
-			]
-		},
-		"23622": {
-			"product": {
-				"alikeName": "废钢日耗(按省)",
-				"diffName": "江苏",
-				"propValueStr": "区域:华东地区,省份:江苏,报价类型:废钢日耗"
-			},
-			"data": [{
-					"priceStr": "82300",
-					"uad": "稳",
-					"datadate": "2019-07-11 15:59:23"
-				},
-				{
-					"priceStr": "82300",
-					"uad": "跌2000",
-					"datadate": "2019-07-04 00:00:00"
-				}
-			]
-		}
-	}
-}
-
-
-``` 

二进制
docs/富宝数据终端202210最终.xlsx


+ 0 - 325
models/base_from_business.go

@@ -1,325 +0,0 @@
-package models
-
-import (
-	"eta_gn/eta_index_lib/global"
-	"eta_gn/eta_index_lib/models/mgo"
-	"eta_gn/eta_index_lib/utils"
-	"fmt"
-	"go.mongodb.org/mongo-driver/bson"
-	"time"
-)
-
-// BaseFromBusinessIndex
-// @Description: 外部指标(商家系统)表
-type BaseFromBusinessIndex struct {
-	BaseFromBusinessIndexId int64     `gorm:"column:base_from_business_index_id;primaryKey" description:"指标ID"`
-	IndexCode               string    `gorm:"column:index_code" description:"指标编码"`
-	IndexName               string    `gorm:"column:index_name" description:"指标名称"`
-	Unit                    string    `gorm:"column:unit" description:"单位"`
-	Frequency               string    `gorm:"column:frequency" description:"频度"`
-	Source                  int       `gorm:"column:source" description:"数据来源"`
-	SourceName              string    `gorm:"column:source_name" description:"数据来源名称"`
-	StartDate               time.Time `gorm:"column:start_date" description:"开始日期"`
-	EndDate                 time.Time `gorm:"column:end_date" description:"结束日期"`
-	Remark                  string    `gorm:"column:remark" description:"备注字段"`
-	BaseModifyTime          time.Time `gorm:"column:base_modify_time" description:"基础信息(名称,单位,频度)变更时间"`
-	DataUpdateTime          time.Time `gorm:"column:data_update_time" description:"最近一次数据发生变化的时间"`
-	CreateTime              time.Time `gorm:"column:create_time" description:"创建时间"`
-	ModifyTime              time.Time `gorm:"column:modify_time" description:"修改时间"`
-}
-
-func (m *BaseFromBusinessIndex) TableName() string {
-	return "base_from_business_index"
-}
-
-// BaseFromBusinessIndexResp
-// @Description: 外部指标(商家系统)表
-type BaseFromBusinessIndexResp struct {
-	IndexCode  string `description:"指标编码"`
-	IndexName  string `description:"指标名称"`
-	Unit       string `description:"单位"`
-	Frequency  string `description:"频度"`
-	SourceName string `description:"数据来源名称"`
-}
-
-// EdbBusinessSource
-// @Description: 自有数据(商家)指标来源
-type EdbBusinessSource struct {
-	EdbBusinessSourceId int64     `orm:"column(edb_business_source_id);pk"`
-	SourceName          string    `description:"来源名称"` // 来源名称
-	CreateTime          time.Time `description:"创建时间"` // 创建时间
-}
-
-// AddBusinessIndexReq
-// @Description:  添加外部指标(商家)请求
-type AddBusinessIndexReq struct {
-	IndexCode  string               `description:"指标编码"`
-	IndexName  string               `description:"指标名称"`
-	Unit       string               `description:"单位"`
-	Frequency  string               `description:"频度"`
-	SourceName string               `description:"数据来源名称"`
-	Remark     string               `description:"备注字段"`
-	DataList   []AddBusinessDataReq `description:"指标数据"`
-}
-
-// AddBusinessDataReq
-// @Description: 外部指标(商家系统)数据
-type AddBusinessDataReq struct {
-	Value float64 `description:"值"`
-	Date  string  `description:"日期"`
-}
-
-// DelBusinessIndexReq
-// @Description:  删除外部指标(商家)请求
-type DelBusinessIndexReq struct {
-	IndexCodeList []string `description:"指标编码"`
-}
-
-// DelBusinessIndexDataReq
-// @Description:  删除外部指标(商家)明细数据请求
-type DelBusinessIndexDataReq struct {
-	IndexCode string `description:"指标编码"`
-	StartDate string `description:"开始日期"`
-	EndDate   string `description:"结束日期"`
-}
-
-// GetIndexItem
-// @Description: 根据指标编码获取自有数据指标
-// @author: Roc
-// @receiver m
-// @datetime 2024-05-31 16:29:30
-// @param indexCode string
-// @return item *BaseFromBusinessIndex
-// @return err error
-func (m *BaseFromBusinessIndex) GetIndexItem(indexCode string) (item *BaseFromBusinessIndex, err error) {
-	sql := `SELECT * FROM base_from_business_index WHERE index_code = ? `
-	err = global.DEFAULT_DmSQL.Raw(sql, indexCode).First(&item).Error
-	return
-}
-
-// GetIndexItemList
-// @Description: 根据指标编码列表获取自有数据指标列表
-// @author: Roc
-// @receiver m
-// @datetime 2024-05-31 16:29:12
-// @param indexCodeList []string
-// @return items []*BaseFromBusinessIndex
-// @return err error
-func (m *BaseFromBusinessIndex) GetIndexItemList(indexCodeList []string) (items []*BaseFromBusinessIndex, err error) {
-	num := len(indexCodeList)
-	if num <= 0 {
-		return
-	}
-	sql := `SELECT * FROM base_from_business_index WHERE index_code in (` + utils.GetOrmInReplace(num) + `) `
-	err = global.DEFAULT_DmSQL.Raw(sql, indexCodeList).Find(&items).Error
-
-	return
-}
-
-// DelIndexItemList
-// @Description: 根据指标编码列表删除自有数据指标
-// @author: Roc
-// @receiver m
-// @datetime 2024-05-31 16:36:52
-// @param indexCodeList []string
-// @return err error
-func (m *BaseFromBusinessIndex) DelIndexItemList(indexCodeList []string) (err error) {
-	num := len(indexCodeList)
-	if num <= 0 {
-		return
-	}
-	sql := `DELETE FROM base_from_business_index WHERE index_code in (` + utils.GetOrmInReplace(num) + `) `
-	err = global.DEFAULT_DmSQL.Exec(sql, indexCodeList).Error
-
-	return
-}
-
-// GetMaxId
-// @Description: 获取自有数据库中的最大id
-// @author: Roc
-// @receiver m
-// @datetime 2024-05-31 13:11:34
-// @return maxId int
-// @return err error
-func (m *BaseFromBusinessIndex) GetMaxId() (maxId int, err error) {
-	sql := `SELECT max(base_from_business_index_id) id FROM base_from_business_index limit 1`
-	err = global.DEFAULT_DmSQL.Raw(sql).First(&maxId).Error
-	return
-}
-
-// Add 新增
-func (m *BaseFromBusinessIndex) Add() (err error) {
-	err = global.DEFAULT_DmSQL.Create(m).Error
-	if err != nil {
-		return
-	}
-
-	return
-}
-
-func (m *BaseFromBusinessIndex) Update(cols []string) (err error) {
-	err = global.DEFAULT_DmSQL.Model(m).Select(cols).Updates(m).Error
-	return
-}
-
-func (m *BaseFromBusinessIndex) Del() (err error) {
-	err = global.DEFAULT_DmSQL.Delete(m).Error
-	return
-}
-
-func (m *BaseFromBusinessIndex) UpdateIndex(item *BaseFromBusinessIndex, updateCols []string) (err error) {
-	if item == nil {
-		return
-	}
-	if len(updateCols) == 0 {
-		return
-	}
-	err = global.DEFAULT_DmSQL.Model(item).Select(updateCols).Updates(item).Error
-	return
-}
-
-// GetEdbBusinessSourceItem
-// @Description: 根据来源名称获取来源信息
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-25 18:09:03
-// @param sourceName string
-// @return item *EdbBusinessSource
-// @return err error
-func (m *EdbBusinessSource) GetEdbBusinessSourceItem(sourceName string) (item *EdbBusinessSource, err error) {
-	sql := `SELECT * FROM edb_business_source WHERE source_name = ? `
-	err = global.DEFAULT_DmSQL.Raw(sql, sourceName).First(&item).Error
-	return
-}
-
-// Add 新增
-func (m *EdbBusinessSource) Add() (err error) {
-	err = global.DEFAULT_DmSQL.Create(m).Error
-	if err != nil {
-		return
-	}
-
-	return
-}
-
-// GetEdbInfoMaxAndMinInfo
-// @Description: 获取指标的最新数据记录信息
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-02 14:50:50
-// @param edbCode string
-// @return item *EdbInfoMaxAndMinInfo
-// @return err error
-func (m BaseFromBusinessIndex) GetEdbInfoMaxAndMinInfo(edbCode string) (item *EdbInfoMaxAndMinInfo, err error) {
-	if utils.UseMongo {
-		return m.getEdbInfoMaxAndMinInfoByMongo(edbCode)
-	} else {
-		return m.getEdbInfoMaxAndMinInfoByMysql(edbCode)
-	}
-
-	return
-}
-
-// getEdbInfoMaxAndMinInfoByMongo
-// @Description: 获取指标的最新数据记录信息(从mongo中获取)
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-02 14:41:20
-// @param edbCode string
-// @return item *EdbInfoMaxAndMinInfo
-// @return err error
-func (m BaseFromBusinessIndex) getEdbInfoMaxAndMinInfoByMongo(edbCode string) (item *EdbInfoMaxAndMinInfo, err error) {
-	mogDataObj := new(mgo.BaseFromBusinessData)
-	pipeline := []bson.M{
-		{"$match": bson.M{"index_code": edbCode}},
-		{"$group": bson.M{
-			"_id":       nil,
-			"min_date":  bson.M{"$min": "$data_time"},
-			"max_date":  bson.M{"$max": "$data_time"},
-			"min_value": bson.M{"$min": "$value"},
-			"max_value": bson.M{"$max": "$value"},
-		}},
-		{"$project": bson.M{"_id": 0}}, // 可选,如果不需要_id字段
-	}
-	result, err := mogDataObj.GetEdbInfoMaxAndMinInfo(pipeline)
-	if err != nil {
-		fmt.Println("BaseFromBusinessIndex GetEdbInfoMaxAndMinInfo Err:" + err.Error())
-		return
-	}
-
-	if !result.MaxDate.IsZero() {
-		whereQuery := bson.M{"index_code": edbCode, "data_time": result.MaxDate}
-		selectParam := bson.D{{"value", 1}, {"_id", 0}}
-		latestValue, tmpErr := mogDataObj.GetLatestValue(whereQuery, selectParam)
-		if tmpErr != nil {
-			err = tmpErr
-			return
-		}
-		result.LatestValue = latestValue.Value
-		result.EndValue = latestValue.Value
-	}
-
-	item = &EdbInfoMaxAndMinInfo{
-		MinDate:     result.MinDate.Format(utils.FormatDate),
-		MaxDate:     result.MaxDate.Format(utils.FormatDate),
-		MinValue:    result.MinValue,
-		MaxValue:    result.MaxValue,
-		LatestValue: result.LatestValue,
-		LatestDate:  result.LatestDate.Format(utils.FormatDate),
-		EndValue:    result.EndValue,
-	}
-
-	return
-}
-
-// getEdbInfoMaxAndMinInfoByMysql
-// @Description: 获取指标的最新数据记录信息(从mysql中获取)
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-02 14:49:58
-// @param edbCode string
-// @return item *EdbInfoMaxAndMinInfo
-// @return err error
-func (m BaseFromBusinessIndex) getEdbInfoMaxAndMinInfoByMysql(edbCode string) (item *EdbInfoMaxAndMinInfo, err error) {
-	dataObj := BaseFromBusinessData{}
-	result, err := dataObj.GetEdbInfoMaxAndMinInfo(edbCode)
-	if err != nil {
-		return
-	}
-
-	item = &EdbInfoMaxAndMinInfo{
-		MinDate:     result.MinDate,
-		MaxDate:     result.MaxDate,
-		MinValue:    result.MinValue,
-		MaxValue:    result.MaxValue,
-		LatestValue: result.LatestValue,
-		LatestDate:  result.LatestDate,
-		EndValue:    result.EndValue,
-	}
-
-	item.MinDate = utils.GormDateStrToDateStr(item.MinDate)
-	item.MaxDate = utils.GormDateStrToDateStr(item.MaxDate)
-	item.LatestDate = utils.GormDateStrToDateStr(item.LatestDate)
-
-	return
-}
-
-// ModifyIndexMaxAndMinInfo
-// @Description: 修改最大值和最小值信息
-// @author: Roc
-// @receiver m
-// @datetime 2024-05-06 14:07:46
-// @param indexCode string
-// @param item *EdbInfoMaxAndMinInfo
-// @param isIndexUpdateOrAdd bool
-// @return err error
-func (m *BaseFromBusinessIndex) ModifyIndexMaxAndMinInfo(indexCode string, item *EdbInfoMaxAndMinInfo, isIndexUpdateOrAdd bool) (err error) {
-	sql := ` UPDATE base_from_business_index SET start_date=?,end_date=?,modify_time=NOW() `
-	if isIndexUpdateOrAdd {
-		sql += `,data_update_time=NOW() `
-	}
-	sql += ` WHERE index_code=?`
-	err = global.DEFAULT_DmSQL.Exec(sql, item.MinDate, item.MaxDate, indexCode).Error
-
-	return
-}

+ 0 - 295
models/base_from_business_data.go

@@ -1,295 +0,0 @@
-package models
-
-import (
-	"errors"
-	"eta_gn/eta_index_lib/global"
-	"eta_gn/eta_index_lib/utils"
-	"fmt"
-	"strings"
-	"time"
-)
-
-// BaseFromBusinessData
-// @Description: 外部指标(商家系统)原始数据表
-type BaseFromBusinessData struct {
-	BusinessDataId          int       `orm:"column(business_data_id);pk" json:"business_data_id"`
-	BaseFromBusinessIndexId int       `json:"base_from_business_index_id"` // 指标id
-	IndexCode               string    `json:"index_code"`                  // 指标编码
-	DataTime                time.Time `json:"data_time"`                   // 数据日期
-	Value                   float64   `json:"value"`                       // 数据值
-	CreateTime              time.Time `json:"create_time"`                 // 创建时间
-	ModifyTime              time.Time `json:"modify_time"`                 // 修改时间
-}
-
-// TableName
-// @Description:  获取表名
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 13:41:36
-// @return string
-func (m *BaseFromBusinessData) TableName() string {
-	return "base_from_business_data"
-}
-
-// CollectionName
-// @Description:  获取集合名称
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 13:41:36
-// @return string
-func (m *BaseFromBusinessData) CollectionName() string {
-	return "base_from_business_data"
-}
-
-// DataBaseName
-// @Description: 获取数据库名称
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 13:41:33
-// @return string
-func (m *BaseFromBusinessData) DataBaseName() string {
-	return utils.MgoDataDbName
-}
-
-type WhereParams struct {
-	Condition string
-	Pars      []interface{}
-	Order     string `description:"排序字段"`
-}
-
-// GetAllDataList
-// @Description: 根据条件获取所有数据
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:18:57
-// @param condition []string
-// @param pars []interface{}
-// @param order string
-// @return result []*BaseFromBusinessData
-// @return err error
-func (m *BaseFromBusinessData) GetAllDataList(condition []string, pars []interface{}, order string) (result []*BaseFromBusinessData, err error) {
-	sql := `SELECT * FROM base_from_business_data `
-	if len(condition) > 0 {
-		sql += ` WHERE ` + strings.Join(condition, " AND ")
-	}
-
-	if order != `` {
-		sql += ` ORDER BY ` + order
-	}
-
-	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&result).Error
-
-	return
-}
-
-// GetLimitDataList
-// @Description: 根据条件获取指定数量数据列表
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:19:16
-// @param condition []string
-// @param pars []interface{}
-// @param order string
-// @param size int64
-// @return result []*BaseFromBusinessData
-// @return err error
-func (m *BaseFromBusinessData) GetLimitDataList(condition []string, pars []interface{}, order string, size int64) (result []*BaseFromBusinessData, err error) {
-	sql := `SELECT * FROM base_from_business_data `
-	if len(condition) > 0 {
-		sql += ` WHERE ` + strings.Join(condition, " AND ")
-	}
-
-	if order != `` {
-		sql += ` ORDER BY ` + order
-	}
-
-	sql += fmt.Sprintf(` LIMIT %d`, size)
-
-	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&result).Error
-
-	return
-}
-
-// GetPageDataList
-// @Description: 根据条件获取分页数据列表
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:19:42
-// @param condition []string
-// @param pars []interface{}
-// @param order string
-// @param startSize int64
-// @param size int64
-// @return result []*BaseFromBusinessData
-// @return err error
-func (m *BaseFromBusinessData) GetPageDataList(condition []string, pars []interface{}, order string, startSize, size int64) (result []*BaseFromBusinessData, err error) {
-	sql := `SELECT * FROM base_from_business_data `
-	if len(condition) > 0 {
-		sql += ` WHERE ` + strings.Join(condition, " AND ")
-	}
-
-	if order != `` {
-		sql += ` ORDER BY ` + order
-	}
-
-	sql += fmt.Sprintf(` LIMIT %d,%d`, startSize, size)
-
-	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&result).Error
-
-	return
-}
-
-// GetCountDataList
-// @Description: 根据条件获取数据列表总数
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:19:50
-// @param condition []string
-// @param pars []interface{}
-// @return count int64
-// @return err error
-func (m *BaseFromBusinessData) GetCountDataList(condition []string, pars []interface{}) (count int64, err error) {
-	//o := orm.NewOrm()
-	sql := `SELECT COUNT(1) as count FROM base_from_business_data `
-	if len(condition) > 0 {
-		sql += ` WHERE ` + strings.Join(condition, " AND ")
-	}
-	//err = o.Raw(sql, pars).QueryRow(&count)
-	err = global.DEFAULT_DmSQL.Raw(sql, pars...).Find(&count).Error
-
-	return
-}
-
-// InsertDataByColl
-// @Description: 写入单条数据(外部传入集合)
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 14:22:18
-// @param addData interface{}
-// @return err error
-func (m *BaseFromBusinessData) InsertDataByColl(addData interface{}) (err error) {
-	err = global.DEFAULT_DmSQL.Create(addData).Error
-
-	return
-}
-
-// BatchInsertData
-// @Description: 批量写入数据
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 14:22:18
-// @param bulk int 每次请求保存的数据量
-// @param dataList []*BaseFromBusinessData
-// @return err error
-func (m *BaseFromBusinessData) BatchInsertData(bulk int, dataList []*BaseFromBusinessData) (err error) {
-	err = global.DEFAULT_DmSQL.CreateInBatches(dataList, bulk).Error
-
-	return
-}
-
-// UpdateData
-// @Description: 单条数据修改
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-26 15:01:51
-// @param whereParams interface{}
-// @param updateParams interface{}
-// @return err error
-func (m *BaseFromBusinessData) UpdateData(updateCols []string) (err error) {
-	err = global.DEFAULT_DmSQL.Model(m).Select(updateCols).Updates(m).Error
-	if err != nil {
-		fmt.Println("UpdateDataByColl:Err:" + err.Error())
-		return
-	}
-
-	return
-}
-
-// HandleData
-// @Description: 数据处理
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:35:54
-// @param addDataList []*BaseFromBusinessData
-// @param updateDataList []*BaseFromBusinessData
-// @return err error
-func (m *BaseFromBusinessData) HandleData(addDataList, updateDataList []*BaseFromBusinessData) (err error) {
-	to := global.DEFAULT_DmSQL.Begin()
-	if err != nil {
-		return
-	}
-	defer func() {
-		if err != nil {
-			fmt.Println("BaseFromBusinessData HandleData,Err:" + err.Error())
-			_ = to.Rollback()
-		} else {
-			_ = to.Commit()
-		}
-	}()
-
-	// 插入数据
-	if len(addDataList) > 0 {
-		err = to.CreateInBatches(addDataList, 500).Error
-		if err != nil {
-			return
-		}
-	}
-
-	// 修改
-	if len(updateDataList) > 0 {
-		for _, v := range updateDataList {
-			err = to.Model(v).Select("Value", "ModifyTime").Updates(v).Error
-			if err != nil {
-				fmt.Println("BaseFromBusinessData HandleData Update:Err:" + err.Error())
-				return
-			}
-		}
-	}
-
-	return
-}
-
-// GetEdbInfoMaxAndMinInfo
-// @Description: 获取当前指标的最大最小值
-// @author: Roc
-// @receiver m
-// @datetime 2024-04-30 17:15:39
-// @param whereParams interface{}
-// @return result EdbInfoMaxAndMinInfo
-// @return err error
-func (m *BaseFromBusinessData) GetEdbInfoMaxAndMinInfo(indexCode string) (result *EdbInfoMaxAndMinInfo, err error) {
-	sql := ``
-	sql = ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date,MIN(value) AS min_value,MAX(value) AS max_value FROM base_from_business_data WHERE index_code = ? `
-	err = global.DEFAULT_DmSQL.Raw(sql, indexCode).First(&result).Error
-	if err != nil {
-		return
-	}
-
-	var latestValue float64
-	sql = ` SELECT value AS latest_value FROM base_from_business_data WHERE index_code = ? ORDER BY data_time DESC LIMIT 1 `
-	err = global.DEFAULT_DmSQL.Raw(sql, indexCode).First(&latestValue).Error
-	result.LatestValue = latestValue
-
-	return
-}
-
-// DelDataByCond
-// @Description: 根据条件删除多条数据
-// @author: Roc
-// @receiver m
-// @datetime 2024-07-01 17:46:56
-// @param condition []string
-// @param pars []interface{}
-// @return err error
-func (m *BaseFromBusinessData) DelDataByCond(condition []string, pars []interface{}) (err error) {
-	if len(condition) <= 0 {
-		err = errors.New("条件不能为空")
-		return
-	}
-	sql := `DELETE FROM base_from_business_data `
-	sql += ` WHERE ` + strings.Join(condition, " AND ")
-
-	err = global.DEFAULT_DmSQL.Exec(sql, pars...).Error
-
-	return
-}

+ 0 - 1
models/chart.go

@@ -26,7 +26,6 @@ func DeleteChartInfoDataRedis(bodyByte []byte) (err error) {
 			return
 		}
 
-		// 删除图表的id
 		for _, v := range list {
 			_ = utils.Rc.Delete(GetChartInfoDataKey(v.ChartInfoId))
 		}

+ 0 - 666
models/edb_data_business.go

@@ -1,666 +0,0 @@
-package models
-
-import (
-	"eta_gn/eta_index_lib/global"
-	"eta_gn/eta_index_lib/models/mgo"
-	"eta_gn/eta_index_lib/utils"
-	"fmt"
-	"github.com/shopspring/decimal"
-	"go.mongodb.org/mongo-driver/bson"
-	"gorm.io/gorm"
-	"strings"
-	"time"
-)
-
-// Business 自有数据
-type Business struct {
-}
-
-// AddBaseParams
-// @Description: 基础指标的添加参数
-type AddBaseParams struct {
-	EdbCode         string `description:"指标编码"`
-	EdbName         string `description:"指标名称"`
-	Unit            string `description:"单位"`
-	ClassifyId      int    `description:"所属分类"`
-	SysUserId       int    `description:"用户id"`
-	SysUserRealName string `description:"用户真实名称"`
-	UniqueCode      string `description:"编码"`
-}
-
-// EditBaseParams
-// @Description: 基础指标的修改参数
-type EditBaseParams struct {
-	EdbCode         string   `description:"指标编码"`
-	EdbName         string   `description:"指标名称"`
-	EdbNameEn       string   `description:"指标名称(英文)"`
-	Unit            string   `description:"单位"`
-	UnitEn          string   `description:"单位(英文)"`
-	ClassifyId      int      `description:"所属分类"`
-	SysUserId       int      `description:"用户id"`
-	SysUserRealName string   `description:"用户真实名称"`
-	UniqueCode      string   `description:"编码"`
-	Lang            string   `description:"语言版本"`
-	EdbInfo         *EdbInfo `description:"指标信息"`
-}
-
-type RefreshBaseParams struct {
-	EdbInfo   *EdbInfo
-	StartDate string
-	EndDate   string
-}
-
-// Add
-// @Description: 添加指标
-// @author: Roc
-// @receiver obj
-// @datetime 2024-04-30 17:35:14
-// @param params AddBaseParams
-// @param businessIndexItem *BaseFromBusinessIndex
-// @return edbInfo *EdbInfo
-// @return err error
-// @return errMsg string
-func (obj Business) Add(params AddBaseParams, businessIndexItem *BaseFromBusinessIndex) (edbInfo *EdbInfo, err error, errMsg string) {
-	to := global.DEFAULT_DmSQL.Begin()
-	defer func() {
-		if err != nil {
-			to.Rollback()
-		} else {
-			to.Commit()
-		}
-	}()
-
-	edbInfo = new(EdbInfo)
-	edbInfo.Source = obj.GetSource()
-	edbInfo.SourceName = obj.GetSourceName()
-	edbInfo.EdbCode = params.EdbCode
-	edbInfo.EdbName = params.EdbName
-	edbInfo.EdbNameSource = params.EdbName
-	edbInfo.Frequency = businessIndexItem.Frequency
-	edbInfo.Unit = params.Unit
-	edbInfo.ClassifyId = params.ClassifyId
-	edbInfo.SysUserId = params.SysUserId
-	edbInfo.SysUserRealName = params.SysUserRealName
-	edbInfo.CreateTime = time.Now()
-	edbInfo.ModifyTime = time.Now()
-	edbInfo.UniqueCode = params.UniqueCode
-	edbInfo.CalculateFormula = ``
-	edbInfo.EdbNameEn = params.EdbName
-	edbInfo.UnitEn = params.Unit
-	edbInfo.EdbType = obj.GetEdbType()
-	edbInfo.SubSource = businessIndexItem.Source
-	edbInfo.SubSourceName = businessIndexItem.SourceName
-	edbInfo.Sort = GetAddEdbMaxSortByClassifyId(params.ClassifyId, utils.EDB_INFO_TYPE)
-	tmpErr := to.Create(edbInfo).Error
-	if tmpErr != nil {
-		err = tmpErr
-		return
-	}
-
-	// 更新数据
-	err = obj.refresh(to, edbInfo, "")
-
-	return
-}
-
-// Edit
-// @Description: 编辑指标
-// @author: Roc
-// @receiver obj
-// @datetime 2024-04-30 17:35:05
-// @param params EditBaseParams
-// @param businessIndexItem *BaseFromBusinessIndex
-// @return err error
-// @return errMsg string
-func (obj Business) Edit(params EditBaseParams, businessIndexItem *BaseFromBusinessIndex) (err error, errMsg string) {
-	edbInfo := params.EdbInfo
-
-	to := global.DEFAULT_DmSQL.Begin()
-	defer func() {
-		if err != nil {
-			to.Rollback()
-		} else {
-			to.Commit()
-		}
-	}()
-
-	//oldEdbInfo := *edbInfo
-
-	//修改指标信息
-	edbInfo.EdbName = params.EdbName
-	edbInfo.EdbNameSource = params.EdbName
-	edbInfo.Frequency = businessIndexItem.Frequency
-	edbInfo.Unit = params.Unit
-	edbInfo.ClassifyId = params.ClassifyId
-	edbInfo.EdbNameEn = params.EdbNameEn
-	edbInfo.UnitEn = params.UnitEn
-	edbInfo.SubSource = businessIndexItem.Source
-	edbInfo.SubSourceName = businessIndexItem.SourceName
-	edbInfo.ModifyTime = time.Now()
-	err = to.Model(edbInfo).Select([]string{"EdbName", "EdbNameSource", "Frequency", "Unit", "ClassifyId", "CalculateFormula", "ModifyTime", "EdbNameEn", "UnitEn", "SubSource", "SubSourceName"}).Updates(edbInfo).Error
-	if err != nil {
-		return
-	}
-
-	//计算数据
-	err = obj.refresh(to, edbInfo, "")
-
-	return
-}
-
-// Refresh 刷新
-func (obj Business) Refresh(params RefreshBaseParams) (err error, errMsg string) {
-	to := global.DEFAULT_DmSQL.Begin()
-	defer func() {
-		if err != nil {
-			to.Rollback()
-		} else {
-			to.Commit()
-		}
-	}()
-
-	// 计算数据
-	err = obj.refresh(to, params.EdbInfo, params.StartDate)
-
-	return
-}
-
-// GetSource 获取来源编码id
-func (obj Business) GetSource() int {
-	return utils.DATA_SOURCE_BUSINESS
-}
-
-// GetSourceName 获取来源名称
-func (obj Business) GetSourceName() string {
-	return utils.DATA_SOURCE_NAME_BUSINESS
-}
-
-// GetEdbType 获取指标类型
-func (obj Business) GetEdbType() int {
-	return utils.DEFAULT_EDB_TYPE
-}
-
-func (obj Business) refresh(to *gorm.DB, edbInfo *EdbInfo, startDate string) (err error) {
-	if utils.UseMongo {
-		return obj.refreshByMongo(edbInfo, startDate)
-	} else {
-		return obj.refreshByMysql(to, edbInfo, startDate)
-	}
-
-	return
-}
-
-func (obj Business) refreshByMongo(edbInfo *EdbInfo, startDate string) (err error) {
-	// 真实数据的最大日期  , 插入规则配置的日期
-	var realDataMaxDate, edbDataInsertConfigDate time.Time
-	var edbDataInsertConfig *EdbDataInsertConfig
-	var isFindConfigDateRealData bool //是否找到配置日期的实际数据的值
-	{
-		edbDataInsertConfig, err = GetEdbDataInsertConfigByEdbId(edbInfo.EdbInfoId)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			return
-		}
-		if edbDataInsertConfig != nil {
-			edbDataInsertConfigDate = edbDataInsertConfig.Date
-		}
-	}
-
-	//获取已存在的所有数据
-	baseDataList, err := obj.getBaseBusinessDataByMongo(edbInfo, startDate)
-
-	//获取指标所有数据
-	existDataList := make([]*mgo.EdbDataBusiness, 0)
-	mogDataObj := new(mgo.EdbDataBusiness)
-	{
-		// 构建查询条件
-		queryConditions := bson.M{
-			"edb_code": edbInfo.EdbCode,
-		}
-
-		if startDate != `` {
-			//获取已存在的所有数据
-			startDateTime, tmpErr := time.ParseInLocation(utils.FormatDate, startDate, time.Local)
-			if tmpErr != nil {
-				err = tmpErr
-				return
-			}
-			queryConditions["data_time"] = bson.M{"$gte": startDateTime}
-		}
-
-		existDataList, err = mogDataObj.GetAllDataList(queryConditions, []string{"data_time"})
-		if err != nil {
-			fmt.Println(obj.GetSourceName() + ",refresh err;getEdbDataBusinessList Err:" + err.Error())
-			return
-		}
-	}
-
-	existDataMap := make(map[string]*mgo.EdbDataBusiness)
-	removeDataTimeMap := make(map[string]bool) //需要移除的日期数据
-	for _, v := range existDataList {
-		tmpDate := v.DataTime.Format(utils.FormatDate)
-		existDataMap[tmpDate] = v
-		removeDataTimeMap[tmpDate] = true
-	}
-	needAddDateMap := make(map[time.Time]int)
-
-	// 待添加的数据集
-	addDataList := make([]interface{}, 0)
-	// 待更新的数据集
-	updateDataList := make([]mgo.EdbDataBusiness, 0)
-
-	for _, tmpData := range baseDataList {
-		currDate := tmpData.DataTime
-		currDateStr := currDate.Format(utils.FormatDate)
-
-		// 当前的实际值
-		saveValue := decimal.NewFromFloat(tmpData.Value).Round(4).String()
-
-		// 下面代码主要目的是处理掉手动插入的数据判断
-		{
-			if realDataMaxDate.IsZero() || currDate.After(realDataMaxDate) {
-				realDataMaxDate = currDate
-			}
-			if edbDataInsertConfigDate.IsZero() || currDate.Equal(edbDataInsertConfigDate) {
-				isFindConfigDateRealData = true
-			}
-		}
-
-		existData, ok := existDataMap[currDateStr]
-		// 如果库中已经存在该数据的话,那么就进行值的变更操作
-		if ok {
-			// 已经入到指标库的值
-			existValStr := decimal.NewFromFloat(existData.Value).Round(4).String()
-
-			//校验待删除日期数据里面是否存在该元素,如果存在的话,那么移除该日期
-			delete(removeDataTimeMap, currDateStr)
-			if existValStr != saveValue {
-				existData.Value = tmpData.Value
-				updateDataList = append(updateDataList, *existData)
-			}
-
-			continue
-		}
-
-		// 库中不存在该日期的数据
-		timestamp := currDate.UnixNano() / 1e6
-		addDataList = append(addDataList, mgo.EdbDataBusiness{
-			EdbInfoId:     edbInfo.EdbInfoId,
-			EdbCode:       edbInfo.EdbCode,
-			DataTime:      currDate,
-			Value:         tmpData.Value,
-			CreateTime:    time.Now(),
-			ModifyTime:    time.Now(),
-			DataTimestamp: timestamp,
-		})
-		needAddDateMap[currDate] = 1
-	}
-
-	// 入库
-	{
-		coll := mogDataObj.GetCollection()
-
-		//删除已经不存在的指标数据(由于该指标当日的数据删除了)
-		{
-			removeDateList := make([]time.Time, 0)
-			for dateTime := range removeDataTimeMap {
-				//获取已存在的所有数据
-				tmpDateTime, tmpErr := time.ParseInLocation(utils.FormatDate, dateTime, time.Local)
-				if tmpErr != nil {
-					err = tmpErr
-					return
-				}
-				removeDateList = append(removeDateList, tmpDateTime)
-			}
-			removeNum := len(removeDateList)
-			if removeNum > 0 {
-				err = mogDataObj.RemoveManyByColl(coll, bson.M{"edb_code": edbInfo.EdbCode, "data_time": bson.M{"$in": removeDateList}})
-				if err != nil {
-					fmt.Println("mogDataObj.RemoveMany() Err:" + err.Error())
-					return
-				}
-			}
-		}
-
-		// 插入新数据
-		if len(addDataList) > 0 {
-			err = mogDataObj.BatchInsertDataByColl(coll, 500, addDataList)
-			if err != nil {
-				fmt.Println("mogDataObj.BatchInsertData() Err:" + err.Error())
-				return
-			}
-		}
-
-		// 修改历史数据
-		if len(updateDataList) > 0 {
-			for _, v := range updateDataList {
-				err = mogDataObj.UpdateDataByColl(coll, bson.M{"_id": v.ID}, bson.M{"$set": bson.M{"value": v.Value, "modify_time": v.ModifyTime}})
-				if err != nil {
-					fmt.Println("mogDataObj.UpdateDataByColl:Err:" + err.Error())
-					return
-				}
-			}
-		}
-	}
-
-	// 处理手工数据补充的配置
-	HandleConfigInsertEdbDataByMongo(realDataMaxDate, edbDataInsertConfig, edbInfo.EdbInfoId, edbInfo.Source, edbInfo.SubSource, existDataMap, isFindConfigDateRealData)
-
-	return
-}
-
-func (obj Business) refreshByMysql(to *gorm.DB, edbInfo *EdbInfo, startDate string) (err error) {
-	dataTableName := GetEdbDataTableName(edbInfo.Source, edbInfo.SubSource)
-	edbInfoIdStr := fmt.Sprint(edbInfo.EdbInfoId)
-
-	// 真实数据的最大日期  , 插入规则配置的日期
-	var realDataMaxDate, edbDataInsertConfigDate time.Time
-	var edbDataInsertConfig *EdbDataInsertConfig
-	var isFindConfigDateRealData bool //是否找到配置日期的实际数据的值
-	{
-		edbDataInsertConfig, err = GetEdbDataInsertConfigByEdbId(edbInfo.EdbInfoId)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			return
-		}
-		if edbDataInsertConfig != nil {
-			edbDataInsertConfigDate = edbDataInsertConfig.Date
-		}
-	}
-
-	//获取已存在的所有数据
-	baseDataList, err := obj.getBaseBusinessDataByMysql(edbInfo, startDate)
-
-	//获取指标所有数据
-	var existCondition string
-	var existPars []interface{}
-
-	existCondition += " AND edb_info_id=? "
-	existPars = append(existPars, edbInfo.EdbInfoId)
-	if startDate != "" {
-		existCondition += " AND data_time>=? "
-		existPars = append(existPars, startDate)
-	}
-
-	existList, err := GetEdbDataByCondition(edbInfo.Source, edbInfo.SubSource, existCondition, existPars)
-	if err != nil {
-		fmt.Println(obj.GetSourceName() + ",refreshByMysql err;getEdbDataBusinessList Err:" + err.Error())
-		return err
-	}
-	existDataMap := make(map[string]*EdbInfoSearchData)
-	removeDataTimeMap := make(map[string]bool) //需要移除的日期数据
-	for _, v := range existList {
-		existDataMap[v.DataTime] = v
-		removeDataTimeMap[v.DataTime] = true
-	}
-	needAddDateMap := make(map[time.Time]int)
-
-	// 待添加的数据集
-	addSql := ` INSERT INTO ` + dataTableName + ` (edb_info_id,edb_code,data_time,value,create_time,modify_time,data_timestamp) values `
-	var isAdd bool
-	// 待更新的数据集
-	updateDataList := make([]*EdbInfoSearchData, 0)
-
-	for _, tmpData := range baseDataList {
-		currDate := tmpData.DataTime
-		currDateStr := currDate.Format(utils.FormatDate)
-
-		// 当前的实际值
-		saveValue := decimal.NewFromFloat(tmpData.Value).Round(4).String()
-
-		// 下面代码主要目的是处理掉手动插入的数据判断
-		{
-			if realDataMaxDate.IsZero() || currDate.After(realDataMaxDate) {
-				realDataMaxDate = currDate
-			}
-			if edbDataInsertConfigDate.IsZero() || currDate.Equal(edbDataInsertConfigDate) {
-				isFindConfigDateRealData = true
-			}
-		}
-
-		existData, ok := existDataMap[currDateStr]
-		// 如果库中已经存在该数据的话,那么就进行值的变更操作
-		if ok {
-			// 已经入到指标库的值
-			existValStr := decimal.NewFromFloat(existData.Value).Round(4).String()
-
-			//校验待删除日期数据里面是否存在该元素,如果存在的话,那么移除该日期
-			delete(removeDataTimeMap, currDateStr)
-			if existValStr != saveValue {
-				existData.Value = tmpData.Value
-				updateDataList = append(updateDataList, existData)
-			}
-
-			continue
-		}
-
-		// 库中不存在该日期的数据
-		timestamp := currDate.UnixNano() / 1e6
-		needAddDateMap[currDate] = 1
-		addSql += GetAddSql(edbInfoIdStr, edbInfo.EdbCode, currDateStr, fmt.Sprint(timestamp), saveValue)
-		isAdd = true
-	}
-
-	//删除已经不存在的指标数据(由于该指标当日的数据删除了)
-	{
-		removeDateList := make([]string, 0)
-		for dateTime := range removeDataTimeMap {
-			removeDateList = append(removeDateList, dateTime)
-		}
-		removeNum := len(removeDateList)
-		if removeNum > 0 {
-			//如果拼接指标变更了,那么需要删除所有的指标数据
-			sql := fmt.Sprintf(` DELETE FROM %s WHERE edb_info_id = ? and data_time in (`+utils.GetOrmInReplace(removeNum)+`) `, dataTableName)
-
-			err = to.Exec(sql, edbInfo.EdbInfoId, removeDateList).Error
-			if err != nil {
-				err = fmt.Errorf("删除自有数据的明细数据失败,Err:" + err.Error())
-				return
-			}
-		}
-	}
-
-	if isAdd {
-		addSql = strings.TrimRight(addSql, ",")
-		err = to.Exec(addSql).Error
-		if err != nil {
-			fmt.Println("RefreshAllCalculate add Err", err.Error())
-			return
-		}
-	}
-
-	// 修改历史数据
-	if len(updateDataList) > 0 {
-		for _, v := range updateDataList {
-			err = ModifyEdbDataById(edbInfo.Source, edbInfo.SubSource, v.EdbDataId, fmt.Sprint(v.Value))
-			if err != nil {
-				fmt.Println(obj.GetSourceName() + ",refreshByMysql:Err:" + err.Error())
-				return err
-			}
-		}
-	}
-
-	// 处理手工数据补充的配置
-	HandleConfigInsertEdbData(realDataMaxDate, edbDataInsertConfig, edbInfo.EdbInfoId, edbInfo.Source, edbInfo.SubSource, existDataMap, isFindConfigDateRealData)
-
-	return
-}
-
-// GetEdbInfoMaxAndMinInfo 获取指标的最新数据记录信息
-func (obj Business) getEdbInfoMaxAndMinInfoByMongo(edbCode string) (item *EdbInfoMaxAndMinInfo, err error) {
-	mogDataObj := new(mgo.EdbDataBusiness)
-	pipeline := []bson.M{
-		{"$match": bson.M{"edb_code": edbCode}},
-		{"$group": bson.M{
-			"_id":       nil,
-			"min_date":  bson.M{"$min": "$data_time"},
-			"max_date":  bson.M{"$max": "$data_time"},
-			"min_value": bson.M{"$min": "$value"},
-			"max_value": bson.M{"$max": "$value"},
-		}},
-		{"$project": bson.M{"_id": 0}}, // 可选,如果不需要_id字段
-	}
-	result, err := mogDataObj.GetEdbInfoMaxAndMinInfo(pipeline)
-	if err != nil {
-		fmt.Println("EdbDataBusiness getEdbDataBusinessList Err:" + err.Error())
-		return
-	}
-
-	if !result.MaxDate.IsZero() {
-		whereQuery := bson.M{"edb_code": edbCode, "data_time": result.MaxDate}
-		selectParam := bson.D{{"value", 1}, {"_id", 0}}
-		latestValue, tmpErr := mogDataObj.GetLatestValue(whereQuery, selectParam)
-		if tmpErr != nil {
-			err = tmpErr
-			return
-		}
-		result.LatestValue = latestValue.Value
-		result.EndValue = latestValue.Value
-	}
-
-	item = &EdbInfoMaxAndMinInfo{
-		MinDate:     result.MinDate.Format(utils.FormatDate),
-		MaxDate:     result.MaxDate.Format(utils.FormatDate),
-		MinValue:    result.MinValue,
-		MaxValue:    result.MaxValue,
-		LatestValue: result.LatestValue,
-		LatestDate:  result.LatestDate.Format(utils.FormatDate),
-		EndValue:    result.EndValue,
-	}
-
-	return
-}
-
-// UnifiedModifyEdbInfoMaxAndMinInfo
-// @Description: 修改指标的最大最小值和最新值
-// @author: Roc
-// @receiver obj
-// @datetime 2024-04-30 17:07:35
-// @param edbInfo *EdbInfo
-// @return err error
-func (obj Business) UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo *EdbInfo) (err error) {
-	if utils.UseMongo {
-		edbInfoMaxAndMinInfo, tmpErr := obj.getEdbInfoMaxAndMinInfoByMongo(edbInfo.EdbCode)
-		// 如果正常获取到了,那就去修改指标的最大最小值
-		if tmpErr == nil && edbInfoMaxAndMinInfo != nil {
-			err = ModifyEdbInfoMaxAndMinInfo(edbInfo.EdbInfoId, edbInfoMaxAndMinInfo)
-		} else {
-			// 清空的目的是为了避免异常返回
-			err = nil
-		}
-	} else {
-		err, _ = UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
-	}
-
-	return
-}
-
-// EdbInfoMgoData
-// @Description: mgo里面的数据
-type EdbInfoMgoData struct {
-	//EdbDataId primitive.ObjectID `description:"数据ID"`
-	DataTime time.Time `description:"数据日期"`
-	Value    float64   `description:"数据"`
-	EdbCode  string    `description:"指标编码"`
-}
-
-// getBaseBusinessData
-// @Description: 获取基础数据
-// @author: Roc
-// @receiver obj
-// @datetime 2024-04-30 11:10:46
-// @param edbInfo *EdbInfo
-// @param startDate string
-// @return newDataList []EdbInfoSearchData
-// @return err error
-func (obj Business) getBaseBusinessData(edbInfo *EdbInfo, startDate string) (newDataList []EdbInfoMgoData, err error) {
-	return obj.getBaseBusinessDataByMongo(edbInfo, startDate)
-}
-
-// getBaseBusinessDataByMongo
-// @Description: 从mongo中获取基础的明细数据
-// @author: Roc
-// @receiver obj
-// @datetime 2024-07-02 10:12:02
-// @param edbInfo *EdbInfo
-// @param startDate string
-// @return newDataList []EdbInfoMgoData
-// @return err error
-func (obj Business) getBaseBusinessDataByMongo(edbInfo *EdbInfo, startDate string) (newDataList []EdbInfoMgoData, err error) {
-	newDataList = make([]EdbInfoMgoData, 0)
-
-	// 获取数据源的指标数据
-	mogDataObj := new(mgo.BaseFromBusinessData)
-
-	// 构建查询条件
-	queryConditions := bson.M{
-		"index_code": edbInfo.EdbCode,
-	}
-
-	if startDate != `` {
-		//获取已存在的所有数据
-		startDateTime, tmpErr := time.ParseInLocation(utils.FormatDate, startDate, time.Local)
-		if tmpErr != nil {
-			err = tmpErr
-			return
-		}
-		queryConditions["data_time"] = bson.M{"$gte": startDateTime}
-	}
-
-	baseDataList, err := mogDataObj.GetAllDataList(queryConditions, []string{"data_time"})
-	if err != nil {
-		fmt.Println("getBaseBusinessData Err:" + err.Error())
-		return
-	}
-
-	for _, v := range baseDataList {
-		newDataList = append(newDataList, EdbInfoMgoData{
-			//EdbDataId: v.ID,
-			DataTime: v.DataTime,
-			Value:    v.Value,
-			EdbCode:  v.IndexCode,
-		})
-	}
-
-	return
-}
-
-// getBaseBusinessDataByMysql
-// @Description: 从mysql中获取基础的明细数据
-// @author: Roc
-// @receiver obj
-// @datetime 2024-07-02 10:12:16
-// @param edbInfo *EdbInfo
-// @param startDate string
-// @return newDataList []EdbInfoMgoData
-// @return err error
-func (obj Business) getBaseBusinessDataByMysql(edbInfo *EdbInfo, startDate string) (newDataList []EdbInfoMgoData, err error) {
-	newDataList = make([]EdbInfoMgoData, 0)
-	// 获取数据源的指标数据
-	baseBusinessDataObj := new(BaseFromBusinessData)
-
-	// 构建查询条件
-	var condition []string
-	var pars []interface{}
-	condition = append(condition, "index_code = ? ")
-	pars = append(pars, edbInfo.EdbCode)
-
-	if startDate != `` {
-		condition = append(condition, " data_time >= ? ")
-		pars = append(pars, startDate)
-	}
-
-	baseDataList, err := baseBusinessDataObj.GetAllDataList(condition, pars, " data_time ASC ")
-	if err != nil {
-		fmt.Println("getBaseBusinessData Err:" + err.Error())
-		return
-	}
-
-	for _, v := range baseDataList {
-		newDataList = append(newDataList, EdbInfoMgoData{
-			DataTime: v.DataTime,
-			Value:    v.Value,
-			EdbCode:  v.IndexCode,
-		})
-	}
-
-	return
-}

+ 368 - 422
routers/commentsRouter.go

@@ -7,427 +7,373 @@ import (
 
 func init() {
 
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"],
-		beego.ControllerComments{
-			Method:           "ChartRecalculate",
-			Router:           `/chart_recalculate`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"],
-		beego.ControllerComments{
-			Method:           "Recalculate",
-			Router:           `/recalculate`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/open:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/open:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "Detail",
-			Router:           `/edb/detail`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BaseFromTradeAnalysisController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BaseFromTradeAnalysisController"],
-		beego.ControllerComments{
-			Method:           "EdbRefresh",
-			Router:           `/edb/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "Add",
-			Router:           `/add`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "DelIndexData",
-			Router:           `/data/del`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "Edit",
-			Router:           `/edit`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "HandleBusinessIndexData",
-			Router:           `/handle`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "DelIndex",
-			Router:           `/index/del`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BusinessIndexController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "Add",
-			Router:           `/add`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "SaveAdjust",
-			Router:           `/adjust/save`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "Calculate",
-			Router:           `/base`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "StepCalculate",
-			Router:           `/base/step_calculate`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "BatchEdit",
-			Router:           `/batch/edit`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "BatchEditMulti",
-			Router:           `/batch/edit/multi`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "BatchSave",
-			Router:           `/batch/save`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "BatchSaveMulti",
-			Router:           `/batch/save/multi`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "CalculateComputeCorrelation",
-			Router:           `/compute_correlation`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "ResetCustomAnalysisData",
-			Router:           `/custom_analysis/reset`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "Edit",
-			Router:           `/edit`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbClassifyController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbClassifyController"],
-		beego.ControllerComments{
-			Method:           "GetOrAdd",
-			Router:           `/get_or_add`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "ResetEdbClassify",
-			Router:           `/classify_reset`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "CopyCalculateFromHz",
-			Router:           `/copy/calculate/from/hz`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "CopyFromHz",
-			Router:           `/copy/from/hz`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "EdbIndexDetail",
-			Router:           `/detail`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
-		beego.ControllerComments{
-			Method:           "RefreshCheck",
-			Router:           `/refresh_check`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoStatController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoStatController"],
-		beego.ControllerComments{
-			Method:           "SetEdbSourceStat",
-			Router:           `/source_update`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
-		beego.ControllerComments{
-			Method:           "GetDefaultConfigList",
-			Router:           `/config/default/list`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
-		beego.ControllerComments{
-			Method:           "GetMysteelIndexConfigList",
-			Router:           `/config/mysteel_index/list`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
-		beego.ControllerComments{
-			Method:           "GetSmmConfigList",
-			Router:           `/config/smm/list`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:GnController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:GnController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"],
-		beego.ControllerComments{
-			Method:           "Add",
-			Router:           `/add`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
-		beego.ControllerComments{
-			Method:           "CalculateBatchSave",
-			Router:           `/batch/save`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
-		beego.ControllerComments{
-			Method:           "CalculateComputeCorrelation",
-			Router:           `/compute_correlation`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
-		beego.ControllerComments{
-			Method:           "Save",
-			Router:           `/save`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
-		beego.ControllerComments{
-			Method:           "CalculateByNinePreview",
-			Router:           `/calculate_by_nine/preview`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
-		beego.ControllerComments{
-			Method:           "Save",
-			Router:           `/save`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
-		beego.ControllerComments{
-			Method:           "Add",
-			Router:           `/add`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
-		beego.ControllerComments{
-			Method:           "Edit",
-			Router:           `/edit`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
-		beego.ControllerComments{
-			Method:           "ExcePython",
-			Router:           `/exec`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"],
-		beego.ControllerComments{
-			Method:           "Calculate",
-			Router:           `/calculate`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
-
-	beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"],
-		beego.ControllerComments{
-			Method:           "Refresh",
-			Router:           `/refresh`,
-			AllowHTTPMethods: []string{"post"},
-			MethodParams:     param.Make(),
-			Filters:          nil,
-			Params:           nil})
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"],
+        beego.ControllerComments{
+            Method: "ChartRecalculate",
+            Router: `/chart_recalculate`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/factor_edb_series:FactorEdbSeriesController"],
+        beego.ControllerComments{
+            Method: "Recalculate",
+            Router: `/recalculate`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/open:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers/open:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/edb/detail`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BaseFromTradeAnalysisController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:BaseFromTradeAnalysisController"],
+        beego.ControllerComments{
+            Method: "EdbRefresh",
+            Router: `/edb/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "SaveAdjust",
+            Router: `/adjust/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "Calculate",
+            Router: `/base`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "StepCalculate",
+            Router: `/base/step_calculate`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "BatchEdit",
+            Router: `/batch/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "BatchEditMulti",
+            Router: `/batch/edit/multi`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "BatchSave",
+            Router: `/batch/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "BatchSaveMulti",
+            Router: `/batch/save/multi`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "CalculateComputeCorrelation",
+            Router: `/compute_correlation`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "ResetCustomAnalysisData",
+            Router: `/custom_analysis/reset`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:CalculateController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbClassifyController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbClassifyController"],
+        beego.ControllerComments{
+            Method: "GetOrAdd",
+            Router: `/get_or_add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "ResetEdbClassify",
+            Router: `/classify_reset`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "CopyCalculateFromHz",
+            Router: `/copy/calculate/from/hz`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "CopyFromHz",
+            Router: `/copy/from/hz`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "EdbIndexDetail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoController"],
+        beego.ControllerComments{
+            Method: "RefreshCheck",
+            Router: `/refresh_check`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoStatController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbInfoStatController"],
+        beego.ControllerComments{
+            Method: "SetEdbSourceStat",
+            Router: `/source_update`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
+        beego.ControllerComments{
+            Method: "GetDefaultConfigList",
+            Router: `/config/default/list`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
+        beego.ControllerComments{
+            Method: "GetMysteelIndexConfigList",
+            Router: `/config/mysteel_index/list`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:EdbRefreshController"],
+        beego.ControllerComments{
+            Method: "GetSmmConfigList",
+            Router: `/config/smm/list`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:GnController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:GnController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:ManualController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
+        beego.ControllerComments{
+            Method: "CalculateBatchSave",
+            Router: `/batch/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
+        beego.ControllerComments{
+            Method: "CalculateComputeCorrelation",
+            Router: `/compute_correlation`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictCalculateController"],
+        beego.ControllerComments{
+            Method: "Save",
+            Router: `/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
+        beego.ControllerComments{
+            Method: "CalculateByNinePreview",
+            Router: `/calculate_by_nine/preview`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PredictController"],
+        beego.ControllerComments{
+            Method: "Save",
+            Router: `/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:PythonController"],
+        beego.ControllerComments{
+            Method: "ExcePython",
+            Router: `/exec`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"],
+        beego.ControllerComments{
+            Method: "Calculate",
+            Router: `/calculate`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"] = append(beego.GlobalControllerRouter["eta_gn/eta_index_lib/controllers:StockPlantController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
 
 }

+ 0 - 5
routers/router.go

@@ -82,11 +82,6 @@ func init() {
 				&controllers.EdbRefreshController{},
 			),
 		),
-		beego.NSNamespace("/business_index",
-			beego.NSInclude(
-				&controllers.BusinessIndexController{},
-			),
-		),
 		beego.NSNamespace("/factor_edb_series",
 			beego.NSInclude(
 				&factor_edb_series.FactorEdbSeriesController{},

+ 0 - 712
services/base_from_business.go

@@ -1,712 +0,0 @@
-package services
-
-import (
-	"errors"
-	"eta_gn/eta_index_lib/logic"
-	"eta_gn/eta_index_lib/models"
-	"eta_gn/eta_index_lib/models/mgo"
-	"eta_gn/eta_index_lib/services/alarm_msg"
-	"eta_gn/eta_index_lib/utils"
-	"fmt"
-	"github.com/qiniu/qmgo"
-	"go.mongodb.org/mongo-driver/bson"
-	"strings"
-	"time"
-)
-
-// HandleBusinessIndex
-// @Description:  处理外部指标
-// @author: Roc
-// @datetime 2024-04-26 14:23:42
-// @param indexReq *models.AddBusinessIndexReq
-// @return err error
-func HandleBusinessIndex(indexReq *models.AddBusinessIndexReq) (resp models.BaseFromBusinessIndexResp, err error) {
-	defer func() {
-		if err != nil {
-			// 添加刷新失败日志
-			dataUpdateResult := 2
-			dataUpdateFailedReason := "服务异常"
-			edbInfo, e := models.GetEdbInfoByEdbCode(utils.DATA_SOURCE_MYSTEEL_CHEMICAL, indexReq.IndexCode)
-			if e == nil {
-				//查询指标存在,才添加刷新日志
-				_ = AddEdbInfoUpdateLog(edbInfo.EdbInfoId, 2, err.Error(), dataUpdateResult, dataUpdateFailedReason, 1, 0)
-			}
-		}
-	}()
-
-	// 没有数据就返回
-	if indexReq.DataList == nil || len(indexReq.DataList) <= 0 {
-		return
-	}
-	// 兼容频度缺少度的字段
-	if !strings.Contains(indexReq.Frequency, "度") {
-		indexReq.Frequency = indexReq.Frequency + "度"
-	}
-	if !utils.VerifyFrequency(indexReq.Frequency) {
-		err = errors.New("指标频度不合法:" + indexReq.Frequency)
-		return
-	}
-
-	// 判断来源,如果来源不存在的话,则创建
-	sourceObj := new(models.EdbBusinessSource)
-	sourceItem, err := sourceObj.GetEdbBusinessSourceItem(indexReq.SourceName)
-	if err != nil {
-		if err.Error() == utils.ErrNoRow() {
-			sourceItem = &models.EdbBusinessSource{
-				EdbBusinessSourceId: 0,
-				SourceName:          indexReq.SourceName,
-				CreateTime:          time.Now(),
-			}
-			err = sourceItem.Add()
-		} else {
-			return
-		}
-	}
-
-	// 指标
-	indexObj := new(models.BaseFromBusinessIndex)
-	if indexReq.IndexCode == `` {
-		// 如果指标编码为空,那么自动生成
-		currId, tmpErr := indexObj.GetMaxId()
-		if tmpErr != nil {
-			err = tmpErr
-			return
-		}
-		indexReq.IndexCode = fmt.Sprintf("SELF%07d", currId+1)
-	}
-	//判断指标是否存在
-	item, err := indexObj.GetIndexItem(indexReq.IndexCode)
-	if err != nil {
-		if err.Error() != utils.ErrNoRow() {
-			return
-		}
-
-		// 添加指标
-		item = &models.BaseFromBusinessIndex{
-			BaseFromBusinessIndexId: 0,
-			IndexCode:               indexReq.IndexCode,
-			IndexName:               indexReq.IndexName,
-			Unit:                    indexReq.Unit,
-			Frequency:               indexReq.Frequency,
-			Source:                  int(sourceItem.EdbBusinessSourceId),
-			SourceName:              sourceItem.SourceName,
-			//StartDate:               time.Time{},
-			//EndDate:                 time.Time{},
-			Remark:         indexReq.Remark,
-			BaseModifyTime: time.Now(),
-			DataUpdateTime: time.Now(),
-			CreateTime:     time.Now(),
-			ModifyTime:     time.Now(),
-		}
-		err = item.Add()
-		if err != nil {
-			fmt.Println("add err:" + err.Error())
-			return
-		}
-	} else {
-		updateCols := make([]string, 0)
-		if item.IndexName != indexReq.IndexName {
-			item.IndexName = indexReq.IndexName
-			updateCols = append(updateCols, "index_name")
-		}
-		if item.Unit != indexReq.Unit {
-			item.Unit = indexReq.Unit
-			updateCols = append(updateCols, "unit")
-		}
-		if item.Frequency != indexReq.Frequency {
-			item.Frequency = indexReq.Frequency
-			updateCols = append(updateCols, "frequency")
-		}
-		if item.Source != int(sourceItem.EdbBusinessSourceId) {
-			item.Source = int(sourceItem.EdbBusinessSourceId)
-			item.SourceName = sourceItem.SourceName
-			updateCols = append(updateCols, "source", "source_name")
-		}
-
-		if len(updateCols) > 0 {
-			item.BaseModifyTime = time.Now()
-			item.ModifyTime = time.Now()
-			updateCols = append(updateCols, "base_modify_time", "modify_time")
-			err = item.Update(updateCols)
-			if err != nil {
-				fmt.Println("update index err:" + err.Error())
-				return
-			}
-		}
-	}
-
-	// 数据处理
-	// 当前传入的最小日期
-	var reqMinDate time.Time
-	if utils.UseMongo {
-		reqMinDate, err = handleBusinessDataByMongo(item, indexReq.DataList)
-	} else {
-		reqMinDate, err = handleBusinessDataByMysql(item, indexReq.DataList)
-	}
-	if err != nil {
-		return
-	}
-
-	// 同步刷新指标库的指标
-	go refreshEdbBusiness(item.IndexCode, reqMinDate)
-
-	resp = models.BaseFromBusinessIndexResp{
-		IndexCode:  item.IndexCode,
-		IndexName:  item.IndexName,
-		Unit:       item.Unit,
-		Frequency:  item.Frequency,
-		SourceName: item.SourceName,
-	}
-
-	return
-}
-
-// handleBusinessDataByMongo
-// @Description: 处理外部指标数据(mongo)
-// @author: Roc
-// @datetime 2024-07-01 15:30:41
-// @param item *models.BaseFromBusinessIndex
-// @param reqDataList []*models.AddBusinessDataReq
-// @return reqMinDate time.Time 当前传入的最小日期
-// @return err error
-func handleBusinessDataByMongo(item *models.BaseFromBusinessIndex, reqDataList []models.AddBusinessDataReq) (reqMinDate time.Time, err error) {
-	mogDataObj := new(mgo.BaseFromBusinessData)
-
-	//获取已存在的所有数据
-	exitDataList, err := mogDataObj.GetAllDataList(bson.M{"index_code": item.IndexCode}, []string{"data_time"})
-	if err != nil {
-		fmt.Println("GetIndexDataList Err:" + err.Error())
-		return
-	}
-
-	// 已经存在的数据集
-	exitDataMap := make(map[string]*mgo.BaseFromBusinessData)
-	for _, v := range exitDataList {
-		exitDataMap[v.DataTime.Format(utils.FormatDate)] = v
-	}
-
-	// 待添加的数据集
-	addDataList := make([]interface{}, 0)
-	updateDataList := make([]mgo.BaseFromBusinessData, 0)
-	//var hasUpdate bool
-	// 遍历excel数据,然后跟现有的数据做校验,不存在则入库
-	for _, data := range reqDataList {
-		dateTime, tmpErr := utils.DealExcelDate(data.Date)
-		if tmpErr != nil {
-			fmt.Println("time.ParseInLocation Err:" + tmpErr.Error())
-			err = tmpErr
-			return
-		}
-
-		// 调整最小日期
-		if reqMinDate.IsZero() || reqMinDate.After(dateTime) {
-			reqMinDate = dateTime
-		}
-
-		date := dateTime.Format(utils.FormatDate)
-
-		findData, ok := exitDataMap[date]
-		if !ok {
-			addDataList = append(addDataList, mgo.BaseFromBusinessData{
-				BaseFromBusinessIndexId: item.BaseFromBusinessIndexId,
-				IndexCode:               item.IndexCode,
-				DataTime:                dateTime,
-				Value:                   data.Value,
-				CreateTime:              time.Now(),
-				ModifyTime:              time.Now(),
-				//DataTimestamp:           0,
-			})
-			continue
-		}
-
-		// 值不匹配,修改数据
-		if findData.Value != data.Value {
-			findData.Value = data.Value
-			updateDataList = append(updateDataList, *findData)
-		}
-	}
-
-	// 指标数据是否新增或修改
-	var isIndexUpdateOrAdd bool
-
-	// 入库
-	{
-		coll := mogDataObj.GetCollection()
-		if len(addDataList) > 0 {
-			isIndexUpdateOrAdd = true
-			err = mogDataObj.BatchInsertDataByColl(coll, 500, addDataList)
-			if err != nil {
-				fmt.Println("mogDataObj.HandleData() Err:" + err.Error())
-				return
-			}
-		}
-
-		if len(updateDataList) > 0 {
-			isIndexUpdateOrAdd = true
-			for _, v := range updateDataList {
-				err = mogDataObj.UpdateDataByColl(coll, bson.M{"_id": v.ID}, bson.M{"$set": bson.M{"value": v.Value, "modify_time": v.ModifyTime}})
-				if err != nil {
-					fmt.Println("UpdateDataByColl:Err:" + err.Error())
-					return
-				}
-			}
-		}
-	}
-
-	// 支持事务的话,下面操作
-	//result, err := mogDataObj.HandleData(addDataList, updateDataList)
-	//if err != nil {
-	//	fmt.Println("mogDataObj.HandleData() Err:" + err.Error())
-	//	return
-	//}
-	//fmt.Println("result", result)
-
-	//修改最大最小日期
-	indexMaxAndMinInfo, err := item.GetEdbInfoMaxAndMinInfo(item.IndexCode)
-	if err != nil {
-		return
-	}
-	if err == nil && indexMaxAndMinInfo != nil {
-		e := item.ModifyIndexMaxAndMinInfo(item.IndexCode, indexMaxAndMinInfo, isIndexUpdateOrAdd)
-		if e != nil {
-			fmt.Println("ModifyIndexMaxAndMinInfo Err:" + e.Error())
-		}
-	}
-
-	return
-}
-
-// handleBusinessDataByMysql
-// @Description: 处理外部指标数据(mysql)
-// @author: Roc
-// @datetime 2024-07-01 15:59:43
-// @param item *models.BaseFromBusinessIndex
-// @param reqDataList []models.AddBusinessDataReq
-// @return reqMinDate time.Time
-// @return err error
-func handleBusinessDataByMysql(item *models.BaseFromBusinessIndex, reqDataList []models.AddBusinessDataReq) (reqMinDate time.Time, err error) {
-	businessDataObj := new(models.BaseFromBusinessData)
-
-	var condition []string
-	var pars []interface{}
-	condition = append(condition, "index_code = ?")
-	pars = append(pars, item.IndexCode)
-	//获取已存在的所有数据
-	exitDataList, err := businessDataObj.GetAllDataList(condition, pars, "data_time ASC")
-	if err != nil {
-		fmt.Println("GetIndexDataList Err:" + err.Error())
-		return
-	}
-
-	// 已经存在的数据集
-	exitDataMap := make(map[string]*models.BaseFromBusinessData)
-	for _, v := range exitDataList {
-		exitDataMap[v.DataTime.Format(utils.FormatDate)] = v
-	}
-
-	// 待添加的数据集
-	addDataList := make([]*models.BaseFromBusinessData, 0)
-	updateDataList := make([]*models.BaseFromBusinessData, 0)
-	//var hasUpdate bool
-	// 遍历excel数据,然后跟现有的数据做校验,不存在则入库
-	for _, data := range reqDataList {
-		dateTime, tmpErr := utils.DealExcelDate(data.Date)
-		if tmpErr != nil {
-			fmt.Println("time.ParseInLocation Err:" + tmpErr.Error())
-			err = tmpErr
-			return
-		}
-
-		// 调整最小日期
-		if reqMinDate.IsZero() || reqMinDate.After(dateTime) {
-			reqMinDate = dateTime
-		}
-
-		date := dateTime.Format(utils.FormatDate)
-
-		findData, ok := exitDataMap[date]
-		if !ok {
-			addDataList = append(addDataList, &models.BaseFromBusinessData{
-				BaseFromBusinessIndexId: int(item.BaseFromBusinessIndexId),
-				IndexCode:               item.IndexCode,
-				DataTime:                dateTime,
-				Value:                   data.Value,
-				CreateTime:              time.Now(),
-				ModifyTime:              time.Now(),
-				//DataTimestamp:           0,
-			})
-			continue
-		}
-
-		// 值不匹配,修改数据
-		if findData.Value != data.Value {
-			findData.Value = data.Value
-			findData.ModifyTime = time.Now()
-			updateDataList = append(updateDataList, findData)
-		}
-	}
-
-	// 指标数据是否新增或修改
-	var isIndexUpdateOrAdd bool
-
-	// 入库
-	{
-		if len(addDataList) > 0 {
-			isIndexUpdateOrAdd = true
-		}
-
-		if len(updateDataList) > 0 {
-			isIndexUpdateOrAdd = true
-		}
-		err = businessDataObj.HandleData(addDataList, updateDataList)
-		if err != nil {
-			fmt.Println("UpdateDataByColl:Err:" + err.Error())
-			return
-		}
-	}
-
-	//修改最大最小日期
-	indexMaxAndMinInfo, err := item.GetEdbInfoMaxAndMinInfo(item.IndexCode)
-	if err != nil {
-		return
-	}
-	if err == nil && indexMaxAndMinInfo != nil {
-		e := item.ModifyIndexMaxAndMinInfo(item.IndexCode, indexMaxAndMinInfo, isIndexUpdateOrAdd)
-		if e != nil {
-			fmt.Println("ModifyIndexMaxAndMinInfo Err:" + e.Error())
-		}
-	}
-
-	return
-}
-
-// DelBusinessIndexResp
-// @Description: 删除外部指标的返回
-type DelBusinessIndexResp struct {
-	IsDeleteEdbCodeList []string `description:"已经删除了的指标编码"`
-	NoDeleteEdbCodeList []string `description:"未删除的指标编码"`
-}
-
-// DelBusinessIndex
-// @Description: 删除外部指标
-// @author: Roc
-// @datetime 2024-05-31 16:27:37
-// @param indexCodeList []string
-// @return err error
-// @return errMsg string
-func DelBusinessIndex(indexCodeList []string) (joinEdbCodeList, needDelEdbCodeList []string, err error, errMsg string) {
-	defer func() {
-		if err != nil {
-			fmt.Println("DelBusinessIndex Err:" + err.Error())
-		}
-	}()
-	errMsg = "删除失败"
-
-	if len(indexCodeList) < 0 {
-		errMsg = "指标编码不允许为空"
-		err = errors.New(errMsg)
-		return
-	}
-
-	// 指标
-	indexObj := new(models.BaseFromBusinessIndex)
-
-	//判断指标是否存在
-	baseIndexList, err := indexObj.GetIndexItemList(indexCodeList)
-	if err != nil {
-		return
-	}
-
-	// 已加入到eta指标库的编码map
-	joinEdbCodeList = make([]string, 0)
-	joinEdbMap := make(map[string]string)
-
-	// 未加入到eta指标库的编码
-	needDelEdbCodeList = make([]string, 0)
-
-	// 判断指标是否加入到指标库
-	tmpEdbInfoList, err := models.GetEdbInfoByEdbCodeList(utils.DATA_SOURCE_BUSINESS, indexCodeList)
-	if err != nil {
-		return
-	}
-	for _, v := range tmpEdbInfoList {
-		joinEdbCodeList = append(joinEdbCodeList, v.EdbCode)
-		joinEdbMap[v.EdbCode] = v.EdbCode
-	}
-
-	for _, v := range baseIndexList {
-		_, ok := joinEdbMap[v.IndexCode]
-		if !ok {
-			needDelEdbCodeList = append(needDelEdbCodeList, v.IndexCode)
-		}
-	}
-
-	// 如果需要删除的指标,则直接返回
-	if len(needDelEdbCodeList) <= 0 {
-		return
-	}
-
-	// 删除指标
-	err = indexObj.DelIndexItemList(needDelEdbCodeList)
-	if err != nil {
-		fmt.Println("删除自有指标失败, Err:" + err.Error())
-		return
-	}
-
-	if utils.UseMongo {
-		// 删除指标明细数据
-		mogDataObj := new(mgo.BaseFromBusinessData)
-		err = mogDataObj.RemoveMany(bson.M{"index_code": bson.M{"$in": needDelEdbCodeList}})
-	} else {
-		var condition []string
-		var pars []interface{}
-		delNum := len(needDelEdbCodeList)
-		if delNum > 0 {
-			condition = append(condition, "index_code in ("+utils.GetOrmInReplace(delNum)+")")
-			pars = append(pars, needDelEdbCodeList)
-
-			businessDataObj := models.BaseFromBusinessData{}
-			err = businessDataObj.DelDataByCond(condition, pars)
-		}
-	}
-	if err != nil {
-		fmt.Println("删除自有指标明细数据 Err:" + err.Error())
-		return
-	}
-
-	return
-}
-
-// DelBusinessIndexData
-// @Description: 删除指标数据
-// @author: Roc
-// @datetime 2024-05-31 15:43:32
-// @param indexCode string
-// @param dateList []string
-// @return err error
-// @return errMsg string
-func DelBusinessIndexData(indexCode string, startDate, endDate string) (err error, errMsg string) {
-	defer func() {
-		if err != nil {
-			fmt.Println("DelBusinessIndexData Err:" + err.Error())
-		}
-	}()
-	errMsg = "删除失败"
-
-	if indexCode == `` {
-		errMsg = "指标编码不允许为空"
-		err = errors.New(errMsg)
-		return
-	}
-	if startDate == `` && endDate == `` {
-		errMsg = "开始日期和结束日期不允许同时为空"
-		err = errors.New(errMsg)
-		return
-	}
-
-	// 指标
-	indexObj := new(models.BaseFromBusinessIndex)
-
-	//判断指标是否存在
-	item, err := indexObj.GetIndexItem(indexCode)
-	if err != nil {
-		if err.Error() != utils.ErrNoRow() {
-			return
-		}
-		err = nil
-		return
-	}
-
-	// 当前传入的最小日期
-	var reqMinDate time.Time
-
-	var startDateTime, endDateTime time.Time
-	if startDate != `` {
-		//获取已存在的所有数据
-		startDateTime, err = time.ParseInLocation(utils.FormatDate, startDate, time.Local)
-		if err != nil {
-			return
-		}
-		// 调整最小日期
-		if reqMinDate.IsZero() || reqMinDate.After(startDateTime) {
-			reqMinDate = startDateTime
-		}
-	}
-
-	if endDate != `` {
-		//获取已存在的所有数据
-		endDateTime, err = time.ParseInLocation(utils.FormatDate, endDate, time.Local)
-		if err != nil {
-			return
-		}
-		// 调整最小日期
-		if reqMinDate.IsZero() || reqMinDate.After(endDateTime) {
-			reqMinDate = endDateTime
-		}
-	}
-
-	// 删除具体的数据
-	var indexMaxAndMinInfo *models.EdbInfoMaxAndMinInfo
-	if utils.UseMongo {
-		indexMaxAndMinInfo, err = delBusinessIndexDataByMongo(item, startDateTime, endDateTime)
-	} else {
-		indexMaxAndMinInfo, err = delBusinessIndexDataByMysql(item, startDateTime, endDateTime)
-	}
-	if err != nil {
-		return
-	}
-
-	// 修改指标的最早最晚日期
-	if indexMaxAndMinInfo != nil {
-		e := item.ModifyIndexMaxAndMinInfo(item.IndexCode, indexMaxAndMinInfo, true)
-		if e != nil {
-			fmt.Println("ModifyIndexMaxAndMinInfo Err:" + e.Error())
-		}
-	}
-
-	// 同步刷新指标库的指标
-	go refreshEdbBusiness(item.IndexCode, reqMinDate)
-
-	return
-}
-
-// delBusinessIndexDataByMongo
-// @Description: 删除指标数据(从mongo删除)
-// @author: Roc
-// @datetime 2024-07-01 18:00:07
-// @param item *models.BaseFromBusinessIndex
-// @param startDateTime time.Time
-// @param endDateTime time.Time
-// @return err error
-func delBusinessIndexDataByMongo(item *models.BaseFromBusinessIndex, startDateTime, endDateTime time.Time) (indexMaxAndMinInfo *models.EdbInfoMaxAndMinInfo, err error) {
-	defer func() {
-		if err != nil {
-			utils.FileLog.Error("delBusinessIndexDataByMongo 删除自有指标明细数据 Err:" + err.Error())
-		}
-	}()
-
-	// 构建查询条件
-	queryConditions := bson.M{
-		"index_code": item.IndexCode,
-	}
-
-	dateCondition, err := mgo.BuildDateTimeCondition(startDateTime, endDateTime)
-	if err != nil {
-		return
-	}
-	if len(dateCondition) > 0 {
-		queryConditions["data_time"] = dateCondition
-	}
-
-	// 删除数据源中的指标明细数据
-	mogDataObj := new(mgo.BaseFromBusinessData)
-	err = mogDataObj.RemoveMany(queryConditions)
-	if err != nil {
-		return
-	}
-
-	//修改最大最小日期
-	indexMaxAndMinInfo, err = item.GetEdbInfoMaxAndMinInfo(item.IndexCode)
-	// 如果有错误,且错误信息是取不到文档,那么就不修改了
-	if err != nil && !errors.Is(err, qmgo.ErrNoSuchDocuments) {
-		return
-	}
-	// 清空的目的是为了避免异常返回
-	err = nil
-
-	return
-}
-
-// delBusinessIndexDataByMysql
-// @Description: 删除指标数据(从mysql删除)
-// @author: Roc
-// @datetime 2024-07-02 09:53:13
-// @param item *models.BaseFromBusinessIndex
-// @param startDateTime time.Time
-// @param endDateTime time.Time
-// @return err error
-func delBusinessIndexDataByMysql(item *models.BaseFromBusinessIndex, startDateTime, endDateTime time.Time) (indexMaxAndMinInfo *models.EdbInfoMaxAndMinInfo, err error) {
-	defer func() {
-		if err != nil {
-			utils.FileLog.Error("delBusinessIndexDataByMysql 删除自有指标明细数据 Err:" + err.Error())
-		}
-	}()
-
-	// 构建查询条件
-	var condition []string
-	var pars []interface{}
-	condition = append(condition, "index_code = ? ")
-	pars = append(pars, item.IndexCode)
-
-	if !startDateTime.IsZero() {
-		condition = append(condition, " data_time >= ? ")
-		pars = append(pars, startDateTime.Format(utils.FormatDate))
-	}
-	if !endDateTime.IsZero() {
-		condition = append(condition, " data_time <= ? ")
-		pars = append(pars, endDateTime.Format(utils.FormatDate))
-	}
-
-	// 删除数据源中的指标明细数据
-	businessDataObj := new(models.BaseFromBusinessData)
-	err = businessDataObj.DelDataByCond(condition, pars)
-	if err != nil {
-		return
-	}
-
-	//修改最大最小日期
-	indexMaxAndMinInfo, err = item.GetEdbInfoMaxAndMinInfo(item.IndexCode)
-	// 如果有错误,且错误信息是取不到文档,那么就不修改了
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		return
-	}
-	// 清空的目的是为了避免异常返回
-	err = nil
-
-	return
-}
-
-func refreshEdbBusiness(indexCode string, reqMinDate time.Time) {
-	var indexErr error
-	var errMsg string
-	defer func() {
-		if indexErr != nil {
-			tips := fmt.Sprintf("自有数据刷新-ETA指标刷新异常, 指标编码: %s, err: %s, 错误信息:%s", indexCode, indexErr.Error(), errMsg)
-			alarm_msg.SendAlarmMsg(tips, 3)
-		}
-	}()
-
-	edbInfo, e := models.GetEdbInfoByEdbCode(utils.DATA_SOURCE_BUSINESS, indexCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
-		indexErr = e
-		return
-	}
-
-	if edbInfo != nil {
-		startDate := ``
-		if reqMinDate.IsZero() {
-			startDate = edbInfo.EndDate
-		} else {
-			startDate = reqMinDate.Format(utils.FormatDate)
-		}
-		params := models.RefreshBaseParams{
-			EdbInfo:   edbInfo,
-			StartDate: startDate,
-		}
-		obj := models.Business{}
-
-		indexErr, errMsg = obj.Refresh(params)
-		if indexErr != nil {
-			return
-		}
-
-		// 更新指标最大最小值
-		indexErr = obj.UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
-		if indexErr != nil {
-			return
-		}
-
-		// 更新ES
-		go logic.UpdateEs(edbInfo.EdbInfoId)
-	}
-}

+ 0 - 98
static/pcsg_task.json

@@ -1,98 +0,0 @@
-[
-  {
-    "TaskKey": "IDpcsgDailyRunHistU2",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRunHist4",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRunHist1",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRunHist2",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRunHistV1",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRun4",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRun6",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRun7",
-    "Frequency": "日度",
-    "VCode": true,
-    "ExtraLetter": "O",
-    "IndexNamePrefix": "Open Interest -",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailyRun8",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  },
-  {
-    "TaskKey": "IDpcsgDailySnap0000",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": "0000"
-  },
-  {
-    "TaskKey": "IDpcsgDailySnap0330",
-    "Frequency": "日度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": "0330"
-  },
-  {
-    "TaskKey": "IDpcsgMonthRun2",
-    "Frequency": "月度",
-    "VCode": false,
-    "ExtraLetter": "",
-    "IndexNamePrefix": "",
-    "IndexCodeSuffix": ""
-  }
-]

二进制
swagger/favicon-16x16.png


二进制
swagger/favicon-32x32.png


+ 0 - 93
swagger/index.html

@@ -1,93 +0,0 @@
-<!-- HTML for static distribution bundle build -->
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8">
-  <title>Swagger UI</title>
-  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700" rel="stylesheet">
-  <link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
-  <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
-  <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
-  <style>
-    html
-    {
-        box-sizing: border-box;
-        overflow: -moz-scrollbars-vertical;
-        overflow-y: scroll;
-    }
-    *,
-    *:before,
-    *:after
-    {
-        box-sizing: inherit;
-    }
-
-    body {
-      margin:0;
-      background: #fafafa;
-    }
-  </style>
-</head>
-
-<body>
-
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0">
-  <defs>
-    <symbol viewBox="0 0 20 20" id="unlocked">
-          <path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"></path>
-    </symbol>
-
-    <symbol viewBox="0 0 20 20" id="locked">
-      <path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"/>
-    </symbol>
-
-    <symbol viewBox="0 0 20 20" id="close">
-      <path d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"/>
-    </symbol>
-
-    <symbol viewBox="0 0 20 20" id="large-arrow">
-      <path d="M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"/>
-    </symbol>
-
-    <symbol viewBox="0 0 20 20" id="large-arrow-down">
-      <path d="M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"/>
-    </symbol>
-
-
-    <symbol viewBox="0 0 24 24" id="jump-to">
-      <path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"/>
-    </symbol>
-
-    <symbol viewBox="0 0 24 24" id="expand">
-      <path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>
-    </symbol>
-
-  </defs>
-</svg>
-
-<div id="swagger-ui"></div>
-
-<script src="./swagger-ui-bundle.js"> </script>
-<script src="./swagger-ui-standalone-preset.js"> </script>
-<script>
-window.onload = function() {
-  // Build a system
-  const ui = SwaggerUIBundle({
-    url: "swagger.json",
-    dom_id: '#swagger-ui',
-    presets: [
-      SwaggerUIBundle.presets.apis,
-      SwaggerUIStandalonePreset
-    ],
-    plugins: [
-      SwaggerUIBundle.plugins.DownloadUrl
-    ],
-    layout: "StandaloneLayout"
-  })
-
-  window.ui = ui
-}
-</script>
-</body>
-
-</html>

+ 0 - 53
swagger/oauth2-redirect.html

@@ -1,53 +0,0 @@
-<!doctype html>
-<html lang="en-US">
-<body onload="run()">
-</body>
-</html>
-<script>
-    'use strict';
-    function run () {
-        var oauth2 = window.opener.swaggerUIRedirectOauth2;
-        var sentState = oauth2.state;
-        var isValid, qp, arr;
-
-        qp = (window.location.hash || location.search).substring(1);
-
-        arr = qp.split("&")
-        arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
-        qp = qp ? JSON.parse('{' + arr.join() + '}',
-                function (key, value) {
-                    return key === "" ? value : decodeURIComponent(value)
-                }
-        ) : {}
-
-        isValid = qp.state === sentState
-
-        if (oauth2.auth.schema.get("flow") === "accessCode" && !oauth2.auth.code) {
-            if (!isValid) {
-                oauth2.errCb({
-                    authId: oauth2.auth.name,
-                    source: "auth",
-                    level: "warning",
-                    message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
-                });
-            }
-
-            if (qp.code) {
-                delete oauth2.state;
-                oauth2.auth.code = qp.code;
-                oauth2.callback(oauth2.auth);
-            } else {
-                oauth2.errCb({
-                    authId: oauth2.auth.name,
-                    source: "auth",
-                    level: "error",
-                    message: "Authorization failed: no accessCode received from the server"
-                });
-            }
-        } else {
-            oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid});
-        }
-        window.close();
-    }
-
-</script>

文件差异内容过多而无法显示
+ 0 - 0
swagger/swagger-ui-bundle.js


+ 0 - 1
swagger/swagger-ui-bundle.js.map

@@ -1 +0,0 @@
-{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAyTA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA0oJA;AAgwFA;AAyrGA;AA0lFA;AA4nFA;AA+9CA;AA+gDA;AAwrCA;AA60EA;;;;;AA6oCA;AAsyJA;;;;;;;;;;;;;;AA64EA;AA4mIA;AAquJA;AA2qHA;AA2mGA;AAiiEA;AAq4DA;AAg3DA;AAoPA;;;;;;AAk7FA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AAglCA;AAu9CA;AAy8EA;AAsiCA;AA+yFA;;;;;;;;;AAgkDA;AA2zIA;AAu7FA;AAmrFA;AAu0EA","sourceRoot":""}

文件差异内容过多而无法显示
+ 0 - 0
swagger/swagger-ui-standalone-preset.js


+ 0 - 1
swagger/swagger-ui-standalone-preset.js.map

@@ -1 +0,0 @@
-{"version":3,"file":"swagger-ui-standalone-preset.js","sources":["webpack:///swagger-ui-standalone-preset.js"],"mappings":"AAAA;;;;;AA8QA;AAmvGA;AAuxFA;;;;;;AAocA;AAkvFA;AAu+CA;AAo+CA;AAgrCA;AAuyEA","sourceRoot":""}

文件差异内容过多而无法显示
+ 0 - 0
swagger/swagger-ui.css


+ 0 - 1
swagger/swagger-ui.css.map

@@ -1 +0,0 @@
-{"version":3,"file":"swagger-ui.css","sources":[],"mappings":"","sourceRoot":""}

文件差异内容过多而无法显示
+ 0 - 0
swagger/swagger-ui.js


+ 0 - 1
swagger/swagger-ui.js.map

@@ -1 +0,0 @@
-{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AA0yCA;AAoyHA;AAmyHA;AAykGA;AA+9BA;AA6iCA;AAojCA;AAu5BA","sourceRoot":""}

+ 0 - 1611
swagger/swagger.json

@@ -1,1611 +0,0 @@
-{
-    "swagger": "2.0",
-    "info": {
-        "title": "beego Test API",
-        "description": "beego has a very cool tools to autogenerate documents for your API\n",
-        "version": "1.0.0",
-        "termsOfService": "http://beego.me/",
-        "contact": {
-            "email": "astaxie@gmail.com"
-        },
-        "license": {
-            "name": "Apache 2.0",
-            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
-        }
-    },
-    "basePath": "/edbapi",
-    "paths": {
-        "/baiinfo/add": {
-            "post": {
-                "tags": [
-                    "baiinfo"
-                ],
-                "description": "新增Baiinfo指标接口\n\u003cbr\u003e",
-                "operationId": "BaiinfoController.新增Baiinfo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/baiinfo/refresh": {
-            "post": {
-                "tags": [
-                    "baiinfo"
-                ],
-                "description": "刷新baiinfo指标接口\n\u003cbr\u003e",
-                "operationId": "BaiinfoController.刷新baiinfo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/calculate/add": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "新增计算指标接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.新增计算指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateSaveReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/calculate/adjust/save": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "保存数据调整指标接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.保存数据调整指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.SaveAdjustEdbReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/calculate/batch/edit": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "累计值转月-同比值-同差等计算新增接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.累计值转月-同比值-同差等计算新增",
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "request",
-                        "description": "type json string",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateBatchSaveReq"
-                        }
-                    }
-                ],
-                "responses": {
-                    "Ret=200": {
-                        "description": "返回指标id"
-                    }
-                }
-            }
-        },
-        "/calculate/batch/save": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "累计值转月-同比值-同差等计算新增接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.累计值转月-同比值-同差等计算新增",
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "request",
-                        "description": "type json string",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateBatchSaveReq"
-                        }
-                    }
-                ],
-                "responses": {
-                    "Ret=200": {
-                        "description": "返回指标id"
-                    }
-                }
-            }
-        },
-        "/calculate/edit": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "编辑计算指标接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.编辑计算指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateSaveReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/calculate/refresh": {
-            "post": {
-                "tags": [
-                    "calculate"
-                ],
-                "description": "刷新计算指标接口\n\u003cbr\u003e",
-                "operationId": "CalculateController.刷新计算指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/cffex/add": {
-            "post": {
-                "tags": [
-                    "cffex"
-                ],
-                "description": "新增中金所指标接口\n\u003cbr\u003e",
-                "operationId": "CffexController.新增中金所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/cffex/refresh": {
-            "post": {
-                "tags": [
-                    "cffex"
-                ],
-                "description": "刷新中金所指标接口\n\u003cbr\u003e",
-                "operationId": "CffexController.刷新中金所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/coal/add": {
-            "post": {
-                "tags": [
-                    "coal"
-                ],
-                "description": "新增煤炭网指标接口\n\u003cbr\u003e",
-                "operationId": "CoalController.新增煤炭网指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/coal/refresh": {
-            "post": {
-                "tags": [
-                    "coal"
-                ],
-                "description": "刷新中国煤炭网指标接口\n\u003cbr\u003e",
-                "operationId": "CoalController.刷新中国煤炭网指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/com_trade/add": {
-            "post": {
-                "tags": [
-                    "com_trade"
-                ],
-                "description": "新增Eia Steo指标接口\n\u003cbr\u003e",
-                "operationId": "ComTradeController.新增Eia Steo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/com_trade/refresh": {
-            "post": {
-                "tags": [
-                    "com_trade"
-                ],
-                "description": "刷新Eia Steo指标接口\n\u003cbr\u003e",
-                "operationId": "ComTradeController.刷新Eia Steo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/dl/add": {
-            "post": {
-                "tags": [
-                    "dl"
-                ],
-                "description": "新增大商所指标接口\n\u003cbr\u003e",
-                "operationId": "DlController.新增大商所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/dl/refresh": {
-            "post": {
-                "tags": [
-                    "dl"
-                ],
-                "description": "刷新大商所指标接口\n\u003cbr\u003e",
-                "operationId": "DlController.刷新大商所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/eia_steo/add": {
-            "post": {
-                "tags": [
-                    "eia_steo"
-                ],
-                "description": "新增Eia Steo指标接口\n\u003cbr\u003e",
-                "operationId": "EiaSteoController.新增Eia Steo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/eia_steo/refresh": {
-            "post": {
-                "tags": [
-                    "eia_steo"
-                ],
-                "description": "刷新Eia Steo指标接口\n\u003cbr\u003e",
-                "operationId": "EiaSteoController.刷新Eia Steo指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/fubao/add": {
-            "post": {
-                "tags": [
-                    "fubao"
-                ],
-                "description": "新增富宝指标接口\n\u003cbr\u003e",
-                "operationId": "FuBaoController.新增富宝指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/fubao/refresh": {
-            "post": {
-                "tags": [
-                    "fubao"
-                ],
-                "description": "刷新路透社指标接口\n\u003cbr\u003e",
-                "operationId": "FuBaoController.刷新富宝指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/future_good/add": {
-            "post": {
-                "tags": [
-                    "future_good"
-                ],
-                "description": "新增wind指标接口\n\u003cbr\u003e",
-                "operationId": "FutureGoodEdbInfoController.新增wind商品指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/future_good/refresh": {
-            "post": {
-                "tags": [
-                    "future_good"
-                ],
-                "description": "刷新wind指标接口\n\u003cbr\u003e",
-                "operationId": "FutureGoodEdbInfoController.刷新wind期货数据指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/future_good/relation/refresh": {
-            "post": {
-                "tags": [
-                    "future_good"
-                ],
-                "description": "刷新商品期货指标相关的接口\n\u003cbr\u003e",
-                "operationId": "FutureGoodEdbInfoController.刷新商品期货指标相关的接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/gie/add": {
-            "post": {
-                "tags": [
-                    "gie"
-                ],
-                "description": "新增欧洲天然气指标接口\n\u003cbr\u003e",
-                "operationId": "GieController.新增欧洲天然气指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/gie/refresh": {
-            "post": {
-                "tags": [
-                    "gie"
-                ],
-                "description": "刷新欧洲天然气指标接口\n\u003cbr\u003e",
-                "operationId": "GieController.刷新欧洲天然气指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/google_travel/add": {
-            "post": {
-                "tags": [
-                    "google_travel"
-                ],
-                "description": "新增谷歌出行数据接口\n\u003cbr\u003e",
-                "operationId": "GoogleTravelController.新增谷歌出行数据接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/google_travel/refresh": {
-            "post": {
-                "tags": [
-                    "google_travel"
-                ],
-                "description": "刷新谷歌出行指标接口\n\u003cbr\u003e",
-                "operationId": "GoogleTravelController.刷新谷歌出行指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/lt/add": {
-            "post": {
-                "tags": [
-                    "lt"
-                ],
-                "description": "新增路透指标接口\n\u003cbr\u003e",
-                "operationId": "LtController.新增路透指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/lt/refresh": {
-            "post": {
-                "tags": [
-                    "lt"
-                ],
-                "description": "刷新路透社指标接口\n\u003cbr\u003e",
-                "operationId": "LtController.刷新路透社指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/lz/add": {
-            "post": {
-                "tags": [
-                    "lz"
-                ],
-                "description": "新增隆众指标接口\n\u003cbr\u003e",
-                "operationId": "LzController.新增隆众指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/lz/refresh": {
-            "post": {
-                "tags": [
-                    "lz"
-                ],
-                "description": "刷新隆众指标接口\n\u003cbr\u003e",
-                "operationId": "LzController.刷新隆众指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/manual/add": {
-            "post": {
-                "tags": [
-                    "manual"
-                ],
-                "description": "新增手工指标接口\n\u003cbr\u003e",
-                "operationId": "ManualController.新增手工指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/manual/refresh": {
-            "post": {
-                "tags": [
-                    "manual"
-                ],
-                "description": "刷新手工指标接口\n\u003cbr\u003e",
-                "operationId": "ManualController.刷新手工指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/mysteel/add": {
-            "post": {
-                "tags": [
-                    "mysteel"
-                ],
-                "description": "新增钢联指标接口\n\u003cbr\u003e",
-                "operationId": "MySteelController.新增钢联指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/mysteel/query/refresh": {
-            "get": {
-                "tags": [
-                    "mysteel"
-                ],
-                "description": "查询刷新指标的接口\n\u003cbr\u003e",
-                "operationId": "MySteelController.查询刷新指标的接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.CheckDeleteClassifyResp"
-                        }
-                    }
-                }
-            }
-        },
-        "/mysteel/refresh": {
-            "post": {
-                "tags": [
-                    "mysteel"
-                ],
-                "description": "刷新钢联指标接口\n\u003cbr\u003e",
-                "operationId": "MySteelController.刷新钢联指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/mysteel_chemical/add": {
-            "post": {
-                "tags": [
-                    "mysteel_chemical"
-                ],
-                "description": "新增钢联化工指标接口\n\u003cbr\u003e",
-                "operationId": "MySteelChemicalController.新增钢联化工指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/mysteel_chemical/refresh": {
-            "post": {
-                "tags": [
-                    "mysteel_chemical"
-                ],
-                "description": "刷新钢联化工指标接口\n\u003cbr\u003e",
-                "operationId": "MySteelChemicalController.刷新钢联化工指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/national_statistics/add": {
-            "post": {
-                "tags": [
-                    "national_statistics"
-                ],
-                "description": "新增指标\n\u003cbr\u003e",
-                "operationId": "NationalStatisticsController.新增指标",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/national_statistics/refresh": {
-            "post": {
-                "tags": [
-                    "national_statistics"
-                ],
-                "description": "刷新指标\n\u003cbr\u003e",
-                "operationId": "NationalStatisticsController.刷新指标",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/pb/add": {
-            "post": {
-                "tags": [
-                    "pb"
-                ],
-                "description": "新增彭博指标接口\n\u003cbr\u003e",
-                "operationId": "PbController.新增彭博指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/pb/refresh": {
-            "post": {
-                "tags": [
-                    "pb"
-                ],
-                "description": "刷新彭博指标接口\n\u003cbr\u003e",
-                "operationId": "PbController.刷新彭博指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/pb_finance/add": {
-            "post": {
-                "tags": [
-                    "pb_finance"
-                ],
-                "description": "新增彭博指标接口\n\u003cbr\u003e",
-                "operationId": "PbFinanceController.新增彭博指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/pb_finance/refresh": {
-            "post": {
-                "tags": [
-                    "pb_finance"
-                ],
-                "description": "刷新彭博指标接口\n\u003cbr\u003e",
-                "operationId": "PbFinanceController.刷新彭博指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/predict/refresh": {
-            "post": {
-                "tags": [
-                    "predict"
-                ],
-                "description": "刷新预测指标接口(有些预测指标里面含有动态数据)\n\u003cbr\u003e",
-                "operationId": "PredictController.刷新预测指标接口(有些预测指标里面含有动态数据)",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/predict/save": {
-            "post": {
-                "tags": [
-                    "predict"
-                ],
-                "description": "新增预测指标运算接口\n\u003cbr\u003e",
-                "operationId": "PredictController.新增/编辑预测指标运算接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateSaveReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/predict_calculate/batch/save": {
-            "post": {
-                "tags": [
-                    "predict_calculate"
-                ],
-                "description": "累计值转月-同比值-同差等计算新增接口\n\u003cbr\u003e",
-                "operationId": "PredictCalculateController.累计值转月-同比值-同差等计算新增",
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "request",
-                        "description": "type json string",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateBatchSaveReq"
-                        }
-                    }
-                ],
-                "responses": {
-                    "Ret=200": {
-                        "description": "返回指标id"
-                    }
-                }
-            }
-        },
-        "/predict_calculate/refresh": {
-            "post": {
-                "tags": [
-                    "predict_calculate"
-                ],
-                "description": "刷新计算指标接口\n\u003cbr\u003e",
-                "operationId": "PredictCalculateController.刷新计算指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/predict_calculate/save": {
-            "post": {
-                "tags": [
-                    "predict_calculate"
-                ],
-                "description": "新增预测指标运算接口\n\u003cbr\u003e",
-                "operationId": "PredictCalculateController.新增/编辑预测指标运算接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EdbInfoCalculateSaveReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/python/add": {
-            "post": {
-                "tags": [
-                    "python"
-                ],
-                "description": "编辑指标接口\n\u003cbr\u003e",
-                "operationId": "PythonController.编辑指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EditEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/python/edit": {
-            "post": {
-                "tags": [
-                    "python"
-                ],
-                "description": "编辑指标接口\n\u003cbr\u003e",
-                "operationId": "PythonController.编辑指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.EditEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/python/exec": {
-            "post": {
-                "tags": [
-                    "python"
-                ],
-                "description": "执行python代码接口\n\u003cbr\u003e",
-                "operationId": "PythonController.执行python代码接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.ExecPythonEdbReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/sci/add": {
-            "post": {
-                "tags": [
-                    "sci"
-                ],
-                "description": "新增Sci指标接口\n\u003cbr\u003e",
-                "operationId": "SciController.新增Sci指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/sci/refresh": {
-            "post": {
-                "tags": [
-                    "sci"
-                ],
-                "description": "刷新sci指标接口\n\u003cbr\u003e",
-                "operationId": "SciController.刷新sci指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/sh/add": {
-            "post": {
-                "tags": [
-                    "sh"
-                ],
-                "description": "新增上期所指标接口\n\u003cbr\u003e",
-                "operationId": "ShController.新增上期所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/sh/refresh": {
-            "post": {
-                "tags": [
-                    "sh"
-                ],
-                "description": "刷新上期所指标接口\n\u003cbr\u003e",
-                "operationId": "ShController.刷新上期所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/shfe/add": {
-            "post": {
-                "tags": [
-                    "shfe"
-                ],
-                "description": "新增上期能源指标接口\n\u003cbr\u003e",
-                "operationId": "ShfeController.新增上期能源指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/shfe/refresh": {
-            "post": {
-                "tags": [
-                    "shfe"
-                ],
-                "description": "刷新上期能源指标接口\n\u003cbr\u003e",
-                "operationId": "ShfeController.刷新上期能源指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/smm/add": {
-            "post": {
-                "tags": [
-                    "smm"
-                ],
-                "description": "新增有色指标接口\n\u003cbr\u003e",
-                "operationId": "SmmController.新增有色指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/smm/refresh": {
-            "post": {
-                "tags": [
-                    "smm"
-                ],
-                "description": "刷新有色指标接口\n\u003cbr\u003e",
-                "operationId": "SmmController.刷新有色指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/stock_plant/calculate": {
-            "post": {
-                "tags": [
-                    "stock_plant"
-                ],
-                "description": "计算减产数\n\u003cbr\u003e",
-                "operationId": "StockPlantController.计算减产数",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/supply_analysis.CalculateVarietyReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/stock_plant/refresh": {
-            "post": {
-                "tags": [
-                    "stock_plant"
-                ],
-                "description": "刷新手工指标接口\n\u003cbr\u003e",
-                "operationId": "StockPlantController.刷新手工指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/ths/add": {
-            "post": {
-                "tags": [
-                    "ths"
-                ],
-                "description": "新增同花顺指标接口\n\u003cbr\u003e",
-                "operationId": "ThsController.新增同花顺指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/ths/refresh": {
-            "post": {
-                "tags": [
-                    "ths"
-                ],
-                "description": "刷新同花顺指标接口\n\u003cbr\u003e",
-                "operationId": "ThsController.刷新同花顺指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/wind/add": {
-            "post": {
-                "tags": [
-                    "wind"
-                ],
-                "description": "新增wind指标接口\n\u003cbr\u003e",
-                "operationId": "WindController.新增wind指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/wind/refresh": {
-            "post": {
-                "tags": [
-                    "wind"
-                ],
-                "description": "刷新wind指标接口\n\u003cbr\u003e",
-                "operationId": "WindController.刷新wind指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/zz/add": {
-            "post": {
-                "tags": [
-                    "zz"
-                ],
-                "description": "新增郑商所指标接口\n\u003cbr\u003e",
-                "operationId": "ZzController.新增郑商所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.AddEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        },
-        "/zz/refresh": {
-            "post": {
-                "tags": [
-                    "zz"
-                ],
-                "description": "刷新郑商所指标接口\n\u003cbr\u003e",
-                "operationId": "ZzController.刷新郑商所指标接口",
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/models.RefreshEdbInfoReq"
-                        }
-                    }
-                }
-            }
-        }
-    },
-    "definitions": {
-        "models.AddEdbInfoReq": {
-            "title": "AddEdbInfoReq",
-            "type": "object",
-            "properties": {
-                "EdbCode": {
-                    "description": "指标编码",
-                    "type": "string"
-                }
-            }
-        },
-        "models.CheckDeleteClassifyResp": {
-            "title": "CheckDeleteClassifyResp",
-            "type": "object"
-        },
-        "models.EdbInfoCalculateBatchSaveReq": {
-            "title": "EdbInfoCalculateBatchSaveReq",
-            "type": "object",
-            "properties": {
-                "AdminId": {
-                    "description": "添加人id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "AdminName": {
-                    "description": "添加人名称",
-                    "type": "string"
-                },
-                "CalculateFormula": {
-                    "description": "计算公式",
-                    "type": "string"
-                },
-                "Calendar": {
-                    "description": "公历/农历",
-                    "type": "string"
-                },
-                "ClassifyId": {
-                    "description": "分类id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "EdbInfoId": {
-                    "description": "指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "EdbInfoIdArr": {
-                    "description": "关联指标列表",
-                    "type": "array",
-                    "items": {
-                        "$ref": "#/definitions/models.EdbInfoCalculateEdbInfoIdReq"
-                    }
-                },
-                "EdbName": {
-                    "description": "指标名称",
-                    "type": "string"
-                },
-                "Formula": {
-                    "description": "N值/移动天数",
-                    "type": "string"
-                },
-                "Frequency": {
-                    "description": "频度",
-                    "type": "string"
-                },
-                "FromEdbInfoId": {
-                    "description": "计算来源指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "MoveFrequency": {
-                    "description": "移动频度:天/周/月/季/年",
-                    "type": "string"
-                },
-                "MoveType": {
-                    "description": "移动方式:1:领先(默认),2:滞后",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "Source": {
-                    "description": "来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:升频",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "Unit": {
-                    "description": "单位",
-                    "type": "string"
-                }
-            }
-        },
-        "models.EdbInfoCalculateEdbInfoIdReq": {
-            "title": "EdbInfoCalculateEdbInfoIdReq",
-            "type": "object",
-            "properties": {
-                "EdbInfoId": {
-                    "description": "指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "FromTag": {
-                    "description": "指标对应标签",
-                    "type": "string"
-                },
-                "MoveValue": {
-                    "description": "移动的值",
-                    "type": "integer",
-                    "format": "int64"
-                }
-            }
-        },
-        "models.EdbInfoCalculateSaveReq": {
-            "title": "EdbInfoCalculateSaveReq",
-            "type": "object",
-            "properties": {
-                "AdminId": {
-                    "description": "添加人id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "AdminName": {
-                    "description": "添加人名称",
-                    "type": "string"
-                },
-                "CalculateFormula": {
-                    "description": "计算公式",
-                    "type": "string"
-                },
-                "ClassifyId": {
-                    "description": "分类id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "EdbInfoId": {
-                    "description": "指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "EdbInfoIdArr": {
-                    "type": "array",
-                    "items": {
-                        "$ref": "#/definitions/models.EdbInfoFromTag"
-                    }
-                },
-                "EdbName": {
-                    "description": "指标名称",
-                    "type": "string"
-                },
-                "Frequency": {
-                    "description": "频率",
-                    "type": "string"
-                },
-                "Unit": {
-                    "description": "单位",
-                    "type": "string"
-                }
-            }
-        },
-        "models.EdbInfoFromTag": {
-            "title": "EdbInfoFromTag",
-            "type": "object",
-            "properties": {
-                "EdbInfoId": {
-                    "description": "指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "FromTag": {
-                    "description": "指标对应标签",
-                    "type": "string"
-                }
-            }
-        },
-        "models.EditEdbInfoReq": {
-            "title": "EditEdbInfoReq",
-            "type": "object"
-        },
-        "models.ExecPythonEdbReq": {
-            "title": "ExecPythonEdbReq",
-            "type": "object",
-            "properties": {
-                "PythonCode": {
-                    "description": "python代码",
-                    "type": "string"
-                }
-            }
-        },
-        "models.RefreshEdbInfoReq": {
-            "title": "RefreshEdbInfoReq",
-            "type": "object",
-            "properties": {
-                "EdbCode": {
-                    "description": "指标编码",
-                    "type": "string"
-                },
-                "EdbInfoId": {
-                    "description": "指标ID",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "StartDate": {
-                    "description": "开始日期",
-                    "type": "string"
-                }
-            }
-        },
-        "models.SaveAdjustEdbDataReq": {
-            "title": "SaveAdjustEdbDataReq",
-            "type": "object",
-            "properties": {
-                "Date": {
-                    "description": "数据日期",
-                    "type": "string"
-                },
-                "Value": {
-                    "description": "数据值",
-                    "type": "number",
-                    "format": "double"
-                }
-            }
-        },
-        "models.SaveAdjustEdbReq": {
-            "title": "SaveAdjustEdbReq",
-            "type": "object",
-            "properties": {
-                "AdminId": {
-                    "description": "添加人id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "AdminName": {
-                    "description": "添加人名称",
-                    "type": "string"
-                },
-                "ClassifyId": {
-                    "description": "分类id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "DataList": {
-                    "description": "指标对应的数据值",
-                    "type": "array",
-                    "items": {
-                        "$ref": "#/definitions/models.SaveAdjustEdbDataReq"
-                    }
-                },
-                "EdbInfoId": {
-                    "description": "指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "EdbName": {
-                    "description": "指标名称",
-                    "type": "string"
-                },
-                "Frequency": {
-                    "description": "频度",
-                    "type": "string"
-                },
-                "FromEdbInfoId": {
-                    "description": "来源指标id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "Unit": {
-                    "description": "单位",
-                    "type": "string"
-                }
-            }
-        },
-        "supply_analysis.CalculateVarietyReq": {
-            "title": "CalculateVarietyReq",
-            "type": "object",
-            "properties": {
-                "AdminId": {
-                    "description": "操作人id",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "AdminName": {
-                    "description": "操作人名称",
-                    "type": "string"
-                },
-                "VarietyId": {
-                    "description": "品种id",
-                    "type": "integer",
-                    "format": "int64"
-                }
-            }
-        }
-    },
-    "tags": [
-        {
-            "name": "ths",
-            "description": "同花顺\n"
-        },
-        {
-            "name": "pb",
-            "description": "彭博\n"
-        },
-        {
-            "name": "pb_finance",
-            "description": "PbFinanceController 彭博财务\n"
-        },
-        {
-            "name": "wind",
-            "description": "wind\n"
-        },
-        {
-            "name": "lz",
-            "description": "隆众\n"
-        },
-        {
-            "name": "lt",
-            "description": "路透社\n"
-        },
-        {
-            "name": "smm",
-            "description": "有色\n"
-        },
-        {
-            "name": "mysteel",
-            "description": "钢联\n"
-        },
-        {
-            "name": "manual",
-            "description": "手工指标\n"
-        },
-        {
-            "name": "calculate",
-            "description": "CalculateController 计算指标\n"
-        },
-        {
-            "name": "zz",
-            "description": "郑商所\n"
-        },
-        {
-            "name": "dl",
-            "description": "大商所\n"
-        },
-        {
-            "name": "sh",
-            "description": "上期所\n"
-        },
-        {
-            "name": "cffex",
-            "description": "中金所\n"
-        },
-        {
-            "name": "shfe",
-            "description": "上期能源\n"
-        },
-        {
-            "name": "gie",
-            "description": "欧洲天然气\n"
-        },
-        {
-            "name": "coal",
-            "description": "中国煤炭网\n"
-        },
-        {
-            "name": "python",
-            "description": "PythonController 计算指标\n"
-        },
-        {
-            "name": "google_travel",
-            "description": "谷歌出行数据\n"
-        },
-        {
-            "name": "mysteel_chemical",
-            "description": "MySteelChemicalController 钢联化工\n"
-        },
-        {
-            "name": "predict_calculate",
-            "description": "PredictCalculateController 预测计算指标\n"
-        },
-        {
-            "name": "eia_steo",
-            "description": "EiaSteoController Eia Steo报告\n"
-        },
-        {
-            "name": "predict",
-            "description": "PredictController 预测指标\n"
-        },
-        {
-            "name": "future_good",
-            "description": "FutureGoodEdbInfoController 期货数据\n"
-        },
-        {
-            "name": "sci",
-            "description": "有色\n"
-        },
-        {
-            "name": "com_trade",
-            "description": "ComTradeController Eia Steo报告\n"
-        },
-        {
-            "name": "baiinfo",
-            "description": "百川盈孚\n"
-        },
-        {
-            "name": "stock_plant",
-            "description": "StockPlantController 存量装置\n"
-        },
-        {
-            "name": "national_statistics",
-            "description": "NationalStatisticsController 国家统计局\n"
-        },
-        {
-            "name": "fubao",
-            "description": "富宝-数据对接\n"
-        }
-    ]
-}

+ 0 - 1220
swagger/swagger.yml

@@ -1,1220 +0,0 @@
-swagger: "2.0"
-info:
-  title: beego Test API
-  description: |
-    beego has a very cool tools to autogenerate documents for your API
-  version: 1.0.0
-  termsOfService: http://beego.me/
-  contact:
-    email: astaxie@gmail.com
-  license:
-    name: Apache 2.0
-    url: http://www.apache.org/licenses/LICENSE-2.0.html
-basePath: /edbapi
-paths:
-  /baiinfo/add:
-    post:
-      tags:
-      - baiinfo
-      description: |-
-        新增Baiinfo指标接口
-        <br>
-      operationId: BaiinfoController.新增Baiinfo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /baiinfo/refresh:
-    post:
-      tags:
-      - baiinfo
-      description: |-
-        刷新baiinfo指标接口
-        <br>
-      operationId: BaiinfoController.刷新baiinfo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /calculate/add:
-    post:
-      tags:
-      - calculate
-      description: |-
-        新增计算指标接口
-        <br>
-      operationId: CalculateController.新增计算指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EdbInfoCalculateSaveReq'
-  /calculate/adjust/save:
-    post:
-      tags:
-      - calculate
-      description: |-
-        保存数据调整指标接口
-        <br>
-      operationId: CalculateController.保存数据调整指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.SaveAdjustEdbReq'
-  /calculate/batch/edit:
-    post:
-      tags:
-      - calculate
-      description: |-
-        累计值转月-同比值-同差等计算新增接口
-        <br>
-      operationId: CalculateController.累计值转月-同比值-同差等计算新增
-      parameters:
-      - in: body
-        name: request
-        description: type json string
-        required: true
-        schema:
-          $ref: '#/definitions/models.EdbInfoCalculateBatchSaveReq'
-      responses:
-        Ret=200:
-          description: 返回指标id
-  /calculate/batch/save:
-    post:
-      tags:
-      - calculate
-      description: |-
-        累计值转月-同比值-同差等计算新增接口
-        <br>
-      operationId: CalculateController.累计值转月-同比值-同差等计算新增
-      parameters:
-      - in: body
-        name: request
-        description: type json string
-        required: true
-        schema:
-          $ref: '#/definitions/models.EdbInfoCalculateBatchSaveReq'
-      responses:
-        Ret=200:
-          description: 返回指标id
-  /calculate/edit:
-    post:
-      tags:
-      - calculate
-      description: |-
-        编辑计算指标接口
-        <br>
-      operationId: CalculateController.编辑计算指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EdbInfoCalculateSaveReq'
-  /calculate/refresh:
-    post:
-      tags:
-      - calculate
-      description: |-
-        刷新计算指标接口
-        <br>
-      operationId: CalculateController.刷新计算指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /cffex/add:
-    post:
-      tags:
-      - cffex
-      description: |-
-        新增中金所指标接口
-        <br>
-      operationId: CffexController.新增中金所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /cffex/refresh:
-    post:
-      tags:
-      - cffex
-      description: |-
-        刷新中金所指标接口
-        <br>
-      operationId: CffexController.刷新中金所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /coal/add:
-    post:
-      tags:
-      - coal
-      description: |-
-        新增煤炭网指标接口
-        <br>
-      operationId: CoalController.新增煤炭网指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /coal/refresh:
-    post:
-      tags:
-      - coal
-      description: |-
-        刷新中国煤炭网指标接口
-        <br>
-      operationId: CoalController.刷新中国煤炭网指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /com_trade/add:
-    post:
-      tags:
-      - com_trade
-      description: |-
-        新增Eia Steo指标接口
-        <br>
-      operationId: ComTradeController.新增Eia Steo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /com_trade/refresh:
-    post:
-      tags:
-      - com_trade
-      description: |-
-        刷新Eia Steo指标接口
-        <br>
-      operationId: ComTradeController.刷新Eia Steo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /dl/add:
-    post:
-      tags:
-      - dl
-      description: |-
-        新增大商所指标接口
-        <br>
-      operationId: DlController.新增大商所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /dl/refresh:
-    post:
-      tags:
-      - dl
-      description: |-
-        刷新大商所指标接口
-        <br>
-      operationId: DlController.刷新大商所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /eia_steo/add:
-    post:
-      tags:
-      - eia_steo
-      description: |-
-        新增Eia Steo指标接口
-        <br>
-      operationId: EiaSteoController.新增Eia Steo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /eia_steo/refresh:
-    post:
-      tags:
-      - eia_steo
-      description: |-
-        刷新Eia Steo指标接口
-        <br>
-      operationId: EiaSteoController.刷新Eia Steo指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /fubao/add:
-    post:
-      tags:
-      - fubao
-      description: |-
-        新增富宝指标接口
-        <br>
-      operationId: FuBaoController.新增富宝指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /fubao/refresh:
-    post:
-      tags:
-      - fubao
-      description: |-
-        刷新路透社指标接口
-        <br>
-      operationId: FuBaoController.刷新富宝指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /future_good/add:
-    post:
-      tags:
-      - future_good
-      description: |-
-        新增wind指标接口
-        <br>
-      operationId: FutureGoodEdbInfoController.新增wind商品指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /future_good/refresh:
-    post:
-      tags:
-      - future_good
-      description: |-
-        刷新wind指标接口
-        <br>
-      operationId: FutureGoodEdbInfoController.刷新wind期货数据指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /future_good/relation/refresh:
-    post:
-      tags:
-      - future_good
-      description: |-
-        刷新商品期货指标相关的接口
-        <br>
-      operationId: FutureGoodEdbInfoController.刷新商品期货指标相关的接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /gie/add:
-    post:
-      tags:
-      - gie
-      description: |-
-        新增欧洲天然气指标接口
-        <br>
-      operationId: GieController.新增欧洲天然气指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /gie/refresh:
-    post:
-      tags:
-      - gie
-      description: |-
-        刷新欧洲天然气指标接口
-        <br>
-      operationId: GieController.刷新欧洲天然气指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /google_travel/add:
-    post:
-      tags:
-      - google_travel
-      description: |-
-        新增谷歌出行数据接口
-        <br>
-      operationId: GoogleTravelController.新增谷歌出行数据接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /google_travel/refresh:
-    post:
-      tags:
-      - google_travel
-      description: |-
-        刷新谷歌出行指标接口
-        <br>
-      operationId: GoogleTravelController.刷新谷歌出行指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /lt/add:
-    post:
-      tags:
-      - lt
-      description: |-
-        新增路透指标接口
-        <br>
-      operationId: LtController.新增路透指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /lt/refresh:
-    post:
-      tags:
-      - lt
-      description: |-
-        刷新路透社指标接口
-        <br>
-      operationId: LtController.刷新路透社指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /lz/add:
-    post:
-      tags:
-      - lz
-      description: |-
-        新增隆众指标接口
-        <br>
-      operationId: LzController.新增隆众指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /lz/refresh:
-    post:
-      tags:
-      - lz
-      description: |-
-        刷新隆众指标接口
-        <br>
-      operationId: LzController.刷新隆众指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /manual/add:
-    post:
-      tags:
-      - manual
-      description: |-
-        新增手工指标接口
-        <br>
-      operationId: ManualController.新增手工指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /manual/refresh:
-    post:
-      tags:
-      - manual
-      description: |-
-        刷新手工指标接口
-        <br>
-      operationId: ManualController.刷新手工指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /mysteel/add:
-    post:
-      tags:
-      - mysteel
-      description: |-
-        新增钢联指标接口
-        <br>
-      operationId: MySteelController.新增钢联指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /mysteel/query/refresh:
-    get:
-      tags:
-      - mysteel
-      description: |-
-        查询刷新指标的接口
-        <br>
-      operationId: MySteelController.查询刷新指标的接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.CheckDeleteClassifyResp'
-  /mysteel/refresh:
-    post:
-      tags:
-      - mysteel
-      description: |-
-        刷新钢联指标接口
-        <br>
-      operationId: MySteelController.刷新钢联指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /mysteel_chemical/add:
-    post:
-      tags:
-      - mysteel_chemical
-      description: |-
-        新增钢联化工指标接口
-        <br>
-      operationId: MySteelChemicalController.新增钢联化工指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /mysteel_chemical/refresh:
-    post:
-      tags:
-      - mysteel_chemical
-      description: |-
-        刷新钢联化工指标接口
-        <br>
-      operationId: MySteelChemicalController.刷新钢联化工指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /national_statistics/add:
-    post:
-      tags:
-      - national_statistics
-      description: |-
-        新增指标
-        <br>
-      operationId: NationalStatisticsController.新增指标
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /national_statistics/refresh:
-    post:
-      tags:
-      - national_statistics
-      description: |-
-        刷新指标
-        <br>
-      operationId: NationalStatisticsController.刷新指标
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /pb/add:
-    post:
-      tags:
-      - pb
-      description: |-
-        新增彭博指标接口
-        <br>
-      operationId: PbController.新增彭博指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /pb/refresh:
-    post:
-      tags:
-      - pb
-      description: |-
-        刷新彭博指标接口
-        <br>
-      operationId: PbController.刷新彭博指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /pb_finance/add:
-    post:
-      tags:
-      - pb_finance
-      description: |-
-        新增彭博指标接口
-        <br>
-      operationId: PbFinanceController.新增彭博指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /pb_finance/refresh:
-    post:
-      tags:
-      - pb_finance
-      description: |-
-        刷新彭博指标接口
-        <br>
-      operationId: PbFinanceController.刷新彭博指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /predict/refresh:
-    post:
-      tags:
-      - predict
-      description: |-
-        刷新预测指标接口(有些预测指标里面含有动态数据)
-        <br>
-      operationId: PredictController.刷新预测指标接口(有些预测指标里面含有动态数据)
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /predict/save:
-    post:
-      tags:
-      - predict
-      description: |-
-        新增预测指标运算接口
-        <br>
-      operationId: PredictController.新增/编辑预测指标运算接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EdbInfoCalculateSaveReq'
-  /predict_calculate/batch/save:
-    post:
-      tags:
-      - predict_calculate
-      description: |-
-        累计值转月-同比值-同差等计算新增接口
-        <br>
-      operationId: PredictCalculateController.累计值转月-同比值-同差等计算新增
-      parameters:
-      - in: body
-        name: request
-        description: type json string
-        required: true
-        schema:
-          $ref: '#/definitions/models.EdbInfoCalculateBatchSaveReq'
-      responses:
-        Ret=200:
-          description: 返回指标id
-  /predict_calculate/refresh:
-    post:
-      tags:
-      - predict_calculate
-      description: |-
-        刷新计算指标接口
-        <br>
-      operationId: PredictCalculateController.刷新计算指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /predict_calculate/save:
-    post:
-      tags:
-      - predict_calculate
-      description: |-
-        新增预测指标运算接口
-        <br>
-      operationId: PredictCalculateController.新增/编辑预测指标运算接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EdbInfoCalculateSaveReq'
-  /python/add:
-    post:
-      tags:
-      - python
-      description: |-
-        编辑指标接口
-        <br>
-      operationId: PythonController.编辑指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EditEdbInfoReq'
-  /python/edit:
-    post:
-      tags:
-      - python
-      description: |-
-        编辑指标接口
-        <br>
-      operationId: PythonController.编辑指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.EditEdbInfoReq'
-  /python/exec:
-    post:
-      tags:
-      - python
-      description: |-
-        执行python代码接口
-        <br>
-      operationId: PythonController.执行python代码接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.ExecPythonEdbReq'
-  /sci/add:
-    post:
-      tags:
-      - sci
-      description: |-
-        新增Sci指标接口
-        <br>
-      operationId: SciController.新增Sci指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /sci/refresh:
-    post:
-      tags:
-      - sci
-      description: |-
-        刷新sci指标接口
-        <br>
-      operationId: SciController.刷新sci指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /sh/add:
-    post:
-      tags:
-      - sh
-      description: |-
-        新增上期所指标接口
-        <br>
-      operationId: ShController.新增上期所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /sh/refresh:
-    post:
-      tags:
-      - sh
-      description: |-
-        刷新上期所指标接口
-        <br>
-      operationId: ShController.刷新上期所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /shfe/add:
-    post:
-      tags:
-      - shfe
-      description: |-
-        新增上期能源指标接口
-        <br>
-      operationId: ShfeController.新增上期能源指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /shfe/refresh:
-    post:
-      tags:
-      - shfe
-      description: |-
-        刷新上期能源指标接口
-        <br>
-      operationId: ShfeController.刷新上期能源指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /smm/add:
-    post:
-      tags:
-      - smm
-      description: |-
-        新增有色指标接口
-        <br>
-      operationId: SmmController.新增有色指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /smm/refresh:
-    post:
-      tags:
-      - smm
-      description: |-
-        刷新有色指标接口
-        <br>
-      operationId: SmmController.刷新有色指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /stock_plant/calculate:
-    post:
-      tags:
-      - stock_plant
-      description: |-
-        计算减产数
-        <br>
-      operationId: StockPlantController.计算减产数
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/supply_analysis.CalculateVarietyReq'
-  /stock_plant/refresh:
-    post:
-      tags:
-      - stock_plant
-      description: |-
-        刷新手工指标接口
-        <br>
-      operationId: StockPlantController.刷新手工指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /ths/add:
-    post:
-      tags:
-      - ths
-      description: |-
-        新增同花顺指标接口
-        <br>
-      operationId: ThsController.新增同花顺指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /ths/refresh:
-    post:
-      tags:
-      - ths
-      description: |-
-        刷新同花顺指标接口
-        <br>
-      operationId: ThsController.刷新同花顺指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /wind/add:
-    post:
-      tags:
-      - wind
-      description: |-
-        新增wind指标接口
-        <br>
-      operationId: WindController.新增wind指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /wind/refresh:
-    post:
-      tags:
-      - wind
-      description: |-
-        刷新wind指标接口
-        <br>
-      operationId: WindController.刷新wind指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-  /zz/add:
-    post:
-      tags:
-      - zz
-      description: |-
-        新增郑商所指标接口
-        <br>
-      operationId: ZzController.新增郑商所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.AddEdbInfoReq'
-  /zz/refresh:
-    post:
-      tags:
-      - zz
-      description: |-
-        刷新郑商所指标接口
-        <br>
-      operationId: ZzController.刷新郑商所指标接口
-      responses:
-        "200":
-          description: ""
-          schema:
-            $ref: '#/definitions/models.RefreshEdbInfoReq'
-definitions:
-  models.AddEdbInfoReq:
-    title: AddEdbInfoReq
-    type: object
-    properties:
-      EdbCode:
-        description: 指标编码
-        type: string
-  models.CheckDeleteClassifyResp:
-    title: CheckDeleteClassifyResp
-    type: object
-  models.EdbInfoCalculateBatchSaveReq:
-    title: EdbInfoCalculateBatchSaveReq
-    type: object
-    properties:
-      AdminId:
-        description: 添加人id
-        type: integer
-        format: int64
-      AdminName:
-        description: 添加人名称
-        type: string
-      CalculateFormula:
-        description: 计算公式
-        type: string
-      Calendar:
-        description: 公历/农历
-        type: string
-      ClassifyId:
-        description: 分类id
-        type: integer
-        format: int64
-      EdbInfoId:
-        description: 指标id
-        type: integer
-        format: int64
-      EdbInfoIdArr:
-        description: 关联指标列表
-        type: array
-        items:
-          $ref: '#/definitions/models.EdbInfoCalculateEdbInfoIdReq'
-      EdbName:
-        description: 指标名称
-        type: string
-      Formula:
-        description: N值/移动天数
-        type: string
-      Frequency:
-        description: 频度
-        type: string
-      FromEdbInfoId:
-        description: 计算来源指标id
-        type: integer
-        format: int64
-      MoveFrequency:
-        description: 移动频度:天/周/月/季/年
-        type: string
-      MoveType:
-        description: 移动方式:1:领先(默认),2:滞后
-        type: integer
-        format: int64
-      Source:
-        description: 来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:升频
-        type: integer
-        format: int64
-      Unit:
-        description: 单位
-        type: string
-  models.EdbInfoCalculateEdbInfoIdReq:
-    title: EdbInfoCalculateEdbInfoIdReq
-    type: object
-    properties:
-      EdbInfoId:
-        description: 指标id
-        type: integer
-        format: int64
-      FromTag:
-        description: 指标对应标签
-        type: string
-      MoveValue:
-        description: 移动的值
-        type: integer
-        format: int64
-  models.EdbInfoCalculateSaveReq:
-    title: EdbInfoCalculateSaveReq
-    type: object
-    properties:
-      AdminId:
-        description: 添加人id
-        type: integer
-        format: int64
-      AdminName:
-        description: 添加人名称
-        type: string
-      CalculateFormula:
-        description: 计算公式
-        type: string
-      ClassifyId:
-        description: 分类id
-        type: integer
-        format: int64
-      EdbInfoId:
-        description: 指标id
-        type: integer
-        format: int64
-      EdbInfoIdArr:
-        type: array
-        items:
-          $ref: '#/definitions/models.EdbInfoFromTag'
-      EdbName:
-        description: 指标名称
-        type: string
-      Frequency:
-        description: 频率
-        type: string
-      Unit:
-        description: 单位
-        type: string
-  models.EdbInfoFromTag:
-    title: EdbInfoFromTag
-    type: object
-    properties:
-      EdbInfoId:
-        description: 指标id
-        type: integer
-        format: int64
-      FromTag:
-        description: 指标对应标签
-        type: string
-  models.EditEdbInfoReq:
-    title: EditEdbInfoReq
-    type: object
-  models.ExecPythonEdbReq:
-    title: ExecPythonEdbReq
-    type: object
-    properties:
-      PythonCode:
-        description: python代码
-        type: string
-  models.RefreshEdbInfoReq:
-    title: RefreshEdbInfoReq
-    type: object
-    properties:
-      EdbCode:
-        description: 指标编码
-        type: string
-      EdbInfoId:
-        description: 指标ID
-        type: integer
-        format: int64
-      StartDate:
-        description: 开始日期
-        type: string
-  models.SaveAdjustEdbDataReq:
-    title: SaveAdjustEdbDataReq
-    type: object
-    properties:
-      Date:
-        description: 数据日期
-        type: string
-      Value:
-        description: 数据值
-        type: number
-        format: double
-  models.SaveAdjustEdbReq:
-    title: SaveAdjustEdbReq
-    type: object
-    properties:
-      AdminId:
-        description: 添加人id
-        type: integer
-        format: int64
-      AdminName:
-        description: 添加人名称
-        type: string
-      ClassifyId:
-        description: 分类id
-        type: integer
-        format: int64
-      DataList:
-        description: 指标对应的数据值
-        type: array
-        items:
-          $ref: '#/definitions/models.SaveAdjustEdbDataReq'
-      EdbInfoId:
-        description: 指标id
-        type: integer
-        format: int64
-      EdbName:
-        description: 指标名称
-        type: string
-      Frequency:
-        description: 频度
-        type: string
-      FromEdbInfoId:
-        description: 来源指标id
-        type: integer
-        format: int64
-      Unit:
-        description: 单位
-        type: string
-  supply_analysis.CalculateVarietyReq:
-    title: CalculateVarietyReq
-    type: object
-    properties:
-      AdminId:
-        description: 操作人id
-        type: integer
-        format: int64
-      AdminName:
-        description: 操作人名称
-        type: string
-      VarietyId:
-        description: 品种id
-        type: integer
-        format: int64
-tags:
-- name: ths
-  description: |
-    同花顺
-- name: pb
-  description: |
-    彭博
-- name: pb_finance
-  description: |
-    PbFinanceController 彭博财务
-- name: wind
-  description: |
-    wind
-- name: lz
-  description: |
-    隆众
-- name: lt
-  description: |
-    路透社
-- name: smm
-  description: |
-    有色
-- name: mysteel
-  description: |
-    钢联
-- name: manual
-  description: |
-    手工指标
-- name: calculate
-  description: |
-    CalculateController 计算指标
-- name: zz
-  description: |
-    郑商所
-- name: dl
-  description: |
-    大商所
-- name: sh
-  description: |
-    上期所
-- name: cffex
-  description: |
-    中金所
-- name: shfe
-  description: |
-    上期能源
-- name: gie
-  description: |
-    欧洲天然气
-- name: coal
-  description: |
-    中国煤炭网
-- name: python
-  description: |
-    PythonController 计算指标
-- name: google_travel
-  description: |
-    谷歌出行数据
-- name: mysteel_chemical
-  description: |
-    MySteelChemicalController 钢联化工
-- name: predict_calculate
-  description: |
-    PredictCalculateController 预测计算指标
-- name: eia_steo
-  description: |
-    EiaSteoController Eia Steo报告
-- name: predict
-  description: |
-    PredictController 预测指标
-- name: future_good
-  description: |
-    FutureGoodEdbInfoController 期货数据
-- name: sci
-  description: |
-    有色
-- name: com_trade
-  description: |
-    ComTradeController Eia Steo报告
-- name: baiinfo
-  description: |
-    百川盈孚
-- name: stock_plant
-  description: |
-    StockPlantController 存量装置
-- name: national_statistics
-  description: |
-    NationalStatisticsController 国家统计局
-- name: fubao
-  description: |
-    富宝-数据对接

+ 0 - 3
utils/calculate.go

@@ -120,8 +120,6 @@ func ComputeCorrelation(sList []Coordinate) (r float64) {
 	}
 	xBar, _ = decimalX.Div(decimal.NewFromInt(int64(lenSList))).Round(4).Float64()
 	yBar, _ = decimalY.Div(decimal.NewFromInt(int64(lenSList))).Round(4).Float64()
-	//fmt.Println(xBar)
-	//fmt.Println(yBar)
 
 	varXDeci := decimal.NewFromFloat(0)
 	varYDeci := decimal.NewFromFloat(0)
@@ -132,7 +130,6 @@ func ComputeCorrelation(sList []Coordinate) (r float64) {
 		diffXXbarDeci := decimal.NewFromFloat(coordinate.X).Sub(decimal.NewFromFloat(xBar))
 		diffYYbarDeci := decimal.NewFromFloat(coordinate.Y).Sub(decimal.NewFromFloat(yBar))
 		ssrDeci = ssrDeci.Add(diffXXbarDeci.Mul(diffYYbarDeci))
-		//fmt.Println("i:", i, ";diffXXbar:", diffXXbarDeci.String(), ";diffYYbar:", diffYYbarDeci.String(), ";ssr:", ssrDeci.String())
 		varXDeci = varXDeci.Add(diffXXbarDeci.Mul(diffXXbarDeci))
 		varYDeci = varYDeci.Add(diffYYbarDeci.Mul(diffYYbarDeci))
 		//varY += diffYYbar ** 2

+ 0 - 143
utils/des3.go

@@ -1,25 +1,11 @@
-// 加密工具类,用了3des和base64
 package utils
 
 import (
-	"bytes"
 	"crypto/cipher"
 	"crypto/des"
 	"encoding/base64"
-	"encoding/hex"
-	"errors"
-	"strings"
 )
 
-// des3 + base64 encrypt
-func DesBase64Encrypt(origData []byte, desKey string) []byte {
-	result, err := TripleDesEncrypt(origData, []byte(desKey))
-	if err != nil {
-		panic(any(err))
-	}
-	return []byte(base64.StdEncoding.EncodeToString(result))
-}
-
 func DesBase64Decrypt(crypted []byte, desKey string) []byte {
 	result, _ := base64.StdEncoding.DecodeString(string(crypted))
 	remain := len(result) % 8
@@ -36,21 +22,6 @@ func DesBase64Decrypt(crypted []byte, desKey string) []byte {
 	return origData
 }
 
-// 3DES加密
-func TripleDesEncrypt(origData, key []byte) ([]byte, error) {
-	block, err := des.NewTripleDESCipher(key)
-	if err != nil {
-		return nil, err
-	}
-	origData = PKCS5Padding(origData, block.BlockSize())
-	// origData = ZeroPadding(origData, block.BlockSize())
-	blockMode := cipher.NewCBCEncrypter(block, key[:8])
-	crypted := make([]byte, len(origData))
-	blockMode.CryptBlocks(crypted, origData)
-	return crypted, nil
-}
-
-// 3DES解密
 func TripleDesDecrypt(crypted, key []byte) ([]byte, error) {
 	block, err := des.NewTripleDESCipher(key)
 	if err != nil {
@@ -65,123 +36,9 @@ func TripleDesDecrypt(crypted, key []byte) ([]byte, error) {
 	return origData, nil
 }
 
-func ZeroPadding(ciphertext []byte, blockSize int) []byte {
-	padding := blockSize - len(ciphertext)%blockSize
-	padtext := bytes.Repeat([]byte{0}, padding)
-	return append(ciphertext, padtext...)
-}
-
-func ZeroUnPadding(origData []byte) []byte {
-	length := len(origData)
-	unpadding := int(origData[length-1])
-	return origData[:(length - unpadding)]
-}
-
-func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
-	padding := blockSize - len(ciphertext)%blockSize
-	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
-	return append(ciphertext, padtext...)
-}
-
 func PKCS5UnPadding(origData []byte) []byte {
 	length := len(origData)
 	// 去掉最后一个字节 unpadding 次
 	unpadding := int(origData[length-1])
 	return origData[:(length - unpadding)]
 }
-
-// DES加密
-func DesEncrypt(content string, key string) string {
-	contents := []byte(content)
-	keys := []byte(key)
-	block, err := des.NewCipher(keys)
-	if err != nil {
-		return ""
-	}
-	contents = PKCS5Padding(contents, block.BlockSize())
-	blockMode := cipher.NewCBCEncrypter(block, keys)
-	crypted := make([]byte, len(contents))
-	blockMode.CryptBlocks(crypted, contents)
-	return byteToHexString(crypted)
-}
-
-func byteToHexString(bytes []byte) string {
-	str := ""
-	for i := 0; i < len(bytes); i++ {
-		sTemp := hex.EncodeToString([]byte{bytes[i]})
-		if len(sTemp) < 2 {
-			str += string(0)
-		}
-		str += strings.ToUpper(sTemp)
-	}
-	return str
-}
-
-// DES解密
-func DesDecrypt(content string, key string) string {
-	contentBytes, err := hex.DecodeString(content)
-	if err != nil {
-		return "字符串转换16进制数组失败" + err.Error()
-	}
-	keys := []byte(key)
-	block, err := des.NewCipher(keys)
-	if err != nil {
-		return "解密失败" + err.Error()
-	}
-	blockMode := cipher.NewCBCDecrypter(block, keys)
-	origData := contentBytes
-	blockMode.CryptBlocks(origData, contentBytes)
-	origData = ZeroUnPadding(origData)
-	return string(origData)
-}
-
-// DES ECB PKCK5Padding
-func EntryptDesECB(data, key []byte) (string, error) {
-	if len(key) > 8 {
-		key = key[:8]
-	}
-	block, err := des.NewCipher(key)
-	if err != nil {
-		return "", errors.New("des.NewCipher " + err.Error())
-	}
-	bs := block.BlockSize()
-	data = PKCS5Padding(data, bs)
-	if len(data)%bs != 0 {
-		return "", errors.New("EntryptDesECB Need a multiple of the blocksize")
-	}
-	out := make([]byte, len(data))
-	dst := out
-	for len(data) > 0 {
-		block.Encrypt(dst, data[:bs])
-		data = data[bs:]
-		dst = dst[bs:]
-	}
-	return base64.StdEncoding.EncodeToString(out), nil
-}
-
-func DecryptDESECB(d string, key []byte) ([]byte, error) {
-	data, err := base64.StdEncoding.DecodeString(d)
-	if err != nil {
-		return nil, errors.New("decodebase64 " + err.Error())
-	}
-	if len(key) > 8 {
-		key = key[:8]
-	}
-	block, err := des.NewCipher(key)
-	if err != nil {
-		return nil, errors.New("des.NewCipher " + err.Error())
-	}
-	bs := block.BlockSize()
-	if len(data)%bs != 0 {
-		return nil, errors.New("DecryptDES crypto/cipher: input not full blocks")
-	}
-	out := make([]byte, len(data))
-	dst := out
-	for len(data) > 0 {
-		block.Decrypt(dst, data[:bs])
-		data = data[bs:]
-		dst = dst[bs:]
-	}
-	out = PKCS5UnPadding(out)
-	return out, nil
-}

+ 0 - 16
utils/logs.go

@@ -32,7 +32,6 @@ func init() {
 	}
 	os.MkdirAll(logPath, os.ModePerm)
 
-	// 打开文件
 	logFileName := path.Join(logPath, logFile)
 	FileLog = logs.NewLogger(1000000)
 	logConf := getDefaultLogConfig()
@@ -56,12 +55,9 @@ type logConfig struct {
 	Rotate   bool   `json:"rotate" description:"是否开启 logrotate,默认是 true"`
 	Level    int    `json:"level" description:"日志保存的时候的级别,默认是 Trace 级别"`
 	Color    bool   `json:"color" description:"日志是否输出颜色"`
-	//Perm     string `json:"perm" description:"日志文件权限"`
 }
 
 func initBinlog() {
-	//binlog日志
-	//binlog日志
 	binlogPath := BinLogPath
 	if binlogPath == "" {
 		binlogPath = DefaultBinlogPath
@@ -76,8 +72,6 @@ func initBinlog() {
 	logConf := getDefaultLogConfig()
 
 	logConf.FileName = logFileName
-	//logConf.MaxLines = 10000000
-	//logConf.Rotate = true
 	b, _ := json.Marshal(logConf)
 	Binlog.SetLogger(logs.AdapterFile, string(b))
 	Binlog.EnableFuncCallDepth(true)
@@ -94,7 +88,6 @@ func initApiLog() {
 	}
 	os.MkdirAll(logPath, os.ModePerm)
 
-	// 打开文件
 	logFileName := path.Join(logPath, logFile)
 	ApiLog = logs.NewLogger(1000000)
 	logConf := getDefaultLogConfig()
@@ -105,13 +98,7 @@ func initApiLog() {
 	ApiLog.EnableFuncCallDepth(true)
 }
 
-// initMgoLog
-// @Description: mongo日志
-// @author: Roc
-// @datetime 2024-05-06 16:42:47
 func initMgoLog() {
-	//mgo日志
-
 	var logPath string
 	{
 		binlogPath := BinLogPath
@@ -133,8 +120,6 @@ func initMgoLog() {
 	logConf := getDefaultLogConfig()
 
 	logConf.FileName = logFileName
-	//logConf.MaxLines = 10000000
-	//logConf.Rotate = true
 	b, _ := json.Marshal(logConf)
 	MongoLog.SetLogger(logs.AdapterFile, string(b))
 	MongoLog.EnableFuncCallDepth(true)
@@ -149,6 +134,5 @@ func getDefaultLogConfig() logConfig {
 		MaxDays:  LogMaxDays, //我就是喜欢31天,咋滴,不喜欢你就自己改-_-!
 		Rotate:   true,
 		Level:    logs.LevelTrace,
-		//Perm:     "",
 	}
 }

部分文件因为文件数量过多而无法显示