...
|
...
|
@@ -51,7 +51,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "cooperationContract_id")
|
|
|
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
|
|
|
tx := repository.transactionContext.PgTx
|
|
|
if cooperationContract.Identify() == nil {
|
|
|
if cooperationContract.Identify() == nil { // 新增合约
|
|
|
cooperationContractId, err := repository.nextIdentify()
|
|
|
if err != nil {
|
|
|
return cooperationContract, err
|
...
|
...
|
@@ -256,7 +256,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
} else { // 编辑合约
|
|
|
if _, err := tx.QueryOne(
|
|
|
pg.Scan(
|
|
|
&cooperationContract.CooperationContractId,
|
...
|
...
|
@@ -823,13 +823,6 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 返回新增的合约
|
|
|
//cooperationContractSaved, err := repository.FindOne(map[string]interface{}{
|
|
|
// "cooperationContractId": cooperationContract.CooperationContractId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, err
|
|
|
//}
|
|
|
return cooperationContract, nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1111,7 +1104,8 @@ func (repository *CooperationContractRepository) FindOne(queryOptions map[string |
|
|
if err := cooperationContractUndertakerQuery.
|
|
|
Where("company->>'companyId' = '?'", cooperationContractModel.Company.CompanyId).
|
|
|
Where("org->>'orgId' = '?'", cooperationContractModel.Org.OrgId).
|
|
|
Where("cooperation_contract_id = ?", cooperationContractModel.CooperationContractId).
|
|
|
//Where("cooperation_contract_id = ?", cooperationContractModel.CooperationContractId).
|
|
|
Where("cooperation_contract_number = ?", cooperationContractModel.CooperationContractNumber).
|
|
|
Select(); err != nil {
|
|
|
return nil, fmt.Errorf("合约承接人不存在")
|
|
|
}
|
...
|
...
|
|