正在显示
5 个修改的文件
包含
42 行增加
和
28 行删除
| @@ -15,7 +15,9 @@ type SearchDividendContractsCommand struct { | @@ -15,7 +15,9 @@ type SearchDividendContractsCommand struct { | ||
| 15 | // 查询限制 | 15 | // 查询限制 |
| 16 | PageSize int `json:"pageSize" valid:"Required"` | 16 | PageSize int `json:"pageSize" valid:"Required"` |
| 17 | //审核状态 | 17 | //审核状态 |
| 18 | - //Status int `json:"status"` | 18 | + OrgId int64 `json:"orgId,omitempty"` |
| 19 | + //审核状态 | ||
| 20 | + UserBaseId int64 `json:"userBaseId,omitempty"` | ||
| 19 | } | 21 | } |
| 20 | 22 | ||
| 21 | func (cmd *SearchDividendContractsCommand) Valid(validation *validation.Validation) { | 23 | func (cmd *SearchDividendContractsCommand) Valid(validation *validation.Validation) { |
| @@ -15,7 +15,7 @@ type CompanyDividendsService struct { | @@ -15,7 +15,7 @@ type CompanyDividendsService struct { | ||
| 15 | func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) { | 15 | func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) { |
| 16 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 16 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
| 17 | cmd.Operator) | 17 | cmd.Operator) |
| 18 | - result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd) | 18 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, cmd) |
| 19 | if err != nil { | 19 | if err != nil { |
| 20 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 20 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 21 | } | 21 | } |
| @@ -23,14 +23,21 @@ func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividen | @@ -23,14 +23,21 @@ func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividen | ||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) | 25 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) |
| 26 | -func (srv CompanyStatisticsService) SearchDividendContracts(userMenusCommand *command.SearchDividendContractsCommand) (int64, interface{}, error) { | ||
| 27 | - var items []*dto.CompanyContractDividendDto | ||
| 28 | - for i := 0; i < 2; i++ { | ||
| 29 | - item := dto.NewCompanyContractDividendDto() | ||
| 30 | - item.LoadDto() | ||
| 31 | - items = append(items, item) | 26 | +func (srv CompanyStatisticsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { |
| 27 | + //var items []*dto.CompanyContractDividendDto | ||
| 28 | + //for i := 0; i < 2; i++ { | ||
| 29 | + // item := dto.NewCompanyContractDividendDto() | ||
| 30 | + // item.LoadDto() | ||
| 31 | + // items = append(items, item) | ||
| 32 | + //} | ||
| 33 | + cmd.OrgId = cmd.Operator.OrgId | ||
| 34 | + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 35 | + cmd.Operator) | ||
| 36 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd) | ||
| 37 | + if err != nil { | ||
| 38 | + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
| 32 | } | 39 | } |
| 33 | - return 2, items, nil | 40 | + return 0, result, nil |
| 34 | } | 41 | } |
| 35 | 42 | ||
| 36 | // DividendsStatistics TODO:企业的合约统计(分红统计) | 43 | // DividendsStatistics TODO:企业的合约统计(分红统计) |
| 1 | package service | 1 | package service |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + "github.com/linmadan/egglib-go/core/application" | ||
| 4 | "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" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto" | 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 | ) | 8 | ) |
| 7 | 9 | ||
| 8 | // 企业端分红服务 | 10 | // 企业端分红服务 |
| @@ -10,25 +12,26 @@ type PersonDividendsService struct { | @@ -10,25 +12,26 @@ type PersonDividendsService struct { | ||
| 10 | } | 12 | } |
| 11 | 13 | ||
| 12 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) | 14 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) |
| 13 | -func (srv PersonDividendsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) { | ||
| 14 | - //var items []*dto.CompanyContractDividendDto | ||
| 15 | - //for i := 0; i < 2; i++ { | ||
| 16 | - // item := dto.NewCompanyContractDividendDto() | ||
| 17 | - // item.LoadDto() | ||
| 18 | - // items = append(items, item) | ||
| 19 | - //} | ||
| 20 | - return struct{}{}, nil | 15 | +func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) { |
| 16 | + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 17 | + cmd.Operator) | ||
| 18 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, cmd) | ||
| 19 | + if err != nil { | ||
| 20 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
| 21 | + } | ||
| 22 | + return result, nil | ||
| 21 | } | 23 | } |
| 22 | 24 | ||
| 23 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) | 25 | // GetDividendContracts 企业的合约列表(分红信息按合约划分) |
| 24 | -func (srv PersonDividendsService) SearchDividendContracts(userMenusCommand *command.SearchDividendContractsCommand) (int64, interface{}, error) { | ||
| 25 | - var items []*dto.CompanyContractDividendDto | ||
| 26 | - for i := 0; i < 2; i++ { | ||
| 27 | - item := dto.NewCompanyContractDividendDto() | ||
| 28 | - item.LoadDto() | ||
| 29 | - items = append(items, item) | 26 | +func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) { |
| 27 | + cmd.OrgId = cmd.Operator.OrgId | ||
| 28 | + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 29 | + cmd.Operator) | ||
| 30 | + result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd) | ||
| 31 | + if err != nil { | ||
| 32 | + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
| 30 | } | 33 | } |
| 31 | - return 2, items, nil | 34 | + return 0, result, nil |
| 32 | } | 35 | } |
| 33 | 36 | ||
| 34 | // DividendsStatistics TODO:企业的合约统计(分红统计) | 37 | // DividendsStatistics TODO:企业的合约统计(分红统计) |
| @@ -10,7 +10,9 @@ import ( | @@ -10,7 +10,9 @@ import ( | ||
| 10 | 10 | ||
| 11 | const ( | 11 | const ( |
| 12 | // 合约分红列表查询 | 12 | // 合约分红列表查询 |
| 13 | - SearchContractDividends = "ContractDividends" | 13 | + SearchContractDividends = "SearchContractDividends" |
| 14 | + // 获取分红合约详情 | ||
| 15 | + GetContractDividends = "GetContractDividends" | ||
| 14 | ) | 16 | ) |
| 15 | 17 | ||
| 16 | // CooperationStatistics 共创统计 | 18 | // CooperationStatistics 共创统计 |
| @@ -43,7 +45,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationStatistics(action str | @@ -43,7 +45,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationStatistics(action str | ||
| 43 | if err != nil { | 45 | if err != nil { |
| 44 | return nil, fmt.Errorf("解析共创统计:%w", err) | 46 | return nil, fmt.Errorf("解析共创统计:%w", err) |
| 45 | } | 47 | } |
| 46 | - var data map[string]interface{} | 48 | + var data interface{} |
| 47 | err = gateway.GetResponseData(result, &data) | 49 | err = gateway.GetResponseData(result, &data) |
| 48 | return &data, err | 50 | return &data, err |
| 49 | } | 51 | } |
| @@ -360,7 +360,7 @@ func (controller *CooperationController) GetDividendContracts() { | @@ -360,7 +360,7 @@ func (controller *CooperationController) GetDividendContracts() { | ||
| 360 | return | 360 | return |
| 361 | } | 361 | } |
| 362 | cmd.Operator = controller.GetOperator() | 362 | cmd.Operator = controller.GetOperator() |
| 363 | - cmd.ContractId, _ = controller.GetInt("contractId") | 363 | + cmd.ContractId, _ = controller.GetInt(":contractId") |
| 364 | data, err := svr.GetDividendContracts(cmd) | 364 | data, err := svr.GetDividendContracts(cmd) |
| 365 | controller.Response(data, err) | 365 | controller.Response(data, err) |
| 366 | } | 366 | } |
| @@ -414,7 +414,7 @@ func (controller *CooperationController) GetDividendContractsPerson() { | @@ -414,7 +414,7 @@ func (controller *CooperationController) GetDividendContractsPerson() { | ||
| 414 | return | 414 | return |
| 415 | } | 415 | } |
| 416 | cmd.Operator = controller.GetOperator() | 416 | cmd.Operator = controller.GetOperator() |
| 417 | - cmd.ContractId, _ = controller.GetInt("contractId") | 417 | + cmd.ContractId, _ = controller.GetInt(":contractId") |
| 418 | data, err := svr.GetDividendContracts(cmd) | 418 | data, err := svr.GetDividendContracts(cmd) |
| 419 | controller.Response(data, err) | 419 | controller.Response(data, err) |
| 420 | } | 420 | } |
-
请 注册 或 登录 后发表评论