| | |
| | | * @return |
| | | */ |
| | | public static ApproveInfoResponse submitApprove(String url, ApproveAddRequest param){ |
| | | System.out.println(JSONObject.toJSONString(param)); |
| | | String result = HttpsUtil.postJson(url, JSONObject.toJSONString(param)); |
| | | if(StringUtils.isNotBlank(result)){ |
| | | // TypeReference typeReference = |
| | | // new TypeReference<ERPApiResponse<ApproveInfoResponse>>(){}; |
| | | // ERPApiResponse<ApproveInfoResponse> response = JSONObject.parseObject(result, typeReference.getType()); |
| | | // if(response!=null && response.isSuccess()){ |
| | | // return response.getData(); |
| | | // } |
| | | TypeReference typeReference = |
| | | new TypeReference<ERPApiResponse<ApproveInfoResponse>>(){}; |
| | | ERPApiResponse<ApproveInfoResponse> response = JSONObject.parseObject(result, typeReference.getType()); |
| | | new TypeReference<ERPApiResponse<String>>(){}; |
| | | ERPApiResponse<String> response = JSONObject.parseObject(result, typeReference.getType()); |
| | | if(response!=null && response.isSuccess()){ |
| | | return response.getData(); |
| | | ApproveInfoResponse approveInfoResponse = new ApproveInfoResponse(); |
| | | approveInfoResponse.setId(response.getData()); |
| | | return approveInfoResponse; |
| | | } |
| | | |
| | | |
| | | } |
| | | return null; |
| | | } |