切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
e1c5c426df9861e0714b62cb075f66086c939e08
1 个父辈
b6f8d458
master
...
dev-pushdata
dev-tangxvhui
dev-zhengzhou
test
v1.3.2-fix
v1.4.0
v2.2.0-fix
20230410
20230403
20230331
20230324
20230315
v2.2.0
v2.0.0
v1.3.2
v1.3.2-fix
v1.3.1
v1.3.0
v1.2.4
1. 优化hrbp 和 360综评接口
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
83 行增加
和
29 行删除
pkg/application/summary_evaluation/command/get_evaluation.go
pkg/application/summary_evaluation/service/service2.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/port/beego/routers/summary_evaluation_router.go
pkg/application/summary_evaluation/command/get_evaluation.go
查看文件 @
e1c5c42
...
...
@@ -26,14 +26,20 @@ type QueryEvaluation360 struct {
CompanyId
int
`json:"-"`
// 公司ID
}
// QueryEvaluationHRBPMy [HRBP] 对 [目标用户] 进行评估
type
QueryEvaluationHRBPMy
struct
{
SummaryEvaluationId
int
`json:"summaryEvaluationId,string"`
CompanyId
int
`json:"-"`
// 公司ID
}
// QueryEvaluationHRBP [HRBP] 对 [目标用户]进行评估,状态已完成
type
QueryEvaluationHRBP
struct
{
//SummaryEvaluationId int `json:"summaryEvaluationId,string"`
CycleId
int
`json:"cycleId,string"`
// 周期ID
TargetUserId
int
`json:"targetUserId,string"`
// 目标人ID
CompanyId
int
`json:"-"`
// 公司ID
}
// 获取上级评估详情
//
QueryEvaluationSuper
获取上级评估详情
type
QueryEvaluationSuper
struct
{
SummaryEvaluationId
int
`json:"summaryEvaluationId,string"`
CompanyId
int
`json:"-"`
...
...
pkg/application/summary_evaluation/service/service2.go
查看文件 @
e1c5c42
...
...
@@ -249,8 +249,8 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua
return
&
itemValuesAdapter
,
nil
}
// GetEvaluation360All 获取360综评详情-上级综评(所有的评估人,评估内容)
func
(
srv
*
SummaryEvaluationService
)
GetEvaluation360All
(
param
*
command
.
QueryEvaluation360
)
(
*
[]
adapter
.
EvaluationItemAdapter
,
error
)
{
// GetEvaluation360Complete 获取360综评详情(他人评估目标用户)(已完成状态)
func
(
srv
*
SummaryEvaluationService
)
GetEvaluation360Complete
(
param
*
command
.
QueryEvaluation360
)
(
*
[]
adapter
.
EvaluationItemAdapter
,
error
)
{
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
param
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -263,12 +263,13 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
_
,
evaluations
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"limit"
:
1
,
"companyId"
:
param
.
CompanyId
,
"cycleId"
:
param
.
CycleId
,
"targetUserId"
:
param
.
TargetUserId
,
"types"
:
domain
.
Evaluation360
},
)
"types"
:
domain
.
Evaluation360
,
"status"
:
domain
.
EvaluationCompleted
,
"limit"
:
99999
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
@@ -583,7 +584,53 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
}
// GetEvaluationHRBP 获取人资综评详情
func
(
srv
*
SummaryEvaluationService
)
GetEvaluationHRBP
(
param
*
command
.
QueryEvaluationHRBP
)
(
*
[]
adapter
.
EvaluationItemAdapter
,
error
)
{
func
(
srv
*
SummaryEvaluationService
)
GetEvaluationHRBP
(
param
*
command
.
QueryEvaluationHRBPMy
)
(
*
[]
adapter
.
EvaluationItemAdapter
,
error
)
{
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
param
)
if
err
!=
nil
{
return
nil
,
err
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
sEvaluation
,
err
:=
evaluationRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
param
.
SummaryEvaluationId
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 自评评估内容(自评模板、筛选项目评估人)
_
,
itemList
,
err
:=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
sEvaluation
.
EvaluationProjectId
,
"nodeType"
:
domain
.
LinkNodeSelfAssessment
,
"evaluatorId"
:
-
1
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 评估内容对应的分数
_
,
itemValues
,
err
:=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
sEvaluation
.
Id
})
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
())
}
itemValuesAdapter
:=
srv
.
buildSummaryItemValue
(
itemList
,
itemValues
)
for
i
:=
range
itemValuesAdapter
{
// 评估人名称赋值
itemValuesAdapter
[
i
]
.
EvaluatorName
=
sEvaluation
.
Executor
.
UserName
}
return
&
itemValuesAdapter
,
nil
}
// GetEvaluationHRBPComplete 获取人资综评详情(已完成状态)
func
(
srv
*
SummaryEvaluationService
)
GetEvaluationHRBPComplete
(
param
*
command
.
QueryEvaluationHRBP
)
(
*
[]
adapter
.
EvaluationItemAdapter
,
error
)
{
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
param
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -597,13 +644,13 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
_
,
evaluations
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"limit"
:
1
,
"limit"
:
99999
,
"companyId"
:
param
.
CompanyId
,
"cycleId"
:
param
.
CycleId
,
"targetUserId"
:
param
.
TargetUserId
,
"status"
:
domain
.
EvaluationCompleted
,
"types"
:
domain
.
EvaluationHrbp
},
)
// sEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
@@ -653,21 +700,6 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu
itemValuesAdapter
[
i
]
.
EvaluatorName
=
executor
.
UserName
}
}
//result := adapter.EvaluationInfoAdapter{
// SummaryEvaluationId: sEvaluation.Id,
// CycleId: int(sEvaluation.CycleId),
// CycleName: sEvaluation.CycleName,
// EvaluationProjectId: sEvaluation.EvaluationProjectId,
// EvaluationProjectName: sEvaluation.EvaluationProjectName,
// LinkNodeId: sEvaluation.NodeId,
// BeginTime: sEvaluation.BeginTime.Format("2006-01-02 15:04:05"),
// EndTime: sEvaluation.EndTime.Format("2006-01-02 15:04:05"),
// TargetUserId: sEvaluation.TargetUser.UserId,
// TargetUserName: sEvaluation.TargetUser.UserName,
// Status: string(sEvaluation.Status),
// EvaluationItems: itemValuesAdapter,
//}
return
&
itemValuesAdapter
,
nil
}
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
查看文件 @
e1c5c42
...
...
@@ -144,7 +144,7 @@ func (c *SummaryEvaluationController) GetEvaluation360() {
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetEvaluation360
All
()
{
func
(
c
*
SummaryEvaluationController
)
GetEvaluation360
Complete
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
in
:=
&
command
.
QueryEvaluation360
{}
err
:=
c
.
BindJSON
(
in
)
...
...
@@ -155,7 +155,7 @@ func (c *SummaryEvaluationController) GetEvaluation360All() {
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
in
.
CompanyId
=
int
(
userReq
.
CompanyId
)
data
,
err
:=
srv
.
GetEvaluation360
All
(
in
)
data
,
err
:=
srv
.
GetEvaluation360
Complete
(
in
)
c
.
Response
(
data
,
err
)
}
...
...
@@ -193,7 +193,7 @@ func (c *SummaryEvaluationController) EvaluationHRBPList() {
func
(
c
*
SummaryEvaluationController
)
GetEvaluationHRBP
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
in
:=
&
command
.
QueryEvaluationHRBP
{}
in
:=
&
command
.
QueryEvaluationHRBP
My
{}
err
:=
c
.
BindJSON
(
in
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
...
...
@@ -206,6 +206,21 @@ func (c *SummaryEvaluationController) GetEvaluationHRBP() {
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetEvaluationHRBPComplete
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
in
:=
&
command
.
QueryEvaluationHRBP
{}
err
:=
c
.
BindJSON
(
in
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
in
.
CompanyId
=
int
(
userReq
.
CompanyId
)
data
,
err
:=
srv
.
GetEvaluationHRBPComplete
(
in
)
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
EditEvaluationHRBP
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
in
:=
&
command
.
EditEvaluationValue
{}
...
...
pkg/port/beego/routers/summary_evaluation_router.go
查看文件 @
e1c5c42
...
...
@@ -16,10 +16,11 @@ func init() {
web
.
NSCtrlPost
(
"/evaluation-self"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationSelf
),
web
.
NSCtrlPost
(
"/evaluation-self/edit"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EditEvaluationSelf
),
web
.
NSCtrlPost
(
"/evaluation-360"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluation360
),
web
.
NSCtrlPost
(
"/evaluation-360all"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluation360
All
),
web
.
NSCtrlPost
(
"/evaluation-360all"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluation360
Complete
),
web
.
NSCtrlPost
(
"/evaluation-360/edit"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EditEvaluation360
),
web
.
NSCtrlPost
(
"/evaluation-360/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
Evaluation360List
),
web
.
NSCtrlPost
(
"/evaluation-hr"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationHRBP
),
web
.
NSCtrlPost
(
"/evaluation-hrAll"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationHRBPComplete
),
web
.
NSCtrlPost
(
"/evaluation-hr/edit"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EditEvaluationHRBP
),
web
.
NSCtrlPost
(
"/evaluation-hr/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EvaluationHRBPList
),
web
.
NSCtrlPost
(
"/self/summary"
,
(
*
controllers
.
SummaryEvaluationController
)
.
CountEvaluationSelfLevel
),
...
...
请
注册
或
登录
后发表评论