...
|
...
|
@@ -160,7 +160,6 @@ func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMone |
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
var employeeDao *dao.EmployeeDao
|
|
|
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -169,8 +168,6 @@ func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMone |
|
|
} else {
|
|
|
employeeDao = value
|
|
|
}
|
|
|
|
|
|
// 企业员工资源库
|
|
|
var employeeRepository domain.EmployeeRepository
|
|
|
if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -179,8 +176,6 @@ func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMone |
|
|
} else {
|
|
|
employeeRepository = value
|
|
|
}
|
|
|
|
|
|
// 判断企业员工是否有效
|
|
|
employee, err := employeeRepository.FindOne(map[string]interface{}{
|
|
|
"uid": personSuMoneyStatisticsCommand.Uid,
|
|
|
})
|
...
|
...
|
@@ -190,8 +185,6 @@ func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMone |
|
|
if employee == nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的企业员工")
|
|
|
}
|
|
|
|
|
|
// 计算个人素币
|
|
|
if personSuMoneyStatistics, err := employeeDao.CalculatePersonSuMoney(personSuMoneyStatisticsCommand.Uid); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
...
|
...
|
@@ -203,7 +196,6 @@ func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMone |
|
|
}
|
|
|
}
|
|
|
|
|
|
// TODO 系统素币统计
|
|
|
func (statisticsService *StatisticsService) SystemSuMoneyStatistics(systemSuMoneyStatisticsCommand *command.SystemSuMoneyStatisticsCommand) (interface{}, error) {
|
|
|
if err := systemSuMoneyStatisticsCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
...
|
...
|
@@ -219,15 +211,6 @@ func (statisticsService *StatisticsService) SystemSuMoneyStatistics(systemSuMone |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
//var cashPoolDao *dao.CashPoolDao
|
|
|
//if value, err := factory.CreateCashPoolDao(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// cashPoolDao = value
|
|
|
//}
|
|
|
|
|
|
var employeeDao *dao.EmployeeDao
|
|
|
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -237,15 +220,6 @@ func (statisticsService *StatisticsService) SystemSuMoneyStatistics(systemSuMone |
|
|
employeeDao = value
|
|
|
}
|
|
|
|
|
|
//var employeeRepository domain.EmployeeRepository
|
|
|
//if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// employeeRepository = value
|
|
|
//}
|
|
|
|
|
|
if systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(systemSuMoneyStatisticsCommand.CompanyId); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
...
|
...
|
@@ -256,7 +230,6 @@ func (statisticsService *StatisticsService) SystemSuMoneyStatistics(systemSuMone |
|
|
}
|
|
|
}
|
|
|
|
|
|
// TODO 系统现金统计
|
|
|
func (statisticsService *StatisticsService) SystemCashStatistics(systemCashStatisticsCommand *command.SystemCashStatisticsCommand) (interface{}, error) {
|
|
|
if err := systemCashStatisticsCommand.ValidateCommand(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
...
|
...
|
@@ -272,15 +245,6 @@ func (statisticsService *StatisticsService) SystemCashStatistics(systemCashStati |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
//var cashPoolDao *dao.CashPoolDao
|
|
|
//if value, err := factory.CreateCashPoolDao(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// cashPoolDao = value
|
|
|
//}
|
|
|
|
|
|
var employeeDao *dao.EmployeeDao
|
|
|
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -300,6 +264,19 @@ func (statisticsService *StatisticsService) SystemCashStatistics(systemCashStati |
|
|
}
|
|
|
}
|
|
|
|
|
|
// TODO 员工素币值统计
|
|
|
func (statisticsService *StatisticsService) EmployeesSuMoneyStatistics(employeesSuMoneyStatisticsCommand *command.EmployeesSuMoneyStatisticsCommand) (interface{}, error) {
|
|
|
|
|
|
return nil ,nil
|
|
|
}
|
|
|
|
|
|
// TODO 员工贡献值统计
|
|
|
func (statisticsService *StatisticsService) EmployeesContributionsStatistics(employeesContributionsStatisticsCommand *command.EmployeesContributionsStatisticsCommand) (interface{}, error) {
|
|
|
|
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
|
|
|
func NewStatisticsService(options map[string]interface{}) *StatisticsService {
|
|
|
newStatisticsService := &StatisticsService{}
|
|
|
return newStatisticsService
|
...
|
...
|
|