|
@@ -7,6 +7,7 @@ import ( |
|
@@ -7,6 +7,7 @@ import ( |
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
|
|
|
10
|
+ "time"
|
|
10
|
)
|
11
|
)
|
|
11
|
|
12
|
|
|
12
|
// 个人端统计 【0%】
|
13
|
// 个人端统计 【0%】
|
|
@@ -39,7 +40,7 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC |
|
@@ -39,7 +40,7 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC |
|
39
|
users, err := gatewayUser.UserSearch(allied_creation_user.ReqUserSearch{
|
40
|
users, err := gatewayUser.UserSearch(allied_creation_user.ReqUserSearch{
|
|
40
|
Limit: 1,
|
41
|
Limit: 1,
|
|
41
|
Offset: 0,
|
42
|
Offset: 0,
|
|
42
|
- UserType: domain.UserTypeCooperation,
|
43
|
+ //UserType: domain.UserTypeCooperation,
|
|
43
|
UserBaseId: cmd.Operator.UserBaseId,
|
44
|
UserBaseId: cmd.Operator.UserBaseId,
|
|
44
|
})
|
45
|
})
|
|
45
|
if err != nil {
|
46
|
if err != nil {
|
|
@@ -50,30 +51,33 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC |
|
@@ -50,30 +51,33 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC |
|
50
|
"contractStoppedSum": cs.ContractStoppedSum, //停止的合约数
|
51
|
"contractStoppedSum": cs.ContractStoppedSum, //停止的合约数
|
|
51
|
"companySum": users.Count, //共创企业数
|
52
|
"companySum": users.Count, //共创企业数
|
|
52
|
}
|
53
|
}
|
|
53
|
-
|
54
|
+ year, month, _ := time.Now().Date()
|
|
|
|
55
|
+ beginTime := time.Date(year, month, 1, 0, 0, 0, 0, time.Local)
|
|
|
|
56
|
+ endTime := beginTime.AddDate(0, 1, 0)
|
|
54
|
// 2.本月分红统计 - 个人
|
57
|
// 2.本月分红统计 - 个人
|
|
55
|
- dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
|
58
|
+ dividendStatisticsResult, err := gateway.CooperationStatistics(allied_creation_cooperation.CreditAccountStatistics, map[string]interface{}{
|
|
56
|
"userBaseId": cmd.Operator.UserBaseId,
|
59
|
"userBaseId": cmd.Operator.UserBaseId,
|
|
|
|
60
|
+ "beginTime": beginTime,
|
|
|
|
61
|
+ "endTime": endTime,
|
|
57
|
})
|
62
|
})
|
|
58
|
if err != nil {
|
63
|
if err != nil {
|
|
59
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
64
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
60
|
}
|
65
|
}
|
|
61
|
type AnnualDividend struct {
|
66
|
type AnnualDividend struct {
|
|
62
|
- AnnualDividends struct {
|
|
|
|
63
|
- Accounted int `json:"accounted"`
|
|
|
|
64
|
- Accounting int `json:"accounting"`
|
|
|
|
65
|
- Paid int `json:"paid"`
|
|
|
|
66
|
- Total int `json:"total"`
|
|
|
|
67
|
- } `json:"annualDividends"`
|
67
|
+ Total float64 `json:"total"`
|
|
|
|
68
|
+ Accounting float64 `json:"accounting"`
|
|
|
|
69
|
+ Accounted float64 `json:"accounted"`
|
|
|
|
70
|
+ Paid float64 `json:"paid"`
|
|
|
|
71
|
+ Unpaid float64 `json:"unpaid"`
|
|
68
|
}
|
72
|
}
|
|
69
|
var annualDividend = &AnnualDividend{}
|
73
|
var annualDividend = &AnnualDividend{}
|
|
70
|
if err := json.UnmarshalFromString(json.MarshalToString(dividendStatisticsResult), annualDividend); err != nil {
|
74
|
if err := json.UnmarshalFromString(json.MarshalToString(dividendStatisticsResult), annualDividend); err != nil {
|
|
71
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
75
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
72
|
}
|
76
|
}
|
|
73
|
dividendStatistics := map[string]interface{}{
|
77
|
dividendStatistics := map[string]interface{}{
|
|
74
|
- "dividendAmount": annualDividend.AnnualDividends.Total, // 分红金额
|
|
|
|
75
|
- "paidAmount": annualDividend.AnnualDividends.Paid, // 已支付
|
|
|
|
76
|
- "unPaidAmount": annualDividend.AnnualDividends.Total - annualDividend.AnnualDividends.Paid, // 未支付
|
78
|
+ "dividendAmount": annualDividend.Total, // 分红金额
|
|
|
|
79
|
+ "paidAmount": annualDividend.Paid, // 已支付
|
|
|
|
80
|
+ "unPaidAmount": annualDividend.Unpaid, // 未支付
|
|
77
|
}
|
81
|
}
|
|
78
|
|
82
|
|
|
79
|
return map[string]interface{}{
|
83
|
return map[string]interface{}{
|
|
@@ -91,7 +95,7 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer |
|
@@ -91,7 +95,7 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer |
|
91
|
Limit: 100,
|
95
|
Limit: 100,
|
|
92
|
Offset: 0,
|
96
|
Offset: 0,
|
|
93
|
UserBaseId: cmd.Operator.UserBaseId,
|
97
|
UserBaseId: cmd.Operator.UserBaseId,
|
|
94
|
- UserType: domain.UserTypeCooperation,
|
98
|
+ //UserType: domain.UserTypeCooperation,
|
|
95
|
})
|
99
|
})
|
|
96
|
if err != nil {
|
100
|
if err != nil {
|
|
97
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
101
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|