cooperation_contract_by_undertaker_dto.go
1.9 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
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
)
type CooperationContractByUndertakerDto struct {
// 承接人ID
UndertakerId int64 `json:"undertakerId,string"`
// 承接人编号
UndertakerCode string `json:"undertakerCode"`
// 承接人姓名
UndertakerName string `json:"undertakerName"`
// 承接人电话
UndertakerPhone string `json:"undertakerPhone"`
// 项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 项目合约名称
CooperationContractName string `json:"cooperationContractName"`
// 合同附件
Attachment []*domain.Attachment `json:"attachment"`
// 发起人姓名
SponsorName string `json:"sponsorName"`
// 发起部门名称
DepartmentName string `json:"departmentName"`
// 共创模式名称
CooperationModeName string `json:"cooperationModeName"`
// 组织机构名称
OrgName string `json:"orgName"`
}
func (dto *CooperationContractByUndertakerDto) LoadDto(contractByUndertaker *models.CooperationContractByUndertaker) error {
dto.UndertakerId = contractByUndertaker.CooperationContractUndertakerId
dto.UndertakerCode = contractByUndertaker.UndertakerCode
dto.UndertakerName = contractByUndertaker.UndertakerName
dto.UndertakerPhone = contractByUndertaker.UndertakerPhone
dto.CooperationContractNumber = contractByUndertaker.CooperationContractNumber
dto.CooperationContractName = contractByUndertaker.CooperationContractName
dto.Attachment = contractByUndertaker.ContractAttachment
dto.SponsorName = contractByUndertaker.CooperationContractSponsor.UserName
if contractByUndertaker.Department != nil {
dto.DepartmentName = contractByUndertaker.Department.DepartmentName
}
dto.CooperationModeName = contractByUndertaker.CooperationModeName
if contractByUndertaker.Org != nil {
dto.OrgName = contractByUndertaker.Org.OrgName
}
return nil
}