切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
9ea0d7be425c6aef420d054728f32e90c5039ab8
1 个父辈
22fc77c7
1. 考核结果 回填值优化
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
332 行增加
和
117 行删除
pkg/application/summary_evaluation/service/service.go
pkg/domain/evaluation_item_used.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/port/beego/routers/summary_evaluation_router.go
pkg/application/summary_evaluation/service/service.go
查看文件 @
9ea0d7b
...
...
@@ -368,6 +368,7 @@ func (srv *SummaryEvaluationService) buildSummaryItemValue(itemList []*domain.Ev
item
.
Value
=
value
.
Value
item
.
Remark
=
value
.
Remark
item
.
Rating
=
value
.
Rating
item
.
EvaluatorName
=
value
.
Executor
.
UserName
}
itemValues
=
append
(
itemValues
,
item
)
}
...
...
@@ -463,24 +464,14 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
TotalScore
:
evaluationData
.
TotalScore
,
}
//获取用户信息
companyRepo
:=
factory
.
CreateCompanyRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
companyData
,
err
:=
companyRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
evaluationData
.
CompanyId
,
})
companyRepo
:=
factory
.
CreateCompanyRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
userRepo
:=
factory
.
CreateUserRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
companyData
,
err
:=
companyRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
evaluationData
.
CompanyId
})
if
err
!=
nil
{
return
result
}
userData
,
err
:=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
evaluationData
.
TargetUser
.
UserId
,
})
userData
,
err
:=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
evaluationData
.
TargetUser
.
UserId
})
if
err
!=
nil
{
return
result
}
...
...
@@ -488,16 +479,13 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
result
.
CompanyLogo
=
companyData
.
Logo
result
.
CompanyName
=
companyData
.
Name
if
userData
.
ParentId
<=
0
{
return
result
}
pUserData
,
err
:=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
userData
.
ParentId
,
})
if
err
!=
nil
{
return
result
if
userData
.
ParentId
>
0
{
pUserData
,
err
:=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
userData
.
ParentId
})
if
err
!=
nil
{
return
result
}
result
.
SupperUser
=
pUserData
.
Name
}
result
.
SupperUser
=
pUserData
.
Name
return
result
}
...
...
@@ -1444,39 +1432,110 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command.
return
result
,
nil
}
// 员工确认综评考核结果
func
(
srv
*
SummaryEvaluationService
)
ConfirmScoreSuperEvaluation
(
param
*
command
.
ConfirmScore
)
error
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
// ConfirmScoreEvaluation 员工确认考核结果
func
(
srv
*
SummaryEvaluationService
)
ConfirmScoreEvaluation
(
param
*
command
.
ConfirmScore
)
error
{
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
param
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
StartTransaction
();
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
return
err
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
}()
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
evaluationData
,
err
:=
evaluationRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
param
.
SummaryEvaluationId
,
})
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
// 考核结果
result
,
err
:=
evaluationRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
param
.
SummaryEvaluationId
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
if
evaluationData
.
Types
!=
domain
.
EvaluationSuper
{
if
result
.
Types
!=
domain
.
EvaluationFinish
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"操作方式错误"
)
}
if
evaluationData
.
TargetUser
.
UserId
!=
param
.
UserId
{
if
result
.
TargetUser
.
UserId
!=
param
.
UserId
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"没有操作权限"
)
}
if
evaluationData
.
Status
==
domain
.
EvaluationUncompleted
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"上级还未正式提交评估内容"
)
if
result
.
CheckResult
==
domain
.
EvaluationCheckCompleted
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"考核结果已确认过了!"
)
}
evaluationData
.
CheckResult
=
domain
.
EvaluationCheckCompleted
err
=
evaluationRepo
.
Save
(
evaluationData
)
if
result
.
Status
==
domain
.
EvaluationUncompleted
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
"前面流程暂未完成提交评估内容"
)
}
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"companyId"
:
result
.
CompanyId
,
"cycleId"
:
result
.
CycleId
,
"targetUserId"
:
result
.
TargetUser
.
UserId
,
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
var
super
*
domain
.
SummaryEvaluation
// 上级评估
for
i
:=
range
evaluationList
{
it
:=
evaluationList
[
i
]
if
it
.
Types
==
domain
.
EvaluationSuper
{
super
=
it
break
}
}
// 评估内容和值
var
itemList
[]
*
domain
.
EvaluationItemUsed
var
itemValues
[]
*
domain
.
SummaryEvaluationValue
// 获取自评模板内容
_
,
itemList
,
err
=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
result
.
EvaluationProjectId
,
"nodeType"
:
domain
.
LinkNodeSelfAssessment
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 按评估项优先级顺序(已确认考核结果 ->上级评估 ->HR或360评估或自评)
if
super
!=
nil
{
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
super
.
Id
})
// 获取已填写的评估内容
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
else
{
// 评估项ID(除考核结果和上级)
var
evaluationIds
=
make
([]
int
,
0
)
for
i
:=
range
evaluationList
{
it
:=
evaluationList
[
i
]
if
it
.
Types
==
domain
.
EvaluationSelf
||
it
.
Types
==
domain
.
Evaluation360
||
it
.
Types
==
domain
.
EvaluationHrbp
{
evaluationIds
=
append
(
evaluationIds
,
it
.
Id
)
}
}
if
len
(
evaluationIds
)
>
0
{
// 获取已填写的评估内容
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationIdList"
:
evaluationIds
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 更新填写值
itemValues
,
err
=
srv
.
updateItemValuePriority
(
result
,
itemList
,
itemValues
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
for
i
:=
range
itemValues
{
err
=
itemValueRepo
.
Save
(
itemValues
[
i
])
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
}
}
err
=
result
.
EvaluationTotalScore
(
itemValues
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
result
.
CheckResult
=
domain
.
EvaluationCheckCompleted
err
=
evaluationRepo
.
Save
(
result
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
...
...
@@ -1486,9 +1545,168 @@ func (srv *SummaryEvaluationService) ConfirmScoreSuperEvaluation(param *command.
return
nil
}
// 按照周期和被评估的人 获取上级评估详情
//// 按评估项优先级顺序(已确认考核结果 ->上级评估 ->HR或360评估 ->自评)
//func (srv *SummaryEvaluationService) getEvaluationResult(list []*domain.SummaryEvaluation) (*domain.SummaryEvaluation, []*domain.SummaryEvaluation) {
// var finish *domain.SummaryEvaluation // 绩效考核结果项(已完成确认)
// var result *domain.SummaryEvaluation // 绩效考核结果项
// var super *domain.SummaryEvaluation // 上级评估
// var self *domain.SummaryEvaluation // 我的自评
// var hr360 = make([]*domain.SummaryEvaluation, 0) // 评估项
//
// for i := range list {
// it := list[i]
//
// if it.Types == domain.EvaluationFinish {
// result = it
// if it.CheckResult == domain.EvaluationCheckCompleted { // 绩效结果已确认
// finish = it
// break
// }
// } else if it.Types == domain.EvaluationSuper {
// super = it
// } else if it.Types == domain.EvaluationSelf {
// self = it
// } else if it.Types == domain.Evaluation360 || it.Types == domain.EvaluationHrbp {
// hr360 = append(hr360, it)
// }
// }
// if finish != nil {
// return result, []*domain.SummaryEvaluation{finish}
// }
//
// if super != nil {
// return result, []*domain.SummaryEvaluation{super}
// }
//
// if len(hr360) > 0 {
// return result, hr360
// }
//
// if self != nil {
// return result, []*domain.SummaryEvaluation{self}
// }
//
// return result, []*domain.SummaryEvaluation{}
//}
//func (srv *SummaryEvaluationService) findSummaryEvaluationByType(
// repo domain.SummaryEvaluationRepository,
// param *command.QueryEvaluation,
// eType domain.EvaluationType) ([]*domain.SummaryEvaluation, error) {
// p := map[string]interface{}{
// "companyId": param.CompanyId,
// "cycleId": param.CycleId,
// "targetUserId": param.TargetUserId,
// }
// if eType == domain.EvaluationFinish || eType == domain.EvaluationSuper || eType == domain.EvaluationSelf {
// p["types"] = eType
// p["limit"] = 1
// } else if eType == domain.Evaluation360 || eType == domain.EvaluationHrbp {
// p["typesList"] = []int{int(domain.Evaluation360), int(domain.EvaluationHrbp)}
// }
// _, list, err := repo.Find(p)
// if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// return list, nil
//}
//func (srv *SummaryEvaluationService) findEvaluationItemValue(
// repo domain.SummaryEvaluationRepository,
// valueRepo domain.SummaryEvaluationValueRepository,
// param *command.QueryEvaluation) (domain.EvaluationType, []*domain.SummaryEvaluationValue, error) {
// var eType = domain.EvaluationSuper
// list, err := srv.findSummaryEvaluationByType(repo, param, eType)
// if err != nil {
// return eType, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// if len(list) == 0 {
// eType = domain.Evaluation360
// list, err = srv.findSummaryEvaluationByType(repo, param, eType)
// if err != nil {
// return eType, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// }
// if len(list) == 0 {
// eType = domain.EvaluationSelf
// list, err = srv.findSummaryEvaluationByType(repo, param, eType)
// if err != nil {
// return eType, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// }
// if len(list) == 0 {
// return eType, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有找到符合条件的数据")
// }
//
// evaluationIds := make([]int, 0)
// for _, v := range list {
// evaluationIds = append(evaluationIds, v.Id)
// }
// // 获取已填写的评估内容
// _, itemValues, err := valueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds})
// if err != nil {
// return eType, nil, err
// }
// return eType, itemValues, nil
//}
//
// 处理优先级
func
(
srv
*
SummaryEvaluationService
)
updateItemValuePriority
(
result
*
domain
.
SummaryEvaluation
,
itemList
[]
*
domain
.
EvaluationItemUsed
,
itemValues
[]
*
domain
.
SummaryEvaluationValue
)
([]
*
domain
.
SummaryEvaluationValue
,
error
)
{
tempSelf
:=
map
[
int
]
*
domain
.
SummaryEvaluationValue
{}
temp360
:=
map
[
int
]
*
domain
.
SummaryEvaluationValue
{}
tempHRBP
:=
map
[
int
]
*
domain
.
SummaryEvaluationValue
{}
for
i
:=
range
itemValues
{
it
:=
itemValues
[
i
]
if
it
.
Types
==
domain
.
EvaluationSelf
{
tempSelf
[
it
.
EvaluationItemId
]
=
it
}
else
if
it
.
Types
==
domain
.
Evaluation360
{
temp360
[
it
.
EvaluationItemId
]
=
it
}
else
if
it
.
Types
==
domain
.
EvaluationHrbp
{
tempHRBP
[
it
.
EvaluationItemId
]
=
it
}
}
nowTime
:=
time
.
Now
()
var
newItemValues
=
make
([]
*
domain
.
SummaryEvaluationValue
,
0
)
for
i
:=
range
itemList
{
it
:=
itemList
[
i
]
var
tempValue
domain
.
SummaryEvaluationValue
tempValue
.
SetBlankValue
(
result
,
it
)
if
it
.
EvaluatorId
==
0
{
if
v
,
ok
:=
tempSelf
[
it
.
Id
];
ok
{
tempValue
=
*
v
}
tempValue
.
Types
=
domain
.
EvaluationSelf
}
else
if
it
.
EvaluatorId
==
-
1
{
if
v
,
ok
:=
tempHRBP
[
it
.
Id
];
ok
{
tempValue
=
*
v
}
tempValue
.
Types
=
domain
.
EvaluationHrbp
}
else
if
it
.
EvaluatorId
>
0
{
if
v
,
ok
:=
temp360
[
it
.
Id
];
ok
{
tempValue
=
*
v
}
tempValue
.
Types
=
domain
.
Evaluation360
}
// 清理ID
tempValue
.
Id
=
0
tempValue
.
CreatedAt
=
nowTime
tempValue
.
UpdatedAt
=
nowTime
newItemValues
=
append
(
newItemValues
,
&
tempValue
)
}
return
newItemValues
,
nil
}
// GetTargetUserEvaluationSuper 按照周期和被评估的人 获取上级评估详情
func
(
srv
*
SummaryEvaluationService
)
GetTargetUserEvaluationSuper
(
param
*
command
.
QueryEvaluation
)
(
*
adapter
.
EvaluationInfoSuperAdapter
,
error
)
{
transactionContext
,
err
:=
factory
.
CreateTransactionContext
(
nil
)
transactionContext
,
err
:=
factory
.
ValidateStartTransaction
(
param
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
}
...
...
@@ -1498,94 +1716,94 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
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
,
})
permissionRepository
:=
factory
.
CreatePermissionRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
// 获取权限配置
_
,
permissionList
,
err
:=
permissionRepository
.
Find
(
map
[
string
]
interface
{}{
"companyId"
:
param
.
CompanyId
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
evaluationRepo
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
itemValueRepo
:=
factory
.
CreateSummaryEvaluationValueRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
_
,
evaluationList
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"
limit"
:
1
,
"
companyId"
:
param
.
CompanyId
,
"cycleId"
:
param
.
CycleId
,
"targetUserId"
:
param
.
TargetUserId
,
"types"
:
domain
.
EvaluationSuper
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
len
(
evaluationList
)
==
0
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"没有找到符合条件的数据"
)
}
evaluationData
:=
evaluationList
[
0
]
if
evaluationData
.
CompanyId
!=
param
.
CompanyId
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
"没有操作权限"
)
var
result
*
domain
.
SummaryEvaluation
// 绩效考核结果项
var
super
*
domain
.
SummaryEvaluation
// 上级评估
for
i
:=
range
evaluationList
{
it
:=
evaluationList
[
i
]
if
it
.
Types
==
domain
.
EvaluationFinish
{
result
=
it
continue
}
if
it
.
Types
==
domain
.
EvaluationSuper
{
super
=
it
continue
}
}
_
,
itemList
,
err
:=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
evaluationData
.
EvaluationProjectId
,
"nodeType"
:
int
(
domain
.
LinkNodeSelfAssessment
),
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
if
result
==
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"没有找到符合条件的数据"
)
}
//获取已填写的评估内容
_
,
itemValues
,
err
:=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
evaluationData
.
Id
,
})
// 评估内容和值
var
itemList
[]
*
domain
.
EvaluationItemUsed
var
itemValues
[]
*
domain
.
SummaryEvaluationValue
// 获取自评模板内容
_
,
itemList
,
err
=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
result
.
EvaluationProjectId
,
"nodeType"
:
domain
.
LinkNodeSelfAssessment
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
len
(
itemValues
)
==
0
{
//上级还未填写评估,获取 360 ,人资评估
_
,
evaluationListOther
,
err
:=
evaluationRepo
.
Find
(
map
[
string
]
interface
{}{
"typesList"
:
[]
int
{
int
(
domain
.
Evaluation360
),
int
(
domain
.
EvaluationHrbp
)},
"targetUserId"
:
evaluationData
.
TargetUser
.
UserId
,
"cycleId"
:
evaluationData
.
CycleId
,
})
// 按评估项优先级顺序(已确认考核结果 ->上级评估 ->HR或360评估或自评)
if
result
.
CheckResult
==
domain
.
EvaluationCheckCompleted
{
/* 已完成考核*/
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
result
.
Id
})
// 获取已填写的评估内容
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
evaluationIds
:=
[]
int
{}
for
_
,
v
:=
range
evaluationListOther
{
evaluationIds
=
append
(
evaluationIds
,
v
.
Id
)
}
if
len
(
evaluationIds
)
>
0
{
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationIdList"
:
evaluationIds
,
})
}
else
{
if
super
!=
nil
{
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationId"
:
super
.
Id
})
// 获取已填写的评估内容
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
else
{
// 评估项ID(除考核结果和上级)
var
evaluationIds
=
make
([]
int
,
0
)
for
i
:=
range
evaluationList
{
it
:=
evaluationList
[
i
]
if
it
.
Types
==
domain
.
EvaluationSelf
||
it
.
Types
==
domain
.
Evaluation360
||
it
.
Types
==
domain
.
EvaluationHrbp
{
evaluationIds
=
append
(
evaluationIds
,
it
.
Id
)
}
}
if
len
(
evaluationIds
)
>
0
{
// 获取已填写的评估内容
_
,
itemValues
,
err
=
itemValueRepo
.
Find
(
map
[
string
]
interface
{}{
"summaryEvaluationIdList"
:
evaluationIds
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 更新填写值
itemValues
,
err
=
srv
.
updateItemValuePriority
(
result
,
itemList
,
itemValues
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
}
}
evaluationBase
:=
srv
.
getSummaryEvaluation
(
transactionContext
,
evaluationData
)
// 基础数据
evaluationBase
:=
srv
.
getSummaryEvaluation
(
transactionContext
,
result
)
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
//组合 评估填写的值和评估项
// 组合 评估填写的值和评估项
itemValuesAdapter
:=
srv
.
buildSummaryItemValue
(
itemList
,
itemValues
)
codeList
:=
[]
*
adapter
.
LevalCodeCount
{}
codeList
:=
make
([]
*
adapter
.
LevalCodeCount
,
0
)
codeMap
:=
map
[
string
]
*
adapter
.
LevalCodeCount
{}
for
i
,
v
:=
range
itemValuesAdapter
{
if
len
(
permissionList
)
>
0
{
if
permissionList
[
0
]
.
OptEvalScore
==
domain
.
PermissionOff
&&
v
.
EvaluatorId
>
0
{
itemValuesAdapter
[
i
]
.
ForbidEdit
=
true
}
if
permissionList
[
0
]
.
OptHrScore
==
domain
.
PermissionOff
&&
v
.
EvaluatorId
<
0
{
itemValuesAdapter
[
i
]
.
ForbidEdit
=
true
}
}
for
_
,
v
:=
range
itemValuesAdapter
{
if
v
.
Weight
==
0
{
if
_
,
ok
:=
codeMap
[
v
.
Value
];
!
ok
{
code
:=
&
adapter
.
LevalCodeCount
{
...
...
@@ -1601,12 +1819,12 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
}
}
result
:=
adapter
.
EvaluationInfoSuperAdapter
{
eiAdapter
:=
adapter
.
EvaluationInfoSuperAdapter
{
EvaluationBaseAdapter
:
evaluationBase
,
LevelCount
:
codeList
,
EvaluationItems
:
itemValuesAdapter
,
}
return
&
result
,
nil
return
&
eiAdapter
,
nil
}
// 获取周期综合评估下,周期评估列表
...
...
@@ -1834,10 +2052,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
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
())
return
nil
,
err
}
defer
func
()
{
_
=
transactionContext
.
RollbackTransaction
()
...
...
pkg/domain/evaluation_item_used.go
查看文件 @
9ea0d7b
...
...
@@ -21,7 +21,7 @@ type EvaluationItemUsed struct {
Rule
EvaluationRule
//评估的选项规则
Weight
float64
//"权重"
Required
int
//必填项 同 NodeContent.Required
EvaluatorId
int
//项目评估人ID ( 0=无评估人、-1=HRBP、 >0
=
员工的id )
EvaluatorId
int
//项目评估人ID ( 0=无评估人、-1=HRBP、 >0 员工的id )
CreatedAt
time
.
Time
//数据创建时间
UpdatedAt
time
.
Time
//数据更新时间
}
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
查看文件 @
9ea0d7b
...
...
@@ -288,8 +288,8 @@ func (c *SummaryEvaluationController) ListExecutorEvaluationSuper() {
c
.
Response
(
data
,
err
)
}
// 员工确认评估分数
func
(
c
*
SummaryEvaluationController
)
ConfirmScoreSuperEvaluation
()
{
// ConfirmScoreEvaluation 员工确认评估分数
func
(
c
*
SummaryEvaluationController
)
ConfirmScoreEvaluation
()
{
srv
:=
service
.
NewSummaryEvaluationService
()
param
:=
&
command
.
ConfirmScore
{}
err
:=
c
.
BindJSON
(
param
)
...
...
@@ -300,7 +300,7 @@ func (c *SummaryEvaluationController) ConfirmScoreSuperEvaluation() {
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
param
.
UserId
=
int
(
userReq
.
UserId
)
err
=
srv
.
ConfirmScore
Super
Evaluation
(
param
)
err
=
srv
.
ConfirmScoreEvaluation
(
param
)
c
.
Response
(
nil
,
err
)
}
...
...
pkg/port/beego/routers/summary_evaluation_router.go
查看文件 @
9ea0d7b
...
...
@@ -27,7 +27,7 @@ func init() {
web
.
NSCtrlPost
(
"/evaluation-super"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-super/edit"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EditEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-super/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ListExecutorEvaluationSuper
),
web
.
NSCtrlPost
(
"/evaluation-super/confirm"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ConfirmScore
Super
Evaluation
),
web
.
NSCtrlPost
(
"/evaluation-super/confirm"
,
(
*
controllers
.
SummaryEvaluationController
)
.
ConfirmScoreEvaluation
),
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
),
...
...
请
注册
或
登录
后发表评论