|
@@ -24,6 +24,7 @@ func (repository *CooperationApplicationRepository) nextIdentify() (int64, error |
|
@@ -24,6 +24,7 @@ func (repository *CooperationApplicationRepository) nextIdentify() (int64, error |
24
|
id, err := IdWorker.NextId()
|
24
|
id, err := IdWorker.NextId()
|
25
|
return id, err
|
25
|
return id, err
|
26
|
}
|
26
|
}
|
|
|
27
|
+
|
27
|
func (repository *CooperationApplicationRepository) Save(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
28
|
func (repository *CooperationApplicationRepository) Save(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
28
|
sqlBuildFields := []string{
|
29
|
sqlBuildFields := []string{
|
29
|
"cooperation_application_id",
|
30
|
"cooperation_application_id",
|
|
@@ -67,7 +68,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
@@ -67,7 +68,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
67
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
68
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
68
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
69
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
69
|
&cooperationApplication.CooperationApplyTime,
|
70
|
&cooperationApplication.CooperationApplyTime,
|
70
|
- &cooperationApplication.CooperationProject,
|
71
|
+ &cooperationApplication.CooperationProject.CooperationProjectNumber,
|
71
|
&cooperationApplication.Org,
|
72
|
&cooperationApplication.Org,
|
72
|
&cooperationApplication.IsCanceled,
|
73
|
&cooperationApplication.IsCanceled,
|
73
|
&cooperationApplication.Company,
|
74
|
&cooperationApplication.Company,
|
|
@@ -85,12 +86,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
@@ -85,12 +86,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
85
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
86
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
86
|
cooperationApplication.CooperationApplicationVerifyTime,
|
87
|
cooperationApplication.CooperationApplicationVerifyTime,
|
87
|
cooperationApplication.CooperationApplyTime,
|
88
|
cooperationApplication.CooperationApplyTime,
|
88
|
- cooperationApplication.CooperationProject,
|
89
|
+ cooperationApplication.CooperationProject.CooperationProjectNumber,
|
89
|
cooperationApplication.Org,
|
90
|
cooperationApplication.Org,
|
90
|
cooperationApplication.IsCanceled,
|
91
|
cooperationApplication.IsCanceled,
|
91
|
cooperationApplication.Company,
|
92
|
cooperationApplication.Company,
|
92
|
cooperationApplication.CreatedAt,
|
93
|
cooperationApplication.CreatedAt,
|
93
|
- cooperationApplication.DeletedAt,
|
94
|
+ nil,
|
94
|
cooperationApplication.UpdatedAt,
|
95
|
cooperationApplication.UpdatedAt,
|
95
|
); err != nil {
|
96
|
); err != nil {
|
96
|
return cooperationApplication, err
|
97
|
return cooperationApplication, err
|
|
@@ -107,7 +108,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
@@ -107,7 +108,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
107
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
108
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
108
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
109
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
109
|
&cooperationApplication.CooperationApplyTime,
|
110
|
&cooperationApplication.CooperationApplyTime,
|
110
|
- &cooperationApplication.CooperationProject,
|
111
|
+ &cooperationApplication.CooperationProject.CooperationProjectNumber,
|
111
|
&cooperationApplication.Org,
|
112
|
&cooperationApplication.Org,
|
112
|
&cooperationApplication.IsCanceled,
|
113
|
&cooperationApplication.IsCanceled,
|
113
|
&cooperationApplication.Company,
|
114
|
&cooperationApplication.Company,
|
|
@@ -125,12 +126,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
@@ -125,12 +126,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
125
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
126
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
126
|
cooperationApplication.CooperationApplicationVerifyTime,
|
127
|
cooperationApplication.CooperationApplicationVerifyTime,
|
127
|
cooperationApplication.CooperationApplyTime,
|
128
|
cooperationApplication.CooperationApplyTime,
|
128
|
- cooperationApplication.CooperationProject,
|
129
|
+ cooperationApplication.CooperationProject.CooperationProjectNumber,
|
129
|
cooperationApplication.Org,
|
130
|
cooperationApplication.Org,
|
130
|
cooperationApplication.IsCanceled,
|
131
|
cooperationApplication.IsCanceled,
|
131
|
cooperationApplication.Company,
|
132
|
cooperationApplication.Company,
|
132
|
cooperationApplication.CreatedAt,
|
133
|
cooperationApplication.CreatedAt,
|
133
|
- cooperationApplication.DeletedAt,
|
134
|
+ nil,
|
134
|
cooperationApplication.UpdatedAt,
|
135
|
cooperationApplication.UpdatedAt,
|
135
|
cooperationApplication.Identify(),
|
136
|
cooperationApplication.Identify(),
|
136
|
); err != nil {
|
137
|
); err != nil {
|
|
@@ -139,6 +140,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
@@ -139,6 +140,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
139
|
}
|
140
|
}
|
140
|
return cooperationApplication, nil
|
141
|
return cooperationApplication, nil
|
141
|
}
|
142
|
}
|
|
|
143
|
+
|
142
|
func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
144
|
func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
143
|
tx := repository.transactionContext.PgTx
|
145
|
tx := repository.transactionContext.PgTx
|
144
|
cooperationApplicationModel := new(models.CooperationApplication)
|
146
|
cooperationApplicationModel := new(models.CooperationApplication)
|
|
@@ -148,6 +150,7 @@ func (repository *CooperationApplicationRepository) Remove(cooperationApplicatio |
|
@@ -148,6 +150,7 @@ func (repository *CooperationApplicationRepository) Remove(cooperationApplicatio |
148
|
}
|
150
|
}
|
149
|
return cooperationApplication, nil
|
151
|
return cooperationApplication, nil
|
150
|
}
|
152
|
}
|
|
|
153
|
+
|
151
|
func (repository *CooperationApplicationRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationApplication, error) {
|
154
|
func (repository *CooperationApplicationRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationApplication, error) {
|
152
|
tx := repository.transactionContext.PgTx
|
155
|
tx := repository.transactionContext.PgTx
|
153
|
cooperationApplicationModel := new(models.CooperationApplication)
|
156
|
cooperationApplicationModel := new(models.CooperationApplication)
|
|
@@ -172,6 +175,7 @@ func (repository *CooperationApplicationRepository) FindOne(queryOptions map[str |
|
@@ -172,6 +175,7 @@ func (repository *CooperationApplicationRepository) FindOne(queryOptions map[str |
172
|
return transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel, cooperationProjectModel)
|
175
|
return transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel, cooperationProjectModel)
|
173
|
}
|
176
|
}
|
174
|
}
|
177
|
}
|
|
|
178
|
+
|
175
|
func (repository *CooperationApplicationRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationApplication, error) {
|
179
|
func (repository *CooperationApplicationRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationApplication, error) {
|
176
|
tx := repository.transactionContext.PgTx
|
180
|
tx := repository.transactionContext.PgTx
|
177
|
var cooperationApplicationModels []*models.CooperationApplication
|
181
|
var cooperationApplicationModels []*models.CooperationApplication
|
|
@@ -198,6 +202,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string |
|
@@ -198,6 +202,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string |
198
|
return int64(count), cooperationApplications, nil
|
202
|
return int64(count), cooperationApplications, nil
|
199
|
}
|
203
|
}
|
200
|
}
|
204
|
}
|
|
|
205
|
+
|
201
|
func NewCooperationApplicationRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationApplicationRepository, error) {
|
206
|
func NewCooperationApplicationRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationApplicationRepository, error) {
|
202
|
if transactionContext == nil {
|
207
|
if transactionContext == nil {
|
203
|
return nil, fmt.Errorf("transactionContext参数不能为nil")
|
208
|
return nil, fmt.Errorf("transactionContext参数不能为nil")
|