lining 6 年之前
父節點
當前提交
de1b32dc89

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

@@ -202,6 +202,26 @@ func (this *ActivitiService) GetMyTasksWithTime(processKey string, userId string
 	return myTasksRetWithTimes
 }
 
+
+func (this *ActivitiService) GetMyFinishedTasksWithTime(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-finished-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

+ 3 - 3
src/dashoo.cn/backend/api/conf/app.conf

@@ -89,9 +89,9 @@ techModuleHost=http://weed1.labsop.cn:9390/3,261195740758
 goodsPdfHost=http://weed1.labsop.cn:9390/4,25ab20466969
 basisPdfHost=http://weed1.labsop.cn:9390/3,25ac524b9715
 techPdfHost=http://weed1.labsop.cn:9390/6,25ad0b7df344
-OriginUrl=http://47.92.212.59:8080/acti-api/api		
-AposeUrl=http://47.92.212.59:8080/acti-api/api/apose		
-BaseUrl=http://47.92.212.59:8080/acti-api/api/acti
+OriginUrl=http://47.92.212.59:8081/acti-api/api
+AposeUrl=http://47.92.212.59:8081/acti-api/api/apose
+BaseUrl=http://47.92.212.59:8081/acti-api/api/acti
 
 [bank]
 callbackHost=http://localhost:10091/api

+ 24 - 17
src/dashoo.cn/backend/api/controllers/oilsupplier/todolist.go

@@ -134,6 +134,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.UserName = this.User.Realname
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkflowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -229,6 +230,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.SupplierTypeCode = item.AppendType
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkFlowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -273,6 +275,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.Status = item.Status
 				todo.CertId = strconv.Itoa(item.CerId)
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkflowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -310,6 +313,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.SupplierTypeCode = item.SupplierTypeName
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey//strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
+				todo.WorkflowId = item.WorkFlowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -378,7 +382,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 	}
 	for i,todo := range todolists {
 		for _,myTasksRetWithTime := range myTasksRetWithTimes {
-			if todo.BusinessKey == myTasksRetWithTime.BusinessKey {
+			if todo.BusinessKey == myTasksRetWithTime.BusinessKey && todo.WorkflowId == myTasksRetWithTime.WorkflowId {
 				todolists[i].CreateTime = myTasksRetWithTime.CreateTime
 			}
 		}
@@ -441,14 +445,14 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 	if stype == "1" || stype == "" {
 		//已办任务===准入
 		var certIdList string
-		myTasksRetWithTimes = actisvc.GetMyTasksWithTime(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
+		myTasksRetWithTimes = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
 		ids := actisvc.GetHistoryMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = ids
 			certIdList = certIdList + ","
 		}
 
-		arr := actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
+		arr := actisvc.GetMyFinishedTasksWithTime(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -458,7 +462,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			certIdList = certIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -468,7 +472,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			certIdList = certIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -478,7 +482,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			certIdList = certIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -488,7 +492,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			certIdList = certIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -519,6 +523,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.UserName = this.User.Realname
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkflowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -529,7 +534,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 		whereapp = whereapp + " and b.Status>0"
 
 		var appendIdList string
-		arr := actisvc.GetMyTasksWithTime(workflow.OIL_APPEND_APPLY, this.User.Id)
+		arr := actisvc.GetMyFinishedTasksWithTime(workflow.OIL_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -539,7 +544,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			appendIdList = appendIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -549,7 +554,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			appendIdList = appendIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -559,7 +564,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			appendIdList = appendIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -569,7 +574,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			appendIdList = appendIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -579,7 +584,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			appendIdList = appendIdList + ","
 		}
 
-		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
+		arr = actisvc.GetMyFinishedTasksWithTime(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -612,6 +617,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.SupplierTypeCode = item.AppendType
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkFlowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -623,7 +629,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			whereannu = whereannu + " and SupplierName like '%" + supplierName + "%'"
 		}
 		var listannu []annualaudit.OilAnnualAudit
-		arr := actisvc.GetMyTasksWithTime(workflow.OIL_AUDIT_APPLY, this.User.Id)
+		arr := actisvc.GetMyFinishedTasksWithTime(workflow.OIL_AUDIT_APPLY, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -665,7 +671,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 		if supplierName != "" {
 			whereInfo = where + " and SupplierName like '%" + supplierName + "%'"
 		}
-		arr := actisvc.GetMyTasksWithTime(workflow.OIL_INFO_CHANGE, this.User.Id)
+		arr := actisvc.GetMyFinishedTasksWithTime(workflow.OIL_INFO_CHANGE, this.User.Id)
 		for _,s := range arr {
 			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 		}
@@ -689,6 +695,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.SupplierTypeCode = item.SupplierTypeName
 				todo.Status = item.Status
 				todo.BusinessKey = item.BusinessKey
+				todo.WorkflowId = item.WorkFlowId
 				todolists = append(todolists, todo)
 			}
 		}
@@ -696,7 +703,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 	//if stype == "5" || stype == "" {
 	//	// 资质变更
 	//	var listqual []qualchange.OilQualChangeMain
-	//	arr := actisvc.GetMyTasksWithTime(workflow.OIL_QUAL_CHANGE, this.User.Id)
+	//	arr := actisvc.GetMyFinishedTasksWithTime(workflow.OIL_QUAL_CHANGE, this.User.Id)
 	//	for _,s := range arr {
 	//		myTasksRetWithTimes = append(myTasksRetWithTimes, s)
 	//	}
@@ -755,7 +762,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 	}
 	for i,todo := range todolists {
 		for _,myTasksRetWithTime := range myTasksRetWithTimes {
-			if todo.BusinessKey == myTasksRetWithTime.BusinessKey {
+			if todo.BusinessKey == myTasksRetWithTime.BusinessKey && todo.WorkflowId == myTasksRetWithTime.WorkflowId {
 				todolists[i].CreateTime = myTasksRetWithTime.CreateTime
 			}
 		}

+ 4 - 1
src/dashoo.cn/backend/api/controllers/workflow/workflow.go

@@ -6,6 +6,7 @@ import (
 	"dashoo.cn/business2/permission"
 	"dashoo.cn/business2/userRole"
 	"dashoo.cn/utils"
+	"sort"
 )
 
 // 动作接口说明
@@ -45,7 +46,9 @@ func (this *WorkflowController) GetHistoricMultiTask() {
 	var historicTasks []workflow.ActiHistoricTask
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	historicTasks = svcActiviti.GetHistoricMultiTasks(processKey, businessKey, processInstanceId)
-
+	sort.Slice(historicTasks, func(i, j int) bool {
+		return historicTasks[i].StartTime < historicTasks[j].StartTime
+	})
 	var datainfo DataInfo
 	datainfo.Items = historicTasks
 	this.Data["json"] = &datainfo