|
@@ -59,18 +59,25 @@ func (ptr *CooperationStatisticsService) cooperationCompanyStatistics(userBaseId |
|
@@ -59,18 +59,25 @@ func (ptr *CooperationStatisticsService) cooperationCompanyStatistics(userBaseId |
59
|
}
|
59
|
}
|
60
|
|
60
|
|
61
|
// 3.个人分红统计
|
61
|
// 3.个人分红统计
|
62
|
- creditAccountDao, _ := dao.NewCreditAccountDao(ptr.transactionContext)
|
|
|
63
|
- var allDividends = &CreditAccountStatisticsResponse{}
|
|
|
64
|
- if err := creditAccountDao.DividendsStatistics(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}, allDividends); err != nil {
|
62
|
+ //creditAccountDao, _ := dao.NewCreditAccountDao(ptr.transactionContext)
|
|
|
63
|
+ //var allDividends = &CreditAccountStatisticsResponse{}
|
|
|
64
|
+ //if err := creditAccountDao.DividendsStatistics(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}, allDividends); err != nil {
|
|
|
65
|
+ // return nil, err
|
|
|
66
|
+ //}
|
|
|
67
|
+ //allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
|
|
68
|
+
|
|
|
69
|
+ creditAccountDao, _ := dao.NewDividendsEstimateDao(ptr.transactionContext)
|
|
|
70
|
+ var allDividends float64
|
|
|
71
|
+ if allDividends, err = creditAccountDao.CountDividendsEstimateDividendsAmount(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}); err != nil {
|
65
|
return nil, err
|
72
|
return nil, err
|
66
|
}
|
73
|
}
|
67
|
- allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
74
|
+ //allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
68
|
|
75
|
|
69
|
var ret = &cooperationCompanyStatisticsResponse{
|
76
|
var ret = &cooperationCompanyStatisticsResponse{
|
70
|
OrgId: orgId,
|
77
|
OrgId: orgId,
|
71
|
CooperationProjectCount: cooperationProjectCount,
|
78
|
CooperationProjectCount: cooperationProjectCount,
|
72
|
CooperationContractCount: cooperationContractCount,
|
79
|
CooperationContractCount: cooperationContractCount,
|
73
|
- DividendsIncome: utils.Round(allDividends.Accounted, 2),
|
80
|
+ DividendsIncome: utils.Round(allDividends, 2),
|
74
|
}
|
81
|
}
|
75
|
return ret, nil
|
82
|
return ret, nil
|
76
|
}
|
83
|
}
|
|
@@ -128,7 +135,7 @@ func (ptr *CooperationStatisticsService) cooperationContractCount(numbers []stri |
|
@@ -128,7 +135,7 @@ func (ptr *CooperationStatisticsService) cooperationContractCount(numbers []stri |
128
|
query.ColumnExpr("count(*) total")
|
135
|
query.ColumnExpr("count(*) total")
|
129
|
query.Where("cooperation_contract_number in (?)", pg.In(numbers))
|
136
|
query.Where("cooperation_contract_number in (?)", pg.In(numbers))
|
130
|
if status > 0 {
|
137
|
if status > 0 {
|
131
|
- query.Where("status =? ")
|
138
|
+ query.Where("status =? ", status)
|
132
|
}
|
139
|
}
|
133
|
query.Select(&total)
|
140
|
query.Select(&total)
|
134
|
return total
|
141
|
return total
|