|
|
@@ -0,0 +1,57 @@
|
|
|
+package workflow
|
|
|
+
|
|
|
+import (
|
|
|
+ "dashoo.cn/backend/api/business/workflow"
|
|
|
+ . "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business2/permission"
|
|
|
+ "dashoo.cn/business2/userRole"
|
|
|
+ "dashoo.cn/utils"
|
|
|
+)
|
|
|
+
|
|
|
+// 动作接口说明
|
|
|
+type WorkflowController struct {
|
|
|
+ BaseController
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// @Title get
|
|
|
+// @Description get workflow by token
|
|
|
+// @Success 200 {object} historicTasks
|
|
|
+// @router /historytask [get]
|
|
|
+func (this *WorkflowController) GetHistoricTask() {
|
|
|
+ businessKey := this.GetString("business")
|
|
|
+ processKey := this.GetString("process")
|
|
|
+ processInstanceId := this.GetString("instance")
|
|
|
+
|
|
|
+ var historicTasks []workflow.ActiHistoricTask
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ historicTasks = svcActiviti.GetHistoricTasks(processKey, businessKey, processInstanceId)
|
|
|
+
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = historicTasks
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取所有用户
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} models.User
|
|
|
+// @router /userlist [get]
|
|
|
+func (this *WorkflowController) UserList() {
|
|
|
+ keyword := this.GetString("keyword")
|
|
|
+ svc := permission.GetPermissionService(utils.DBE)
|
|
|
+ var users []userRole.Base_User
|
|
|
+
|
|
|
+ where := "IsVisible=1 and AccCode='" + this.User.AccCode + "' "
|
|
|
+ if keyword != "" {
|
|
|
+ where = where + " and Realname like '%" + keyword + "%'"
|
|
|
+ }
|
|
|
+ total := svc.GetPagingEntitiesWithOrder(1, 1000, "Id", false, &users, where)
|
|
|
+
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = users
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|