Browse Source

修改流程判定条件单选项

v1
超级管理员 2 years ago
parent
commit
64f47654fe
  1. 1
      api/version1/taskplatform/taskflow/flowType.go
  2. 21
      api/version1/taskplatform/taskflow/runflow.go

1
api/version1/taskplatform/taskflow/flowType.go

@ -98,6 +98,7 @@ type ConditionListInfo struct {
Isok bool `json:"isok"` //页面渲染使用 Isok bool `json:"isok"` //页面渲染使用
IsCheckbox bool `json:"isCheckbox"` //结果值多选 IsCheckbox bool `json:"isCheckbox"` //结果值多选
Options []OptionsInfo `json:"options"` //可选项(用于关联表单使用) Options []OptionsInfo `json:"options"` //可选项(用于关联表单使用)
Oneanswer string `json:"oneanswer"` //可选项锚定值(用于关联表单使用)
Answers []string `json:"answers"` //可选项锚定值(用于关联表单使用) Answers []string `json:"answers"` //可选项锚定值(用于关联表单使用)
CustomFields []CustomFieldsInfo `json:"customFields"` //自定义字段条件主体 CustomFields []CustomFieldsInfo `json:"customFields"` //自定义字段条件主体
NodeUserList []FlowPermissionInfo `json:"nodeUserList"` //人员、行政组织、角色为条件主体 NodeUserList []FlowPermissionInfo `json:"nodeUserList"` //人员、行政组织、角色为条件主体

21
api/version1/taskplatform/taskflow/runflow.go

@ -249,7 +249,7 @@ func (n *NodePublicInfoES) ResolveRouting(step int, creater modelshr.ManCont, or
default: default:
} }
} }
// fmt.Printf("termAry:%v----->%v\n", len(n.ConditionList), termAry) fmt.Printf("termAry:%v----->%v\n", len(n.ConditionList), termAry)
// if len(termAry) == len(n.ConditionList) { // if len(termAry) == len(n.ConditionList) {
if termAry == len(n.ConditionList) { if termAry == len(n.ConditionList) {
if n.ChildNode != nil { if n.ChildNode != nil {
@ -401,7 +401,7 @@ func JudgingCustomConditions(customFields []CustomFieldsInfo, presetVal []Condit
} }
} }
} }
// fmt.Printf("处理自定义条件-->%v-->%v\n", isOk, len(customFields)) fmt.Printf("处理自定义条件-->%v-->%v\n", isOk, len(customFields))
if isOk == len(customFields) { if isOk == len(customFields) {
isTrue = true isTrue = true
} }
@ -435,6 +435,7 @@ func ProcessMultipleSelectionResults(judging ConditionListInfo, presetVal []Cond
if v.Types == 3 && judging.Factorid == v.Factorid { if v.Types == 3 && judging.Factorid == v.Factorid {
if judging.IsCheckbox { if judging.IsCheckbox {
fmt.Printf("termAry:%v----->%v----->%v\n", v.Answers, judging.Answers, len(v.Answers) <= len(judging.Answers))
//多选 //多选
if len(v.Answers) <= len(judging.Answers) { //判断答案个数是否小于等于设定条件值个数 if len(v.Answers) <= len(judging.Answers) { //判断答案个数是否小于等于设定条件值个数
isTrue = true isTrue = true
@ -445,14 +446,18 @@ func ProcessMultipleSelectionResults(judging ConditionListInfo, presetVal []Cond
} }
} }
} else { //单选 } else { //单选
if len(v.Answers) == len(judging.Answers) { fmt.Printf("termAry:%v----->%v----->%v\n", v.Oneanswer, judging.Oneanswer, v.Oneanswer == judging.Oneanswer)
// if len(v.Answers) == len(judging.Answers) {
// isTrue = false
// for i := 0; i < len(v.Answers); i++ {
// if !publicmethod.IsInTrue[string](v.Answers[i], judging.Answers) {
// isTrue = false
// }
// }
if v.Oneanswer == judging.Oneanswer {
isTrue = true isTrue = true
for i := 0; i < len(v.Answers); i++ {
if !publicmethod.IsInTrue[string](v.Answers[i], judging.Answers) {
isTrue = false
}
}
} }
// }
} }
} }
} }

Loading…
Cancel
Save