erp调用接口测试

This commit is contained in:
liss
2025-10-14 15:14:11 +08:00
parent 2cdcf23a4c
commit d0e7938e4d

View File

@@ -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;
}
}
}