|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
|
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory"
|
|
|
|
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/statistics/command"
|
|
...
|
...
|
@@ -307,15 +306,11 @@ func (statisticsService *StatisticsService) EmployeesSuMoneyStatistics(employees |
|
|
|
employeeDao = value
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(employeesSuMoneyStatisticsCommand, "\n")
|
|
|
|
|
|
|
|
if employeesSuMoneyStatisticsCommand.StartTime.IsZero() && employeesSuMoneyStatisticsCommand.EndTime.IsZero() {
|
|
|
|
employeesSuMoneyStatisticsCommand.StartTime = time.Date(1971, time.Month(1), 1, 0, 0, 0, 0, time.Now().Location())
|
|
|
|
employeesSuMoneyStatisticsCommand.EndTime = time.Now().Local()
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(employeesSuMoneyStatisticsCommand, "\n")
|
|
|
|
|
|
|
|
if employeesSuMoneyStatistics, err := employeeDao.CalculateEmployeesSuMoney(employeesSuMoneyStatisticsCommand.CompanyId, employeesSuMoneyStatisticsCommand.StartTime, employeesSuMoneyStatisticsCommand.EndTime); err != nil {
|
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
|
} else {
|
|
...
|
...
|
@@ -351,6 +346,11 @@ func (statisticsService *StatisticsService) EmployeesContributionsStatistics(emp |
|
|
|
employeeDao = value
|
|
|
|
}
|
|
|
|
|
|
|
|
if employeesContributionsStatisticsCommand.StartTime.IsZero() && employeesContributionsStatisticsCommand.EndTime.IsZero() {
|
|
|
|
employeesContributionsStatisticsCommand.StartTime = time.Date(1971, time.Month(1), 1, 0, 0, 0, 0, time.Now().Location())
|
|
|
|
employeesContributionsStatisticsCommand.EndTime = time.Now().Local()
|
|
|
|
}
|
|
|
|
|
|
|
|
if employeesContributionsStatistics, err := employeeDao.CalculateEmployeesContributions(employeesContributionsStatisticsCommand.CompanyId, employeesContributionsStatisticsCommand.StartTime, employeesContributionsStatisticsCommand.EndTime); err != nil {
|
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
|
} else {
|
...
|
...
|
|