|
@@ -54,6 +54,7 @@ func InitBaseIndexData(dataPath string) {
|
|
|
|
|
|
// 获取创建人信息
|
|
|
mobileMap := make(map[string]*models.Admin)
|
|
|
+ emailMap := make(map[string]*models.Admin)
|
|
|
if utils.MYSQL_URL_ETA != "" {
|
|
|
admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
if e != nil {
|
|
@@ -61,10 +62,12 @@ func InitBaseIndexData(dataPath string) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range admins {
|
|
|
- if v.Mobile == "" {
|
|
|
- continue
|
|
|
+ if v.Mobile != "" {
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+ if v.Email != "" {
|
|
|
+ emailMap[v.Email] = v
|
|
|
}
|
|
|
- mobileMap[v.Mobile] = v
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -278,6 +281,11 @@ func InitBaseIndexData(dataPath string) {
|
|
|
indexMap["AdminId"] = admin.AdminId
|
|
|
indexMap["AdminName"] = admin.RealName
|
|
|
}
|
|
|
+ // 先匹配下手机号, 没有则匹配下邮箱
|
|
|
+ if admin == nil && emailMap[mobile] != nil {
|
|
|
+ indexMap["AdminId"] = emailMap[mobile].AdminId
|
|
|
+ indexMap["AdminName"] = emailMap[mobile].RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|
|
@@ -373,6 +381,7 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
|
|
|
// 获取创建人信息
|
|
|
mobileMap := make(map[string]*models.Admin)
|
|
|
+ emailMap := make(map[string]*models.Admin)
|
|
|
if utils.MYSQL_URL_ETA != "" {
|
|
|
admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
if e != nil {
|
|
@@ -380,10 +389,12 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range admins {
|
|
|
- if v.Mobile == "" {
|
|
|
- continue
|
|
|
+ if v.Mobile != "" {
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+ if v.Email != "" {
|
|
|
+ emailMap[v.Email] = v
|
|
|
}
|
|
|
- mobileMap[v.Mobile] = v
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -614,6 +625,11 @@ func InitBaseIndexDataFromMysteel(filePath string) {
|
|
|
indexMap["AdminId"] = admin.AdminId
|
|
|
indexMap["AdminName"] = admin.RealName
|
|
|
}
|
|
|
+ // 先匹配下手机号, 没有则匹配下邮箱
|
|
|
+ if admin == nil && emailMap[mobile] != nil {
|
|
|
+ indexMap["AdminId"] = emailMap[mobile].AdminId
|
|
|
+ indexMap["AdminName"] = emailMap[mobile].RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|
|
@@ -694,6 +710,7 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
|
|
|
// 获取创建人信息
|
|
|
mobileMap := make(map[string]*models.Admin)
|
|
|
+ emailMap := make(map[string]*models.Admin)
|
|
|
if utils.MYSQL_URL_ETA != "" {
|
|
|
admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
if e != nil {
|
|
@@ -701,10 +718,12 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range admins {
|
|
|
- if v.Mobile == "" {
|
|
|
- continue
|
|
|
+ if v.Mobile != "" {
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+ if v.Email != "" {
|
|
|
+ emailMap[v.Email] = v
|
|
|
}
|
|
|
- mobileMap[v.Mobile] = v
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -935,6 +954,11 @@ func InitBaseIndexDataFromDataSourceSmm(filePath string) {
|
|
|
indexMap["AdminId"] = admin.AdminId
|
|
|
indexMap["AdminName"] = admin.RealName
|
|
|
}
|
|
|
+ // 先匹配下手机号, 没有则匹配下邮箱
|
|
|
+ if admin == nil && emailMap[mobile] != nil {
|
|
|
+ indexMap["AdminId"] = emailMap[mobile].AdminId
|
|
|
+ indexMap["AdminName"] = emailMap[mobile].RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("初始化指标失败:" + err.Error() + " result:" + string(result))
|
|
@@ -1020,6 +1044,7 @@ func InitDataToEdbInfo(filePath string) {
|
|
|
|
|
|
// 获取创建人信息
|
|
|
mobileMap := make(map[string]*models.Admin)
|
|
|
+ emailMap := make(map[string]*models.Admin)
|
|
|
if utils.MYSQL_URL_ETA != "" {
|
|
|
admins, e := models.GetSysAdminList(``, make([]interface{}, 0))
|
|
|
if e != nil {
|
|
@@ -1027,10 +1052,12 @@ func InitDataToEdbInfo(filePath string) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range admins {
|
|
|
- if v.Mobile == "" {
|
|
|
- continue
|
|
|
+ if v.Mobile != "" {
|
|
|
+ mobileMap[v.Mobile] = v
|
|
|
+ }
|
|
|
+ if v.Email != "" {
|
|
|
+ emailMap[v.Email] = v
|
|
|
}
|
|
|
- mobileMap[v.Mobile] = v
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1305,6 +1332,11 @@ func InitDataToEdbInfo(filePath string) {
|
|
|
indexMap["AdminId"] = admin.AdminId
|
|
|
indexMap["AdminName"] = admin.RealName
|
|
|
}
|
|
|
+ // 先匹配下手机号, 没有则匹配下邮箱
|
|
|
+ if admin == nil && emailMap[mobile] != nil {
|
|
|
+ indexMap["AdminId"] = emailMap[mobile].AdminId
|
|
|
+ indexMap["AdminName"] = emailMap[mobile].RealName
|
|
|
+ }
|
|
|
result, err = PostEdbLib(indexMap, method)
|
|
|
if err != nil {
|
|
|
errorIndexList = append(errorIndexList, fmt.Sprintf("指标编码:%s,初始化指标失败:%s ;result:%s", indexCode, err.Error(), string(result)))
|