use of com.dingtalk.api.request.OapiProcessinstanceGetRequest in project dingtalk-app-server by nju-softeng.
the class OAApi method getOAOutCome.
public int getOAOutCome(String processInstanceId) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/processinstance/get");
OapiProcessinstanceGetRequest req = new OapiProcessinstanceGetRequest();
req.setProcessInstanceId(processInstanceId);
OapiProcessinstanceGetResponse rsp = client.execute(req, getAccessToken());
if (rsp.getProcessInstance().getStatus().equals("COMPLETED")) {
if (rsp.getProcessInstance().getResult().equals("agree"))
return 1;
else
return 0;
} else
return -1;
} catch (Exception e) {
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
Aggregations