|
@@ -27,9 +27,15 @@ func RefreshDataFromThs() (err error) {
|
|
|
return errors.New("GetEdbInfoByCondition:" + err.Error())
|
|
|
}
|
|
|
|
|
|
+ now := time.Now()
|
|
|
+ var endDate string
|
|
|
+ if now.Hour() == 0 {
|
|
|
+ endDate = time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
+ } else {
|
|
|
+ endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ }
|
|
|
for _, v := range items {
|
|
|
startDate := v.EndDate.AddDate(0, 0, -3).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
err = SyncEdbDataByThs(int64(v.EdbInfoId), v.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return errors.New("SyncEdbDataByThs:" + err.Error())
|
|
@@ -74,10 +80,15 @@ func RefreshDataFromWind() (err error) {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- for k, v := range items {
|
|
|
- fmt.Println("line 67:", k, v.EdbCode)
|
|
|
+ now := time.Now()
|
|
|
+ var endDate string
|
|
|
+ if now.Hour() == 0 {
|
|
|
+ endDate = time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
+ } else {
|
|
|
+ endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+ for _, v := range items {
|
|
|
startDate := v.EndDate.AddDate(0, 0, -3).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
err = SyncEdbDataByWind(int64(v.EdbInfoId), v.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
|
return err
|
|
@@ -113,9 +124,15 @@ func RefreshDataFromPb() (err error) {
|
|
|
return errors.New("GetEdbInfoByCondition:" + err.Error())
|
|
|
}
|
|
|
|
|
|
+ now := time.Now()
|
|
|
+ var endDate string
|
|
|
+ if now.Hour() == 0 {
|
|
|
+ endDate = time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
+ } else {
|
|
|
+ endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ }
|
|
|
for _, v := range items {
|
|
|
startDate := v.EndDate.AddDate(0, 0, -3).Format(utils.FormatDateUnSpace)
|
|
|
- endDate := time.Now().Format(utils.FormatDateUnSpace)
|
|
|
fmt.Println(startDate, endDate)
|
|
|
err = SyncEdbDataByPb(int64(v.EdbInfoId), v.EdbCode, startDate, endDate)
|
|
|
if err != nil {
|
|
@@ -190,9 +207,16 @@ func RefreshDataFromCalculate() (err error) {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+
|
|
|
+ now := time.Now()
|
|
|
+ var endDate string
|
|
|
+ if now.Hour() == 0 {
|
|
|
+ endDate = time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
+ } else {
|
|
|
+ endDate = time.Now().Format(utils.FormatDate)
|
|
|
+ }
|
|
|
for _, v := range items {
|
|
|
startDate := v.EndDate.AddDate(0, 0, -3).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
var edbInfoIdBytes []string
|
|
|
calculateMap, err := data_manage.GetEdbInfoCalculateDetail(int(v.EdbInfoId))
|
|
|
if err != nil {
|