money_incentives_estimate_dto.go
1.6 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
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
"time"
)
type StageAndUndertaker struct {
// 分红阶段
Stage int32 `json:"stage"`
// 共创承接人
Undertakers []*domain.Undertaker `json:"undertakers"`
}
type MoneyIncentivesEstimateDto struct {
// 共创合约ID
CooperationContractId int64 `json:"cooperationContractId,string"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式或者合伙模式
CooperationModeName string `json:"cooperationMode"`
// 共创合约发起部门
Department *domain.Department `json:"department"`
// 共创合约发起人
CooperationContractSponsorName string `json:"cooperationContractSponsor"`
// 创建合约时间
CreatedAt time.Time `json:"createdAt"`
// 阶段和承接人
StageAndUndertaker []*StageAndUndertaker `json:"stageAndUndertaker"`
}
func (dto *MoneyIncentivesEstimateDto) LoadDto(contract *domain.CooperationContract, stageAndUndertaker []*StageAndUndertaker) error {
dto.CooperationContractId = contract.CooperationContractId
dto.CooperationContractNumber = contract.CooperationContractNumber
dto.CooperationContractName = contract.CooperationContractName
dto.CooperationModeName = contract.CooperationMode.CooperationModeName
dto.Department = contract.Department
dto.CooperationContractSponsorName = contract.CooperationContractSponsor.UserName
dto.CreatedAt = contract.CreatedAt
dto.StageAndUndertaker = stageAndUndertaker
return nil
}