分页查询用户流程待办

  • SDK调用
MyWorkflowClient client = new MyWorkflowClient();
client.setUrl(URL+"/my");
QueryOptions options = new QueryOptions();
options.setPageSize(10);
options.setPageIndex(1);
Filter filter = new Filter();
//设置排序
options.setOrderBy("appCode desc");
options.setFilters(JSONObject.fromObject(filter,getJsonConfig()).toString());
List<Rule> rules = new ArrayList<Rule>();
Rule rule = new Rule();
rule.setField("data");
rule.setData("RS");
rule.setFieldType("str");
rule.setOp(Rule.OP_CN);
rules.add(rule);
filter.setRules(rules);
options.setFilters(JSONObject.fromObject(filter,getJsonConfig()).toString());
ResultEntity<ResultPage<List<WorkItem>>> resultPageResultEntity = client.pageQueryToDoWorkItems (options);
String result = JSONObject.fromObject(resultPageResultEntity,getJsonConfig()).toString();
System.out.println(result);
  • CURL 调用
curl -X GET "URL/my/pageQueryToDoWorkItems?page_size=10&page=1&orderby=appCode desc&filters=%7b%22rules%22%3a%5b%7b%22data%22%3a%22RS%22%2c%22field%22%3a%22appType%22%2c%22type%22%3a%22str%22%2c%22op%22%3a%22cn%22%7d%5d%7d"
注:参数说明
1. page_size 页码大小
2. page 页码
3. orderby 排序字段
4. filters 查询参数(需要对url进行编码,编码之前的字符串为:{"rules":[{"data":"RS","field":"appType","fieldType":"str","op":"cn"}]})
rules: 参数说明
data:  查询的值
field:  查询的字段,本查询方法提供以下查询字段
        status:流程实例状态 executing-执行中,end-结束 start-发起
        procName:流程实例名称
        receiveTime:接收时间,时间类型(yyyy-MM-dd HH:mm:ss)
        taskName:工作项名称
        taskText:工作项显示名称
        createUserName:拟稿人
        passUserName:发送人
        appType:流程应用类型
        appTypeName:流程应用类型名称
        appName:流程应用名称
        appCode 流程应用编码
        finishTime:处理(完成)时间,时间类型(yyyy-MM-dd HH:mm:ss)
        procId:流程实例id
以上除特别说明,字段类型均为字符串。
fieldType: 查询字段类型(date,日期:str 日期,num 数值)
op:查询逻辑关系,提供以下关系cn-模糊查询(like),eq-等于(=),ne-不等于(!=),lt-小于(<),le-小于等于(<=) gt-大于(>),ge-大于等于(>=)

  • 响应示例
{
  "businessObject": {
    "datas": [
      {
        "addTask": false,
        "alertTime": null,
        "appCode": "0828",
        "appName": "传阅测试",
        "appType": "test001",
        "appTypeName": "test12",
        "assigneeOrgId": "",
        "assigneeOrgName": "",
        "assigneeUserId": "",
        "assigneeUserName": "",
        "autoFinish": false,
        "businessDataId": "b28d6d35cabd47eb9c2af70a60aed31d",
        "createOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "createOrgName": "广州轨道交通建设监理有限公司财务部",
        "createUserName": "唐琪",
        "currentTaskNames": "",
        "currentTaskUsers": "",
        "expiredTime": null,
        "extendedFieldOne": "",
        "extendedFieldThree": "",
        "extendedFieldTwo": "",
        "finishTime": null,
        "important": 0,
        "itemId": "83f47fef-5ddd-4faa-80cf-646a852f8ff8",
        "opinionArea": "",
        "opinionContent": "",
        "passOrgId": "3a8a5378-9ffd-43b5-8503-e5aa3b9e9102",
        "passOrgName": "房地产事业总部财务管理部",
        "passTaskId": 2,
        "passUserId": "d7b2ae8b-bc82-4420-bb7c-69d1040d11aa",
        "passUserName": "龙茂杰",
        "pcPageUrl": "",
        "procId": "20190829000021",
        "procName": "082901",
        "readTime": null,
        "receiveTime": "2019-08-29 13:54:46",
        "secret": 0,
        "status": "sent",
        "taskId": 3,
        "taskName": "审批步骤1",
        "taskText": "审批步骤1",
        "userChoice": "",
        "userId": "27b3f6ef-2647-4232-b064-3b5721e51dd5",
        "userName": "唐琪",
        "userOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "userOrgName": "广州轨道交通建设监理有限公司财务部",
        "workItemType": 0,
        "workflowStatus": ""
      },
      {
        "addTask": false,
        "alertTime": null,
        "appCode": "08202",
        "appName": "test_ys2",
        "appType": "test001",
        "appTypeName": "test12",
        "assigneeOrgId": "",
        "assigneeOrgName": "",
        "assigneeUserId": "",
        "assigneeUserName": "",
        "autoFinish": false,
        "businessDataId": "c49eaaebed7c4c49af70e0531a8a4c85",
        "createOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "createOrgName": "广州轨道交通建设监理有限公司财务部",
        "createUserName": "唐琪",
        "currentTaskNames": "",
        "currentTaskUsers": "",
        "expiredTime": null,
        "extendedFieldOne": "",
        "extendedFieldThree": "",
        "extendedFieldTwo": "",
        "finishTime": null,
        "important": 0,
        "itemId": "3b38a2a6-3d9b-408b-8eba-dd73076196c1",
        "opinionArea": "",
        "opinionContent": "",
        "passOrgId": "",
        "passOrgName": "",
        "passTaskId": 0,
        "passUserId": "",
        "passUserName": "",
        "pcPageUrl": "",
        "procId": "20190828000002",
        "procName": "0827test2",
        "readTime": null,
        "receiveTime": "2019-08-28 11:12:11",
        "secret": 0,
        "status": "sent",
        "taskId": 1,
        "taskName": "流程开始",
        "taskText": "流程开始",
        "userChoice": "",
        "userId": "27b3f6ef-2647-4232-b064-3b5721e51dd5",
        "userName": "唐琪",
        "userOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "userOrgName": "广州轨道交通建设监理有限公司财务部",
        "workItemType": 0,
        "workflowStatus": ""
      }
    ],
    "pageCount": 1,
    "pageIndex": 1,
    "pageSize": 10,
    "totalCount": 2
  },
  "message": "成功",
  "statusCode": 200,
  "success": true
}