dto.go
4.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
//MoneyIncentivesItem 金额激励分红列表
type MoneyIncentivesItem struct {
}
//业绩分红列表
type DividendsEstimateDividendItem struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号
CustomerName string `json:"customerName"` //客户名称
DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号
OrderTime int64 `json:"orderTime"` //订单/退货单日期
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
RegionName string `json:"regionName"` //区域名称
}
func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {
var listdata []DividendsEstimateDividendItem
for _, v := range param.List {
item := DividendsEstimateDividendItem{
CooperationContractNumber: v.CooperationContractNumber,
CustomerName: v.CustomerName,
DividendsIncentivesAmount: v.OrderAmount,
OrderOrReturnedOrderNum: v.OrderNumber,
OrderTime: v.OrderDate.UnixNano() / 1e6,
OriginalOrderNum: v.OriginalOrderNum,
RegionName: v.RegionName,
}
listdata = append(listdata, item)
}
return listdata
}
//金额激励列表
type DividendsEstimateMoneyItem struct {
CooperationContractName string `json:"cooperationContractName"` //合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //共创模式
CreatedAt int64 `json:"createdAt"` //合约建立时间
Department struct {
DepartmentId int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId"`
UserBaseId int `json:"userBaseId"`
UsersName string `json:"userName"`
Phone string `json:"phone"`
} `json:"cooperationContractSponsor"` //合约发起人
}
func ToDividendsEstimateMoneyItem(param *allied_creation_cooperation.DataDividendsEstimateSearchMoney) []DividendsEstimateMoneyItem {
var listdata []DividendsEstimateMoneyItem
for _, v := range param.Grid.List {
item := DividendsEstimateMoneyItem{
CooperationContractName: v.CooperationContractName,
CooperationContractNumber: v.CooperationContractNumber,
CreatedAt: v.CreatedAt.Unix(),
}
item.CooperationMode.CooperationModeId = v.CooperationMode.CooperationModeId
item.CooperationMode.CooperationModeName = v.CooperationMode.CooperationModeName
item.CooperationMode.CooperationModeNumber = v.CooperationMode.CooperationModeNumber
item.Department.DepartmentId = v.Department.DepartmentId
item.Department.DepartmentName = v.Department.DepartmentName
item.CooperationContractSponsor.UserId = v.CooperationContractSponsor.UserId
item.CooperationContractSponsor.Phone = v.CooperationContractSponsor.UserInfo.Phone
item.CooperationContractSponsor.UsersName = v.CooperationContractSponsor.UserInfo.UsersName
listdata = append(listdata, item)
}
return listdata
}
//合约承接人
type ContractUndertaker struct {
UserId int `json:"userId,string,"`
UsersName string `json:"userName"`
ContractIncentivesRules []int `json:"contractIncentivesRules"`
}
// 金额激励规则
type MoneyIncentivesRule struct {
MoneyIncentivesStage int //阶段
MoneyIncentivesStageStart int //阶段开始时间
}