|
@@ -217,9 +217,45 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
@@ -217,9 +217,45 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
217
|
return cooperationContract, err
|
217
|
return cooperationContract, err
|
|
218
|
} else {
|
218
|
} else {
|
|
219
|
//TODO 更新相关人
|
219
|
//TODO 更新相关人
|
|
|
|
220
|
+ // 获取相关人列表
|
|
|
|
221
|
+ var cooperationContractRelevantModels []*models.CooperationContractRelevant
|
|
|
|
222
|
+ cooperationContractRelevantQuery := tx.Model(&cooperationContractRelevantModels)
|
|
|
|
223
|
+ if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
|
224
|
+ return nil, err
|
|
|
|
225
|
+ }
|
|
|
|
226
|
+ var cooperationContractRelevantModelsUpdate []*models.CooperationContractRelevant // 待更新的相关人
|
|
|
|
227
|
+ var cooperationContractRelevantModelsDelete []*models.CooperationContractRelevant // 待删除的相关人
|
|
|
|
228
|
+ var cooperationContractRelevantModelsCreate []*models.CooperationContractRelevant // 待增加的相关人
|
|
|
|
229
|
+
|
|
|
|
230
|
+ for _, cooperationContractRelevantModels := range cooperationContractRelevantModels {
|
|
|
|
231
|
+ for _, cooperationContractRelevantDomain := range cooperationContract.RelevantPeople {
|
|
|
|
232
|
+
|
|
|
|
233
|
+ }
|
|
|
|
234
|
+ }
|
|
|
|
235
|
+
|
|
220
|
//TODO 更新承接人
|
236
|
//TODO 更新承接人
|
|
|
|
237
|
+ // 获取承接人列表
|
|
|
|
238
|
+ var cooperationContractUndertakerModels []*models.CooperationContractUndertaker
|
|
|
|
239
|
+ cooperationContractUndertakerQuery := tx.Model(&cooperationContractUndertakerModels)
|
|
|
|
240
|
+ if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
|
241
|
+ return nil, err
|
|
|
|
242
|
+ }
|
|
|
|
243
|
+
|
|
221
|
//TODO 更新分红激励规则
|
244
|
//TODO 更新分红激励规则
|
|
|
|
245
|
+ // 获取分红激励规则列表
|
|
|
|
246
|
+ var dividendsIncentivesRuleModels []*models.DividendsIncentivesRule
|
|
|
|
247
|
+ dividendsIncentivesRuleQuery := tx.Model(÷ndsIncentivesRuleModels)
|
|
|
|
248
|
+ if err := dividendsIncentivesRuleQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
|
249
|
+ return nil, err
|
|
|
|
250
|
+ }
|
|
|
|
251
|
+
|
|
222
|
//TODO 更新金额激励规则
|
252
|
//TODO 更新金额激励规则
|
|
|
|
253
|
+ // 获取金额激励规则列表
|
|
|
|
254
|
+ var moneyIncentivesRuleModels []*models.MoneyIncentivesRule
|
|
|
|
255
|
+ moneyIncentivesRuleQuery := tx.Model(&moneyIncentivesRuleModels)
|
|
|
|
256
|
+ if err := moneyIncentivesRuleQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
|
257
|
+ return nil, err
|
|
|
|
258
|
+ }
|
|
223
|
}
|
259
|
}
|
|
224
|
}
|
260
|
}
|
|
225
|
return cooperationContract, nil
|
261
|
return cooperationContract, nil
|