2
3
Prechádzať zdrojové kódy

返回我的任务的创建时间

yuedefeng 6 rokov pred
rodič
commit
2fe198a345

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

@@ -183,6 +183,25 @@ func (this *ActivitiService) GetMyTasks(processKey string, userId string) string
 	return string(p)
 }
 
+func (this *ActivitiService) GetMyTasksWithTime(processKey string, userId string) []ActiMyTasksRetWithTimeVM {
+	var ActiMyTasks ActiMyTasksVM
+	ActiMyTasks.ProcessKey = processKey
+	ActiMyTasks.UserId = userId
+	jsonParam, err := json.Marshal(ActiMyTasks)
+	if err != nil {
+		fmt.Println(err, "生成json字符串错误")
+	}
+	params := string(jsonParam)
+	fmt.Println(params)
+	//token = Authorization(this.Username, this.Password)
+	retVal := this.Post("/my-tasks-with-time", params, "")
+
+	p, _ := ioutil.ReadAll(retVal.Body)
+	myTasksRetWithTimes := make([]ActiMyTasksRetWithTimeVM, 0)
+	json.Unmarshal(p, &myTasksRetWithTimes)
+	return myTasksRetWithTimes
+}
+
 func (this *ActivitiService) GetHistoricTasks(processKey string, businessKey string, processInstanceId string) []ActiHistoricTask {
 	var ActiProcess ActiProcessVM
 	ActiProcess.ProcessKey = processKey

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

@@ -24,6 +24,11 @@ type ActiMyTasksVM struct {
 	UserId     string `json:"userId"`
 }
 
+type ActiMyTasksRetWithTimeVM struct {
+	BusinessKey string `json:"businessKey"`
+	CreateTime  string `json:"createTime"`
+}
+
 type ActiHistoricTask struct {
 	BusinessKey       string `json:"businessKey"`
 	TaskName          string `json:"taskName"`