...
|
...
|
@@ -101,6 +101,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
); err != nil {
|
|
|
return cooperationContract, err
|
|
|
}
|
|
|
|
|
|
// 新增相关人
|
|
|
var relevantPeopleModel []*models.CooperationContractRelevant
|
|
|
for _, relevant := range cooperationContract.RelevantPeople {
|
...
|
...
|
@@ -116,14 +117,18 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
UserType: relevant.UserType,
|
|
|
Status: relevant.Status,
|
|
|
Company: relevant.Company,
|
|
|
UpdatedAt: time.Now(),
|
|
|
UpdatedAt: time.Time{},
|
|
|
DeletedAt: time.Time{},
|
|
|
CreatedAt: time.Time{},
|
|
|
CreatedAt: time.Now(),
|
|
|
})
|
|
|
}
|
|
|
if len(relevantPeopleModel) > 0 {
|
|
|
if _, err := tx.Model(&relevantPeopleModel).Insert(); err != nil {
|
|
|
if result, err := tx.Model(&relevantPeopleModel).Insert(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
log.Logger.Info("新增的相关人", map[string]interface{}{
|
|
|
"relevantPeopleModel": result,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -640,7 +645,14 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return cooperationContract, nil
|
|
|
// 返回新增的合约
|
|
|
cooperationContractSaved, err := repository.FindOne(map[string]interface{}{
|
|
|
"cooperationContractId":cooperationContract.CooperationContractId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
return cooperationContractSaved, nil
|
|
|
}
|
|
|
|
|
|
func (repository *CooperationContractRepository) UpdateOne(cooperationContract *domain.CooperationContract) (*domain.CooperationContract, error) {
|
...
|
...
|
|