本文档介绍了如何在系统中集成ICE待办任务功能,包括推送待办消息和更新待办任务状态。
在 application.yml 文件中配置ICE待办任务相关参数:
ice:
# ... 其他配置
pending-task:
# WSDL接口地址(请向ICE运维人员获取)
wsdl-url: http://app.ceic.com:xxxx/xx/xxxx/xxxx?wsdl
# 订阅号,找系统管理员获取
platform-id: your-platform-id
# 系统唯一标识
system-id: your-system-id
/ice/pending-task/send| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| platformId | String | 否 | 订阅号,如未填写则使用配置中的默认值 |
| title | String | 是 | 标题 |
| sumary | String | 否 | 摘要,如需换行用"\n" |
| content | String | 否 | 消息正文 |
| code | String | 是 | 用户工号 |
| type | Integer | 否 | 类型,此处必须传入:2(默认值) |
| url | String | 是 | 跳转的url链接 |
| taskId | String | 否 | 此消息的任务ID,如果后续需要修改状态必填 |
| isCompleted | String | 否 | 是否已完成状态,1待办,2已办 |
| systemId | String | 否 | 系统的唯一识别,如未填写则使用配置中的默认值 |
{
"title": "审批申请",
"sumary": "张三提交的请假申请",
"content": "张三于2023年1月1日提交了请假申请,请审批。",
"code": "EMP001",
"url": "http://your-app.com/approval/detail/123",
"taskId": "task-123"
}
/ice/pending-task/batch-send/ice/pending-task/status| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| taskId | String | 是 | 此消息的任务ID |
| isCompleted | String | 是 | 是否已完成状态,1待办,2已办 |
| systemId | String | 是 | 系统的唯一识别 |
/ice/pending-task/cancel/{taskId}?systemId=xxx@Autowired
private IcePendingTaskService icePendingTaskService;
// 创建待办任务请求对象
IcePendingTaskRequest request = new IcePendingTaskRequest();
request.setTitle("审批申请");
request.setSumary("张三提交的请假申请");
request.setContent("张三于2023年1月1日提交了请假申请,请审批。");
request.setCode("EMP001");
request.setUrl("http://your-app.com/approval/detail/123");
request.setTaskId("task-123");
// 推送待办消息
IcePendingTaskResponse response = icePendingTaskService.sendPendingTask(request);
if (response.getSuccess()) {
System.out.println("推送成功");
} else {
System.out.println("推送失败:" + response.getMsg());
}
// 创建状态变更请求对象
IcePendingTaskStatusRequest statusRequest = new IcePendingTaskStatusRequest();
statusRequest.setTaskId("task-123");
statusRequest.setIsCompleted("2"); // 2表示已办
statusRequest.setSystemId("your-system-id");
// 更新状态
IcePendingTaskResponse response = icePendingTaskService.updatePendingTaskStatus(statusRequest);
if (response.getSuccess()) {
System.out.println("状态更新成功");
} else {
System.out.println("状态更新失败:" + response.getMsg());
}