Exemplo n.º 1
0
  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;
  }
Exemplo n.º 2
0
 public CongChucSoap[] getDSCongChuc() {
   try {
     List<CongChuc> result = CongChucLocalServiceUtil.findByStatus(Constants.ACTIVATED);
     if (result != null) {
       return CongChucSoap.toSoapModels(result);
     }
   } catch (Exception e) {
     // TODO: handle exception
   }
   return null;
 }
Exemplo n.º 3
0
  public CongChucSoap getCongChucTheoId(Long id) {
    try {
      CongChuc result = CongChucLocalServiceUtil.fetchCongChuc(id);
      if (result != null) {
        return CongChucSoap.toSoapModel(result);
      }

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    return null;
  }
Exemplo n.º 4
0
  public CongChucSoap getCongChucTheoUserId(Long liferayUserId) {

    try {
      TaiKhoanNguoiDungSoap tSoap = getTaiKhoanNguoiDungTheoUserId(liferayUserId);

      if (tSoap != null) {
        List<CongChuc> cList = CongChucLocalServiceUtil.findByTaiKhoanNguoiDungId(tSoap.getId());
        if (cList != null && cList.size() > 0) {
          return CongChucSoap.toSoapModel(cList.get(0));
        }
      }
    } catch (Exception e) {
      // TODO Auto-generated catch block

    }

    return null;
  }
Exemplo n.º 5
0
  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;
  }