作者 郑周

1. 环节内容,增加必填项属性

... ... @@ -1073,6 +1073,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
ReteResult: "",
CreatedAt: nowTime,
Weight: v.Weight,
Required: v.Required,
UpdatedAt: nowTime,
DeletedAt: nil,
// Rule: ,
... ...
... ... @@ -19,6 +19,11 @@ const (
LinkNodeViewResult int = 5 // 环节-绩效结果查看
)
const (
NodeRequiredNo int = 1 // 是否必填项-非必填
NodeRequiredYes int = 2 // 是否必填项-必填
)
type EntryItem struct {
Title string `json:"title" comment:"填写标题"`
HintText string `json:"hintText" comment:"文本内容提示"`
... ... @@ -35,6 +40,7 @@ type NodeContent struct {
PromptTitle string `json:"promptTitle" comment:"提示项标题"`
PromptText string `json:"promptText" comment:"提示项正文"`
EntryItems []*EntryItem `json:"entryItems" comment:"填写项"`
Required int `json:"required" comment:"必填项"`
}
// LinkNode 评估流程、环节
... ...
... ... @@ -23,6 +23,7 @@ type StaffAssessContent struct {
ReteResult string `json:"reteResult"` //评估的结果
Rule EvaluationRule `json:"rule"` //评估的选项规则
Weight float64 `json:"weight" ` //"权重"
Required int `json:"required"` // 必填项
CreatedAt time.Time `json:"createdAt"` //数据创建时间
UpdatedAt time.Time `json:"updatedAt"` //数据更新时间
DeletedAt *time.Time `json:"deletedAt"`
... ...
... ... @@ -23,6 +23,7 @@ type StaffAssessContent struct {
Rule domain.EvaluationRule
Remark []domain.AssessContemtRemark
Weight float64 `pg:",use_zero"` //权重
Required int //必填项
CreatedAt time.Time //数据创建时间
UpdatedAt time.Time //数据更新时间
DeletedAt *time.Time
... ...
... ... @@ -37,6 +37,7 @@ func (repo *StaffAssessContentRepository) TransformToDomain(d *models.StaffAsses
ReteResult: d.ReteResult,
Rule: d.Rule,
Weight: d.Weight,
Required: d.Required,
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: nil,
... ... @@ -59,6 +60,7 @@ func (repo *StaffAssessContentRepository) Save(d *domain.StaffAssessContent) (*d
Rule: d.Rule,
Remark: d.Remark,
Weight: d.Weight,
Required: d.Required,
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: nil,
... ...
... ... @@ -120,6 +120,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf
})
}
// 必填项
nc.Required = domain.NodeRequiredNo
nodeContents = append(nodeContents, nc)
}
}
... ...