星空对接接口开发:对同步星空接口添加修改校验

This commit is contained in:
16358 2025-06-30 14:25:30 +08:00
parent 9cfe463d20
commit 8ccbc78c94
2 changed files with 13 additions and 13 deletions

View File

@ -106,7 +106,7 @@ public class ApiPostBack {
}
//单据下推
public String pushPoundBillFormData(String id) throws IOException {
public void pushPoundBillFormData(String id) throws IOException {
PoundBill poundBill = poundBillService.selectPoundBillById(id);
if (poundBill == null) throw new RuntimeException("磅单不存在!");
@ -120,10 +120,10 @@ public class ApiPostBack {
try {
jsonInputString = objectMapper.writeValueAsString(request);
} catch (JsonProcessingException e) {
return "JSON序列化失败" + e.getMessage();
throw new RuntimeException("JSON序列化失败" + e.getMessage());
}
return sendPostRequest(url, jsonInputString);
sendPostRequest(url, jsonInputString);
}
private String sendPostRequest(String url, String jsonBody) throws IOException {
@ -159,10 +159,10 @@ public class ApiPostBack {
return response.toString();
}
} else {
return "请求失败,响应码:" + responseCode;
throw new RuntimeException("请求失败,响应码:" + responseCode);
}
} catch (IOException e) {
return "回传数据失败!: " + e.getMessage();
throw new RuntimeException("回传数据失败!: " + e.getMessage());
}
}

View File

@ -148,14 +148,14 @@ public class ApiTask {
//保存数据
makePoundAppliFormData(dictValue,oaData);
break;
case "STK_TRANSFERAPPLY":
//保存数据
makeMainPoundFormData(dictValue,oaData);
break;
case "SP_InStock":
//保存数据
makeMainPoundFormData(dictValue,oaData);
break;
// case "STK_TRANSFERAPPLY":
// //保存数据
// makeMainPoundFormData(dictValue,oaData);
// break;
// case "SP_InStock":
// //保存数据
// makeMainPoundFormData(dictValue,oaData);
// break;
default:
errorLog.append(errorCount++ + ""+ "获取数据失败!: 因未知错误导致返回参数为空!" + "\n");
}