dto.go
7.1 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package dto
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CooperationApplicationItem struct {
CooperationProject struct {
CooperationProjectID int `json:"cooperationProjectId"` //共创项目
CooperationProjectName string `json:"cooperationProjectName"` //共创名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号
} `json:"cooperationProject"`
CooperationApplicationApplicant struct {
UserName string `json:"usersName"` //申请人名字
UserCode string `json:"usersCode"`
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"Phone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"` //组织
}
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
//data := CooperationApplicationItem{
// CooperationApplicationAttachment: param.CooperationApplicationAttachment,
// CooperationApplicationDescription: param.CooperationApplicationDescription,
// CooperationApplicationID: param.CooperationApplicationID,
// IsCanceled: param.IsCanceled,
// CooperationApplicationVerifyDescription: param.CooperationApplicationVerifyDescription,
// CooperationApplicationStatus: param.CooperationApplicationStatus,
// Org: param.Org,
//}
//data.CooperationApplicationApplicant.UserName = param.CooperationApplicationApplicant.UserInfo.UserName
//data.CooperationApplicationApplicant.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone
//data.CooperationApplicationApplicant.UserCode = param.CooperationApplicationApplicant.UserInfo.UserPhone
//data.CooperationApplicationApplicant.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
//data.CooperationProject.CooperationProjectID = param.CooperationProject.CooperationProjectID
//data.CooperationProject.CooperationProjectName = param.CooperationProject.CooperationProjectName
//data.CooperationProject.CooperationProjectNumber = param.CooperationProject.CooperationProjectNumber
//return &data
return nil
}
type CooperationApplicationInfo struct {
CooperationProject struct {
CooperationProjectID int `json:"cooperationProjectId"` //共创项目
CooperationProjectName string `json:"cooperationProjectName"` //共创名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
}
CooperationApplicationApplicant struct {
UserName string `json:"userName"` //申请人名字
UserCode string `json:"userCode"`
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"` //组织
}
func ToCooperationApplicationInfo(applicationParam *allied_creation_cooperation.CooperationApplication,
objectParam *allied_creation_cooperation.CooperationProject) *CooperationApplicationInfo {
//data := CooperationApplicationInfo{
// CooperationApplicationAttachment: applicationParam.CooperationApplicationAttachment,
// CooperationApplicationDescription: applicationParam.CooperationApplicationDescription,
// CooperationApplicationID: applicationParam.CooperationApplicationID,
// IsCanceled: applicationParam.IsCanceled,
// CooperationApplicationVerifyDescription: applicationParam.CooperationApplicationVerifyDescription,
// CooperationApplicationStatus: applicationParam.CooperationApplicationStatus,
// Org: applicationParam.Org,
//}
//data.CooperationProject.CooperationProjectID = objectParam.CooperationProjectId
//data.CooperationProject.CooperationProjectName = objectParam.CooperationProjectName
//data.CooperationProject.CooperationProjectNumber = objectParam.CooperationProjectNumber
//data.CooperationProject.CooperationMode.CooperationModeId = objectParam.CooperationMode.CooperationModeId
//data.CooperationProject.CooperationMode.CooperationModeName = objectParam.CooperationMode.CooperationModeName
//data.CooperationProject.CooperationMode.CooperationModeNumber = objectParam.CooperationMode.CooperationModeNumber
//data.CooperationApplicationApplicant.UserName = applicationParam.CooperationApplicationApplicant.UserInfo.UserName
//data.CooperationApplicationApplicant.Phone = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
//data.CooperationApplicationApplicant.UserCode = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
//data.CooperationApplicationApplicant.DepartmentName = applicationParam.CooperationApplicationApplicant.Department.DepartmentName
//return &data
return nil
}