|
@@ -31,7 +31,7 @@ func RefreshDataFromThs(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDate)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -148,7 +148,7 @@ func RefreshDataFromPb(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDateUnSpace)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDateUnSpace)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -286,7 +286,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
edbInfo, _ := data_manage.GetEdbInfoById(v.FromEdbInfoId)
|
|
|
edbInfoList = append(edbInfoList, edbInfo)
|
|
|
}
|
|
|
- fmt.Println("RefreshCalculate:", edbInfoList, edbInfoId, edbCode, v.CalculateFormula, startDate, endDate, edbInfoIdBytes)
|
|
|
+ endDate = ""
|
|
|
err = RefreshCalculate(edbInfoList, edbInfoId, edbCode, v.CalculateFormula, startDate, endDate, edbInfoIdBytes)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculate Err:" + err.Error())
|
|
@@ -302,7 +302,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
}
|
|
|
year := time.Now().Year() - 1
|
|
|
startDate := strconv.Itoa(year) + "-01" + "-01"
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateLjzzy(edbInfoId, fromEdbInfo, edbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateLjzzy Err:" + err.Error())
|
|
@@ -317,7 +317,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateTbz(edbInfoId, fromEdbInfo, calculateTbz.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTbz Err:" + err.Error())
|
|
@@ -332,7 +332,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateTcz(edbInfoId, fromEdbInfo, calculateTcz.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTcz Err:" + err.Error())
|
|
@@ -361,7 +361,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateHbz(edbInfoId, source, fromEdbInfo, calculateHbz.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTbz Err:" + err.Error())
|
|
@@ -376,7 +376,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateHcz(edbInfoId, source, fromEdbInfo, calculateHcz.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTbz Err:" + err.Error())
|
|
@@ -392,7 +392,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ endDate := ""//time.Now().Format(utils.FormatDate)
|
|
|
err = data_manage.RefreshCalculateBp(edbInfoId, fromEdbInfo, calculateBp.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTbz Err:" + err.Error())
|
|
@@ -437,7 +437,7 @@ func RefreshDataFromManual(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDate)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -490,7 +490,7 @@ func RefreshDataFromLz(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDateUnSpace)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDateUnSpace)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -544,7 +544,7 @@ func RefreshDataFromYs(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDateUnSpace)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDateUnSpace)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -598,7 +598,7 @@ func RefreshDataFromGl(wg *sync.WaitGroup) (err error) {
|
|
|
}
|
|
|
|
|
|
var endDate string
|
|
|
- endDate = time.Now().Format(utils.FormatDateUnSpace)
|
|
|
+ endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDateUnSpace)
|
|
|
for _, v := range items {
|
|
|
startDate := ""
|
|
|
if v.Frequency == "日度" {
|
|
@@ -636,4 +636,4 @@ func RefreshDataFromGl(wg *sync.WaitGroup) (err error) {
|
|
|
func ResetEdbInfoIsUpdate(cont context.Context) (err error) {
|
|
|
go data_manage.ResetEdbInfoIsUpdate()
|
|
|
return nil
|
|
|
-}
|
|
|
+}
|