|
@@ -49,10 +49,26 @@ func InitBaseIndexData(dataPath string) {
|
|
|
return
|
|
|
}
|
|
|
fmt.Println("rows len:", len(rows))
|
|
|
+
|
|
|
+ // 获取创建人信息
|
|
|
+ admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
+ if e != nil {
|
|
|
+ err = fmt.Errorf("GetSysAdminList err: %s", e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mobileMap := make(map[string]*models.Admin)
|
|
|
+ for _, v := range admins {
|
|
|
+ if v.Mobile == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+
|
|
|
for rk, row := range rows {
|
|
|
if rk > 0 {
|
|
|
- var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source string
|
|
|
+ var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source, mobile string
|
|
|
for ck, colCell := range row {
|
|
|
+ colCell = strings.TrimSpace(colCell)
|
|
|
switch ck {
|
|
|
case 0:
|
|
|
classifyFirst = colCell
|
|
@@ -70,6 +86,8 @@ func InitBaseIndexData(dataPath string) {
|
|
|
unit = colCell
|
|
|
case 7:
|
|
|
source = colCell
|
|
|
+ case 8:
|
|
|
+ mobile = colCell
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -162,6 +180,11 @@ func InitBaseIndexData(dataPath string) {
|
|
|
indexMap["Frequency"] = frequency
|
|
|
indexMap["Unit"] = unit
|
|
|
indexMap["ClassifyId"] = resp.Data.ClassifyId
|
|
|
+ admin := mobileMap[mobile]
|
|
|
+ if admin != nil {
|
|
|
+ indexMap["AdminId"] = admin.AdminId
|
|
|
+ indexMap["AdminName"] = admin.RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|
|
@@ -252,10 +275,26 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
return
|
|
|
}
|
|
|
fmt.Println("rows len:", len(rows))
|
|
|
+
|
|
|
+ // 获取创建人信息
|
|
|
+ admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
+ if e != nil {
|
|
|
+ err = fmt.Errorf("GetSysAdminList err: %s", e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mobileMap := make(map[string]*models.Admin)
|
|
|
+ for _, v := range admins {
|
|
|
+ if v.Mobile == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+
|
|
|
for rk, row := range rows {
|
|
|
if rk > 0 {
|
|
|
- var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source string
|
|
|
+ var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source, mobile string
|
|
|
for ck, colCell := range row {
|
|
|
+ colCell = strings.TrimSpace(colCell)
|
|
|
switch ck {
|
|
|
case 0:
|
|
|
classifyFirst = colCell
|
|
@@ -273,6 +312,8 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
unit = colCell
|
|
|
case 7:
|
|
|
source = colCell
|
|
|
+ case 8:
|
|
|
+ mobile = colCell
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -389,6 +430,11 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
indexMap["Frequency"] = frequency
|
|
|
indexMap["Unit"] = unit
|
|
|
indexMap["ClassifyId"] = resp.Data.ClassifyId
|
|
|
+ admin := mobileMap[mobile]
|
|
|
+ if admin != nil {
|
|
|
+ indexMap["AdminId"] = admin.AdminId
|
|
|
+ indexMap["AdminName"] = admin.RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|
|
@@ -466,10 +512,26 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
return
|
|
|
}
|
|
|
fmt.Println("rows len:", len(rows))
|
|
|
+
|
|
|
+ // 获取创建人信息
|
|
|
+ admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
+ if e != nil {
|
|
|
+ err = fmt.Errorf("GetSysAdminList err: %s", e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mobileMap := make(map[string]*models.Admin)
|
|
|
+ for _, v := range admins {
|
|
|
+ if v.Mobile == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+
|
|
|
for rk, row := range rows {
|
|
|
if rk > 0 {
|
|
|
- var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source string
|
|
|
+ var classifyFirst, classifySecond, classifyThree, indexCode, indexName, frequency, unit, source, mobile string
|
|
|
for ck, colCell := range row {
|
|
|
+ colCell = strings.TrimSpace(colCell)
|
|
|
switch ck {
|
|
|
case 0:
|
|
|
classifyFirst = colCell
|
|
@@ -487,6 +549,8 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
unit = colCell
|
|
|
case 7:
|
|
|
source = colCell
|
|
|
+ case 8:
|
|
|
+ mobile = colCell
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -603,6 +667,11 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
indexMap["Frequency"] = frequency
|
|
|
indexMap["Unit"] = unit
|
|
|
indexMap["ClassifyId"] = resp.Data.ClassifyId
|
|
|
+ admin := mobileMap[mobile]
|
|
|
+ if admin != nil {
|
|
|
+ indexMap["AdminId"] = admin.AdminId
|
|
|
+ indexMap["AdminName"] = admin.RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|