|
@@ -70,9 +70,13 @@ public class SRMSynAttacmentApiPlugin implements Serializable {
|
|
|
JSONObject requestJSON = XmlUtils.documentToJSONObject(request);
|
|
|
JSONObject billBody = requestJSON.getJSONArray("BillBody").getJSONObject(0);
|
|
|
JSONObject bill = billBody.getJSONArray("Bill").getJSONObject(0);
|
|
|
- JSONArray fileArray = billBody.getJSONArray("Document")
|
|
|
- .getJSONObject(0).getJSONArray("Files")
|
|
|
- .getJSONObject(0).getJSONArray("File");
|
|
|
+
|
|
|
+ JSONArray files = billBody.getJSONArray("Document").getJSONObject(0).getJSONArray("Files");
|
|
|
+ if(files == null || files.size() == 0){
|
|
|
+ return returnResult("1000", "无file参数", null);
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONArray fileArray = files.getJSONObject(0).getJSONArray("File");
|
|
|
|
|
|
String billNO = bill.getString("billcode");
|
|
|
String billType = bill.getString("billtype");
|
|
@@ -84,8 +88,12 @@ public class SRMSynAttacmentApiPlugin implements Serializable {
|
|
|
entityName = "er_prepaybill";
|
|
|
}
|
|
|
|
|
|
+ if(StringUtils.isEmpty(billNO)){
|
|
|
+ return returnResult("1000", "单据号(billcode)参数为空", null);
|
|
|
+ }
|
|
|
+
|
|
|
if(StringUtils.isEmpty(entityName)){
|
|
|
- return returnResult("1000", "单据类型(" + billType + ")不匹配", null);
|
|
|
+ return returnResult("1000", "单据类型(" + billType + ")不匹配,只支持RC、XM、YF", null);
|
|
|
}
|
|
|
|
|
|
QFilter qFilter = new QFilter("billno", QCP.equals, billNO);
|