From 936f21d63efa74a07eb8488427d62f38a23abe3a Mon Sep 17 00:00:00 2001 From: "zhanglei@ap-leasing.com.cn" Date: Thu, 14 Sep 2023 13:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=8E=A7=E4=B8=AD=E5=8F=B0-=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=B7=A5=E4=BD=9C=E5=9C=B0=E5=9D=80=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E7=B3=BB=E7=BB=9F=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esb/service/impl/AmpServiceImpl.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/com/ample/esb/service/impl/AmpServiceImpl.java b/src/com/ample/esb/service/impl/AmpServiceImpl.java index c9059d19e..0ab5fb00c 100644 --- a/src/com/ample/esb/service/impl/AmpServiceImpl.java +++ b/src/com/ample/esb/service/impl/AmpServiceImpl.java @@ -385,7 +385,6 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { int ageInYear = DateUtils.yearDiffByDate(idBirthday,nowDay); int ageInMonth = DateUtils.monthDiffByDate(idBirthday,nowDay); String workAddressId = boCpt.getAttribute("work_address_id").getString(); - BizObject boRai = this.getAddressById(workAddressId); String workProvinceCode = boRai.getAttribute("province_code").toString(); String workCityCode = boRai.getAttribute("city_code").toString(); @@ -1017,8 +1016,24 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { } public BizObject getAddressById(String addressId) throws JBOException { + BizObject boRai = null; + + if(addressId==null || "".equals(addressId)){ + boRai.setAttributeValue("province_code",""); + boRai.setAttributeValue("city_code",""); + boRai.setAttributeValue("district_code",""); + boRai.setAttributeValue("address_detail","¿ÕµØÖ·"); + return boRai; + } BizObjectManager rcAddressInfo = JBOFactory.getBizObjectManager(RC_ADDRESS_INFO.CLASS_NAME); - BizObject boRai = rcAddressInfo.createQuery("address_id=:id").setParameter("id", addressId).getSingleResult(false); + boRai = rcAddressInfo.createQuery("address_id=:id").setParameter("id", addressId).getSingleResult(false); + + if(boRai == null){ + boRai.setAttributeValue("province_code",""); + boRai.setAttributeValue("city_code",""); + boRai.setAttributeValue("district_code",""); + boRai.setAttributeValue("address_detail","δ²éµÃµØÖ·"); + } return boRai; }