예제 #1
0
  public String queryAllFlueSheets() {
    m_flueSheets =
        m_flueSheetService.queryLimitedFlueSheets(
            m_tunnelId, m_tunnelSectionId, 0, Integer.MAX_VALUE);

    return SUCCESS;
  }
예제 #2
0
  public String flueSheetList() {
    Authority auth =
        checkAuthority(buildResource(Modules.s_flueSheet_model, Operation.s_operation_delete));
    if (auth != null) {
      return auth.getName();
    }
    try {
      if (m_tunnelId == 0) {
        m_tunnelId = m_tunnelService.queryDefaultTunnelId();
      }
      m_tunnels = m_tunnelService.queryAllTunnels();
      m_tunnelSections =
          m_tunnelSectionService.queryLimitedTunnelSectionsByTunnelId(
              m_tunnelId, 0, Integer.MAX_VALUE);

      m_totalSize = m_flueSheetService.querySizeByTunnelAndSection(m_tunnelId, m_tunnelSectionId);
      m_totalPages = computeTotalPages(m_totalSize);
      int start = (m_index - 1) * SIZE;
      if (start < 0) {
        start = 0;
      }
      m_flueSheets =
          m_flueSheetService.queryLimitedFlueSheets(m_tunnelId, m_tunnelSectionId, start, SIZE);
      for (FlueSheet flueSheet : m_flueSheets) {
        flueSheet.setTunnel(m_tunnelService.findByPK(flueSheet.getTunnelId()));
        int scheduleId = flueSheet.getScheduleId();
        if (scheduleId > 0) {
          Schedule schedule = m_scheduleService.findByPK(scheduleId);
          if (schedule != null) {
            flueSheet.setSchedule(schedule);
            schedule.setConstructionUnit(
                m_constructionUnitService.findByPK(schedule.getConstructionUnitId()));
          }
        }
        if (flueSheet.getDocumentId() > 0) {
          flueSheet.setDocument(m_documentService.findByPK(flueSheet.getDocumentId()));
        }
      }
      return SUCCESS;
    } catch (Exception e) {
      m_logger.error(e.getMessage(), e);
      return ERROR;
    }
  }