切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
c6d1f8e27e7f9c5e6e762572f084fe8d022ce517
2 个父辈
bb04f9c3
1f77be8e
合并已修复的bug'1.2.4' into test
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
17 行增加
和
6 行删除
pkg/application/evaluation_project/project_service.go
pkg/application/evaluation_project/project_service.go
查看文件 @
c6d1f8e
...
...
@@ -525,7 +525,9 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand)
if
project
.
State
==
domain
.
ProjectStateEnable
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
"项目已启动"
)
}
if
project
.
State
==
domain
.
ProjectStatePause
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
"项目暂停中,先进行恢复"
)
}
// 周期内的所有项目,已启用的员工不能重复被评估
_
,
projects
,
err
:=
projectRepository
.
Find
(
map
[
string
]
interface
{}{
"companyId"
:
project
.
CompanyId
,
"cycleId"
:
project
.
CycleId
},
"template"
)
if
err
!=
nil
{
...
...
@@ -625,7 +627,7 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand)
task
.
NextSentAt
=
nil
}
task
,
err
:=
taskRepository
.
Insert
(
task
)
_
,
err
:=
taskRepository
.
Insert
(
task
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
@@ -871,6 +873,17 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo
}
func
(
rs
*
EvaluationProjectService
)
generateEvaluationItemUsed
(
transactionContext
application
.
TransactionContext
,
project
*
domain
.
EvaluationProject
)
error
{
itemUsedRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
var
err
error
cnt
,
_
,
err
:=
itemUsedRepo
.
Find
(
map
[
string
]
interface
{}{
"projectId"
:
project
.
Id
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"检查评估选项"
+
err
.
Error
())
}
if
cnt
>
0
{
return
nil
}
var
itemUsedList
[]
*
domain
.
EvaluationItemUsed
nowTime
:=
time
.
Now
()
for
_
,
v
:=
range
project
.
Template
.
LinkNodes
{
...
...
@@ -901,10 +914,8 @@ func (rs *EvaluationProjectService) generateEvaluationItemUsed(transactionContex
itemUsedList
=
append
(
itemUsedList
,
&
item
)
}
}
itemUsedRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
err
:=
itemUsedRepo
.
BatchInsert
(
itemUsedList
)
err
=
itemUsedRepo
.
BatchInsert
(
itemUsedList
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
请
注册
或
登录
后发表评论