作者 yangfu

合约分红列表 、详情

... ... @@ -15,7 +15,9 @@ type SearchDividendContractsCommand struct {
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
//审核状态
//Status int `json:"status"`
OrgId int64 `json:"orgId,omitempty"`
//审核状态
UserBaseId int64 `json:"userBaseId,omitempty"`
}
func (cmd *SearchDividendContractsCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -15,7 +15,7 @@ type CompanyDividendsService struct {
func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, cmd)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
... ... @@ -23,14 +23,21 @@ func (srv CompanyStatisticsService) GetDividendContracts(cmd *command.GetDividen
}
// GetDividendContracts 企业的合约列表(分红信息按合约划分)
func (srv CompanyStatisticsService) SearchDividendContracts(userMenusCommand *command.SearchDividendContractsCommand) (int64, interface{}, error) {
var items []*dto.CompanyContractDividendDto
for i := 0; i < 2; i++ {
item := dto.NewCompanyContractDividendDto()
item.LoadDto()
items = append(items, item)
func (srv CompanyStatisticsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) {
//var items []*dto.CompanyContractDividendDto
//for i := 0; i < 2; i++ {
// item := dto.NewCompanyContractDividendDto()
// item.LoadDto()
// items = append(items, item)
//}
cmd.OrgId = cmd.Operator.OrgId
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd)
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return 2, items, nil
return 0, result, nil
}
// DividendsStatistics TODO:企业的合约统计(分红统计)
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 企业端分红服务
... ... @@ -10,25 +12,26 @@ type PersonDividendsService struct {
}
// GetDividendContracts 企业的合约列表(分红信息按合约划分)
func (srv PersonDividendsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) {
//var items []*dto.CompanyContractDividendDto
//for i := 0; i < 2; i++ {
// item := dto.NewCompanyContractDividendDto()
// item.LoadDto()
// items = append(items, item)
//}
return struct{}{}, nil
func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendContractsCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, cmd)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result, nil
}
// GetDividendContracts 企业的合约列表(分红信息按合约划分)
func (srv PersonDividendsService) SearchDividendContracts(userMenusCommand *command.SearchDividendContractsCommand) (int64, interface{}, error) {
var items []*dto.CompanyContractDividendDto
for i := 0; i < 2; i++ {
item := dto.NewCompanyContractDividendDto()
item.LoadDto()
items = append(items, item)
func (srv PersonDividendsService) SearchDividendContracts(cmd *command.SearchDividendContractsCommand) (int64, interface{}, error) {
cmd.OrgId = cmd.Operator.OrgId
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchContractDividends, cmd)
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return 2, items, nil
return 0, result, nil
}
// DividendsStatistics TODO:企业的合约统计(分红统计)
... ...
... ... @@ -10,7 +10,9 @@ import (
const (
// 合约分红列表查询
SearchContractDividends = "ContractDividends"
SearchContractDividends = "SearchContractDividends"
// 获取分红合约详情
GetContractDividends = "GetContractDividends"
)
// CooperationStatistics 共创统计
... ... @@ -43,7 +45,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationStatistics(action str
if err != nil {
return nil, fmt.Errorf("解析共创统计:%w", err)
}
var data map[string]interface{}
var data interface{}
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -360,7 +360,7 @@ func (controller *CooperationController) GetDividendContracts() {
return
}
cmd.Operator = controller.GetOperator()
cmd.ContractId, _ = controller.GetInt("contractId")
cmd.ContractId, _ = controller.GetInt(":contractId")
data, err := svr.GetDividendContracts(cmd)
controller.Response(data, err)
}
... ... @@ -414,7 +414,7 @@ func (controller *CooperationController) GetDividendContractsPerson() {
return
}
cmd.Operator = controller.GetOperator()
cmd.ContractId, _ = controller.GetInt("contractId")
cmd.ContractId, _ = controller.GetInt(":contractId")
data, err := svr.GetDividendContracts(cmd)
controller.Response(data, err)
}
... ...