分页查询用户流程待办和传阅

  • SDK调用
MyWorkflowClient client = new MyWorkflowClient();
client.setUrl(URL+"/my");
QueryOptions options = new QueryOptions();
options.setPageSize(10);
options.setPageIndex(1);
//设置排序
options.setOrderBy("appCode desc");
options.setFilters(JSONObject.fromObject(filter,getJsonConfig()).toString());
Filter filter = new Filter();
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. pageQueryWorkItems(options);
String result = JSONObject.fromObject(resultPageResultEntity,getJsonConfig()).toString();
System.out.println(result);
  • CURL 调用
curl -X GET "URL/my/pageQueryWorkItems?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-大于等于(>=)


  • 响应示例
{
	"datas": [{
			"defVersionId": "9c607f3d-a159-4160-b1c4-5bb0a63be79b",
			"readTime": null,
			"createOrgName": "规划科",
			"pcPageUrl": null,
			"addTask": null,
			"passTaskId": null,
			"important": 0,
			"exceptionType": null,
			"receiveTime": "2018-12-28 17:37:05",
			"createUserName": "张子裕",
			"assigneeUserName": null,
			"createOrgId": "59675d79-191a-4dcd-a077-e10705e4549d",
			"passTaskText": null,
			"taskSeqId": null,
			"extendedFieldThree": null,
			"userOrgId": "59675d79-191a-4dcd-a077-e10705e4549d",
			"assigneeOrgName": null,
			"createTime": "2018-12-28 17:37:05",
			"enableSkipWorkflow": false,
			"passUserName": null,
			"workItemType": null,
			"appName": "人事请假审批",
			"taskName": "提交请假审批",
			"parallelOrgName": null,
			"assigneeOrgId": null,
			"passUserId": null,
			"passTaskName": null,
			"instanceId": "cb5ad92b-070b-4e59-b30b-b74572b41e77",
			"passLoginId": null,
			"userChoice": null,
			"status": "sent",
			"taskId": 1,
			"parallelLevelCode": null,
			"appTypeName": "人事",
			"userId": "e97a3f9c-2649-459c-995f-0322198c114d",
			"passOrgName": null,
			"opinionArea": "string",
			"appCode": "RS-00001",
			"taskText": "提交请假审批",
			"orgLevelCode": null,
			"userOrgName": "规划科",
			"passOrgId": null,
			"assigneeLoginId": null,
			"exceptionContent": null,
			"delete": null,
			"operateSource": null,
			"appVersionId": "031324c3-846d-4242-b36d-9485409db1f5",
			"procName": "string",
			"extendedFieldOne": null,
			"businessDataId": "string",
			"opinionContent": "string",
			"currentTaskUsers": null,
			"parallelOrgId": null,
			"workflowStatus": null,
			"extendedFieldTwo": null,
			"itemId": "d465a4eb-7f9f-40b4-9576-1ec8c8a7fe8e",
			"secret": 0,
			"loginId": null,
			"mobilePageUrl": null,
			"assigneeUserId": null,
			"userName": "张子裕",
			"finishTime": null,
			"createUserId": "e97a3f9c-2649-459c-995f-0322198c114d",
			"appType": "RS",
			"taskLevelCode": null,
			"enableRollBack": false,
			"autoFinish": false,
			"definitionname": "人事请假审批",
			"alertTime": null,
			"currentTaskNames": null,
			"procId": "20181228000002"
		},
		{
			"defVersionId": "9c607f3d-a159-4160-b1c4-5bb0a63be79b",
			"readTime": null,
			"createOrgName": "规划科",
			"pcPageUrl": null,
			"addTask": null,
			"passTaskId": null,
			"important": 0,
			"exceptionType": null,
			"receiveTime": "2018-12-28 17:34:40",
			"createUserName": "张子裕",
			"assigneeUserName": null,
			"createOrgId": "59675d79-191a-4dcd-a077-e10705e4549d",
			"passTaskText": null,
			"taskSeqId": null,
			"extendedFieldThree": null,
			"userOrgId": "59675d79-191a-4dcd-a077-e10705e4549d",
			"assigneeOrgName": null,
			"createTime": "2018-12-28 17:34:40",
			"enableSkipWorkflow": false,
			"passUserName": null,
			"workItemType": null,
			"appName": "人事请假审批",
			"taskName": "提交请假审批",
			"parallelOrgName": null,
			"assigneeOrgId": null,
			"passUserId": null,
			"passTaskName": null,
			"instanceId": "e147adbb-73c0-4270-9590-94db2782f3a6",
			"passLoginId": null,
			"userChoice": null,
			"status": "sent",
			"taskId": 1,
			"parallelLevelCode": null,
			"appTypeName": "人事",
			"userId": "e97a3f9c-2649-459c-995f-0322198c114d",
			"passOrgName": null,
			"opinionArea": "string",
			"appCode": "RS-00001",
			"taskText": "提交请假审批",
			"orgLevelCode": null,
			"userOrgName": "规划科",
			"passOrgId": null,
			"assigneeLoginId": null,
			"exceptionContent": null,
			"delete": null,
			"operateSource": null,
			"appVersionId": "031324c3-846d-4242-b36d-9485409db1f5",
			"procName": "string",
			"extendedFieldOne": null,
			"businessDataId": "string",
			"opinionContent": "string",
			"currentTaskUsers": null,
			"parallelOrgId": null,
			"workflowStatus": null,
			"extendedFieldTwo": null,
			"itemId": "804ce06c-de60-4ac7-a015-8801f45d3284",
			"secret": 0,
			"loginId": null,
			"mobilePageUrl": null,
			"assigneeUserId": null,
			"userName": "张子裕",
			"finishTime": null,
			"createUserId": "e97a3f9c-2649-459c-995f-0322198c114d",
			"appType": "RS",
			"taskLevelCode": null,
			"enableRollBack": false,
			"autoFinish": false,
			"definitionname": "人事请假审批",
			"alertTime": null,
			"currentTaskNames": null,
			"procId": "20181228000001"
		}
	],
	"pageIndex": 1,
	"pageSize": 10,
	"totalCount": 6
}