|
@@ -29,15 +29,16 @@ func FileCoalFirm() {
|
|
|
var smonth string
|
|
|
dateMonth := int(time.Now().Month())
|
|
|
smonth = strconv.Itoa(dateMonth)
|
|
|
- path := "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月).xlsx"
|
|
|
+ path := "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月) .xlsx"
|
|
|
path = fmt.Sprintf(path,nyear,smonth)
|
|
|
exist,err := PathExists(path)
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
|
return
|
|
|
}
|
|
|
+ fmt.Println(path)
|
|
|
if !exist {
|
|
|
- path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月中旬).xlsx"
|
|
|
+ path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月中旬) .xlsx"
|
|
|
path = fmt.Sprintf(path,nyear,smonth)
|
|
|
exist,err = PathExists(path)
|
|
|
if err != nil {
|
|
@@ -45,8 +46,9 @@ func FileCoalFirm() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ fmt.Println(path)
|
|
|
if !exist {
|
|
|
- path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月上旬).xlsx"
|
|
|
+ path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月上旬) .xlsx"
|
|
|
path = fmt.Sprintf(path,nyear,smonth)
|
|
|
exist,err = PathExists(path)
|
|
|
if err != nil {
|
|
@@ -54,11 +56,12 @@ func FileCoalFirm() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ fmt.Println(path)
|
|
|
if !exist {
|
|
|
//本月三个文件都没有,去取上一个月的
|
|
|
dateMonth = dateMonth - 1
|
|
|
smonth = strconv.Itoa(dateMonth)
|
|
|
- path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月).xlsx"
|
|
|
+ path = "/home/code/python/coal_mail/emailFile/全国分企业煤炭产量旬度数据(%s年%s月) .xlsx"
|
|
|
path = fmt.Sprintf(path,nyear,smonth)
|
|
|
exist,err = PathExists(path)
|
|
|
if err != nil {
|
|
@@ -71,10 +74,10 @@ func FileCoalFirm() {
|
|
|
fmt.Println(path)
|
|
|
//path = "static/file/全国分企业煤炭产量旬度数据(2022年3月上旬).xlsx"
|
|
|
xlFile, _ = xlsx.OpenFile(path)
|
|
|
- //if err != nil {
|
|
|
- // fmt.Println(err)
|
|
|
- // return
|
|
|
- //}
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
var year, month, day string
|
|
|
var yearMap = make(map[int]string)
|