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; }