作者 tangxuhui
@@ -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%】
@@ -37,9 +38,9 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC @@ -37,9 +38,9 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC
37 gatewayUser := allied_creation_user.NewHttplibAlliedCreationUser( 38 gatewayUser := allied_creation_user.NewHttplibAlliedCreationUser(
38 cmd.Operator) 39 cmd.Operator)
39 users, err := gatewayUser.UserSearch(allied_creation_user.ReqUserSearch{ 40 users, err := gatewayUser.UserSearch(allied_creation_user.ReqUserSearch{
40 - Limit: 1,  
41 - Offset: 0,  
42 - UserType: domain.UserTypeCooperation, 41 + Limit: 1,
  42 + Offset: 0,
  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())
@@ -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())
@@ -7,3 +7,9 @@ type UserInfo struct { @@ -7,3 +7,9 @@ type UserInfo struct {
7 UsersId int `json:"userId,string"` 7 UsersId int `json:"userId,string"`
8 UserCode string `json:"userCode"` 8 UserCode string `json:"userCode"`
9 } 9 }
  10 +
  11 +const c = 10128
  12 +
  13 +func EncryptUserId(userId int64) int64 {
  14 + return userId + c
  15 +}
@@ -227,7 +227,7 @@ func (gateway HttplibAlliedCreationUser) AuthRefreshIM(param ReqAuthRefreshIM) ( @@ -227,7 +227,7 @@ func (gateway HttplibAlliedCreationUser) AuthRefreshIM(param ReqAuthRefreshIM) (
227 227
228 //RefreshIM 用户基础数据 228 //RefreshIM 用户基础数据
229 func (gateway HttplibAlliedCreationUser) AuthUserBaseInfo(param ReqAuthUserBase) (*DataAuthUserBase, error) { 229 func (gateway HttplibAlliedCreationUser) AuthUserBaseInfo(param ReqAuthUserBase) (*DataAuthUserBase, error) {
230 - url := gateway.baseUrL + "/auth/user-base-info" 230 + url := gateway.baseUrL + "/auth/user-info"
231 method := "POST" 231 method := "POST"
232 req := gateway.CreateRequest(url, method) 232 req := gateway.CreateRequest(url, method)
233 log.Logger.Debug("向用户模块请求数据:用户基础数据。", map[string]interface{}{ 233 log.Logger.Debug("向用户模块请求数据:用户基础数据。", map[string]interface{}{
@@ -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 {