erp调用接口测试
This commit is contained in:
@@ -263,7 +263,6 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String test1() {
|
public String test1() {
|
||||||
try {
|
|
||||||
String address = erpAddress + "-" + sapsys;
|
String address = erpAddress + "-" + sapsys;
|
||||||
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.公司代码;
|
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.公司代码;
|
||||||
String funcnr = funcnrEnum.getFuncnr();
|
String funcnr = funcnrEnum.getFuncnr();
|
||||||
@@ -281,13 +280,13 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
|||||||
|
|
||||||
// 创建HTTP请求实体
|
// 创建HTTP请求实体
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(requestBody.toJSONString(), headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>(requestBody.toJSONString(), headers);
|
||||||
|
|
||||||
// 发送POST请求
|
// 发送POST请求
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
// ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
|
try{
|
||||||
return address;
|
ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
|
||||||
|
return url + requestEntity + response;
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
throw exception(ERP_ERROR_EXISTS);
|
return url + requestEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user