作者 陈志颖

fix:修复现金池投入现金问题

... ... @@ -361,7 +361,7 @@ func (statisticsService *StatisticsService) EmployeesContributionsStatistics(emp
}
}
// TODO 员工排行榜统计
// 员工排行榜统计
func (statisticsService *StatisticsService) EmployeesRankingListStatistics(employeesRankingListStatisticsCommand *command.EmployeesRankingListStatisticsCommand) (interface{}, error) {
if err := employeesRankingListStatisticsCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
... ...
... ... @@ -57,7 +57,6 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的公司id")
}
// 获取平台素币兑换情况
var employeeDao *dao.EmployeeDao
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -66,7 +65,7 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co
} else {
employeeDao = value
}
// 获取平台素币兑换情况
systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(createCashPoolCommand.CompanyId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ... @@ -93,7 +92,6 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 新建现金池
newCashPool := &domain.CashPool{
CompanyId: createCashPoolCommand.CompanyId,
Cash: createCashPoolCommand.Cash,
... ... @@ -1028,9 +1026,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP
exchangeCashPersonListRepository = value
}
fmt.Print(listExchangeCashPersonQuery, "\n")
// TODO 返回兑换现金活动总榜
// 返回兑换现金活动总榜
if listExchangeCashPersonQuery.ExchangeCashActivityId == 0 && listExchangeCashPersonQuery.CompanyId != 0 {
// 找到该公司下的所有活动id
var exchangeActivityRepository domain.ExchangeActivityRepository
... ... @@ -1042,7 +1038,6 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP
exchangeActivityRepository = value
}
// TODO 需要改为获取所有活动,去除分页
if _, activities, err := exchangeActivityRepository.FindAll(map[string]interface{}{
"companyId": listExchangeCashPersonQuery.CompanyId,
}); err != nil {
... ...
... ... @@ -156,7 +156,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
// 系统未兑换现金
cashPool := new(models.CashPool)
if err := tx.Model(cashPool).
ColumnExpr("exchanged_cash").
Column("exchanged_cash").
Where("cash_pool.company_id = ?", companyId).
Order("id DESC").
Limit(1).
... ... @@ -164,7 +164,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
return nil, err
}
if err := tx.Model(cashPool).
ColumnExpr("un_exchange_cash").
Column("un_exchange_cash").
Where("cash_pool.company_id = ?", companyId).
Order("id DESC").
Limit(1).
... ...