|
|
@@ -8,6 +8,8 @@ import jp.yamoto.farm.common.biz.mapper.MastAddressBaseMapper;
|
|
|
import jp.yamoto.farm.common.biz.mapper.SysDictDataMapper;
|
|
|
import jp.yamoto.farm.common.biz.service.IFarmCommonService;
|
|
|
import jp.yamoto.farm.common.core.domain.entity.SysDictData;
|
|
|
+import jp.yamoto.farm.common.exception.ServiceException;
|
|
|
+import jp.yamoto.farm.common.utils.MessageUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -77,6 +79,10 @@ public class FarmCommonService implements IFarmCommonService {
|
|
|
*/
|
|
|
public MastAddressEntity selectMastAddressByPostalCode(String postalCode) {
|
|
|
|
|
|
- return addressBaseMapper.selectMastAddressByPostalCode(postalCode);
|
|
|
+ MastAddressEntity mastAddressEntity =addressBaseMapper.selectMastAddressByPostalCode(postalCode);
|
|
|
+ if (mastAddressEntity == null) {
|
|
|
+ throw new ServiceException(MessageUtils.message("EM010", MessageUtils.message("label.postalCode"), postalCode));
|
|
|
+ }
|
|
|
+ return mastAddressEntity;
|
|
|
}
|
|
|
}
|