|
@@ -4,8 +4,8 @@ import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"hongze/mysteel_watch/global"
|
|
|
- "hongze/mysteel_watch/models/index"
|
|
|
"hongze/mysteel_watch/models"
|
|
|
+ "hongze/mysteel_watch/models/index"
|
|
|
"hongze/mysteel_watch/utils"
|
|
|
"io/ioutil"
|
|
|
"log"
|
|
@@ -141,7 +141,7 @@ func WatchIndexFile(filePath string) {
|
|
|
sheetList := f.GetSheetList()
|
|
|
for _, sv := range sheetList {
|
|
|
|
|
|
- var indexName, indexCode, unit, source, frequency, startDate, endDate, describe string
|
|
|
+ var indexName, indexCode, unit, source, frequency, startDate, endDate, describe, updateDate string
|
|
|
var indexId int64
|
|
|
rows, err := f.GetRows(sv)
|
|
|
if err != nil {
|
|
@@ -186,6 +186,10 @@ func WatchIndexFile(filePath string) {
|
|
|
if rk == 7 {
|
|
|
describe = colCell
|
|
|
}
|
|
|
+
|
|
|
+ if rk == 9 {
|
|
|
+ updateDate = colCell
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -320,6 +324,7 @@ func WatchIndexFile(filePath string) {
|
|
|
dataItem.IndexCode = indexCode
|
|
|
dataItem.DataTime = dateTime
|
|
|
dataItem.Value = value
|
|
|
+ dataItem.UpdateDate = updateDate
|
|
|
dataItem.CreateTime = time.Now()
|
|
|
dataItem.ModifyTime = time.Now()
|
|
|
dataList = append(dataList, *dataItem)
|
|
@@ -388,6 +393,7 @@ func WatchIndexFileMergeRelease(filePath string) {
|
|
|
startDateMap := make(map[int]string)
|
|
|
endDateMap := make(map[int]string)
|
|
|
describeMap := make(map[int]string)
|
|
|
+ updateDateMap := make(map[int]string)
|
|
|
|
|
|
rows, err := f.GetRows(sv)
|
|
|
if err != nil {
|
|
@@ -434,6 +440,8 @@ func WatchIndexFileMergeRelease(filePath string) {
|
|
|
}
|
|
|
case 7: //备注
|
|
|
describeMap[k-1] = colCell
|
|
|
+ case 9:
|
|
|
+ updateDateMap[k-1] = colCell
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -455,7 +463,7 @@ func WatchIndexFileMergeRelease(filePath string) {
|
|
|
}
|
|
|
|
|
|
for k, excelDataMap := range indexExcelDataList {
|
|
|
- mysteelIndexHandle(runMode, indexNameMap[k], indexCodeMap[k], unitMap[k], sourceMap[k], frequencyMap[k], startDateMap[k], endDateMap[k], describeMap[k], excelDataMap)
|
|
|
+ mysteelIndexHandle(runMode, indexNameMap[k], indexCodeMap[k], unitMap[k], sourceMap[k], frequencyMap[k], startDateMap[k], endDateMap[k], describeMap[k], updateDateMap[k], excelDataMap)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -465,7 +473,7 @@ func WatchIndexFileMergeRelease(filePath string) {
|
|
|
}
|
|
|
|
|
|
// mysteelIndexHandle 钢联数据处理
|
|
|
-func mysteelIndexHandle(runMode, indexName, indexCode, unit, source, frequency, startDate, endDate, describe string, excelDataMap map[string]string) {
|
|
|
+func mysteelIndexHandle(runMode, indexName, indexCode, unit, source, frequency, startDate, endDate, describe, updateDate string, excelDataMap map[string]string) {
|
|
|
var err error
|
|
|
|
|
|
//return
|
|
@@ -574,6 +582,7 @@ func mysteelIndexHandle(runMode, indexName, indexCode, unit, source, frequency,
|
|
|
dataItem.IndexCode = indexCode
|
|
|
dataItem.DataTime = dateTime
|
|
|
dataItem.Value = value
|
|
|
+ dataItem.UpdateDate = updateDate
|
|
|
dataItem.CreateTime = time.Now()
|
|
|
dataItem.ModifyTime = time.Now()
|
|
|
addDataList = append(addDataList, *dataItem)
|