...
|
...
|
@@ -217,9 +217,45 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
return cooperationContract, err
|
|
|
} else {
|
|
|
//TODO 更新相关人
|
|
|
// 获取相关人列表
|
|
|
var cooperationContractRelevantModels []*models.CooperationContractRelevant
|
|
|
cooperationContractRelevantQuery := tx.Model(&cooperationContractRelevantModels)
|
|
|
if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
var cooperationContractRelevantModelsUpdate []*models.CooperationContractRelevant // 待更新的相关人
|
|
|
var cooperationContractRelevantModelsDelete []*models.CooperationContractRelevant // 待删除的相关人
|
|
|
var cooperationContractRelevantModelsCreate []*models.CooperationContractRelevant // 待增加的相关人
|
|
|
|
|
|
for _, cooperationContractRelevantModels := range cooperationContractRelevantModels {
|
|
|
for _, cooperationContractRelevantDomain := range cooperationContract.RelevantPeople {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//TODO 更新承接人
|
|
|
// 获取承接人列表
|
|
|
var cooperationContractUndertakerModels []*models.CooperationContractUndertaker
|
|
|
cooperationContractUndertakerQuery := tx.Model(&cooperationContractUndertakerModels)
|
|
|
if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
//TODO 更新分红激励规则
|
|
|
// 获取分红激励规则列表
|
|
|
var dividendsIncentivesRuleModels []*models.DividendsIncentivesRule
|
|
|
dividendsIncentivesRuleQuery := tx.Model(÷ndsIncentivesRuleModels)
|
|
|
if err := dividendsIncentivesRuleQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
//TODO 更新金额激励规则
|
|
|
// 获取金额激励规则列表
|
|
|
var moneyIncentivesRuleModels []*models.MoneyIncentivesRule
|
|
|
moneyIncentivesRuleQuery := tx.Model(&moneyIncentivesRuleModels)
|
|
|
if err := moneyIncentivesRuleQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return cooperationContract, nil
|
...
|
...
|
|