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