From 601aacd037f92fb8990c784b68ac076057cd2bee Mon Sep 17 00:00:00 2001 From: "zhanglei@ap-leasing.com.cn" Date: Tue, 26 Sep 2023 15:29:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=8E=A7=E4=B8=AD=E5=8F=B0-=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Daddress=5Fid=E4=B8=BA=E7=A9=BA=E6=97=B6NPE=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/ample/esb/service/impl/AmpServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/ample/esb/service/impl/AmpServiceImpl.java b/src/com/ample/esb/service/impl/AmpServiceImpl.java index 102e15cc4..c2fde5d0b 100644 --- a/src/com/ample/esb/service/impl/AmpServiceImpl.java +++ b/src/com/ample/esb/service/impl/AmpServiceImpl.java @@ -414,6 +414,9 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { int ageInMonth = DateUtils.monthDiffByDate(idBirthday,nowDay); String workAddressId = boCpt.getAttribute("work_address_id").getString(); BizObject boRai = this.getAddressById(workAddressId); + if(boRai==null){ + + } String workProvinceCode = boRai.getAttribute("province_code").toString(); String workCityCode = boRai.getAttribute("city_code").toString(); String workDistrictCode = boRai.getAttribute("district_code").toString(); @@ -1049,22 +1052,24 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { public BizObject getAddressById(String addressId) throws JBOException { BizObject boRai = null; - + BizObjectManager rcAddressInfo = JBOFactory.getBizObjectManager(RC_ADDRESS_INFO.CLASS_NAME); if(addressId==null || "".equals(addressId)){ + boRai = rcAddressInfo.newObject(); 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); + boRai = rcAddressInfo.createQuery("address_id=:id").setParameter("id", addressId).getSingleResult(false); if(boRai == null){ + boRai = rcAddressInfo.newObject(); boRai.setAttributeValue("province_code",""); boRai.setAttributeValue("city_code",""); boRai.setAttributeValue("district_code",""); - boRai.setAttributeValue("address_detail","未查得地址"); + boRai.setAttributeValue("address_detail","根据address_id未查得地址"); } return boRai; }