|
@@ -51,33 +51,22 @@ func IndexCreateCheck() (err error) {
|
|
|
for _, v := range list {
|
|
|
fmt.Println("IndexCreateCheck start:", v.IndexCode, v.FilePath)
|
|
|
if v.FilePath != "" && utils.FileIsExist(v.FilePath) {
|
|
|
- fmt.Println("Refresh:" + v.IndexCode)
|
|
|
- err = UpdateComment(v.FilePath)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateComment Err:" + err.Error())
|
|
|
- go alarm_msg.SendAlarmMsg(utils.APPNAME+" 指标数据未生成检测失败:"+err.Error()+";file:"+v.FilePath, 3)
|
|
|
- }
|
|
|
- time.Sleep(1 * time.Second)
|
|
|
- //MysteelChemicalRefresh(v.FilePath)
|
|
|
- AddIndexRefreshToLpush(v.FilePath)
|
|
|
- } else {
|
|
|
- fmt.Println("IndexCreate:" + v.IndexCode)
|
|
|
- //saveFilePath, err := IndexCreate(v)
|
|
|
- saveFilePath, err := IndexCreate(v.UpdateWeek, v.IndexCode)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("IndexCreate Err:" + err.Error())
|
|
|
- go alarm_msg.SendAlarmMsg(utils.APPNAME+" 指标数据未生成检测失败:"+err.Error(), 3)
|
|
|
- }
|
|
|
- v.FilePath = saveFilePath
|
|
|
- fmt.Println("IndexCreate saveFilePath:" + v.FilePath)
|
|
|
- time.Sleep(1 * time.Second)
|
|
|
- if utils.FileIsExist(saveFilePath) {
|
|
|
- //MysteelChemicalRefresh(saveFilePath)
|
|
|
- AddIndexRefreshToLpush(saveFilePath)
|
|
|
- }
|
|
|
- fmt.Println("MysteelChemicalRefresh end:" + v.IndexCode)
|
|
|
+ os.Remove(v.FilePath)
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println("IndexCreate:" + v.IndexCode)
|
|
|
+ saveFilePath, err := IndexCreate(v.UpdateWeek, v.IndexCode)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("IndexCreate Err:" + err.Error())
|
|
|
+ go alarm_msg.SendAlarmMsg(utils.APPNAME+" 指标数据未生成检测失败:"+err.Error(), 3)
|
|
|
+ }
|
|
|
+ v.FilePath = saveFilePath
|
|
|
+ fmt.Println("IndexCreate saveFilePath:" + v.FilePath)
|
|
|
+ time.Sleep(1 * time.Second)
|
|
|
+ if utils.FileIsExist(saveFilePath) {
|
|
|
+ AddIndexRefreshToLpush(saveFilePath)
|
|
|
}
|
|
|
- fmt.Println("IndexCreateCheck end:" + v.IndexCode)
|
|
|
+ fmt.Println("MysteelChemicalRefresh end:" + v.IndexCode)
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
@@ -111,6 +100,13 @@ func IndexCreate(updateWeek, indexCode string) (saveFilePath string, err error)
|
|
|
templateFile.Close()
|
|
|
}()
|
|
|
|
|
|
+ sheetList := templateFile.GetSheetList()
|
|
|
+ for k, v := range sheetList {
|
|
|
+ if k > 0 {
|
|
|
+ templateFile.DeleteSheet(v)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
startDate := "1990-01-01"
|
|
|
commentStr := `"BlankValue":"0","CanMark":true,"ChartLineType":"0","DateBlock":0,"DateBlockCount":1,"DateFormat":0,"DateTimeTag":"","EndDate":"","ExportType":0,"HasDescription":true,"HasEmptyRows":false,"HasFrequency":true,"HasIndexID":true,"HasLastDate":true,"HasSourceName":true,"HasTimeInterval":true,"HasUnit":true,"HasUpdateDate":true,"IsCreateChart":false,"IsDataSort":true,"IsNewSheet":false,"IsNewWorkbook":false,"Models":[{"DataFormat":0,"DataStartDate":"` + startDate + `","DefineName":"","DefineUnit":"","DisplayIndexCode":"` + indexCode + `","IndexCode":"` + indexCode + `","IndexFormula":"` + indexCode + `","PointValue":0,"UnionStart":""}],"Position":"A1","RangeData":"A2:B280","ShowBlankLines":false,"StartDate":"","Transpose":false,"UpdateMode":1,"lookModel":{"IsLast":false,"LookValue":0,"lookType":0},"ver":3}
|
|
|
`
|