切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
b60f9e16fe4d022ac0e3f0a108b184cbfb2d9b5e
1 个父辈
13f4601b
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
字段类型变更
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
47 行增加
和
13 行删除
pkg/application/evaluation_project/project_service.go
pkg/application/summary_evaluation/adapter/evaluation_info.go
pkg/domain/evaluation_item_used.go
pkg/infrastructure/pg/models/evaluation_item_used.go
pkg/infrastructure/repository/pg_evaluation_item_used_repository.go
pkg/application/evaluation_project/project_service.go
查看文件 @
b60f9e1
...
...
@@ -604,13 +604,43 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo
func
(
rs
*
EvaluationProjectService
)
generateEvaluationItemUsed
(
transactionContext
application
.
TransactionContext
,
project
*
domain
.
EvaluationProject
)
error
{
// var itemUsedList []*domain.EvaluationItemUsed
// for _, v := range project.Template.LinkNodes {
// for _, v2 := range v.NodeContents {
// }
// }
// itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
var
itemUsedList
[]
*
domain
.
EvaluationItemUsed
nowTime
:=
time
.
Now
()
for
_
,
v
:=
range
project
.
Template
.
LinkNodes
{
for
i2
,
v2
:=
range
v
.
NodeContents
{
item
:=
domain
.
EvaluationItemUsed
{
Id
:
0
,
CompanyId
:
int
(
project
.
CompanyId
),
EvaluationProjectId
:
int
(
project
.
Id
),
NodeId
:
int
(
v
.
Id
),
NodeType
:
v
.
Type
,
SortBy
:
i2
,
Category
:
v2
.
Category
,
Name
:
v2
.
Name
,
PromptTitle
:
v2
.
PromptTitle
,
PromptText
:
v2
.
PromptText
,
EntryItems
:
v2
.
EntryItems
,
Weight
:
v2
.
Weight
,
Required
:
v2
.
Required
,
EvaluatorId
:
int
(
v2
.
EvaluatorId
),
CreatedAt
:
nowTime
,
UpdatedAt
:
nowTime
,
// RuleType: 0,
// Rule: *v2.Rule,
}
if
v2
.
Rule
!=
nil
{
item
.
RuleType
=
v2
.
Rule
.
Type
item
.
Rule
=
*
v2
.
Rule
}
itemUsedList
=
append
(
itemUsedList
,
&
item
)
}
}
itemUsedRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
err
:=
itemUsedRepo
.
BatchInsert
(
itemUsedList
)
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
return
nil
}
...
...
pkg/application/summary_evaluation/adapter/evaluation_info.go
查看文件 @
b60f9e1
...
...
@@ -22,7 +22,7 @@ type EvaluationItemAdapter struct {
Name
string
`json:"name"`
//名称
PromptTitle
string
`json:"promptTitle"`
//提示项标题
PromptText
string
`json:"promptText"`
//提示项正文
EntryItems
[]
domain
.
EntryItem
`json:"entryItems"`
//填写的反馈
EntryItems
[]
*
domain
.
EntryItem
`json:"entryItems"`
//填写的反馈
RuleType
int
`json:"ruleType"`
//评估方式(0评级、1评分)
Rule
domain
.
EvaluationRule
`json:"rule"`
//评估的选项规则
Weight
float64
`json:"weight"`
//"权重"
...
...
pkg/domain/evaluation_item_used.go
查看文件 @
b60f9e1
...
...
@@ -10,17 +10,18 @@ type EvaluationItemUsed struct {
CompanyId
int
//公司id
EvaluationProjectId
int
//对应的项目id
NodeId
int
//填写评估评估节点对应id
NodeType
string
//填写评估评估节点对应类型同evaluation_template.go->LinkNode.Type,
NodeType
int
//填写评估评估节点对应类型同evaluation_template.go->LinkNode.Type,
SortBy
int
//排序
Category
string
//类别
Name
string
//名称
PromptTitle
string
//提示项标题
PromptText
string
//提示项正文
EntryItems
[]
EntryItem
//填写的反馈
EntryItems
[]
*
EntryItem
//填写的反馈
RuleType
int
//评估方式(0评级、1评分)
Rule
EvaluationRule
//评估的选项规则
Weight
float64
//"权重"
Required
int
// 必填项
EvaluatorId
int
// 项目评估人ID ( 0=无评估人、-1=HRBP )
CreatedAt
time
.
Time
//数据创建时间
UpdatedAt
time
.
Time
//数据更新时间
}
...
...
pkg/infrastructure/pg/models/evaluation_item_used.go
查看文件 @
b60f9e1
...
...
@@ -13,15 +13,16 @@ type EvaluationItemUsed struct {
CompanyId
int
//公司id
EvaluationProjectId
int
//对应的项目id
NodeId
int
//填写评估评估节点对应id
NodeType
string
//填写评估评估节点对应类型同evaluation_template.go->LinkNode.Type,
NodeType
int
//填写评估评估节点对应类型同evaluation_template.go->LinkNode.Type,
SortBy
int
//排序
Category
string
//类别
Name
string
//名称
PromptTitle
string
//提示项标题
PromptText
string
//提示项正文
EntryItems
[]
domain
.
EntryItem
//填写的反馈
EntryItems
[]
*
domain
.
EntryItem
//填写的反馈
RuleType
int
//评估方式(0评级、1评分)
Rule
domain
.
EvaluationRule
//评估的选项规则
EvaluatorId
int
// 项目评估人ID ( 0=无评估人、-1=HRBP )
Weight
float64
//"权重"
Required
int
// 必填项
CreatedAt
time
.
Time
//数据创建时间
...
...
pkg/infrastructure/repository/pg_evaluation_item_used_repository.go
查看文件 @
b60f9e1
...
...
@@ -35,6 +35,7 @@ func (repo *EvaluationItemUsedRepository) TransformToDomain(d *models.Evaluation
Required
:
d
.
Required
,
CreatedAt
:
d
.
CreatedAt
,
UpdatedAt
:
d
.
UpdatedAt
,
EvaluatorId
:
d
.
EvaluatorId
,
}
}
...
...
@@ -59,6 +60,7 @@ func (repo *EvaluationItemUsedRepository) BatchInsert(items []*domain.Evaluation
Required
:
v
.
Required
,
CreatedAt
:
v
.
CreatedAt
,
UpdatedAt
:
v
.
UpdatedAt
,
EvaluatorId
:
v
.
EvaluatorId
,
}
mList
=
append
(
mList
,
&
m
)
}
...
...
请
注册
或
登录
后发表评论