|
@@ -48,6 +48,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
@@ -48,6 +48,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
48
|
"created_at",
|
48
|
"created_at",
|
|
49
|
"deleted_at",
|
49
|
"deleted_at",
|
|
50
|
"updated_at",
|
50
|
"updated_at",
|
|
|
|
51
|
+ "cooperation_contract_undertaker_id",
|
|
51
|
}
|
52
|
}
|
|
52
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
53
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
53
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
54
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
|
@@ -86,6 +87,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
@@ -86,6 +87,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
86
|
÷ndsEstimate.CreatedAt,
|
87
|
÷ndsEstimate.CreatedAt,
|
|
87
|
÷ndsEstimate.DeletedAt,
|
88
|
÷ndsEstimate.DeletedAt,
|
|
88
|
÷ndsEstimate.UpdatedAt,
|
89
|
÷ndsEstimate.UpdatedAt,
|
|
|
|
90
|
+ ÷ndsEstimate.CooperationContractUndertakerId,
|
|
89
|
),
|
91
|
),
|
|
90
|
fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
92
|
fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
91
|
dividendsEstimate.DividendsEstimateId,
|
93
|
dividendsEstimate.DividendsEstimateId,
|
|
@@ -110,6 +112,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
@@ -110,6 +112,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
110
|
dividendsEstimate.CreatedAt,
|
112
|
dividendsEstimate.CreatedAt,
|
|
111
|
nil,
|
113
|
nil,
|
|
112
|
dividendsEstimate.UpdatedAt,
|
114
|
dividendsEstimate.UpdatedAt,
|
|
|
|
115
|
+ dividendsEstimate.CooperationContractUndertakerId,
|
|
113
|
); err != nil {
|
116
|
); err != nil {
|
|
114
|
return dividendsEstimate, err
|
117
|
return dividendsEstimate, err
|
|
115
|
}
|
118
|
}
|
|
@@ -138,6 +141,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
@@ -138,6 +141,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
138
|
÷ndsEstimate.CreatedAt,
|
141
|
÷ndsEstimate.CreatedAt,
|
|
139
|
÷ndsEstimate.DeletedAt,
|
142
|
÷ndsEstimate.DeletedAt,
|
|
140
|
÷ndsEstimate.UpdatedAt,
|
143
|
÷ndsEstimate.UpdatedAt,
|
|
|
|
144
|
+ ÷ndsEstimate.CooperationContractUndertakerId,
|
|
141
|
),
|
145
|
),
|
|
142
|
fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
146
|
fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
143
|
dividendsEstimate.DividendsEstimateId,
|
147
|
dividendsEstimate.DividendsEstimateId,
|
|
@@ -162,6 +166,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
@@ -162,6 +166,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
162
|
dividendsEstimate.CreatedAt,
|
166
|
dividendsEstimate.CreatedAt,
|
|
163
|
nil,
|
167
|
nil,
|
|
164
|
dividendsEstimate.UpdatedAt,
|
168
|
dividendsEstimate.UpdatedAt,
|
|
|
|
169
|
+ dividendsEstimate.CooperationContractUndertakerId,
|
|
165
|
dividendsEstimate.Identify(),
|
170
|
dividendsEstimate.Identify(),
|
|
166
|
); err != nil {
|
171
|
); err != nil {
|
|
167
|
return dividendsEstimate, err
|
172
|
return dividendsEstimate, err
|
|
@@ -183,28 +188,29 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do |
|
@@ -183,28 +188,29 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do |
|
183
|
}
|
188
|
}
|
|
184
|
}
|
189
|
}
|
|
185
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
190
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
|
186
|
- DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
|
187
|
- DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
|
188
|
- PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
|
189
|
- DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
|
190
|
- DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
|
191
|
- DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
|
192
|
- DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
|
193
|
- DividendsType: dividendsEstimate.DividendsType,
|
|
|
|
194
|
- DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
|
195
|
- OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
|
196
|
- CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
|
197
|
- DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
|
198
|
- DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
|
199
|
- Org: dividendsEstimate.Org,
|
|
|
|
200
|
- Company: dividendsEstimate.Company,
|
|
|
|
201
|
- Operator: dividendsEstimate.Operator,
|
|
|
|
202
|
- OperateTime: dividendsEstimate.OperateTime,
|
|
|
|
203
|
- IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
|
204
|
- OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
|
205
|
- CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
|
206
|
- DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
|
207
|
- UpdatedAt: dividendsEstimate.UpdatedAt,
|
191
|
+ DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
|
192
|
+ DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
|
193
|
+ PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
|
194
|
+ DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
|
195
|
+ DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
|
196
|
+ DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
|
197
|
+ DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
|
198
|
+ DividendsType: dividendsEstimate.DividendsType,
|
|
|
|
199
|
+ DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
|
200
|
+ OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
|
201
|
+ CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
|
202
|
+ DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
|
203
|
+ DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
|
204
|
+ Org: dividendsEstimate.Org,
|
|
|
|
205
|
+ Company: dividendsEstimate.Company,
|
|
|
|
206
|
+ Operator: dividendsEstimate.Operator,
|
|
|
|
207
|
+ OperateTime: dividendsEstimate.OperateTime,
|
|
|
|
208
|
+ IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
|
209
|
+ OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
|
210
|
+ CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
|
211
|
+ DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
|
212
|
+ UpdatedAt: dividendsEstimate.UpdatedAt,
|
|
|
|
213
|
+ CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
208
|
})
|
214
|
})
|
|
209
|
}
|
215
|
}
|
|
210
|
if len(dividendsEstimateModels) > 0 {
|
216
|
if len(dividendsEstimateModels) > 0 {
|
|
@@ -229,28 +235,29 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* |
|
@@ -229,28 +235,29 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* |
|
229
|
var dividendsEstimateModels []*models.DividendsEstimate
|
235
|
var dividendsEstimateModels []*models.DividendsEstimate
|
|
230
|
for _, dividendsEstimate := range dividendsEstimates {
|
236
|
for _, dividendsEstimate := range dividendsEstimates {
|
|
231
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
237
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
|
232
|
- DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
|
233
|
- DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
|
234
|
- PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
|
235
|
- DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
|
236
|
- DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
|
237
|
- DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
|
238
|
- DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
|
239
|
- DividendsType: dividendsEstimate.DividendsType,
|
|
|
|
240
|
- DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
|
241
|
- OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
|
242
|
- CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
|
243
|
- DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
|
244
|
- DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
|
245
|
- Org: dividendsEstimate.Org,
|
|
|
|
246
|
- Company: dividendsEstimate.Company,
|
|
|
|
247
|
- Operator: dividendsEstimate.Operator,
|
|
|
|
248
|
- OperateTime: dividendsEstimate.OperateTime,
|
|
|
|
249
|
- IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
|
250
|
- OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
|
251
|
- CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
|
252
|
- DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
|
253
|
- UpdatedAt: time.Now(),
|
238
|
+ DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
|
239
|
+ DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
|
240
|
+ PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
|
241
|
+ DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
|
242
|
+ DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
|
243
|
+ DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
|
244
|
+ DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
|
245
|
+ DividendsType: dividendsEstimate.DividendsType,
|
|
|
|
246
|
+ DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
|
247
|
+ OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
|
248
|
+ CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
|
249
|
+ DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
|
250
|
+ DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
|
251
|
+ Org: dividendsEstimate.Org,
|
|
|
|
252
|
+ Company: dividendsEstimate.Company,
|
|
|
|
253
|
+ Operator: dividendsEstimate.Operator,
|
|
|
|
254
|
+ OperateTime: dividendsEstimate.OperateTime,
|
|
|
|
255
|
+ IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
|
256
|
+ OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
|
257
|
+ CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
|
258
|
+ DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
|
259
|
+ UpdatedAt: time.Now(),
|
|
|
|
260
|
+ CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
254
|
})
|
261
|
})
|
|
255
|
}
|
262
|
}
|
|
256
|
if _, err := tx.Model(÷ndsEstimateModels).WherePK().Update(); err != nil {
|
263
|
if _, err := tx.Model(÷ndsEstimateModels).WherePK().Update(); err != nil {
|