...
|
...
|
@@ -143,7 +143,16 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
// 新增承接人
|
|
|
var undertakersModel []*models.CooperationContractUndertaker
|
|
|
for _, undertaker := range cooperationContract.Undertakers {
|
|
|
if undertaker.Identify() == nil {
|
|
|
undertakerId, err := repository.nextIdentify()
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
undertaker.UndertakerId = undertakerId
|
|
|
}
|
|
|
}
|
|
|
undertakersModel = append(undertakersModel, &models.CooperationContractUndertaker{
|
|
|
CooperationContractUndertakerId: undertaker.UndertakerId,
|
|
|
CooperationContractNumber: cooperationContract.CooperationContractNumber,
|
|
|
CooperationContractId: cooperationContract.CooperationContractId,
|
|
|
UserId: undertaker.UserId,
|
...
|
...
|
@@ -1063,16 +1072,6 @@ func (repository *CooperationContractRepository) FindOne(queryOptions map[string |
|
|
if cooperationContractModel.CooperationContractId == 0 {
|
|
|
return nil, nil
|
|
|
} else {
|
|
|
// 获取共创模式
|
|
|
//cooperationModeModels := new(models.CooperationMode)
|
|
|
//cooperationModeQuery := tx.Model(cooperationModeModels)
|
|
|
//if err := cooperationModeQuery.
|
|
|
// Where("company->>'companyId' = '?'", cooperationContractModel.Company.CompanyId).
|
|
|
// Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId).
|
|
|
// Where("cooperation_mode_number = ?", cooperationContractModel.CooperationModeNumber).
|
|
|
// First(); err != nil {
|
|
|
// return nil, fmt.Errorf("共创合约关联的共创模式不存在")
|
|
|
//}
|
|
|
var cooperationModeModels []*models.CooperationMode
|
|
|
cooperationModeQuery := tx.Model(&cooperationModeModels)
|
|
|
if countMode, err := cooperationModeQuery.
|
...
|
...
|
|