作者 陈志颖

fix:未配置年榜

@@ -433,9 +433,8 @@ func (statisticsService *StatisticsService) ContributionsWealthRanking(contribut @@ -433,9 +433,8 @@ func (statisticsService *StatisticsService) ContributionsWealthRanking(contribut
433 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 433 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
434 } else { 434 } else {
435 if len(listIntervals) == 0 { // 未配置年榜 435 if len(listIntervals) == 0 { // 未配置年榜
436 - timeNow := time.Now().Local()  
437 - contributionsWealthRankingQuery.StartTime = time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 0, 0, 0, 0, time.Local)  
438 - contributionsWealthRankingQuery.EndTime = time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 23, 59, 59, 0, time.Local) 436 + contributionsWealthRankingQuery.StartTime = time.Date(00001, 01, 01, 0, 0, 0, 0, time.Local)
  437 + contributionsWealthRankingQuery.EndTime = time.Date(0001, 01, 01, 23, 59, 59, 0, time.Local)
439 } else if len(listIntervals) == 1 { // 只配置了一个年榜 438 } else if len(listIntervals) == 1 { // 只配置了一个年榜
440 currentTime := time.Now().Local() 439 currentTime := time.Now().Local()
441 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()) { // 当前时间在榜单内 440 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 () { @@ -510,6 +510,7 @@ func (controller *SuMoneyController) ImportExchangeList () {
510 // 新增成功计数 510 // 新增成功计数
511 var successDataCount int64 511 var successDataCount int64
512 512
  513 + // 导入命令
513 var createExchangeCashPersonCommands []*command.CreateExchangeCashPersonCommand 514 var createExchangeCashPersonCommands []*command.CreateExchangeCashPersonCommand
514 515
515 for i, row := range rows { 516 for i, row := range rows {
@@ -534,10 +535,8 @@ func (controller *SuMoneyController) ImportExchangeList () { @@ -534,10 +535,8 @@ func (controller *SuMoneyController) ImportExchangeList () {
534 controller.ServeJSON() 535 controller.ServeJSON()
535 return 536 return
536 } else { 537 } else {
537 - successDataCount = int64(len(rows) - 3 - len(failureDataList))  
538 - }  
539 -  
540 - // 导入失败返回 538 + if len(failureDataList) > 0 { // 导入失败返回
  539 + successDataCount = 0
541 ret = map[string]interface{}{ 540 ret = map[string]interface{}{
542 "successCount": successDataCount, 541 "successCount": successDataCount,
543 "fail": map[string]interface{}{ 542 "fail": map[string]interface{}{
@@ -545,14 +544,16 @@ func (controller *SuMoneyController) ImportExchangeList () { @@ -545,14 +544,16 @@ func (controller *SuMoneyController) ImportExchangeList () {
545 "tableData": failureDataList, 544 "tableData": failureDataList,
546 }, 545 },
547 } 546 }
548 -  
549 - // 导入成功返回 547 + } else { // 导入成功返回
  548 + successDataCount = int64(len(rows) - 3 - len(failureDataList))
550 if successDataCount == int64(len(rows) - 3) { 549 if successDataCount == int64(len(rows) - 3) {
551 ret = map[string]interface{}{ 550 ret = map[string]interface{}{
552 "successCount": successDataCount, 551 "successCount": successDataCount,
553 "fail": nil, 552 "fail": nil,
554 } 553 }
555 } 554 }
  555 + }
  556 + }
556 557
557 response = utils.ResponseData(controller.Ctx, ret) 558 response = utils.ResponseData(controller.Ctx, ret)
558 controller.Data["json"] = response 559 controller.Data["json"] = response