Browse Source

todo getmytasks

yuedefeng 6 năm trước cách đây
mục cha
commit
8cc612bd00
1 tập tin đã thay đổi với 23 bổ sung18 xóa
  1. 23 18
      src/dashoo.cn/backend/api/controllers/oilsupplier/todolist.go

+ 23 - 18
src/dashoo.cn/backend/api/controllers/oilsupplier/todolist.go

@@ -58,30 +58,35 @@ func (this *TodoListController) GetMyTaskEntityList() {
 	if stype == "1" || stype == "" {
 		//找出待办任务===准入
 		var certIdList string
-		if actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
-			certIdList = certIdList + ","
+		ids := actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
-		if actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id))
-			certIdList = certIdList + ","
+		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
-		if actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id))
-			certIdList = certIdList + ","
+
+		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
-		if actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id))
-			certIdList = certIdList + ","
+
+		ids = actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
-		if actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id))
-			certIdList = certIdList + ","
+
+		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
-		if actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id) != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id))
-			certIdList = certIdList + ","
+
+		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		if len(strings.Trim(ids, ",")) > 0 {
+			certIdList += strings.Trim(ids, ",")+ ","
 		}
+
 		certIdList = strings.Trim(certIdList, ",")
 		certIdarr := strings.Split(certIdList, ",")
 		for i, item := range certIdarr {