...
|
...
|
@@ -7,6 +7,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
// 个人端统计 【0%】
|
...
|
...
|
@@ -50,30 +51,33 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC |
|
|
"contractStoppedSum": cs.ContractStoppedSum, //停止的合约数
|
|
|
"companySum": users.Count, //共创企业数
|
|
|
}
|
|
|
|
|
|
year, month, _ := time.Now().Date()
|
|
|
beginTime := time.Date(year, month, 1, 0, 0, 0, 0, time.Local)
|
|
|
endTime := beginTime.AddDate(0, 1, 0)
|
|
|
// 2.本月分红统计 - 个人
|
|
|
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
|
|
|
dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.CreditAccountStatistics, map[string]interface{}{
|
|
|
"userBaseId": cmd.Operator.UserBaseId,
|
|
|
"beginTime": beginTime,
|
|
|
"endTime": endTime,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
type AnnualDividend struct {
|
|
|
AnnualDividends struct {
|
|
|
Accounted int `json:"accounted"`
|
|
|
Accounting int `json:"accounting"`
|
|
|
Paid int `json:"paid"`
|
|
|
Total int `json:"total"`
|
|
|
} `json:"annualDividends"`
|
|
|
Total float64 `json:"total"`
|
|
|
Accounting float64 `json:"accounting"`
|
|
|
Accounted float64 `json:"accounted"`
|
|
|
Paid float64 `json:"paid"`
|
|
|
Unpaid float64 `json:"unpaid"`
|
|
|
}
|
|
|
var annualDividend = &AnnualDividend{}
|
|
|
if err := json.UnmarshalFromString(json.MarshalToString(dividendStatisticsResult), annualDividend); err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
dividendStatistics := map[string]interface{}{
|
|
|
"dividendAmount": annualDividend.AnnualDividends.Total, // 分红金额
|
|
|
"paidAmount": annualDividend.AnnualDividends.Paid, // 已支付
|
|
|
"unPaidAmount": annualDividend.AnnualDividends.Total - annualDividend.AnnualDividends.Paid, // 未支付
|
|
|
"dividendAmount": annualDividend.Total, // 分红金额
|
|
|
"paidAmount": annualDividend.Paid, // 已支付
|
|
|
"unPaidAmount": annualDividend.Unpaid, // 未支付
|
|
|
}
|
|
|
|
|
|
return map[string]interface{}{
|
...
|
...
|
|