company_dividends.go 2.6 KB
package service

import (
	"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"
)

// 企业端分红服务
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())
	//}
	var items []*dto.CompanyContractDividendDto
	for i := 0; i < 2; i++ {
		item := dto.NewCompanyContractDividendDto()
		item.LoadDto()
		items = append(items, item)
	}
	return map[string]interface{}{
		"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())
	//}
	return map[string]interface{}{
		"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())
	//}
	var items []*dto.DividendsEstimatesDto
	for i := 0; i < 2; i++ {
		item := dto.NewDividendsEstimatesDto()
		item.LoadDto()
		items = append(items, item)
	}
	return map[string]interface{}{
		"list": items,
	}, nil
}