dto.go
2.7 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
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CooperationContractItem struct {
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationContractName string `json:"CooperationContractName"` //合约名称
Status int `json:"status"` //合约状态
CreateTtime int `json:"createTtime"`
Department struct {
DepartmentId int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
} `json:"department"`
IncentivesType string `json:"incentivesType"` //Incentives激励方式
CooperationContractSponsor struct {
UserId int `json:"userId,string,"`
UserName string `json:"userName"`
} `json:"cooperationContractSponsor"` //共创发起人
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string,"` // 共创模式ID
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
CooperationModeName string `json:"cooperationModeName"` // 模式名称,
} `json:"cooperationMode"` //共创模式
Org struct {
OrgId int `json:"orgId"` // id
OrgName string `json:"orgName"` //
} `json:"org"` //组织结构
}
func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem {
// relevantPeople := []int{}
data := CooperationContractItem{
CooperationContractId: param.CooperationContractId,
CooperationProjectNumber: param.CooperationContractNumber,
CooperationContractName: param.CooperationContractName,
CooperationContractNumber: param.CooperationContractNumber,
Status: param.Status,
CreateTtime: int(param.CreatedAt.Unix()),
}
data.CooperationContractSponsor.UserId = param.CooperationContractSponsor.UserId
data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
data.Department.DepartmentId = param.Department.DepartmentId
data.Department.DepartmentName = param.Department.DepartmentName
data.Org.OrgId = int(param.Org.OrgId)
data.Org.OrgName = param.Org.OrgName
data.CooperationMode.CooperationModeId = param.CooperationMode.CooperationModeId
data.CooperationMode.CooperationModeName = param.CooperationMode.CooperationModeName
data.CooperationMode.CooperationModeNumber = param.CooperationMode.CooperationModeNumber
return nil
}
type CooperationContractInfo struct {
}