|
@@ -280,7 +280,6 @@ func (this *CoalMineDataController) CoastalHistory() {
|
|
|
}
|
|
|
|
|
|
for ii, sheet := range req.SheetData {
|
|
|
-
|
|
|
//遍历行读取
|
|
|
maxCol := len(sheet.Rows)
|
|
|
for i := 0; i < maxCol; i++ {
|
|
@@ -288,14 +287,28 @@ func (this *CoalMineDataController) CoastalHistory() {
|
|
|
row := sheet.Rows[i]
|
|
|
cells := row.Cells
|
|
|
for k, cell := range cells {
|
|
|
- if k > 1 && k < 9 {
|
|
|
+ ignore := 1
|
|
|
+ ignore2 := 10
|
|
|
+ if ii == 3 {
|
|
|
+ // 第四页供煤没有星期,所以只跳过第一行
|
|
|
+ ignore = 0
|
|
|
+ ignore2 = 9
|
|
|
+ }
|
|
|
+ if k > ignore && k < ignore2 {
|
|
|
text := cell.Value
|
|
|
text = strings.Replace(text, ":", "", -1)
|
|
|
text = strings.Replace(text, ":", "", -1)
|
|
|
if ii == 3 {
|
|
|
text += "供煤"
|
|
|
}
|
|
|
- groupMap[k] = text
|
|
|
+ if ii == 2 {
|
|
|
+ text += "天数"
|
|
|
+ }
|
|
|
+ province := strings.Replace(text, "日耗", "", -1)
|
|
|
+ province = strings.Replace(province, "库存", "", -1)
|
|
|
+ province = strings.Replace(province, "可用天数", "", -1)
|
|
|
+ province = strings.Replace(province, "供煤", "", -1)
|
|
|
+ groupMap[k] = province
|
|
|
var item models.BaseFromCoalmineMapping
|
|
|
item.IndexName = text
|
|
|
//合计命名
|
|
@@ -342,7 +355,11 @@ func (this *CoalMineDataController) CoastalHistory() {
|
|
|
row := sheet.Rows[i]
|
|
|
cells := row.Cells
|
|
|
for k, cell := range cells {
|
|
|
- if k < 9 {
|
|
|
+ ingore := 10
|
|
|
+ if ii == 3 {
|
|
|
+ ingore = 9
|
|
|
+ }
|
|
|
+ if k < ingore {
|
|
|
var item models.BaseFromCoalmineCoastalIndex
|
|
|
if k == 0 {
|
|
|
text := cell.Value
|
|
@@ -363,7 +380,12 @@ func (this *CoalMineDataController) CoastalHistory() {
|
|
|
dataTime = parsedTime.Format(utils.FormatDate)
|
|
|
}
|
|
|
}
|
|
|
- if k > 1 {
|
|
|
+ ignore := 1
|
|
|
+ if ii == 3 {
|
|
|
+ // 第四页供煤没有星期,所以只跳过第一行
|
|
|
+ ignore = 0
|
|
|
+ }
|
|
|
+ if k > ignore {
|
|
|
text := cell.Value
|
|
|
item.IndexName = nameMap[k]
|
|
|
item.IndexCode = codeMap[nameMap[k]]
|
|
@@ -486,13 +508,14 @@ func (this *CoalMineDataController) InlandHistory() {
|
|
|
sheetName = sheet.Name
|
|
|
fmt.Println("sheetName:", sheetName)
|
|
|
var unit string
|
|
|
+ sheetName = strings.TrimLeft(sheetName, "内陆")
|
|
|
if sheetName == "可用天数" {
|
|
|
unit = "天"
|
|
|
} else {
|
|
|
unit = "万吨"
|
|
|
}
|
|
|
//遍历行读取
|
|
|
- maxCol := sheet.MaxCol
|
|
|
+ maxCol := sheet.MaxRow
|
|
|
for i := 0; i < maxCol; i++ {
|
|
|
if i == 0 {
|
|
|
row := sheet.Rows[i]
|