12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package data
- import (
- "eta_gn/eta_task/models/data_manage"
- "eta_gn/eta_task/utils"
- "fmt"
- )
- // SetChartEdbEndDate 设置图表中,指标的最新日期
- func SetChartEdbEndDate() {
- var err error
- defer func() {
- if err != nil {
- fmt.Println("SetChartEdbEndDate err:" + err.Error())
- }
- }()
- allList, err := data_manage.GetAllChartInfo()
- if err != nil {
- return
- }
- allMap := make(map[int]*data_manage.ChartInfo)
- for _, v := range allList {
- allMap[v.ChartInfoId] = v
- }
- list, err := data_manage.GetChartInfoEdbEndDate()
- if err != nil {
- return
- }
- for _, sv := range list {
- if findItem, ok := allMap[sv.ChartInfoId]; ok {
- if findItem.EdbEndDate.Equal(sv.EdbEndDate) {
- err = data_manage.ModifyChartInfoEdbEndDate(sv.ChartInfoId, sv.EdbEndDate.Format(utils.FormatDate))
- if err != nil {
- return
- }
- }
- }
- }
- }
|