|
@@ -43,7 +43,13 @@ func (this *PbController) Add() {
|
|
cacheKey = utils.CACHE_EDB_DATA_ADD + strconv.Itoa(source) + "_" + req.EdbCode
|
|
cacheKey = utils.CACHE_EDB_DATA_ADD + strconv.Itoa(source) + "_" + req.EdbCode
|
|
if !utils.Rc.IsExist(cacheKey) {
|
|
if !utils.Rc.IsExist(cacheKey) {
|
|
utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
|
|
utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
|
|
- dataItem, err := services.GetEdbDataFromPb(req.EdbCode, utils.BASE_START_DATE_UnSpace, utils.BASE_END_DATE_UnSpace, "")
|
|
|
|
|
|
+ dataItem, err := services.GetEdbDataFromPb(req.EdbCode, utils.BASE_START_DATE_UnSpace, utils.PB_BASE_END_DATE_UnSpace, "")
|
|
|
|
+ // 日志记录
|
|
|
|
+ num := 0
|
|
|
|
+ if dataItem != nil {
|
|
|
|
+ num = len(dataItem.Date)
|
|
|
|
+ }
|
|
|
|
+ models.AddEdbRefreshApiRecordByRefresh(&models.EdbInfo{EdbCode: req.EdbCode, Source: source}, utils.BASE_START_DATE_UnSpace, num, err)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取指标信息失败!"
|
|
br.Msg = "获取指标信息失败!"
|
|
br.ErrMsg = "获取指标信息失败 GetEdbDataFromPb,Err:" + err.Error()
|
|
br.ErrMsg = "获取指标信息失败 GetEdbDataFromPb,Err:" + err.Error()
|
|
@@ -115,7 +121,13 @@ func (this *PbController) Refresh() {
|
|
|
|
|
|
//开始日期格式化
|
|
//开始日期格式化
|
|
startDateTime, _ := time.ParseInLocation(utils.FormatDate, req.StartDate, time.Local)
|
|
startDateTime, _ := time.ParseInLocation(utils.FormatDate, req.StartDate, time.Local)
|
|
- dataItem, err := services.GetEdbDataFromPb(req.EdbCode, startDateTime.Format(utils.FormatDateUnSpace), utils.BASE_END_DATE_UnSpace, edbInfo.TerminalCode)
|
|
|
|
|
|
+ dataItem, err := services.GetEdbDataFromPb(req.EdbCode, startDateTime.Format(utils.FormatDateUnSpace), utils.PB_BASE_END_DATE_UnSpace, edbInfo.TerminalCode)
|
|
|
|
+ // 日志记录
|
|
|
|
+ num := 0
|
|
|
|
+ if dataItem != nil {
|
|
|
|
+ num = len(dataItem.Date)
|
|
|
|
+ }
|
|
|
|
+ models.AddEdbRefreshApiRecordByRefresh(edbInfo, startDateTime.Format(utils.FormatDateUnSpace), num, err)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取指标信息失败!"
|
|
br.Msg = "获取指标信息失败!"
|
|
br.ErrMsg = "获取指标信息失败 GetEdbDataFromPb,Err:" + err.Error()
|
|
br.ErrMsg = "获取指标信息失败 GetEdbDataFromPb,Err:" + err.Error()
|