作者 yangfu

统计修改

@@ -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%】
@@ -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{}{
@@ -89,12 +89,12 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -89,12 +89,12 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
89 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 89 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
90 roleListQuery.Operator) 90 roleListQuery.Operator)
91 roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{ 91 roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
92 - Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,  
93 - Limit: roleListQuery.PageSize,  
94 - OrgName: roleListQuery.OrgName,  
95 - RoleName: roleListQuery.RoleName,  
96 - InOrgIds: roleListQuery.Operator.OrgIds,  
97 - RoleType: roleListQuery.RoleType, 92 + Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,
  93 + Limit: roleListQuery.PageSize,
  94 + OrgName: roleListQuery.OrgName,
  95 + MatchRoleName: roleListQuery.RoleName,
  96 + InOrgIds: roleListQuery.Operator.OrgIds,
  97 + RoleType: roleListQuery.RoleType,
98 }) 98 })
99 if err != nil { 99 if err != nil {
100 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 100 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -35,6 +35,8 @@ type ( @@ -35,6 +35,8 @@ type (
35 OrgId int64 `json:"orgId"` 35 OrgId int64 `json:"orgId"`
36 // 匹配多个组织 36 // 匹配多个组织
37 InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"` 37 InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
  38 + // 角色名称
  39 + MatchRoleName string `cname:"匹配角色名称" json:"matchRoleName,omitempty"`
38 } 40 }
39 41
40 DataRoleSearch struct { 42 DataRoleSearch struct {