diff --git a/src/main/java/com/yem/wm/es/exportinvoice/op/ExportInvoiceSaveOP.java b/src/main/java/com/yem/wm/es/exportinvoice/op/ExportInvoiceSaveOP.java index 2b08478c..4f1d35f9 100644 --- a/src/main/java/com/yem/wm/es/exportinvoice/op/ExportInvoiceSaveOP.java +++ b/src/main/java/com/yem/wm/es/exportinvoice/op/ExportInvoiceSaveOP.java @@ -81,25 +81,29 @@ public class ExportInvoiceSaveOP extends AbstractOperationServicePlugIn { String yemLadbillnum = dataEntitie.getString("yem_ladbillnum");//提单号 // queryString//合同号 DynamicObjectCollection yem_shipports = dataEntitie.getDynamicObjectCollection("yem_shipports");//起运港 - if (!YEM.isEmpty(yem_shipports)&& !yem_shipports.isEmpty()) { + if (!YEM.isEmpty(yem_shipports) && !yem_shipports.isEmpty()) { for (DynamicObject yemShipport : yem_shipports) { - String ssa = yemShipport.getDynamicObject("fbasedataid").getString("name");//起运港 - yemShipports.append(ssa); + if (yemShipport != null) { + String ssa = yemShipport.getDynamicObject("fbasedataid").getString("name");//起运港 + yemShipports.append(ssa); + } } } DynamicObjectCollection yem_Destports = dataEntitie.getDynamicObjectCollection("yem_destports");//目的港 - if (!YEM.isEmpty(yem_Destports)&& !yem_Destports.isEmpty()) { + if (!YEM.isEmpty(yem_Destports) && !yem_Destports.isEmpty()) { for (DynamicObject yemShipport : yem_Destports) { - String string = yemShipport.getDynamicObject("fbasedataid").getString("name"); - yemDestports.append(string);//目的港 + if (yemShipport != null) { + String string = yemShipport.getDynamicObject("fbasedataid").getString("name"); + yemDestports.append(string);//目的港 + } } } BigDecimal stripTrailingZeros = new BigDecimal(totalAmount.toPlainString().replaceAll("0*$", "").replaceAll("\\.$", "")); BigDecimal stripTrailingZeros1 = new BigDecimal(yemSeatransfee.toPlainString().replaceAll("0*$", "").replaceAll("\\.$", "")); BigDecimal stripTrailingZeros2 = new BigDecimal(yemInsurefee.toPlainString().replaceAll("0*$", "").replaceAll("\\.$", "")); dataEntitie.set("yem_remark", yemTradeway + " 成交总额:" + yemSettlement + stripTrailingZeros + " 汇率:" + yemExrate.stripTrailingZeros() - + "\r\n 海运费:"+ yemseatransfeecurr + stripTrailingZeros1 + " 保险费:" + yeminsurefeecurr + stripTrailingZeros2 - + "\r\n 提单号:"+ yemLadbillnum + "\r\n 合同号:"+ queryString + "\r\n 起运港:" + yemShipports + "\r\n 目的港:" + yemDestports); + + "\r\n 海运费:" + yemseatransfeecurr + stripTrailingZeros1 + " 保险费:" + yeminsurefeecurr + stripTrailingZeros2 + + "\r\n 提单号:" + yemLadbillnum + "\r\n 合同号:" + queryString + "\r\n 起运港:" + yemShipports + "\r\n 目的港:" + yemDestports); } } }