...
|
...
|
@@ -3,11 +3,10 @@ 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"
|
|
|
)
|
|
|
|
|
|
// 企业端分红服务 【50%】
|
|
|
// 企业端分红服务 【80%】
|
|
|
type CompanyDividendsService struct {
|
|
|
}
|
|
|
|
...
|
...
|
@@ -42,58 +41,38 @@ func (srv CompanyStatisticsService) SearchDividendContracts(cmd *command.SearchD |
|
|
|
|
|
// DividendsStatistics TODO:企业的合约统计(分红统计)
|
|
|
func (srv CompanyStatisticsService) DividendsStatistics(cmd *command.DividendsStatisticsCommand) (interface{}, error) {
|
|
|
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
// cmd.Operator)
|
|
|
//result, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
|
|
|
// "companyId":cmd.Operator.CompanyId,
|
|
|
// "orgId":cmd.Operator.OrgId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
//return result, nil
|
|
|
return map[string]interface{}{
|
|
|
"allDividends": map[string]interface{}{
|
|
|
"sumTotal": 9000,
|
|
|
"accounting": 6000,
|
|
|
"accounted": 3000,
|
|
|
"paid": 2000,
|
|
|
},
|
|
|
"annualDividends": map[string]interface{}{
|
|
|
"sumTotal": 9000,
|
|
|
"accounting": 6000,
|
|
|
"accounted": 3000,
|
|
|
"paid": 2000,
|
|
|
},
|
|
|
"quarterDividends": map[string]interface{}{
|
|
|
"sumTotal": 9000,
|
|
|
"accounting": 6000,
|
|
|
"accounted": 3000,
|
|
|
"paid": 2000,
|
|
|
},
|
|
|
}, nil
|
|
|
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
cmd.Operator)
|
|
|
result, err := gateway.CooperationStatistics(allied_creation_cooperation.DividendsStatistics, map[string]interface{}{
|
|
|
"companyId": cmd.Operator.CompanyId,
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
|
|
|
func (srv CompanyStatisticsService) SearchDividendsEstimates(cmd *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) {
|
|
|
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
// cmd.Operator)
|
|
|
//result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchDividendsEstimates, map[string]interface{}{
|
|
|
// "companyId":cmd.Operator.CompanyId,
|
|
|
// "orgId":cmd.Operator.OrgId,
|
|
|
// "dividendsAccountStatus":cmd.Status,
|
|
|
// "offset":(cmd.PageNumber-1)*cmd.PageSize,
|
|
|
// "limit":cmd.PageSize,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return 0,nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
//return 0,result, nil
|
|
|
var items []*dto.DividendsEstimatesDto
|
|
|
for i := 0; i < 2; i++ {
|
|
|
item := dto.NewDividendsEstimatesDto()
|
|
|
item.LoadDto()
|
|
|
items = append(items, item)
|
|
|
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
cmd.Operator)
|
|
|
result, err := gateway.CooperationStatistics(allied_creation_cooperation.SearchDividendsEstimates, map[string]interface{}{
|
|
|
"companyId": cmd.Operator.CompanyId,
|
|
|
"orgId": cmd.Operator.OrgId,
|
|
|
"dividendsAccountStatus": cmd.Status,
|
|
|
"offset": (cmd.PageNumber - 1) * cmd.PageSize,
|
|
|
"limit": cmd.PageSize,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return 2, items, nil
|
|
|
return 0, result, nil
|
|
|
//var items []*dto.DividendsEstimatesDto
|
|
|
//for i := 0; i < 2; i++ {
|
|
|
// item := dto.NewDividendsEstimatesDto()
|
|
|
// item.LoadDto()
|
|
|
// items = append(items, item)
|
|
|
//}
|
|
|
//return 2, items, nil
|
|
|
} |
...
|
...
|
|