Exemplo n.º 1
0
  public Citizen getCitizenByUser(Long userId) {
    try {
      log.info("1.====userLiferayId:" + userId);
      TaiKhoanNguoiDung taiKhoanNguoiDung =
          TaiKhoanNguoiDungLocalServiceUtil.findByTaiKhoanNguoiDungId(userId);
      if (taiKhoanNguoiDung != null) {
        log.info("2.====taikhoannguoidungid:" + taiKhoanNguoiDung.getId());
        CongDan congDan =
            CongDanLocalServiceUtil.findByTaiKhoanNguoiDungId(taiKhoanNguoiDung.getId());
        if (congDan != null) {
          log.info("3.====congdanid:" + congDan.getId());

          return getCongDanSoap(congDan);
        } else {
          log.info("====Khong tim thay cong dan voi taikhoanid:" + taiKhoanNguoiDung.getId());
        }
      } else {
        log.info("=====Khong tim thay tai khoan voi account:" + userId);
      }
    } catch (Exception e) {
      // TODO: handle exception
      log.error("===lOI XAY RA", e);
      e.printStackTrace();
    }
    return null;
  }