作者 郑周

添加、更新模板

... ... @@ -34,7 +34,7 @@ func (rs *EvaluationTemplateService) Create(in *command.CreateTemplateCommand) (
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if count > 0 {
return nil, application.ThrowError(application.BUSINESS_ERROR, "名称已存在")
return nil, application.ThrowError(application.BUSINESS_ERROR, "已存在相同名称的评估模板")
}
linkNodes := make([]*domain.LinkNode, 0)
... ... @@ -44,30 +44,35 @@ func (rs *EvaluationTemplateService) Create(in *command.CreateTemplateCommand) (
Id: sid + 1,
Type: domain.LinkNodeSelfAssessment,
Name: "填写自评反馈",
NodeContents: make([]*domain.NodeContent, 0),
KpiCycle: domain.KpiCycleDay,
})
linkNodes = append(linkNodes, &domain.LinkNode{
Id: sid + 2,
Type: domain.LinkNodeAllInvite,
Name: "360°邀请",
NodeContents: make([]*domain.NodeContent, 0),
KpiCycle: domain.KpiCycleDay,
})
linkNodes = append(linkNodes, &domain.LinkNode{
Id: sid + 3,
Type: domain.LinkNodeAllAssessment,
Name: "360°评估",
NodeContents: make([]*domain.NodeContent, 0),
KpiCycle: domain.KpiCycleDay,
})
linkNodes = append(linkNodes, &domain.LinkNode{
Id: sid + 4,
Type: domain.LinkNodeSuperiorAssessment,
Name: "上级评估",
NodeContents: make([]*domain.NodeContent, 0),
KpiCycle: domain.KpiCycleDay,
})
linkNodes = append(linkNodes, &domain.LinkNode{
Id: sid + 5,
Type: domain.LinkNodeViewResult,
Name: "绩效结果查看",
NodeContents: make([]*domain.NodeContent, 0),
KpiCycle: domain.KpiCycleDay,
})
... ...
... ... @@ -33,7 +33,7 @@ type EntryItem struct {
type NodeContent struct {
Category string `json:"category" comment:"类别"`
Name string `json:"name" comment:"名称"`
RuleId int64 `json:"ruleId" comment:"评估规则ID"`
RuleId int64 `json:"ruleId,string" comment:"评估规则ID"`
Rule *EvaluationRule `json:"rule" comment:"评估规则对象"`
PromptTitle string `json:"promptTitle" comment:"提示项标题"`
PromptText string `json:"promptText" comment:"提示项正文"`
... ... @@ -59,7 +59,7 @@ type LinkNode struct {
NodeContents []*NodeContent `json:"nodeContents" comment:"环节-评估内容"`
TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
KpiCycle int `json:"state" comment:"考核周期(1日、2周、3月)"`
KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
//NodeAllInvite *NodeAllInvite `json:"nodeAllInvite" comment:"360°邀请人员"`
}
... ...