|
|
1
|
+package dto
|
|
|
2
|
+
|
|
|
3
|
+import (
|
|
|
4
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
|
|
5
|
+)
|
|
|
6
|
+
|
|
|
7
|
+type CooperationApplicationDto struct {
|
|
|
8
|
+ // 共创申请ID
|
|
|
9
|
+ CooperationApplicationId int64 `json:"cooperationApplicationId,string"`
|
|
|
10
|
+ // 共创申请人
|
|
|
11
|
+ CooperationApplicationApplicant *User `json:"cooperationApplicationApplicant"`
|
|
|
12
|
+ // 共创申请描述附件
|
|
|
13
|
+ CooperationApplicationAttachment []*domain.Attachment `json:"cooperationApplicationAttachment"`
|
|
|
14
|
+ // 共创申请描述
|
|
|
15
|
+ CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
|
|
|
16
|
+ // 共创申请审核状态,1待审核,2已同意,3已拒绝
|
|
|
17
|
+ CooperationApplicationStatus int32 `json:"cooperationApplicationStatus"`
|
|
|
18
|
+ // 共创申请审核人
|
|
|
19
|
+ CooperationApplicationVerifier *User `json:"cooperationApplicationVerifier"`
|
|
|
20
|
+ // 共创申请审核描述
|
|
|
21
|
+ CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
|
|
|
22
|
+ // 共创申请审核时间
|
|
|
23
|
+ CooperationApplicationVerifyTime int64 `json:"cooperationApplicationVerifyTime"`
|
|
|
24
|
+ // 共创申请时间
|
|
|
25
|
+ CooperationApplyTime int64 `json:"cooperationApplyTime"`
|
|
|
26
|
+ // 共创项目
|
|
|
27
|
+ CooperationProject *CooperationProject `json:"cooperationProject"`
|
|
|
28
|
+ // 数据所属组织机构
|
|
|
29
|
+ Org *Org `json:"org"`
|
|
|
30
|
+ // 是否被取消标志位
|
|
|
31
|
+ IsCanceled bool `json:"isCanceled"`
|
|
|
32
|
+ // 公司
|
|
|
33
|
+ Company *Company `json:"company"`
|
|
|
34
|
+ // 创建时间
|
|
|
35
|
+ //CreatedAt time.Time `json:"createdAt"`
|
|
|
36
|
+ // 删除时间
|
|
|
37
|
+ //DeletedAt time.Time `json:"deletedAt"`
|
|
|
38
|
+ // 更新时间
|
|
|
39
|
+ //UpdatedAt time.Time `json:"updatedAt"`
|
|
|
40
|
+}
|
|
|
41
|
+
|
|
|
42
|
+// User 用户第三方服务防腐模型
|
|
|
43
|
+type User struct {
|
|
|
44
|
+ // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
|
|
|
45
|
+ UserId int64 `json:"userId"`
|
|
|
46
|
+ // 冗余字段,jsonb格式,不限制存放内容
|
|
|
47
|
+ UserInfo *domain.UserInfo `json:"userInfo,omitempty"`
|
|
|
48
|
+ // 用户所属的部门
|
|
|
49
|
+ Department *Department `json:"department"`
|
|
|
50
|
+}
|
|
|
51
|
+
|
|
|
52
|
+type Company struct {
|
|
|
53
|
+ // 公司ID,通过集成REST上下文获取
|
|
|
54
|
+ CompanyId int64 `json:"companyId"`
|
|
|
55
|
+ // 公司logo
|
|
|
56
|
+ CompanyLogo string `json:"companyLogo"`
|
|
|
57
|
+ // 公司名称
|
|
|
58
|
+ CompanyName string `json:"companyName"`
|
|
|
59
|
+}
|
|
|
60
|
+
|
|
|
61
|
+// Org 组织机构值对象
|
|
|
62
|
+type Org struct {
|
|
|
63
|
+ // 组织机构ID
|
|
|
64
|
+ OrgId int64 `json:"orgId"`
|
|
|
65
|
+ // 组织名称
|
|
|
66
|
+ OrgName string `json:"orgName"`
|
|
|
67
|
+ // 公司
|
|
|
68
|
+ //Company *Company `json:"company"`
|
|
|
69
|
+}
|
|
|
70
|
+
|
|
|
71
|
+// Department 部门值对象
|
|
|
72
|
+type Department struct {
|
|
|
73
|
+ // 部门ID,通过REST集成上下文获取
|
|
|
74
|
+ DepartmentId int64 `json:"departmentId"`
|
|
|
75
|
+ // 部门名称
|
|
|
76
|
+ DepartmentName string `json:"departmentName"`
|
|
|
77
|
+}
|
|
|
78
|
+
|
|
|
79
|
+// CooperationProject 共创项目实体
|
|
|
80
|
+type CooperationProject struct {
|
|
|
81
|
+ // 共创项目ID
|
|
|
82
|
+ CooperationProjectId int64 `json:"cooperationProjectId"`
|
|
|
83
|
+ // 共创项目编号
|
|
|
84
|
+ CooperationProjectNumber string `json:"cooperationProjectNumber"`
|
|
|
85
|
+ // 共创项目描述
|
|
|
86
|
+ CooperationProjectDescription string `json:"cooperationProjectDescription"`
|
|
|
87
|
+ // 共创项目名称
|
|
|
88
|
+ CooperationProjectName string `json:"cooperationProjectName"`
|
|
|
89
|
+ // 图片附件
|
|
|
90
|
+ Attachment []*domain.Attachment `json:"attachment"`
|
|
|
91
|
+}
|
|
|
92
|
+
|
|
|
93
|
+func (data *CooperationApplicationDto) LoadDto(a *domain.CooperationApplication) {
|
|
|
94
|
+ data.CooperationApplicationId = a.CooperationApplicationId
|
|
|
95
|
+ data.CooperationApplicationApplicant = data.LoadUser(a.CooperationApplicationApplicant)
|
|
|
96
|
+ data.CooperationApplicationAttachment = a.CooperationApplicationAttachment
|
|
|
97
|
+ data.CooperationApplicationDescription = a.CooperationApplicationDescription
|
|
|
98
|
+ data.CooperationApplicationStatus = a.CooperationApplicationStatus
|
|
|
99
|
+ data.CooperationApplicationVerifier = data.LoadUser(a.CooperationApplicationVerifier)
|
|
|
100
|
+ data.CooperationApplicationVerifyDescription = a.CooperationApplicationDescription
|
|
|
101
|
+ data.CooperationApplicationVerifyTime = a.CooperationApplicationVerifyTime.Unix() * 1000
|
|
|
102
|
+ data.CooperationApplyTime = a.CooperationApplyTime.Unix() * 1000
|
|
|
103
|
+ data.CooperationProject = data.LoadCooperationProject(a.CooperationProject)
|
|
|
104
|
+ data.Org = data.LoadOrg(a.Org)
|
|
|
105
|
+ data.IsCanceled = a.IsCanceled
|
|
|
106
|
+ data.Company = data.LoadCompany(a.Company)
|
|
|
107
|
+}
|
|
|
108
|
+
|
|
|
109
|
+func (data *CooperationApplicationDto) LoadUser(v *domain.User) *User {
|
|
|
110
|
+ if v == nil {
|
|
|
111
|
+ return &User{}
|
|
|
112
|
+ }
|
|
|
113
|
+ return &User{
|
|
|
114
|
+ UserId: v.UserId,
|
|
|
115
|
+ UserInfo: v.UserInfo,
|
|
|
116
|
+ }
|
|
|
117
|
+}
|
|
|
118
|
+
|
|
|
119
|
+func (data *CooperationApplicationDto) LoadCompany(v *domain.Company) *Company {
|
|
|
120
|
+ return &Company{
|
|
|
121
|
+ CompanyId: v.CompanyId,
|
|
|
122
|
+ CompanyName: v.CompanyName,
|
|
|
123
|
+ }
|
|
|
124
|
+}
|
|
|
125
|
+
|
|
|
126
|
+func (data *CooperationApplicationDto) LoadOrg(v *domain.Org) *Org {
|
|
|
127
|
+ return &Org{
|
|
|
128
|
+ OrgId: v.OrgId,
|
|
|
129
|
+ OrgName: v.OrgName,
|
|
|
130
|
+ }
|
|
|
131
|
+}
|
|
|
132
|
+
|
|
|
133
|
+func (data *CooperationApplicationDto) LoadDepartment(v *domain.Org) *Department {
|
|
|
134
|
+ return &Department{
|
|
|
135
|
+ DepartmentId: v.OrgId,
|
|
|
136
|
+ DepartmentName: v.OrgName,
|
|
|
137
|
+ }
|
|
|
138
|
+}
|
|
|
139
|
+
|
|
|
140
|
+func (data *CooperationApplicationDto) LoadCooperationProject(v *domain.CooperationProject) *CooperationProject {
|
|
|
141
|
+ return &CooperationProject{
|
|
|
142
|
+ CooperationProjectId: v.CooperationProjectId,
|
|
|
143
|
+ CooperationProjectNumber: v.CooperationProjectNumber,
|
|
|
144
|
+ CooperationProjectDescription: v.CooperationProjectDescription,
|
|
|
145
|
+ CooperationProjectName: v.CooperationProjectName,
|
|
|
146
|
+ Attachment: v.Attachment,
|
|
|
147
|
+ }
|
|
|
148
|
+} |