| @@ -842,9 +842,9 @@ func RefreshUserYearTable(pageStartTime time.Time, pageEndTime time.Time) { | |||||
| repoInfo := getRepoDetailInfo(DetailInfoMap, dateRecordAll.ID, MostDownloadMap) | repoInfo := getRepoDetailInfo(DetailInfoMap, dateRecordAll.ID, MostDownloadMap) | ||||
| dataSetInfo, datasetscore := getDataSetInfo(dateRecordAll.ID, CreatedDataset, dataSetDownloadMap, CommitDatasetNumMap, CollectedDataset) | dataSetInfo, datasetscore := getDataSetInfo(dateRecordAll.ID, CreatedDataset, dataSetDownloadMap, CommitDatasetNumMap, CollectedDataset) | ||||
| scoreMap["datasetscore"] = datasetscore | scoreMap["datasetscore"] = datasetscore | ||||
| codeInfo, codescore := getCodeInfo(dateRecordAll) | |||||
| codeInfo, codescore := getCodeInfo(&dateRecordAll) | |||||
| scoreMap["codescore"] = codescore | scoreMap["codescore"] = codescore | ||||
| cloudBrainInfo := getCloudBrainInfo(dateRecordAll, CloudBrainTaskItemMap, scoreMap) | |||||
| cloudBrainInfo := getCloudBrainInfo(&dateRecordAll, CloudBrainTaskItemMap, scoreMap) | |||||
| playARoll := getPlayARoll(bonusMap, dateRecordAll.Name, scoreMap) | playARoll := getPlayARoll(bonusMap, dateRecordAll.Name, scoreMap) | ||||
| re := &UserSummaryCurrentYear{ | re := &UserSummaryCurrentYear{ | ||||
| ID: dateRecordAll.ID, | ID: dateRecordAll.ID, | ||||
| @@ -891,6 +891,8 @@ func getBonusWeekDataMap() map[int64][]int { | |||||
| if strings.HasSuffix(filenames[i], "\r") { | if strings.HasSuffix(filenames[i], "\r") { | ||||
| filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] | filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] | ||||
| } | } | ||||
| week, num := getWeekAndNum(filenames[i]) | |||||
| log.Info("filenames[i]=" + filenames[i] + "week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) | |||||
| url = setting.RecommentRepoAddr + "bonus/weekdata/" + filenames[i] | url = setting.RecommentRepoAddr + "bonus/weekdata/" + filenames[i] | ||||
| csvContent, err1 := GetContentFromPromote(url) | csvContent, err1 := GetContentFromPromote(url) | ||||
| if err1 == nil { | if err1 == nil { | ||||
| @@ -908,7 +910,6 @@ func getBonusWeekDataMap() map[int64][]int { | |||||
| userId := getInt64Value(aLine[0]) | userId := getInt64Value(aLine[0]) | ||||
| order := getIntValue(aLine[2]) | order := getIntValue(aLine[2]) | ||||
| money := getIntValue(aLine[3]) | money := getIntValue(aLine[3]) | ||||
| week, num := getWeekAndNum(filenames[i]) | |||||
| //log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) | //log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) | ||||
| //email := lines[2] | //email := lines[2] | ||||
| record, ok := bonusMap[userId] | record, ok := bonusMap[userId] | ||||
| @@ -1028,7 +1029,7 @@ func getPlayARoll(bonusMap map[string]map[string]int, userName string, scoreMap | |||||
| } | } | ||||
| } | } | ||||
| func getCloudBrainInfo(dateRecordAll UserBusinessAnalysisAll, CloudBrainTaskItemMap map[string]int, scoreMap map[string]float64) string { | |||||
| func getCloudBrainInfo(dateRecordAll *UserBusinessAnalysisAll, CloudBrainTaskItemMap map[string]int, scoreMap map[string]float64) string { | |||||
| trainscore := 0.0 | trainscore := 0.0 | ||||
| debugscore := 0.0 | debugscore := 0.0 | ||||
| runtime := 0.0 | runtime := 0.0 | ||||
| @@ -1063,7 +1064,7 @@ func getCloudBrainInfo(dateRecordAll UserBusinessAnalysisAll, CloudBrainTaskItem | |||||
| } | } | ||||
| } | } | ||||
| func getCodeInfo(dateRecordAll UserBusinessAnalysisAll) (string, float64) { | |||||
| func getCodeInfo(dateRecordAll *UserBusinessAnalysisAll) (string, float64) { | |||||
| if dateRecordAll.CommitCount > 0 { | if dateRecordAll.CommitCount > 0 { | ||||
| codeInfo := make(map[string]string) | codeInfo := make(map[string]string) | ||||
| codeInfo["commit_count"] = fmt.Sprint(dateRecordAll.CommitCount) | codeInfo["commit_count"] = fmt.Sprint(dateRecordAll.CommitCount) | ||||