切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
d975a2b389b7480dadc5e85ed34a2eb44bcd917c
1 个父辈
c807b6e6
添加 综合评估的查询条件
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
87 行增加
和
25 行删除
pkg/application/summary_evaluation/service/service.go
pkg/application/summary_evaluation/service/service2.go
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
pkg/application/summary_evaluation/service/service.go
查看文件 @
d975a2b
...
...
@@ -97,39 +97,90 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
var
cntAll360
int
var
cntUncompleted360
int
//查找360评估,统计未完成的
cnt
360
,
_
,
err
:
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
cnt
All360
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
Evaluation360
),
"executorId"
:
param
.
UserId
,
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"
status"
:
string
(
domain
.
EvaluationUncompleted
),
"
beginTime"
:
time
.
Now
(
),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
cntAll360
>
0
{
//查找360评估,统计未完成的
cntUncompleted360
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
Evaluation360
),
"executorId"
:
param
.
UserId
,
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"status"
:
string
(
domain
.
EvaluationUncompleted
),
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
var
cntAllSuper
int
var
cntUncompletedSuper
int
//查询需要执行上级评估,统计未完成
cnt
Super
,
_
,
err
:
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
cnt
AllSuper
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationSuper
),
"executorId"
:
param
.
UserId
,
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"
status"
:
string
(
domain
.
EvaluationUncompleted
),
"
beginTime"
:
time
.
Now
(
),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
cntAllSuper
>
0
{
//查询需要执行上级评估,统计未完成
cntUncompletedSuper
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationSuper
),
"executorId"
:
param
.
UserId
,
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"status"
:
string
(
domain
.
EvaluationUncompleted
),
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
var
cntAllHrbp
int
var
cntUncompletedHrbp
int
//查询需要执行人资评估,统计未完成
cntHrbp
,
_
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationHrbp
),
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"status"
:
string
(
domain
.
EvaluationUncompleted
),
cntAllHrbp
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationHrbp
),
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
cntAllHrbp
>
0
{
// 查询需要执行人资评估,统计未完成
cntUncompletedHrbp
,
_
,
err
=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationHrbp
),
"limit"
:
1
,
"cycleId"
:
param
.
CycleId
,
"status"
:
string
(
domain
.
EvaluationUncompleted
),
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
isHrbp
,
err
:=
roleService
.
GetHRBP
(
transactionContext
,
param
.
CompanyId
,
param
.
UserId
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
...
...
@@ -177,7 +228,6 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
}
else
{
menu1_1
.
StatusName
=
"未完成"
}
}
if
len
(
myEvaluationSuper
)
>
0
{
if
myEvaluationSuper
[
0
]
.
CheckResult
==
domain
.
EvaluationCheckCompleted
{
...
...
@@ -201,12 +251,11 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
StatusName
:
""
,
Types
:
"360综评"
,
}
if
cnt360
>
0
{
if
cnt
Uncompleted
360
>
0
{
menu2_1
.
StatusName
=
"未完成"
}
else
{
}
else
if
cntAll360
>
0
{
menu2_1
.
StatusName
=
"已完成"
}
menu2
.
Child
=
append
(
menu2
.
Child
,
menu2_1
)
menuList
=
append
(
menuList
,
menu2
)
menu3
:=
adapter
.
MenuListAdapter
{
CycleId
:
0
,
...
...
@@ -221,12 +270,11 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
StatusName
:
""
,
Types
:
"人资综评"
,
}
if
cntHrbp
>
0
{
if
cnt
Uncompleted
Hrbp
>
0
{
menu3_1
.
StatusName
=
"未完成"
}
else
{
}
else
if
cntAllHrbp
>
0
{
menu3_1
.
StatusName
=
"已完成"
}
menu3
.
Child
=
append
(
menu3
.
Child
,
menu3_1
)
//hrbp 才有这个菜单
if
isHrbp
>
0
{
menuList
=
append
(
menuList
,
menu3
)
...
...
@@ -244,9 +292,9 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
StatusName
:
""
,
Types
:
"上级综评"
,
}
if
cntSuper
>
0
{
if
cnt
Uncompleted
Super
>
0
{
menu4_1
.
StatusName
=
"未完成"
}
else
{
}
else
if
cntAllSuper
>
0
{
menu4_1
.
StatusName
=
"已完成"
}
menu4
.
Child
=
append
(
menu4
.
Child
,
menu4_1
)
...
...
@@ -512,14 +560,14 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
// 员工提交自评内容后,
// 员工作为被评估人,
// 变更360评估/人资评估/
上级评估
的开始时间
// 变更360评估/人资评估/的开始时间
func
(
srv
*
SummaryEvaluationService
)
AfterCompletedEvaluationSelf
(
transactionContext
application
.
TransactionContext
,
param
*
domain
.
SummaryEvaluation
)
error
{
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"targetUserId"
:
param
.
TargetUser
.
UserId
,
"typesList"
:
[]
int
{
int
(
domain
.
Evaluation360
),
int
(
domain
.
EvaluationHrbp
)
,
int
(
domain
.
EvaluationSuper
)
},
"typesList"
:
[]
int
{
int
(
domain
.
Evaluation360
),
int
(
domain
.
EvaluationHrbp
)},
"cycleId"
:
param
.
CycleId
,
"limit"
:
1000
,
})
...
...
@@ -571,7 +619,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(transaction
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 变更
360评估/人资评估/
上级评估的开始时间
// 变更上级评估的开始时间
for
_
,
v
:=
range
evaluationList
{
v
.
BeginTime
=
time
.
Now
()
err
=
evaluationRepo
.
Save
(
v
)
...
...
@@ -1027,6 +1075,7 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command.
"executorId"
:
param
.
ExecutorId
,
"types"
:
int
(
domain
.
EvaluationSuper
),
"limit"
:
limit
,
"beginTime"
:
time
.
Now
(),
}
if
offset
>
0
{
condition1
[
"offset"
]
=
offset
...
...
@@ -1046,6 +1095,7 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command.
"types"
:
int
(
domain
.
EvaluationSuper
),
"status"
:
domain
.
EvaluationUncompleted
,
"limit"
:
1
,
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
...
...
@@ -1339,9 +1389,10 @@ func (srv *SummaryEvaluationService) ListAllEvaluationSuper(param *command.Query
//获取评估列表信息
condition1
:=
map
[
string
]
interface
{}{
"cycleId"
:
param
.
CycleId
,
"types"
:
int
(
domain
.
EvaluationSuper
),
"limit"
:
limit
,
"cycleId"
:
param
.
CycleId
,
"types"
:
int
(
domain
.
EvaluationSuper
),
"limit"
:
limit
,
"beginTime"
:
time
.
Now
(),
}
if
offset
>
0
{
condition1
[
"offset"
]
=
offset
...
...
pkg/application/summary_evaluation/service/service2.go
查看文件 @
d975a2b
...
...
@@ -48,6 +48,7 @@ func (srv *SummaryEvaluationService) Evaluation360List(param *command.QueryEvalu
"targetUserName"
:
searchTargetName
,
"limit"
:
limit
,
"offset"
:
offset
,
"beginTime"
:
time
.
Now
(),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
...
...
@@ -457,6 +458,7 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
"types"
:
domain
.
EvaluationHrbp
,
"limit"
:
limit
,
"offset"
:
offset
,
"beginTime"
:
time
.
Now
(),
}
if
len
(
param
.
SearchName
)
>
0
{
condition
[
"targetUserName"
]
=
"%"
+
param
.
SearchName
+
"%"
...
...
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
查看文件 @
d975a2b
...
...
@@ -162,6 +162,15 @@ func (repo *SummaryEvaluationRepository) Find(queryOptions map[string]interface{
query
.
Where
(
`summary_evaluation.executor->>'userId'='?'`
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"beginTime"
];
ok
{
t
:=
v
.
(
time
.
Time
)
query
.
Where
(
`summary_evaluation.begin_time<=?`
,
t
)
}
if
v
,
ok
:=
queryOptions
[
"endTime"
];
ok
{
t
:=
v
.
(
time
.
Time
)
query
.
Where
(
`summary_evaluation.end_time>=?`
,
t
)
}
query
.
Order
(
"id desc"
)
count
,
err
:=
query
.
SelectAndCount
()
if
err
!=
nil
{
...
...
请
注册
或
登录
后发表评论