ソースを参照

处理特殊的情况

xyxie 1 年間 前
コミット
d18dbdabaa
1 ファイル変更5 行追加2 行削除
  1. 5 2
      services/base_from_yongyi_v2/daily.go

+ 5 - 2
services/base_from_yongyi_v2/daily.go

@@ -485,8 +485,11 @@ func HandleYongyiExcelDaily4(f *excelize.File, sheetName string) (indexList []*m
 					} else {
 						dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
 						if e != nil {
-							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
-							continue
+							dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+							if e != nil {
+								utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+								continue
+							}
 						}
 					}
 					dateMap[k] = dateT.Format(utils.FormatDate)