Merge branch 'test' into dev-tangxvhui
正在显示
7 个修改的文件
包含
16 行增加
和
0 行删除
@@ -1072,6 +1072,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a | @@ -1072,6 +1072,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a | ||
1072 | ReteResult: "", | 1072 | ReteResult: "", |
1073 | CreatedAt: nowTime, | 1073 | CreatedAt: nowTime, |
1074 | Weight: v.Weight, | 1074 | Weight: v.Weight, |
1075 | + Required: v.Required, | ||
1075 | UpdatedAt: nowTime, | 1076 | UpdatedAt: nowTime, |
1076 | DeletedAt: nil, | 1077 | DeletedAt: nil, |
1077 | // Rule: , | 1078 | // Rule: , |
@@ -1725,11 +1726,13 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma | @@ -1725,11 +1726,13 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma | ||
1725 | continue | 1726 | continue |
1726 | } | 1727 | } |
1727 | v.Value = item.Value | 1728 | v.Value = item.Value |
1729 | + if v.Required == 1 { | ||
1728 | //转换填入的评估值 | 1730 | //转换填入的评估值 |
1729 | err = v.TransformValue() | 1731 | err = v.TransformValue() |
1730 | if err != nil { | 1732 | if err != nil { |
1731 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 1733 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
1732 | } | 1734 | } |
1735 | + } | ||
1733 | for ii := range v.Remark { | 1736 | for ii := range v.Remark { |
1734 | for _, vvv := range item.Remark { | 1737 | for _, vvv := range item.Remark { |
1735 | if v.Remark[ii].Title == vvv.Title { | 1738 | if v.Remark[ii].Title == vvv.Title { |
@@ -172,6 +172,7 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs | @@ -172,6 +172,7 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs | ||
172 | } | 172 | } |
173 | changeableRows[v.TargetUserId]["targetUserName"] = v.TargetUserName | 173 | changeableRows[v.TargetUserId]["targetUserName"] = v.TargetUserName |
174 | changeableRows[v.TargetUserId]["targetUserId"] = v.TargetUserId | 174 | changeableRows[v.TargetUserId]["targetUserId"] = v.TargetUserId |
175 | + changeableRows[v.TargetUserId]["assessId"] = v.AssessId | ||
175 | if v.ContentId > 0 { | 176 | if v.ContentId > 0 { |
176 | name := fmt.Sprintf("%s-%s", v.Category, v.ContentName) | 177 | name := fmt.Sprintf("%s-%s", v.Category, v.ContentName) |
177 | key := fmt.Sprintf("k%d", i) | 178 | key := fmt.Sprintf("k%d", i) |
@@ -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 | + NodeRequiredYes int = 1 // 是否必填项-必填(默认) | ||
24 | + NodeRequiredNo 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.NodeRequiredYes | ||
123 | nodeContents = append(nodeContents, nc) | 125 | nodeContents = append(nodeContents, nc) |
124 | } | 126 | } |
125 | } | 127 | } |
-
请 注册 或 登录 后发表评论