切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
a24376fcf9ed7bf65443196c16122f0bdfba726a
1 个父辈
a46e26da
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
73 行增加
和
7 行删除
pkg/application/summary_evaluation/command/query_evaluation_list.go
pkg/application/summary_evaluation/service/service.go
pkg/domain/summary_evaluation.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/port/beego/routers/summary_evaluation_router.go
pkg/application/summary_evaluation/command/query_evaluation_list.go
查看文件 @
a24376f
package
command
// 查询执行人的
上级
评估列表
// 查询执行人的评估列表
type
QueryExecutorEvaluationList
struct
{
PageNumber
int
`json:"pageNumber"`
PageSize
int
`json:"pageSize"`
...
...
pkg/application/summary_evaluation/service/service.go
查看文件 @
a24376f
...
...
@@ -3,6 +3,7 @@ package service
import
(
"errors"
"fmt"
"strconv"
"strings"
"time"
...
...
@@ -1676,3 +1677,51 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
}
return
nil
}
// 获取现在待执行的综合自评
func
(
srv
*
SummaryEvaluationService
)
ListExecutorNowEvaluationSelf
(
param
*
command
.
QueryExecutorEvaluationList
)
(
map
[
string
]
interface
{},
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
StartTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
condition1
:=
map
[
string
]
interface
{}{
"types"
:
int
(
domain
.
EvaluationSelf
),
"targetUserId"
:
param
.
ExecutorId
,
"limit"
:
20
,
"beginTime"
:
time
.
Now
(),
"endTime"
:
time
.
Now
(),
"status"
:
string
(
domain
.
EvaluationUncompleted
),
}
//获取评估列表信息
cnt
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
condition1
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
listResult
:=
[]
map
[
string
]
string
{}
for
_
,
v
:=
range
evaluationList
{
item
:=
map
[
string
]
string
{
"summaryEvaluationId"
:
strconv
.
Itoa
(
v
.
Id
),
"cycleId"
:
strconv
.
Itoa
(
int
(
v
.
CycleId
)),
"cycleName"
:
v
.
CycleName
,
"evaluationStatus"
:
string
(
v
.
Status
),
"endTime"
:
v
.
EndTime
.
Local
()
.
Format
(
"2006-01-02 15:04:05"
),
"beginTime"
:
v
.
BeginTime
.
Local
()
.
Format
(
"2006-01-02 15:04:05"
),
}
listResult
=
append
(
listResult
,
item
)
}
result
:=
tool_funs
.
SimpleWrapGridMap
(
int64
(
cnt
),
listResult
)
return
result
,
nil
}
...
...
pkg/domain/summary_evaluation.go
查看文件 @
a24376f
...
...
@@ -39,11 +39,11 @@ type RatingCodeNumber struct {
type
EvaluationType
int
//综合评估类型
const
(
EvaluationSelf
EvaluationType
=
1
//自评
Evaluation360
EvaluationType
=
2
//360评估
EvaluationSuper
EvaluationType
=
3
//上级评估
EvaluationHrbp
EvaluationType
=
4
//人资评估
EvaluationFinish
EvaluationType
=
5
//评估考核结果 TODO
EvaluationSelf
EvaluationType
=
1
//自评
Evaluation360
EvaluationType
=
2
//360评估
EvaluationSuper
EvaluationType
=
3
//上级评估
EvaluationHrbp
EvaluationType
=
4
//人资评估
)
// 评估的填写状态
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
查看文件 @
a24376f
...
...
@@ -362,3 +362,20 @@ func (c *SummaryEvaluationController) ExportAllEvaluationSuper() {
c
.
Ctx
.
Output
.
Header
(
"Expires"
,
"0"
)
data
.
Write
(
c
.
Ctx
.
ResponseWriter
)
}
// 按周期获取上级评估列表
func
(
c
*
SummaryEvaluationController
)
ListExecutorEvaluationSelf
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
param
:=
&
command
.
QueryExecutorEvaluationList
{}
err
:=
c
.
BindJSON
(
param
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
param
.
CompanyId
=
int
(
userReq
.
CompanyId
)
param
.
ExecutorId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
ListExecutorNowEvaluationSelf
(
param
)
c
.
Response
(
data
,
err
)
}
...
...
pkg/port/beego/routers/summary_evaluation_router.go
查看文件 @
a24376f
...
...
@@ -31,7 +31,7 @@ func init() {
web
.
NSCtrlPost
(
"/target_user/evaluation-super"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetTargetUserEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-super/all"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ListAllEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-super/all/export"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ExportAllEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-self/now"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ListExecutorEvaluationSelf
),
//
)
web
.
AddNamespace
(
summaryNS
)
...
...
请
注册
或
登录
后发表评论