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; }
public DonViHanhChinhSoap getDonViHanhChinhTheoUserId(Long userid) { try { List<TaiKhoanNguoiDung> cList = TaiKhoanNguoiDungLocalServiceUtil.findByTaiKhoanNguoiDung(userid, Constants.ACTIVATED); if (cList != null && cList.size() > 0) { TaiKhoanNguoiDung account = cList.get(0); List<CongChuc> congChucs = CongChucLocalServiceUtil.findByTaiKhoanNguoiDungId(account.getId()); long coquanId = 0; if (congChucs.size() > 0) { coquanId = congChucs.get(0).getCoQuanQuanLyId(); } if (coquanId > 0) { CoQuanQuanLy coquan = CoQuanQuanLyLocalServiceUtil.fetchCoQuanQuanLy(coquanId); if (coquan != null) { long donviId = coquan.getDonViHanhChinhId(); if (donviId > 0) { return getDonViHanhchinhTheoId(donviId); } } } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
public CoQuanQuanLySoap getCoQuanQuanLyTheoUserId(Long liferayUserid) { try { List<TaiKhoanNguoiDung> cList = TaiKhoanNguoiDungLocalServiceUtil.findByTaiKhoanNguoiDung( liferayUserid, Constants.ACTIVATED); if (cList != null && cList.size() > 0) { TaiKhoanNguoiDung account = cList.get(0); List<CongChuc> congChucs = CongChucLocalServiceUtil.findByTaiKhoanNguoiDungId(account.getId()); // long coquanId = account.getCoQuanQuanLyId(); if (congChucs.size() > 0) { long coquanId = congChucs.get(0).getCoQuanQuanLyId(); return CoQuanQuanLySoap.toSoapModel( CoQuanQuanLyLocalServiceUtil.fetchCoQuanQuanLy(coquanId)); } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }