作者 tangxuhui
@@ -3,7 +3,6 @@ package service @@ -3,7 +3,6 @@ package service
3 import ( 3 import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"  
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
8 ) 7 )
9 8
@@ -36,58 +35,31 @@ func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDiv @@ -36,58 +35,31 @@ func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDiv
36 35
37 // DividendsStatistics 企业的合约统计(分红统计) 36 // DividendsStatistics 企业的合约统计(分红统计)
38 func (srv PersonDividendsService) DividendsStatistics(cmd *command.DividendsStatisticsCommand) (interface{}, error) { 37 func (srv PersonDividendsService) DividendsStatistics(cmd *command.DividendsStatisticsCommand) (interface{}, error) {
39 - //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
40 - // cmd.Operator)  
41 - //result, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{  
42 - // "userBaseId":cmd.Operator.UserBaseId,  
43 - //})  
44 - //if err != nil {  
45 - // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
46 - //}  
47 - //return result, nil  
48 - return map[string]interface{}{  
49 - "allDividends": map[string]interface{}{  
50 - "sumTotal": 9000,  
51 - "accounting": 6000,  
52 - "accounted": 3000,  
53 - "paid": 2000,  
54 - },  
55 - "annualDividends": map[string]interface{}{  
56 - "sumTotal": 9000,  
57 - "accounting": 6000,  
58 - "accounted": 3000,  
59 - "paid": 2000,  
60 - },  
61 - "quarterDividends": map[string]interface{}{  
62 - "sumTotal": 9000,  
63 - "accounting": 6000,  
64 - "accounted": 3000,  
65 - "paid": 2000,  
66 - },  
67 - }, nil 38 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  39 + cmd.Operator)
  40 + result, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
  41 + "userBaseId": cmd.Operator.UserBaseId,
  42 + })
  43 + if err != nil {
  44 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  45 + }
  46 + return result, nil
68 } 47 }
69 48
70 // SearchDividendsEstimates 企业的合约明细列表(分红预算信息) 49 // SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
71 func (srv PersonDividendsService) SearchDividendsEstimates(cmd *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) { 50 func (srv PersonDividendsService) SearchDividendsEstimates(cmd *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) {
72 - //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
73 - // cmd.Operator)  
74 - //result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchDividendsEstimates, map[string]interface{}{  
75 - // "companyId":cmd.Operator.CompanyId,  
76 - // //"orgId":cmd.Operator.OrgId,  
77 - // "userBaseId":cmd.Operator.UserBaseId,  
78 - // "dividendsAccountStatus":cmd.Status,  
79 - // "offset":(cmd.PageNumber-1)*cmd.PageSize,  
80 - // "limit":cmd.PageSize,  
81 - //})  
82 - //if err != nil {  
83 - // return 0,nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
84 - //}  
85 - //return 0,result, nil  
86 - var items []*dto.DividendsEstimatesDto  
87 - for i := 0; i < 2; i++ {  
88 - item := dto.NewDividendsEstimatesDto()  
89 - item.LoadDto()  
90 - items = append(items, item) 51 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  52 + cmd.Operator)
  53 + result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchDividendsEstimates, map[string]interface{}{
  54 + "companyId": cmd.Operator.CompanyId,
  55 + //"orgId":cmd.Operator.OrgId,
  56 + "userBaseId": cmd.Operator.UserBaseId,
  57 + "dividendsAccountStatus": cmd.Status,
  58 + "offset": (cmd.PageNumber - 1) * cmd.PageSize,
  59 + "limit": cmd.PageSize,
  60 + })
  61 + if err != nil {
  62 + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
91 } 63 }
92 - return 2, items, nil 64 + return 0, result, nil
93 } 65 }
@@ -18,7 +18,7 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit @@ -18,7 +18,7 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
18 PageNumber: cmd.PageNumber, 18 PageNumber: cmd.PageNumber,
19 PageSize: cmd.PageSize, 19 PageSize: cmd.PageSize,
20 PaymentStatus: 2, 20 PaymentStatus: 2,
21 - // TODO:时间段过滤,用户过滤 21 + UserBaseId: cmd.Operator.UserBaseId,
22 }) 22 })
23 if err != nil { 23 if err != nil {
24 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 24 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -166,6 +166,7 @@ func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *qu @@ -166,6 +166,7 @@ func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *qu
166 if roleId > 0 { 166 if roleId > 0 {
167 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{ 167 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{
168 RoleId: int64(roleId), 168 RoleId: int64(roleId),
  169 + OrgId: roleUserBeforeEditQuery.Operator.OrgId,
169 }) 170 })
170 171
171 if err != nil { 172 if err != nil {
@@ -265,12 +266,13 @@ func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command. @@ -265,12 +266,13 @@ func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.
265 return roleUserDeleteCommand, err 266 return roleUserDeleteCommand, err
266 } 267 }
267 268
268 -// 角色下关联用户的数据 (暂时不需要这个) 269 +// 角色下关联用户的数据
269 func (rolesService *RolesService) RoleUserInfo(roleUserInfoQuery *query.RoleUserInfoQuery) (interface{}, error) { 270 func (rolesService *RolesService) RoleUserInfo(roleUserInfoQuery *query.RoleUserInfoQuery) (interface{}, error) {
270 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 271 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
271 roleUserInfoQuery.Operator) 272 roleUserInfoQuery.Operator)
272 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{ 273 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{
273 RoleId: roleUserInfoQuery.RoleId, 274 RoleId: roleUserInfoQuery.RoleId,
  275 + OrgId: roleUserInfoQuery.Operator.OrgId,
274 }) 276 })
275 if err != nil { 277 if err != nil {
276 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 278 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())