正在显示
6 个修改的文件
包含
62 行增加
和
24 行删除
| @@ -613,9 +613,9 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs | @@ -613,9 +613,9 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs | ||
| 613 | 613 | ||
| 614 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(queryParam.Operator) | 614 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(queryParam.Operator) |
| 615 | result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ | 615 | result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ |
| 616 | - UserBaseId: queryParam.Operator.UserBaseId, | ||
| 617 | - //Phone: queryParam.Phone, | ||
| 618 | - UserType: domain.UserTypeEmployee, | 616 | + UserBaseId: queryParam.Operator.UserBaseId, |
| 617 | + UserType: domain.UserTypeEmployee, | ||
| 618 | + PullRealTime: true, | ||
| 619 | }) | 619 | }) |
| 620 | if err != nil { | 620 | if err != nil { |
| 621 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 621 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| @@ -15,7 +15,7 @@ type SearchDividendContractsCommand struct { | @@ -15,7 +15,7 @@ type SearchDividendContractsCommand struct { | ||
| 15 | // 查询限制 | 15 | // 查询限制 |
| 16 | PageSize int `json:"pageSize" valid:"Required"` | 16 | PageSize int `json:"pageSize" valid:"Required"` |
| 17 | //审核状态 | 17 | //审核状态 |
| 18 | - OrgId int64 `json:"orgId,omitempty"` | 18 | + OrgId int64 `json:"companyId,omitempty"` |
| 19 | //审核状态 | 19 | //审核状态 |
| 20 | UserBaseId int64 `json:"userBaseId,omitempty"` | 20 | UserBaseId int64 `json:"userBaseId,omitempty"` |
| 21 | } | 21 | } |
| @@ -23,12 +23,6 @@ func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividen | @@ -23,12 +23,6 @@ func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividen | ||
| 23 | 23 | ||
| 24 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) | 24 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) |
| 25 | func (srv CompanyStatisticsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { | 25 | func (srv CompanyStatisticsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { |
| 26 | - //var items []*dto.CompanyContractDividendDto | ||
| 27 | - //for i := 0; i < 2; i++ { | ||
| 28 | - // item := dto.NewCompanyContractDividendDto() | ||
| 29 | - // item.LoadDto() | ||
| 30 | - // items = append(items, item) | ||
| 31 | - //} | ||
| 32 | cmd.OrgId = cmd.Operator.OrgId | 26 | cmd.OrgId = cmd.Operator.OrgId |
| 33 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 27 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 34 | cmd.Operator) | 28 | cmd.Operator) |
| @@ -14,7 +14,9 @@ type PersonDividendsService struct { | @@ -14,7 +14,9 @@ type PersonDividendsService struct { | ||
| 14 | func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) { | 14 | func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) { |
| 15 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 15 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 16 | cmd.Operator) | 16 | cmd.Operator) |
| 17 | - result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, cmd) | 17 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, map[string]interface{}{ |
| 18 | + "contractId": cmd.ContractId, | ||
| 19 | + }) | ||
| 18 | if err != nil { | 20 | if err != nil { |
| 19 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 21 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 20 | } | 22 | } |
| @@ -23,10 +25,15 @@ func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendC | @@ -23,10 +25,15 @@ func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendC | ||
| 23 | 25 | ||
| 24 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) | 26 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) |
| 25 | func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { | 27 | func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { |
| 26 | - cmd.OrgId = cmd.Operator.OrgId | 28 | + cmd.UserBaseId = cmd.Operator.UserBaseId |
| 27 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 29 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 28 | cmd.Operator) | 30 | cmd.Operator) |
| 29 | - result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd) | 31 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, map[string]interface{}{ |
| 32 | + "orgId": cmd.OrgId, | ||
| 33 | + "userBaseId": cmd.UserBaseId, | ||
| 34 | + "limit": cmd.PageSize, | ||
| 35 | + "offset": cmd.PageNumber * cmd.PageSize, | ||
| 36 | + }) | ||
| 30 | if err != nil { | 37 | if err != nil { |
| 31 | return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 38 | return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 32 | } | 39 | } |
| @@ -73,9 +73,9 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC | @@ -73,9 +73,9 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC | ||
| 73 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 73 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 74 | } | 74 | } |
| 75 | dividendStatistics := map[string]interface{}{ | 75 | dividendStatistics := map[string]interface{}{ |
| 76 | - "dividendAmount": annualDividend.AnnualDividends.Total, // 分红金额 | ||
| 77 | - "paidAmount": annualDividend.AnnualDividends.Paid, // 已支付 | ||
| 78 | - "unPaidAmount": annualDividend.AnnualDividends.Accounting, // 未支付 | 76 | + "dividendAmount": annualDividend.AnnualDividends.Total, // 分红金额 |
| 77 | + "paidAmount": annualDividend.AnnualDividends.Paid, // 已支付 | ||
| 78 | + "unPaidAmount": annualDividend.AnnualDividends.Total - annualDividend.AnnualDividends.Paid, // 未支付 | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | return map[string]interface{}{ | 81 | return map[string]interface{}{ |
| @@ -98,19 +98,53 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer | @@ -98,19 +98,53 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer | ||
| 98 | if err != nil { | 98 | if err != nil { |
| 99 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 99 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 100 | } | 100 | } |
| 101 | + var companyList []int | ||
| 102 | + for i := range users.Users { | ||
| 103 | + user := users.Users[i] | ||
| 104 | + companyList = append(companyList, user.Org.OrgId) | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 108 | + cmd.Operator) | ||
| 109 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.CooperationCompanyStatistics, map[string]interface{}{ | ||
| 110 | + "userBaseId": cmd.Operator.UserBaseId, | ||
| 111 | + "companyList": companyList, | ||
| 112 | + }) | ||
| 113 | + if err != nil { | ||
| 114 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
| 115 | + } | ||
| 101 | 116 | ||
| 102 | - var values []interface{} | 117 | + type cooperationCompanyStatisticsResponse struct { |
| 118 | + // 当天统计的企业id | ||
| 119 | + OrgId int64 `json:"orgId"` | ||
| 120 | + // 共创项目数 | ||
| 121 | + CooperationProjectCount int64 `json:"cooperationProjectCount"` | ||
| 122 | + // 共创合约数 | ||
| 123 | + CooperationContractCount int64 `json:"cooperationContractCount"` | ||
| 124 | + // 分红占比 | ||
| 125 | + DividendsRatio float64 `json:"dividendsRatio"` | ||
| 126 | + // 分红支出 | ||
| 127 | + DividendsIncome float64 `json:"dividendsIncome"` | ||
| 128 | + // 企业信息 | ||
| 129 | + Company domain.CompanyData `json:"company"` | ||
| 130 | + } | ||
| 131 | + var cooperationCompanyStatisticsResponses []cooperationCompanyStatisticsResponse | ||
| 132 | + if err := json.UnmarshalFromString(json.MarshalToString(result), &cooperationCompanyStatisticsResponses); err != nil { | ||
| 133 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
| 134 | + } | ||
| 135 | + if len(cooperationCompanyStatisticsResponses) != len(users.Users) { | ||
| 136 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不匹配") | ||
| 137 | + } | ||
| 103 | 138 | ||
| 139 | + var values = make([]interface{}, 0) | ||
| 104 | for i := range users.Users { | 140 | for i := range users.Users { |
| 105 | user := users.Users[i] | 141 | user := users.Users[i] |
| 106 | - item := map[string]interface{}{ | ||
| 107 | - "company": user.Company, | ||
| 108 | - "cooperationProjectCount": 0, | ||
| 109 | - "cooperationContractCount": 0, | ||
| 110 | - "dividendsRatio": 0, | ||
| 111 | - "dividendsIncome": 0, | 142 | + cooperationCompanyStatisticsResponses[i].Company = domain.CompanyData{ |
| 143 | + CompanyID: user.Org.OrgId, | ||
| 144 | + CompanyName: user.Org.OrgName, | ||
| 145 | + CompanyLogo: user.Company.Log, | ||
| 112 | } | 146 | } |
| 113 | - values = append(values, item) | 147 | + values = append(values, cooperationCompanyStatisticsResponses[i]) |
| 114 | } | 148 | } |
| 115 | return map[string]interface{}{ | 149 | return map[string]interface{}{ |
| 116 | "list": values, | 150 | "list": values, |
| @@ -24,6 +24,9 @@ const ( | @@ -24,6 +24,9 @@ const ( | ||
| 24 | CompanyDividendsStatistics = "CompanyDividendsStatistics" | 24 | CompanyDividendsStatistics = "CompanyDividendsStatistics" |
| 25 | // 企业、个人 - 分红预算列表 | 25 | // 企业、个人 - 分红预算列表 |
| 26 | SearchDividendsEstimates = "SearchDividendsEstimates" | 26 | SearchDividendsEstimates = "SearchDividendsEstimates" |
| 27 | + | ||
| 28 | + // 个人 - 共创企业统计 | ||
| 29 | + CooperationCompanyStatistics = "CooperationCompanyStatistics" | ||
| 27 | ) | 30 | ) |
| 28 | 31 | ||
| 29 | // CooperationStatistics 共创统计 | 32 | // CooperationStatistics 共创统计 |
-
请 注册 或 登录 后发表评论