...
|
...
|
@@ -432,7 +432,7 @@ func (ptr *CooperationStatisticsService) CooperationUserModeStatistics(queryOpti |
|
|
}
|
|
|
|
|
|
// 3.分红支出
|
|
|
dividendsDetails, err := ptr.userModeDividend(request.OrgId, mapMode, mapModeContracts)
|
|
|
dividendsDetails, err := ptr.userModeDividend(request.UserId, request.OrgId, mapMode, mapModeContracts)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
@@ -449,14 +449,14 @@ func (ptr *CooperationStatisticsService) CooperationUserModeStatistics(queryOpti |
|
|
}
|
|
|
|
|
|
// 用户模式分红
|
|
|
func (ptr *CooperationStatisticsService) userModeDividend(orgId int64, mapMode map[string]*domain.CooperationMode, mapModeContracts map[string][]string) (interface{}, error) {
|
|
|
func (ptr *CooperationStatisticsService) userModeDividend(userId, orgId int64, mapMode map[string]*domain.CooperationMode, mapModeContracts map[string][]string) (interface{}, error) {
|
|
|
creditAccountDao, _ := dao.NewCreditAccountDao(ptr.transactionContext)
|
|
|
var dividends dividendsExpenseByTypes = make([]dividendsExpenseByType, 0)
|
|
|
var total float64 = 0
|
|
|
for _, v := range mapMode {
|
|
|
numbers := mapModeContracts[v.CooperationModeNumber]
|
|
|
var dividendsEstimate = &CreditAccountStatisticsResponse{}
|
|
|
err := creditAccountDao.DividendsStatistics(map[string]interface{}{"orgId": orgId, "cooperationContractNumbers": numbers}, dividendsEstimate)
|
|
|
err := creditAccountDao.DividendsStatistics(map[string]interface{}{"userId": userId, "orgId": orgId, "cooperationContractNumbers": numbers}, dividendsEstimate)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
|