切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
c0a3fff553f248033b8ed3881486ec55a2820069
1 个父辈
851929d6
暂存
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
45 行增加
和
18 行删除
pkg/application/staff_assess/adapter/assess_info.go
pkg/application/staff_assess/service/service.go
pkg/domain/evaluation_rule.go
pkg/application/staff_assess/adapter/assess_info.go
查看文件 @
c0a3fff
...
...
@@ -22,19 +22,3 @@ type AssessInfoResp struct {
DutyTime
string
`json:"dutyTime"`
//入职时间 //
AssessContent
[]
*
domain
.
StaffAssessContent
`json:"assessContent"`
//评估内容
}
type
AssessContent
struct
{
Category
string
`json:"category"`
//comment:"类别"
Name
string
`json:"name"`
// comment:"名称"
PromptTitle
string
`json:"promptTitle"`
//comment:"提示项标题"
PromptText
string
`json:"promptText"`
// comment:"提示项正文"
Rule
AssessContentRule
`json:"rules"`
//评定规则
Value
string
`json:"value"`
// 实际填写评定值
Remark
[]
domain
.
AssessContemtRemark
`json:"entryItems"`
// comment:"填写反馈"
}
type
AssessContentRule
struct
{
Types
int
`json:"types"`
//评估方式(0评级、1评分)
Rating
domain
.
Rating
`json:"rating"`
//评级
Score
domain
.
Score
`json:"score"`
//评分
}
...
...
pkg/application/staff_assess/service/service.go
查看文件 @
c0a3fff
...
...
@@ -540,7 +540,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application.
assessList
=
append
(
assessList
,
assessListTemp
...
)
}
if
v
.
LinkNodeType
==
domain
.
LinkNodeSuperiorAssessment
{
//
TODO
//
创建上级评估
stepSelfTemp
.
BeginTime
=
v
.
BeginTime
stepSelfTemp
.
EndTime
=
v
.
EndTime
stepSelfTemp
.
LinkNodeId
=
v
.
LinkNodeId
...
...
@@ -1623,7 +1623,7 @@ func (srv *StaffAssessServeice) getStaffDescrip(transactionContext application.T
UserName
:
userData
.
Name
,
CompanyName
:
companyData
.
Name
,
SupperUserName
:
""
,
DutyTime
:
userData
.
CreatedAt
.
Local
()
.
Format
(
"2006-01-02 15:04:05"
)
,
DutyTime
:
userData
.
EntryTime
,
}
for
_
,
v
:=
range
supperUserList
{
userInfo
.
SupperUserName
=
userInfo
.
SupperUserName
+
v
.
Name
+
" "
...
...
pkg/domain/evaluation_rule.go
查看文件 @
c0a3fff
package
domain
import
(
"errors"
"time"
)
...
...
@@ -55,6 +56,48 @@ type EvaluationRule struct {
DeletedAt
*
time
.
Time
`json:"deletedAt" comment:"删除时间"`
}
//根据评估填写的值,得出等级名称,
//如果 评估方式是评分,对评估填写的值 的小数点进行处理
//value 根据评估填写的值
func
(
rule
*
EvaluationRule
)
ScoreOrRating
(
value
*
string
)
(
string
,
error
)
{
switch
rule
.
Type
{
case
EvaluationTypeRating
:
return
rule
.
RatingValue
(
value
)
case
EvaluationTypeScore
:
return
rule
.
ScoreValue
(
value
)
}
return
""
,
errors
.
New
(
"rule.Type 错误"
)
}
//根据评估填写的值,得出等级名称,
func
(
rule
*
EvaluationRule
)
ScoreValue
(
value
*
string
)
(
string
,
error
)
{
// valueFloat, err := strconv.ParseFloat(*value, 64)
// if err != nil {
// return "", errors.New("评分填写的值错误")
// }
// if valueFloat < rule.Score.Min || valueFloat > rule.Score.Max {
// return "", errors.New("评分填写的值超出限制")
// }
valueDescrip
:=
""
// for _, v := range rule.Score.Levels {
// if valueFloat >= v.Start && valueFloat <= v.End {
// valueDescrip = v.Name
// }
// }
return
valueDescrip
,
nil
}
//根据评估填写的值,得出等级名称,
func
(
rule
*
EvaluationRule
)
RatingValue
(
value
*
string
)
(
string
,
error
)
{
for
_
,
v
:=
range
rule
.
Rating
.
Levels
{
if
v
.
Code
==
*
value
{
return
v
.
Name
,
nil
}
}
return
""
,
errors
.
New
(
"评估填写的值错误"
)
}
// GenerateSysRule 当前公司下的生成默认规则
func
GenerateSysRule
(
companyId
int64
)
*
EvaluationRule
{
levels
:=
make
([]
*
RatingLevel
,
0
)
...
...
请
注册
或
登录
后发表评论