Explorar el Código

工作流修改,添加了startprocess2

yuedefeng hace 6 años
padre
commit
0aea2f1d9d

+ 22 - 0
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -117,6 +117,28 @@ func (this *ActivitiService) StartProcess(processKey string, formEntityId string
 	return string(p)
 }
 
+func (this *ActivitiService) StartProcess2(processKey string, formEntityId string, userNames string, result string) string {
+	/*vars := make(map[string]string)
+	vars["processDefinitionKey"] = processKey
+	vars["formEntityId"] = formEntityId*/
+	/*params := "processDefinitionKey="+processKey+"&formEntityId"+formEntityId*/
+	var ActiProcess ActiProcessVM
+	ActiProcess.ProcessKey = processKey
+	ActiProcess.BusinessKey = formEntityId
+	ActiProcess.UserNames = userNames
+	ActiProcess.Result = result
+	json, err := json.Marshal(ActiProcess)
+	if err != nil {
+		fmt.Println(err, "生成json字符串错误")
+	}
+	params := string(json)
+	fmt.Println(params)
+	//token = Authorization(this.Username, this.Password)
+	retVal := this.Post("/start-process", params, "")
+	p, _ := ioutil.ReadAll(retVal.Body)
+	return string(p)
+}
+
 //func (this *ActivitiService) TaskComplete(processKey string, formEntityId string, userNames string, userId string, result string, remarks string) string {
 /*var ActiComplete ActiCompleteVM
 ActiComplete.ProcessKey = processKey

+ 1 - 0
src/dashoo.cn/backend/api/business/workflow/workflow.go

@@ -7,6 +7,7 @@ type ActiProcessVM struct {
 	BusinessKey       string `json:"businessKey"`
 	ProcessInstanceId string `json:"processInstanceId"`
 	UserNames         string `json:"userNames"`
+	Result         	  string `json:"result"`
 }
 
 type ActiCompleteVM struct {

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -669,7 +669,7 @@ func (this *OilSupplierCertController) AuditEntity() {
 			} else if supplierCertEntity.InStyle == "6" {
 				processInstanceId = svcActiviti.StartProcess(workflow.OIL_FIRST_SUPPLIER_APPLY, businessKey, this.User.Id)
 			} else {
-				processInstanceId = svcActiviti.StartProcess(workflow.OIL_SUPPLIER_APPLY, businessKey, this.User.Id)
+				processInstanceId = svcActiviti.StartProcess2(workflow.OIL_ENUSER_SUPPLIER_APPLY, businessKey, this.User.Id, "1")
 			}
 		}
 
@@ -701,7 +701,7 @@ func (this *OilSupplierCertController) AuditEntity() {
 		} else if supplierCertEntity.InStyle == "6" {
 			ActiComplete.ProcessKey = workflow.OIL_FIRST_SUPPLIER_APPLY
 		} else {
-			ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_APPLY
+			ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
 		}
 	}