|
|
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/infrastructure/service_gateway/allied_creation_user"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
|
|
|
)
|
|
|
|
|
|
// 企业端分红服务
|
...
|
...
|
@@ -12,45 +11,60 @@ type CompanyDividendsService struct { |
|
|
|
|
|
// IndexStatistics TODO:企业的合约列表(分红信息按合约划分)
|
|
|
func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
userMenusCommand.Operator)
|
|
|
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
UserId: int(userMenusCommand.Operator.UserId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
// userMenusCommand.Operator)
|
|
|
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
// UserId: int(userMenusCommand.Operator.UserId),
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
var items []*dto.CompanyContractDividendDto
|
|
|
for i := 0; i < 2; i++ {
|
|
|
item := dto.NewCompanyContractDividendDto()
|
|
|
item.LoadDto()
|
|
|
items = append(items, item)
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"accessMenus": resultMenu.Menus,
|
|
|
"list": items,
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
// IndexStatistics TODO:企业的合约统计(分红统计)
|
|
|
func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *command.DividendsStatisticsCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
userMenusCommand.Operator)
|
|
|
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
UserId: int(userMenusCommand.Operator.UserId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
// userMenusCommand.Operator)
|
|
|
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
// UserId: int(userMenusCommand.Operator.UserId),
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
return map[string]interface{}{
|
|
|
"accessMenus": resultMenu.Menus,
|
|
|
"sumTotal": 9000,
|
|
|
"waitSettle": 6000,
|
|
|
"hasBeenSettle": 3000,
|
|
|
"hasBeenPay": 2000,
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
// IndexStatistics 企业的合约明细列表(分红预算信息)
|
|
|
func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) {
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
userMenusCommand.Operator)
|
|
|
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
UserId: int(userMenusCommand.Operator.UserId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
// userMenusCommand.Operator)
|
|
|
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
|
|
|
// UserId: int(userMenusCommand.Operator.UserId),
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
var items []*dto.DividendsEstimatesDto
|
|
|
for i := 0; i < 2; i++ {
|
|
|
item := dto.NewDividendsEstimatesDto()
|
|
|
item.LoadDto()
|
|
|
items = append(items, item)
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"accessMenus": resultMenu.Menus,
|
|
|
"list": items,
|
|
|
}, nil
|
|
|
} |
...
|
...
|
|