Browse Source

增加根据业务类型判断是否关联流程接口

张亚军 1 month ago
parent
commit
ff7275afd5
2 changed files with 18 additions and 0 deletions
  1. 13 0
      ng_cws_client/ng_cws_client.go
  2. 5 0
      service/request/workflow.go

+ 13 - 0
ng_cws_client/ng_cws_client.go

@@ -366,3 +366,16 @@ func ExtractDynamicValueMap(inputModelMap map[string]any, inputParamStruct any)
 	}
 	return dynamicValueMap, nil
 }
+
+// CheckWorkFlowByBusinessType 根据业务类型判断是否关联流程
+func CheckWorkFlowByBusinessType(reqParams *request.CheckWorkFlowByBusinessTypeRequest) (bool, error) {
+	//根据业务类型获取流程模型ID
+	workflowTemplateId, err := getWorkTemplateInfoByBusinessTypeApi(reqParams.BusinessType, reqParams.TenantID)
+	if err != nil {
+		return false, err
+	}
+	if utils.IsStringEmpty(workflowTemplateId) {
+		return false, nil
+	}
+	return true, err
+}

+ 5 - 0
service/request/workflow.go

@@ -73,3 +73,8 @@ type QueryWorkflowByIDs struct {
 	PageNo   int      `json:"pageNo" assign:"-"`
 	PageSize int      `json:"pageSize" assign:"-"`
 }
+
+type CheckWorkFlowByBusinessTypeRequest struct {
+	BusinessType string `json:"businessType"`
+	TenantID     string `json:"tenantId"`
+}