dividend.go 2.8 KB
package protocol

import "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol/company"

const (
	BonusTotal       = iota //0 累计分红
	BonusOutstanding        //1 分红支出
)

/*DividendStatistics 分红统计*/
type DividendStatisticsRequest struct {
	StartTime int64 `json:"startTime"` // 单位毫秒
	EndTime   int64 `json:"endTime"`   // 单位毫秒
	//分红类型(0累计分红、1分红支出)
	//DividendAction int `json:"dividendAction"`
	PartnerId int64 `json:"partnerId"`
}
type DividendStatisticsResponse struct {
	Statistics DividendStatistics `json:"statistics"` //全部
	Timestamp  int64              `json:"timestamp"`
}

// Career   int = 1 //事业
// Business int = 2 //业务
// Develop  int = 3 //研发
// App      int = 4 //业务产品-应用
type DividendStatisticsV2Response struct {
	Statistics         DividendStatistics `json:"statistics"`         // 全部
	StatisticsCareer   DividendStatistics `json:"statisticsCareer"`   // 事业分类
	StatisticsBusiness DividendStatistics `json:"statisticsBusiness"` // 业务分类
	StatisticsDevelop  DividendStatistics `json:"statisticsDevelop"`  // 研发a分类
	StatisticsApp      DividendStatistics `json:"statisticsApp"`      // 业务产品-应用
	Timestamp          int64              `json:"timestamp"`
}

type DividendStatistics struct {
	Received    float64   `json:"received"`    //总已收分红
	Outstanding float64   `json:"outstanding"` //总未收分红/分红支出
	Receivable  float64   `json:"receivable"`  //总应收分红
	Quarters    [4]Bonus  `json:"quarters"`    //4个季度分红
	Months      [12]Bonus `json:"months"`      //12个月度分红
}

type Bonus struct {
	Receivable  float64 `json:"receivable"`  //应收分红
	Received    float64 `json:"received"`    //已收分红
	Outstanding float64 `json:"outstanding"` //未收分红
	Expend      float64 `json:"-"`           //季度分红支出
}

/*DividendOrders 分红订单*/
type DividendOrdersRequest struct {
	DetailAction   int   `json:"detailAction"`   //明细类型(0已收明细、1未收明细)
	DividendAction int   `json:"dividendAction"` //分红类型(0累计分红、1分红支出)
	StartTime      int64 `json:"startTime"`
	EndTime        int64 `json:"endTime" valid:"Required"`

	// 合作类型(空或不传,即所有类型)
	JoinWays []*company.JoinWays `json:"joinWays"`

	PageIndex int `json:"pageIndex,omitempty"`
	PageSize  int `json:"pageSize,omitempty"`

	PartnerId int64 `json:"partnerId"`
}
type DividendOrdersResponse struct {
	List  []*DividendOrderListItem `json:"list"`
	Total int                      `json:"total"`
}

type DividendOrderListItem struct {
	Id                 int64   `json:"id"`
	OrderNo            string  `json:"-"`
	DeliveryNo         string  `json:"deliveryNo"`
	OrderAmount        float64 `json:"orderAmount"`
	DividendReceivable float64 `json:"dividendReceivable"`
}