作者 陈志颖

fix:去除总榜时间

... ... @@ -361,3 +361,28 @@
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"}
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
2020/11/24 09:09:56.658 [I] [???:0] http server Running on http://:8082
2020/11/24 09:15:20.226 [I] [???:0] http server Running on http://:8082
2020/11/24 10:11:33.014 [I] [???:0] http server Running on http://:8082
2020/11/24 10:14:13.989 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./statistics/employees-ranking-list.1606184053989521000
Auth=
BodyData:{
"companyId": 381,
"uid": 3259769336137728,
"rankingType": 1,
"offset": 0,
"limit": 20
}
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\""}
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
2020/11/24 10:14:49.172 [I] [???:0] http server Running on http://:8082
2020/11/24 10:14:53.080 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./statistics/employees-ranking-list.1606184093080911000
Auth=
BodyData:{
"companyId": 381,
"uid": 3259769336137728,
"rankingType": 1,
"offset": 0,
"limit": 20
}
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
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
}
if contributionsWealthRankingQuery.RankingType == 1 { // 返回总榜
contributionsWealthRankingQuery.StartTime = time.Date(1971, time.Month(1), 1, 0, 0, 0, 0, time.Local)
contributionsWealthRankingQuery.EndTime = time.Now().Local()
contributionsWealthRankingQuery.StartTime = time.Date(0001, 01, 01, 0, 0, 0, 0, time.UTC)
contributionsWealthRankingQuery.EndTime = time.Date(0001, 01, 01, 0, 0, 0, 0, time.UTC)
} else if contributionsWealthRankingQuery.RankingType == 2 { // 返回年榜
// 获取公司最新年榜
var listIntervalRepository domain.ListIntervalRepository
... ...
... ... @@ -859,6 +859,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if len(cashPoolsFound) == 0 {
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, "当前公司未创建现金池")
}
... ...
... ... @@ -339,10 +339,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryWealth = queryWealth.Where("e.company_id = ?", companyId)
}
if startTime, ok := queryOptions["startTime"]; ok {
if startTime, ok := queryOptions["startTime"]; ok && !startTime.(time.Time).IsZero() {
queryWealth = queryWealth.Where(`su_money_transaction_record.create_time > ?`, startTime)
}
if endTime, ok := queryOptions["endTime"]; ok {
if endTime, ok := queryOptions["endTime"]; ok && !endTime.(time.Time).IsZero() {
queryWealth = queryWealth.Where(`su_money_transaction_record.create_time < ?`, endTime)
}
// 财富值排行榜子查询
... ... @@ -401,10 +401,10 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryContributions = queryContributions.Where("e.company_id = ?", companyId)
}
if startTime, ok := queryOptions["startTime"]; ok {
if startTime, ok := queryOptions["startTime"]; ok && !startTime.(time.Time).IsZero() {
queryContributions = queryContributions.Where(`su_money_transaction_record.create_time > ?`, startTime)
}
if endTime, ok := queryOptions["endTime"]; ok {
if endTime, ok := queryOptions["endTime"]; ok && !endTime.(time.Time).IsZero() {
queryContributions = queryContributions.Where(`su_money_transaction_record.create_time < ?`, endTime)
}
// 贡献值子查询
... ...