作者 陈志颖

fix:未配置年榜

... ... @@ -433,9 +433,8 @@ func (statisticsService *StatisticsService) ContributionsWealthRanking(contribut
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if len(listIntervals) == 0 { // 未配置年榜
timeNow := time.Now().Local()
contributionsWealthRankingQuery.StartTime = time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 0, 0, 0, 0, time.Local)
contributionsWealthRankingQuery.EndTime = time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 23, 59, 59, 0, time.Local)
contributionsWealthRankingQuery.StartTime = time.Date(00001, 01, 01, 0, 0, 0, 0, time.Local)
contributionsWealthRankingQuery.EndTime = time.Date(0001, 01, 01, 23, 59, 59, 0, time.Local)
} else if len(listIntervals) == 1 { // 只配置了一个年榜
currentTime := time.Now().Local()
if currentTime.After(listIntervals[0].IntervalStartTime.Local()) && currentTime.Before(listIntervals[0].IntervalEndTime.Local()) || currentTime.Equal(listIntervals[0].IntervalStartTime.Local()) || currentTime.Equal(listIntervals[0].IntervalEndTime.Local()) { // 当前时间在榜单内
... ...
... ... @@ -510,6 +510,7 @@ func (controller *SuMoneyController) ImportExchangeList () {
// 新增成功计数
var successDataCount int64
// 导入命令
var createExchangeCashPersonCommands []*command.CreateExchangeCashPersonCommand
for i, row := range rows {
... ... @@ -534,23 +535,23 @@ func (controller *SuMoneyController) ImportExchangeList () {
controller.ServeJSON()
return
} else {
successDataCount = int64(len(rows) - 3 - len(failureDataList))
}
// 导入失败返回
ret = map[string]interface{}{
"successCount": successDataCount,
"fail": map[string]interface{}{
"tableHeader": tableHeader,
"tableData": failureDataList,
},
}
// 导入成功返回
if successDataCount == int64(len(rows) - 3) {
ret = map[string]interface{}{
"successCount": successDataCount,
"fail": nil,
if len(failureDataList) > 0 { // 导入失败返回
successDataCount = 0
ret = map[string]interface{}{
"successCount": successDataCount,
"fail": map[string]interface{}{
"tableHeader": tableHeader,
"tableData": failureDataList,
},
}
} else { // 导入成功返回
successDataCount = int64(len(rows) - 3 - len(failureDataList))
if successDataCount == int64(len(rows) - 3) {
ret = map[string]interface{}{
"successCount": successDataCount,
"fail": nil,
}
}
}
}
... ...