作者 陈志颖

fix:去除总榜时间

@@ -361,3 +361,28 @@ @@ -361,3 +361,28 @@
361 2020/11/24 08:59:36.836 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/22.1606179576812922000 BodyData:{"code":0,"data":{"listIntervalId":22,"companyId":381,"intervalStartTime":"2020-12-15T00:00:00+08:00","intervalEndTime":"2020-12-16T23:59:59+08:00"},"msg":"ok"} 361 2020/11/24 08:59:36.836 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/22.1606179576812922000 BodyData:{"code":0,"data":{"listIntervalId":22,"companyId":381,"intervalStartTime":"2020-12-15T00:00:00+08:00","intervalEndTime":"2020-12-16T23:59:59+08:00"},"msg":"ok"}
362 2020/11/24 08:59:36.836 [D] [server.go:1925] | 127.0.0.1| 200 | 23.603024ms| match| PUT  /list-interval/22 r:/list-interval/:listId 362 2020/11/24 08:59:36.836 [D] [server.go:1925] | 127.0.0.1| 200 | 23.603024ms| match| PUT  /list-interval/22 r:/list-interval/:listId
363 2020/11/24 09:09:56.658 [I] [???:0] http server Running on http://:8082 363 2020/11/24 09:09:56.658 [I] [???:0] http server Running on http://:8082
  364 +2020/11/24 09:15:20.226 [I] [???:0] http server Running on http://:8082
  365 +2020/11/24 10:11:33.014 [I] [???:0] http server Running on http://:8082
  366 +2020/11/24 10:14:13.989 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./statistics/employees-ranking-list.1606184053989521000
  367 + Auth=
  368 + BodyData:{
  369 + "companyId": 381,
  370 + "uid": 3259769336137728,
  371 + "rankingType": 1,
  372 + "offset": 0,
  373 + "limit": 20
  374 +}
  375 +2020/11/24 10:14:14.233 [D] [server.go:2843] <====Send RequestId:POST./statistics/employees-ranking-list.1606184053989521000 BodyData:{"code":501,"msg":"内部服务出错:ERROR #22008 date/time field value out of range: \"0000-12-31 15:54:17+00:00:00\""}
  376 +2020/11/24 10:14:14.233 [D] [server.go:1925] | 127.0.0.1| 200 | 244.136558ms| match| POST  /statistics/employees-ranking-list r:/statistics/employees-ranking-list
  377 +2020/11/24 10:14:49.172 [I] [???:0] http server Running on http://:8082
  378 +2020/11/24 10:14:53.080 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./statistics/employees-ranking-list.1606184093080911000
  379 + Auth=
  380 + BodyData:{
  381 + "companyId": 381,
  382 + "uid": 3259769336137728,
  383 + "rankingType": 1,
  384 + "offset": 0,
  385 + "limit": 20
  386 +}
  387 +2020/11/24 10:14:53.298 [D] [server.go:2843] <====Send RequestId:POST./statistics/employees-ranking-list.1606184093080911000 BodyData:{"code":0,"data":{"currentEmployeeContributions":{"Uid":3259769336137728,"EmployeeName":"杨志","EmployeesContributions":7232,"Ranking":3},"currentEmployeeWealth":{"Uid":3259769336137728,"EmployeeName":"杨志","EmployeeSuMoney":7032,"Ranking":3},"employeesContributions":[{"Uid":3259769335767040,"EmployeeName":"朱武","EmployeesContributions":88100,"Ranking":1},{"Uid":3259769336174592,"EmployeeName":"索超","EmployeesContributions":26217.3,"Ranking":2},{"Uid":3259769336137728,"EmployeeName":"杨志","EmployeesContributions":7232,"Ranking":3},{"Uid":3259769336070144,"EmployeeName":"杜迁","EmployeesContributions":3635,"Ranking":4},{"Uid":3259769336037376,"EmployeeName":"朱贵2","EmployeesContributions":3325,"Ranking":5},{"Uid":3259769336137728,"EmployeeName":"杨志358","EmployeesContributions":3309.8,"Ranking":6},{"Uid":3288265494991872,"EmployeeName":"李四","EmployeesContributions":10.5,"Ranking":7},{"Uid":3259769336317952,"EmployeeName":"陈达","EmployeesContributions":0,"Ran
  388 +2020/11/24 10:14:53.298 [D] [server.go:1925] | 127.0.0.1| 200 | 218.323689ms| match| POST  /statistics/employees-ranking-list r:/statistics/employees-ranking-list
@@ -410,8 +410,8 @@ func (statisticsService *StatisticsService) ContributionsWealthRanking(contribut @@ -410,8 +410,8 @@ func (statisticsService *StatisticsService) ContributionsWealthRanking(contribut
410 } 410 }
411 411
412 if contributionsWealthRankingQuery.RankingType == 1 { // 返回总榜 412 if contributionsWealthRankingQuery.RankingType == 1 { // 返回总榜
413 - contributionsWealthRankingQuery.StartTime = time.Date(1971, time.Month(1), 1, 0, 0, 0, 0, time.Local)  
414 - contributionsWealthRankingQuery.EndTime = time.Now().Local() 413 + contributionsWealthRankingQuery.StartTime = time.Date(0001, 01, 01, 0, 0, 0, 0, time.UTC)
  414 + contributionsWealthRankingQuery.EndTime = time.Date(0001, 01, 01, 0, 0, 0, 0, time.UTC)
415 } else if contributionsWealthRankingQuery.RankingType == 2 { // 返回年榜 415 } else if contributionsWealthRankingQuery.RankingType == 2 { // 返回年榜
416 // 获取公司最新年榜 416 // 获取公司最新年榜
417 var listIntervalRepository domain.ListIntervalRepository 417 var listIntervalRepository domain.ListIntervalRepository
@@ -859,6 +859,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -859,6 +859,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
859 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 859 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
860 } 860 }
861 if len(cashPoolsFound) == 0 { 861 if len(cashPoolsFound) == 0 {
  862 +
862 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, "当前公司未创建现金池") 863 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, "当前公司未创建现金池")
863 } 864 }
864 865
@@ -339,10 +339,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter @@ -339,10 +339,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
339 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) { 339 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
340 queryWealth = queryWealth.Where("e.company_id = ?", companyId) 340 queryWealth = queryWealth.Where("e.company_id = ?", companyId)
341 } 341 }
342 - if startTime, ok := queryOptions["startTime"]; ok { 342 + if startTime, ok := queryOptions["startTime"]; ok && !startTime.(time.Time).IsZero() {
343 queryWealth = queryWealth.Where(`su_money_transaction_record.create_time > ?`, startTime) 343 queryWealth = queryWealth.Where(`su_money_transaction_record.create_time > ?`, startTime)
344 } 344 }
345 - if endTime, ok := queryOptions["endTime"]; ok { 345 + if endTime, ok := queryOptions["endTime"]; ok && !endTime.(time.Time).IsZero() {
346 queryWealth = queryWealth.Where(`su_money_transaction_record.create_time < ?`, endTime) 346 queryWealth = queryWealth.Where(`su_money_transaction_record.create_time < ?`, endTime)
347 } 347 }
348 // 财富值排行榜子查询 348 // 财富值排行榜子查询
@@ -401,10 +401,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter @@ -401,10 +401,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
401 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) { 401 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
402 queryContributions = queryContributions.Where("e.company_id = ?", companyId) 402 queryContributions = queryContributions.Where("e.company_id = ?", companyId)
403 } 403 }
404 - if startTime, ok := queryOptions["startTime"]; ok { 404 + if startTime, ok := queryOptions["startTime"]; ok && !startTime.(time.Time).IsZero() {
405 queryContributions = queryContributions.Where(`su_money_transaction_record.create_time > ?`, startTime) 405 queryContributions = queryContributions.Where(`su_money_transaction_record.create_time > ?`, startTime)
406 } 406 }
407 - if endTime, ok := queryOptions["endTime"]; ok { 407 + if endTime, ok := queryOptions["endTime"]; ok && !endTime.(time.Time).IsZero() {
408 queryContributions = queryContributions.Where(`su_money_transaction_record.create_time < ?`, endTime) 408 queryContributions = queryContributions.Where(`su_money_transaction_record.create_time < ?`, endTime)
409 } 409 }
410 // 贡献值子查询 410 // 贡献值子查询