作者 郑周

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

@@ -1073,6 +1073,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a @@ -1073,6 +1073,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
1073 ReteResult: "", 1073 ReteResult: "",
1074 CreatedAt: nowTime, 1074 CreatedAt: nowTime,
1075 Weight: v.Weight, 1075 Weight: v.Weight,
  1076 + Required: v.Required,
1076 UpdatedAt: nowTime, 1077 UpdatedAt: nowTime,
1077 DeletedAt: nil, 1078 DeletedAt: nil,
1078 // Rule: , 1079 // Rule: ,
@@ -19,6 +19,11 @@ const ( @@ -19,6 +19,11 @@ const (
19 LinkNodeViewResult int = 5 // 环节-绩效结果查看 19 LinkNodeViewResult int = 5 // 环节-绩效结果查看
20 ) 20 )
21 21
  22 +const (
  23 + NodeRequiredNo int = 1 // 是否必填项-非必填
  24 + NodeRequiredYes int = 2 // 是否必填项-必填
  25 +)
  26 +
22 type EntryItem struct { 27 type EntryItem struct {
23 Title string `json:"title" comment:"填写标题"` 28 Title string `json:"title" comment:"填写标题"`
24 HintText string `json:"hintText" comment:"文本内容提示"` 29 HintText string `json:"hintText" comment:"文本内容提示"`
@@ -35,6 +40,7 @@ type NodeContent struct { @@ -35,6 +40,7 @@ type NodeContent struct {
35 PromptTitle string `json:"promptTitle" comment:"提示项标题"` 40 PromptTitle string `json:"promptTitle" comment:"提示项标题"`
36 PromptText string `json:"promptText" comment:"提示项正文"` 41 PromptText string `json:"promptText" comment:"提示项正文"`
37 EntryItems []*EntryItem `json:"entryItems" comment:"填写项"` 42 EntryItems []*EntryItem `json:"entryItems" comment:"填写项"`
  43 + Required int `json:"required" comment:"必填项"`
38 } 44 }
39 45
40 // LinkNode 评估流程、环节 46 // LinkNode 评估流程、环节
@@ -23,6 +23,7 @@ type StaffAssessContent struct { @@ -23,6 +23,7 @@ type StaffAssessContent struct {
23 ReteResult string `json:"reteResult"` //评估的结果 23 ReteResult string `json:"reteResult"` //评估的结果
24 Rule EvaluationRule `json:"rule"` //评估的选项规则 24 Rule EvaluationRule `json:"rule"` //评估的选项规则
25 Weight float64 `json:"weight" ` //"权重" 25 Weight float64 `json:"weight" ` //"权重"
  26 + Required int `json:"required"` // 必填项
26 CreatedAt time.Time `json:"createdAt"` //数据创建时间 27 CreatedAt time.Time `json:"createdAt"` //数据创建时间
27 UpdatedAt time.Time `json:"updatedAt"` //数据更新时间 28 UpdatedAt time.Time `json:"updatedAt"` //数据更新时间
28 DeletedAt *time.Time `json:"deletedAt"` 29 DeletedAt *time.Time `json:"deletedAt"`
@@ -23,6 +23,7 @@ type StaffAssessContent struct { @@ -23,6 +23,7 @@ type StaffAssessContent struct {
23 Rule domain.EvaluationRule 23 Rule domain.EvaluationRule
24 Remark []domain.AssessContemtRemark 24 Remark []domain.AssessContemtRemark
25 Weight float64 `pg:",use_zero"` //权重 25 Weight float64 `pg:",use_zero"` //权重
  26 + Required int //必填项
26 CreatedAt time.Time //数据创建时间 27 CreatedAt time.Time //数据创建时间
27 UpdatedAt time.Time //数据更新时间 28 UpdatedAt time.Time //数据更新时间
28 DeletedAt *time.Time 29 DeletedAt *time.Time
@@ -37,6 +37,7 @@ func (repo *StaffAssessContentRepository) TransformToDomain(d *models.StaffAsses @@ -37,6 +37,7 @@ func (repo *StaffAssessContentRepository) TransformToDomain(d *models.StaffAsses
37 ReteResult: d.ReteResult, 37 ReteResult: d.ReteResult,
38 Rule: d.Rule, 38 Rule: d.Rule,
39 Weight: d.Weight, 39 Weight: d.Weight,
  40 + Required: d.Required,
40 CreatedAt: d.CreatedAt, 41 CreatedAt: d.CreatedAt,
41 UpdatedAt: d.UpdatedAt, 42 UpdatedAt: d.UpdatedAt,
42 DeletedAt: nil, 43 DeletedAt: nil,
@@ -59,6 +60,7 @@ func (repo *StaffAssessContentRepository) Save(d *domain.StaffAssessContent) (*d @@ -59,6 +60,7 @@ func (repo *StaffAssessContentRepository) Save(d *domain.StaffAssessContent) (*d
59 Rule: d.Rule, 60 Rule: d.Rule,
60 Remark: d.Remark, 61 Remark: d.Remark,
61 Weight: d.Weight, 62 Weight: d.Weight,
  63 + Required: d.Required,
62 CreatedAt: d.CreatedAt, 64 CreatedAt: d.CreatedAt,
63 UpdatedAt: d.UpdatedAt, 65 UpdatedAt: d.UpdatedAt,
64 DeletedAt: nil, 66 DeletedAt: nil,
@@ -120,6 +120,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf @@ -120,6 +120,8 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf
120 }) 120 })
121 } 121 }
122 122
  123 + // 必填项
  124 + nc.Required = domain.NodeRequiredNo
123 nodeContents = append(nodeContents, nc) 125 nodeContents = append(nodeContents, nc)
124 } 126 }
125 } 127 }