切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-cooperation
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
陈志颖
3 years ago
提交
394b0aad566e8e40a3cf671eb6b9f2b6bf577fd1
2 个父辈
65429ed6
8c787512
合并分支 'dev' 到 'test'
Dev 查看合并请求
!34
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
30 行增加
和
31 行删除
pkg/infrastructure/pg/models/cooperation_contract_relevant.go
pkg/infrastructure/pg/models/cooperation_contract_undertaker.go
pkg/infrastructure/repository/pg_cooperation_contract_repository.go
pkg/infrastructure/pg/models/cooperation_contract_relevant.go
查看文件 @
394b0aa
...
...
@@ -34,7 +34,7 @@ type CooperationContractRelevant struct {
// 更新时间
UpdatedAt
time
.
Time
`comment:"更新时间"`
// 删除时间
DeletedAt
time
.
Time
`comment:"删除时间"`
DeletedAt
time
.
Time
`comment:"删除时间"
pg:",soft_delete"
`
// 创建时间
CreatedAt
time
.
Time
`comment:"创建时间"`
}
...
...
pkg/infrastructure/pg/models/cooperation_contract_undertaker.go
查看文件 @
394b0aa
...
...
@@ -44,5 +44,5 @@ type CooperationContractUndertaker struct {
// 更新时间
UpdatedAt
time
.
Time
`comment:"更新时间"`
// 删除时间
DeletedAt
time
.
Time
`comment:"删除时间"`
DeletedAt
time
.
Time
`comment:"删除时间"
pg:",soft_delete"
`
}
...
...
pkg/infrastructure/repository/pg_cooperation_contract_repository.go
查看文件 @
394b0aa
...
...
@@ -143,25 +143,34 @@ 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
{
CooperationContractNumber
:
cooperationContract
.
CooperationContractNumber
,
CooperationContractId
:
cooperationContract
.
CooperationContractId
,
UserId
:
undertaker
.
UserId
,
UserBaseId
:
undertaker
.
UserBaseId
,
Org
:
undertaker
.
Org
,
Orgs
:
undertaker
.
Orgs
,
Department
:
undertaker
.
Department
,
Roles
:
undertaker
.
Roles
,
UserInfo
:
undertaker
.
UserInfo
,
UserType
:
undertaker
.
UserType
,
Referrer
:
undertaker
.
Referrer
,
Salesman
:
undertaker
.
Salesman
,
Status
:
undertaker
.
Status
,
Company
:
undertaker
.
Company
,
ContractAttachment
:
undertaker
.
ContractAttachment
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Time
{},
DeletedAt
:
time
.
Time
{},
CooperationContractUndertakerId
:
undertaker
.
UndertakerId
,
CooperationContractNumber
:
cooperationContract
.
CooperationContractNumber
,
CooperationContractId
:
cooperationContract
.
CooperationContractId
,
UserId
:
undertaker
.
UserId
,
UserBaseId
:
undertaker
.
UserBaseId
,
Org
:
undertaker
.
Org
,
Orgs
:
undertaker
.
Orgs
,
Department
:
undertaker
.
Department
,
Roles
:
undertaker
.
Roles
,
UserInfo
:
undertaker
.
UserInfo
,
UserType
:
undertaker
.
UserType
,
Referrer
:
undertaker
.
Referrer
,
Salesman
:
undertaker
.
Salesman
,
Status
:
undertaker
.
Status
,
Company
:
undertaker
.
Company
,
ContractAttachment
:
undertaker
.
ContractAttachment
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Time
{},
DeletedAt
:
time
.
Time
{},
})
}
if
len
(
undertakersModel
)
>
0
{
...
...
@@ -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
.
...
...
@@ -1151,7 +1150,7 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in
query
.
Where
(
"cooperation_contract_name like ?"
,
fmt
.
Sprintf
(
"%%%s%%"
,
cooperationContractName
))
}
if
departmentName
,
ok
:=
queryOptions
[
"departmentName"
];
ok
&&
departmentName
!=
""
{
query
.
Where
(
`(cooperation_contract.department->>'departmentName')::te
s
t LIKE ?`
,
fmt
.
Sprintf
(
"%%%s%%"
,
departmentName
))
query
.
Where
(
`(cooperation_contract.department->>'departmentName')::te
x
t LIKE ?`
,
fmt
.
Sprintf
(
"%%%s%%"
,
departmentName
))
}
if
sponsorName
,
ok
:=
queryOptions
[
"sponsorName"
];
ok
&&
sponsorName
!=
""
{
query
.
Where
(
`(cooperation_contract.cooperation_contract_sponsor->>'userName')::text LIKE ?`
,
fmt
.
Sprintf
(
"%%%s%%"
,
sponsorName
))
...
...
请
注册
或
登录
后发表评论