|
@@ -253,21 +253,21 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
source := v.Source
|
|
|
fmt.Println(v.EdbInfoId, v.EdbCode, v.EdbName, v.SourceName, source)
|
|
|
if source == utils.DATA_SOURCE_CALCULATE {
|
|
|
- //startDate := ""
|
|
|
- //if v.Frequency == "日度" {
|
|
|
- // startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
|
|
|
- //} else if v.Frequency == "周度" {
|
|
|
- // startDate = v.EndDate.AddDate(0, 0, -(utils.DATA_REFRESH * 7)).Format(utils.FormatDate)
|
|
|
- //} else if v.Frequency == "月度" {
|
|
|
- // startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH, 0).Format(utils.FormatDate)
|
|
|
- //} else if v.Frequency == "季度" {
|
|
|
- // startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH*3, 0).Format(utils.FormatDate)
|
|
|
- //} else if v.Frequency == "年度" {
|
|
|
- // startDate = v.EndDate.AddDate(-utils.DATA_REFRESH, 0, 0).Format(utils.FormatDate)
|
|
|
- //} else {
|
|
|
- // startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
|
|
|
- //}
|
|
|
- //endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ startDate := ""
|
|
|
+ if v.Frequency == "日度" {
|
|
|
+ startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
|
|
|
+ } else if v.Frequency == "周度" {
|
|
|
+ startDate = v.EndDate.AddDate(0, 0, -(utils.DATA_REFRESH * 7)).Format(utils.FormatDate)
|
|
|
+ } else if v.Frequency == "月度" {
|
|
|
+ startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH, 0).Format(utils.FormatDate)
|
|
|
+ } else if v.Frequency == "季度" {
|
|
|
+ startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH*3, 0).Format(utils.FormatDate)
|
|
|
+ } else if v.Frequency == "年度" {
|
|
|
+ startDate = v.EndDate.AddDate(-utils.DATA_REFRESH, 0, 0).Format(utils.FormatDate)
|
|
|
+ } else {
|
|
|
+ startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+ endDate := time.Now().Format(utils.FormatDate)
|
|
|
var edbInfoIdBytes []string
|
|
|
calculateMap, err := data_manage.GetEdbInfoCalculateDetail(int(v.EdbInfoId))
|
|
|
if err != nil {
|
|
@@ -282,7 +282,7 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
edbInfoList = append(edbInfoList, edbInfo)
|
|
|
}
|
|
|
//endDate = ""
|
|
|
- err = RefreshCalculate(edbInfoList, edbInfoId, edbCode, v.CalculateFormula, edbInfoIdBytes)
|
|
|
+ err = RefreshCalculate(edbInfoList, edbInfoId, edbCode, v.CalculateFormula, startDate, endDate, edbInfoIdBytes)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculate Err:" + err.Error())
|
|
|
}
|
|
@@ -301,10 +301,10 @@ func RefreshDataFromCalculateAll() (err error) {
|
|
|
}
|
|
|
return errors.New("GetEdbInfoById Err:" + err.Error())
|
|
|
}
|
|
|
- //year := time.Now().Year() - 1
|
|
|
- //startDate := strconv.Itoa(year) + "-01" + "-01"
|
|
|
- //endDate := "" //time.Now().Format(utils.FormatDate)
|
|
|
- err = data_manage.RefreshCalculateLjzzy(edbInfoId, fromEdbInfo, edbCode)
|
|
|
+ year := time.Now().Year() - 1
|
|
|
+ startDate := strconv.Itoa(year) + "-01" + "-01"
|
|
|
+ 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())
|
|
|
}
|
|
@@ -320,9 +320,9 @@ 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)
|
|
|
- err = data_manage.RefreshCalculateTbz(edbInfoId, fromEdbInfo, calculateTbz.EdbCode)
|
|
|
+ startDate := time.Now().AddDate(-2, -2, 0).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())
|
|
|
}
|
|
@@ -338,9 +338,9 @@ 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)
|
|
|
- err = data_manage.RefreshCalculateTcz(edbInfoId, fromEdbInfo, calculateTcz.EdbCode)
|
|
|
+ startDate := time.Now().AddDate(-2, -2, 0).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())
|
|
|
}
|
|
@@ -373,10 +373,10 @@ 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)
|
|
|
+ startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
|
|
|
+ endDate := "" //time.Now().Format(utils.FormatDate)
|
|
|
formulaInt, _ := strconv.Atoi(v.CalculateFormula)
|
|
|
- err = data_manage.RefreshCalculateHbz(edbInfoId, source, fromEdbInfo, calculateHbz.EdbCode, formulaInt)
|
|
|
+ err = data_manage.RefreshCalculateHbz(edbInfoId, source, fromEdbInfo, calculateHbz.EdbCode, startDate, endDate, formulaInt)
|
|
|
if err != nil {
|
|
|
return errors.New("RefreshCalculateTbz Err:" + err.Error())
|
|
|
}
|
|
@@ -392,9 +392,9 @@ 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)
|
|
|
- err = data_manage.RefreshCalculateHcz(edbInfoId, source, fromEdbInfo, calculateHcz.EdbCode)
|
|
|
+ startDate := time.Now().AddDate(-2, -2, 0).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())
|
|
|
}
|
|
@@ -411,9 +411,9 @@ 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)
|
|
|
- err = data_manage.RefreshCalculateBp(edbInfoId, fromEdbInfo, calculateBp.EdbCode)
|
|
|
+ startDate := time.Now().AddDate(-2, -2, 0).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())
|
|
|
}
|