Exemplo n.º 1
0
 public CoQuanQuanLySoap[] getDSCoQuanQuanLyTheoTTHC(Long thuTucHanhChinhId) {
   try {
     List<TTHC2CoQuanQuanLy> cList =
         TTHC2CoQuanQuanLyLocalServiceUtil.getDSTTHC2CoQuanQuanLy(
             thuTucHanhChinhId, Constants.ACTIVATED);
     if (cList != null) {
       List<CoQuanQuanLy> result = new ArrayList<CoQuanQuanLy>();
       for (TTHC2CoQuanQuanLy tthc2CoQuanQuanLy : cList) {
         try {
           CoQuanQuanLy coQuanQuanLy =
               CoQuanQuanLyLocalServiceUtil.getCoQuanQuanLy(tthc2CoQuanQuanLy.getCoQuanQuanLyId());
           result.add(coQuanQuanLy);
         } catch (Exception e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
         }
       }
       return CoQuanQuanLySoap.toSoapModels(result);
     }
   } catch (Exception e) {
     // TODO: handle exception
     e.printStackTrace();
   }
   return null;
 }
Exemplo n.º 2
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.º 3
0
  public CoQuanQuanLySoap getCoQuanQuanLyTheoId(Long id) {
    try {
      return CoQuanQuanLySoap.toSoapModel(CoQuanQuanLyLocalServiceUtil.fetchCoQuanQuanLy(id));

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

    }
    return null;
  }
Exemplo n.º 4
0
 public CoQuanQuanLySoap[] getDSCoQuanQLTheoCapCoQuanQLId(Long capCoQuanQuanLyId) {
   try {
     List<CoQuanQuanLy> cList =
         CoQuanQuanLyLocalServiceUtil.findByCapCoQuanQuanLyId(
             capCoQuanQuanLyId, Constants.ACTIVATED);
     if (cList != null) {
       return CoQuanQuanLySoap.toSoapModels(cList);
     }
   } catch (Exception e) {
     // TODO: handle exception
   }
   return null;
 }
Exemplo n.º 5
0
 public CoQuanQuanLySoap[] getCoQuanQuanLyTheoChaId(Long chaId) {
   try {
     List<CoQuanQuanLy> cList =
         CoQuanQuanLyLocalServiceUtil.findByParentId(chaId, Constants.ACTIVATED);
     if (cList != null) {
       return CoQuanQuanLySoap.toSoapModels(cList);
     }
   } catch (Exception e) {
     // TODO: handle exception
     e.printStackTrace();
   }
   return null;
 }
Exemplo n.º 6
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;
  }