分页查询用户的流程应用

  • 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<Application>>> resultPageResultEntity = client.pageQueryApplications(options);
String result = JSONObject.fromObject(resultPageResultEntity,getJsonConfig()).toString();
System.out.println(result);
  • CURL 调用
curl -X GET "URL/my/pageQueryApplications?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" -H "accept: application/json"

注:参数说明
1. page_size 页码大小
2. page 页码
3. orderby 排序字段

4. filters 查询参数(需要对url进行编码,编码之前的字符串为:{"rules":[{"data":"RS","field":"appType","fieldType":"str","op":"cn"}]})

rules: 参数说明
data:  查询的值
field:  查询的字段,本查询方法提供以下查询字段
         appType
         appName
         appCode
         status: 'enable'-可用,'disable'-禁用
         以上除特别说明,字段类型均为字符串。
fieldType: 查询字段类型(date,日期:str 日期,num 数值)
op:查询逻辑关系,提供以下关系cn-模糊查询(like),eq-等于(=),ne-不等于(!=),lt-小于(<),le-小于等于(<=) gt-大于(>),ge-大于等于(>=)


  • 响应示例
{
  "datas": [
    {
      "appCode": "test0417-001",
      "appDescription": "",
      "appFormUrl": "",
      "appName": "test0417",
      "appType": "test001",
      "appUrl": "",
      "pcPageUrl": "http://10.105.184.65:10086/demo-web/demo/workflow/form.html",
      "workflowId": 0,
      "workflowVersion": ""
    },
    {
      "appCode": "test02",
      "appDescription": "",
      "appFormUrl": "",
      "appName": "json参与者测试",
      "appType": "test001",
      "appUrl": "",
      "pcPageUrl": "",
      "workflowId": 0,
      "workflowVersion": ""
    },
    {
      "appCode": "test00555",
      "appDescription": "",
      "appFormUrl": "",
      "appName": "会签测试",
      "appType": "test001",
      "appUrl": "",
      "pcPageUrl": "",
      "workflowId": 0,
      "workflowVersion": ""
    },
    {
      "appCode": "test00444",
      "appDescription": "",
      "appFormUrl": "",
      "appName": "SubprocessTest",
      "appType": "test001",
      "appUrl": "",
      "pcPageUrl": "",
      "workflowId": 0,
      "workflowVersion": ""
    },
    {
      "appCode": "test-workflow",
      "appDescription": "",
      "appFormUrl": "",
      "appName": "示例流程",
      "appType": "test001",
      "appUrl": "",
      "pcPageUrl": "http://localhost:8080/demo-web/demo/workflow/form.html",
      "workflowId": 0,
      "workflowVersion": ""
    }
  ],
  "pageCount": 1,
  "pageIndex": 1,
  "pageSize": 10,
  "totalCount": 5
},
"message": "成功",
"statusCode": 200,
"success": true
}