切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
04c7023d4fef39ac48297e1cc701b983f6e18b9e
1 个父辈
cc9bba18
修改 评估值的校验处理
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
pkg/domain/staff_assess_content.go
pkg/domain/staff_assess_content.go
查看文件 @
04c7023
...
...
@@ -7,7 +7,7 @@ import (
"time"
)
//填写的评估内容
//
填写的评估内容
type
StaffAssessContent
struct
{
Id
int
`json:"id"`
//id
StaffAssessId
int
`json:"staffAssessId"`
//用户需要的评估项id
...
...
@@ -36,8 +36,8 @@ type AssessContemtRemark struct {
RemarkText
string
`json:"remarkText"`
// comment:"填写文本内容"
}
//TransformValue
//根据规则 rule 转换评填写的值
// TransformValue
// 根据规则 rule 转换评填写的值
func
(
content
*
StaffAssessContent
)
TransformValue
()
error
{
switch
content
.
Rule
.
Type
{
case
EvaluationTypeRating
:
...
...
@@ -77,10 +77,10 @@ func (content *StaffAssessContent) scoreValue() error {
fStr
:=
fmt
.
Sprintf
(
"%%.%df"
,
rule
.
Score
.
DecimalPlaces
)
valueStr
:=
fmt
.
Sprintf
(
fStr
,
valueFloat
)
content
.
Value
=
valueStr
if
rule
.
Score
.
IntervalState
==
0
{
// 未开启按分数子区间匹配等级
return
nil
}
//if rule.Score.IntervalState == 0 {
// 未开启按分数子区间匹配等级
// return nil
//}
for
_
,
v
:=
range
rule
.
Score
.
Levels
{
if
valueFloat
<
v
.
Start
||
valueFloat
>
v
.
End
{
continue
...
...
@@ -90,7 +90,7 @@ func (content *StaffAssessContent) scoreValue() error {
content
.
ReteResult
=
v
.
Name
return
nil
}
return
errors
.
New
(
"评分填写的值错误"
)
return
nil
}
//type StaffAssessContentSort []*StaffAssessContent
...
...
请
注册
或
登录
后发表评论