星空对接接口开发:对同步星空接口添加修改校验
This commit is contained in:
parent
9cfe463d20
commit
8ccbc78c94
|
@ -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);
|
PoundBill poundBill = poundBillService.selectPoundBillById(id);
|
||||||
if (poundBill == null) throw new RuntimeException("磅单不存在!");
|
if (poundBill == null) throw new RuntimeException("磅单不存在!");
|
||||||
|
|
||||||
|
@ -120,10 +120,10 @@ public class ApiPostBack {
|
||||||
try {
|
try {
|
||||||
jsonInputString = objectMapper.writeValueAsString(request);
|
jsonInputString = objectMapper.writeValueAsString(request);
|
||||||
} catch (JsonProcessingException e) {
|
} 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 {
|
private String sendPostRequest(String url, String jsonBody) throws IOException {
|
||||||
|
@ -159,10 +159,10 @@ public class ApiPostBack {
|
||||||
return response.toString();
|
return response.toString();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "请求失败,响应码:" + responseCode;
|
throw new RuntimeException("请求失败,响应码:" + responseCode);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return "回传数据失败!: " + e.getMessage();
|
throw new RuntimeException("回传数据失败!: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,14 +148,14 @@ public class ApiTask {
|
||||||
//保存数据
|
//保存数据
|
||||||
makePoundAppliFormData(dictValue,oaData);
|
makePoundAppliFormData(dictValue,oaData);
|
||||||
break;
|
break;
|
||||||
case "STK_TRANSFERAPPLY":
|
// case "STK_TRANSFERAPPLY":
|
||||||
//保存数据
|
// //保存数据
|
||||||
makeMainPoundFormData(dictValue,oaData);
|
// makeMainPoundFormData(dictValue,oaData);
|
||||||
break;
|
// break;
|
||||||
case "SP_InStock":
|
// case "SP_InStock":
|
||||||
//保存数据
|
// //保存数据
|
||||||
makeMainPoundFormData(dictValue,oaData);
|
// makeMainPoundFormData(dictValue,oaData);
|
||||||
break;
|
// break;
|
||||||
default:
|
default:
|
||||||
errorLog.append(errorCount++ + "、"+ "获取数据失败!: 因未知错误导致返回参数为空!" + "\n");
|
errorLog.append(errorCount++ + "、"+ "获取数据失败!: 因未知错误导致返回参数为空!" + "\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue