|
@@ -18,7 +18,7 @@ func FileCoalInland() () {
|
|
|
go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "RefreshDataFromCoalInland ErrMsg:"+err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
|
}()
|
|
|
- //path := "static/file/内陆17省动力煤终端用户供耗存20220322.xlsx"
|
|
|
+ //path := "static/file/内陆17省动力煤终端用户供耗存20220408.xlsx"
|
|
|
path := "/home/code/python/coal_mail/emailFile/内陆17省动力煤终端用户供耗存%s.xlsx"
|
|
|
for i := 0;i < 7;i++{
|
|
|
npath := fmt.Sprintf(path,time.Now().AddDate(0,0,-i).Format(utils.FormatDateUnSpace))
|
|
@@ -70,6 +70,13 @@ func FileCoalInland() () {
|
|
|
|
|
|
for s, sheet := range xlFile.Sheets {
|
|
|
sheetName = sheet.Name
|
|
|
+ fmt.Println("sheetName:",sheetName)
|
|
|
+ var unit string
|
|
|
+ if sheetName == "可用天数" {
|
|
|
+ unit = "天"
|
|
|
+ }else {
|
|
|
+ unit = "万吨"
|
|
|
+ }
|
|
|
//遍历行读取
|
|
|
maxCol := sheet.MaxCol
|
|
|
for i := 0; i < maxCol; i++ {
|
|
@@ -144,7 +151,7 @@ func FileCoalInland() () {
|
|
|
item.GroupName = groupMap[k]
|
|
|
item.Source = "内陆十七省"
|
|
|
item.DataTime = dataTime
|
|
|
- item.Unit = "万吨"
|
|
|
+ item.Unit = unit
|
|
|
item.Frequency = "日度"
|
|
|
item.ModifyTime = time.Now()
|
|
|
item.CreateTime = time.Now()
|