contract_dividends_person.go 2.2 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 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
}

// 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)
	}
	return 2, items, nil
}

// DividendsStatistics  TODO:企业的合约统计(分红统计)
func (srv PersonDividendsService) DividendsStatistics(userMenusCommand *command.DividendsStatisticsCommand) (interface{}, error) {
	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
}

// SearchDividendsEstimates  企业的合约明细列表(分红预算信息)
func (srv PersonDividendsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (int64, interface{}, error) {
	var items []*dto.DividendsEstimatesDto
	for i := 0; i < 2; i++ {
		item := dto.NewDividendsEstimatesDto()
		item.LoadDto()
		items = append(items, item)
	}
	return 2, items, nil
}