Procházet zdrojové kódy

发起流程前校验接收结构体修改

张亚军 před 9 měsíci
rodič
revize
a6c0424dca
2 změnil soubory, kde provedl 36 přidání a 11 odebrání
  1. 7 7
      ng_cws_client/ng_cws_client.go
  2. 29 4
      service/response/workflow.go

+ 7 - 7
ng_cws_client/ng_cws_client.go

@@ -51,11 +51,11 @@ func StartWorkFlowByBusinessType(reqParams *request.StartWorkFlowByBusinessTypeR
 	}
 
 	//发起流程
-	//businessObject := &request.WorkflowBusinessObject{
-	//	BusinessType:   reqParams.BusinessType,
-	//	BusinessObject: reqParams.Data,
-	//}
-	jsonBytes, err := json.Marshal(reqParams.Data)
+	businessObject := &request.WorkflowBusinessObject{
+		BusinessType:   reqParams.BusinessType,
+		BusinessObject: reqParams.Data,
+	}
+	jsonBytes, err := json.Marshal(businessObject)
 	if err != nil {
 		return "", err
 	}
@@ -150,8 +150,8 @@ func LaunchWorkflowPrepare(reqParams *request.LaunchWorkflowPrepareParams) (*res
 	}
 	customStructureInfo := &response.CustomStructureInfo{}
 	for _, info := range resp.Infos {
-		if 1 == info.Flag && len(info.ChooseData) > 0 {
-			customStructureInfo = &info.ChooseData[0]
+		if info.ID == "userStructureId" {
+			customStructureInfo.ID = info.Options[0].Value
 			break
 		}
 	}

+ 29 - 4
service/response/workflow.go

@@ -36,10 +36,35 @@ type BusinessCatalogsInfoWithWorkflowTemplate struct {
 }
 
 type PrepareInfo struct {
-	Flag               int                   `json:"flag"` // 1-选择部门 2-选择审批人
-	WorkflowFieldLabel string                `json:"workflowFieldLabel"`
-	ChooseData         []CustomStructureInfo `json:"chooseData"`
-	WorkflowFieldName  string                `json:"workflowFieldName"`
+	//Flag               int                   `json:"flag"` // 1-选择部门 2-选择审批人
+	//WorkflowFieldLabel string                `json:"workflowFieldLabel"`
+	//ChooseData         []CustomStructureInfo `json:"chooseData"`
+	//WorkflowFieldName  string                `json:"workflowFieldName"`
+	ID          string   `json:"id"`
+	Label       string   `json:"label"`
+	Placeholder string   `json:"placeholder"`
+	Value       string   `json:"value"`
+	Name        string   `json:"name"`
+	Type        string   `json:"type"`
+	Rules       []Rule   `json:"rules"`
+	Options     []Option `json:"options"`
+	Props       Props    `json:"props"`
+}
+
+type Option struct {
+	Label string `json:"label"`
+	Value string `json:"value"`
+}
+
+type Props struct {
+	Multiple   bool `json:"multiple"`
+	Filterable bool `json:"filterable"`
+}
+
+type Rule struct {
+	Required bool     `json:"required"`
+	Message  string   `json:"message"`
+	Trigger  []string `json:"trigger"`
 }
 
 type CustomStructureInfo struct {