示例#1
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;
    }
  }
示例#2
0
  public String flueSheetUpdate() {
    try {
      m_flueSheet = m_flueSheetService.findByPK(m_flueSheetId);
      m_tunnels = m_tunnelService.queryAllTunnels();
      m_tunnelSections =
          m_tunnelSectionService.queryLimitedTunnelSectionsByTunnelId(
              m_flueSheet.getTunnelId(), 0, Integer.MAX_VALUE);
      m_schedule = m_scheduleService.findByPK(m_flueSheet.getScheduleId());
      m_constructionUnits = m_constructionUnitService.queryAllConstructionUnits();
      int documentId = m_flueSheet.getDocumentId();

      if (documentId > 0) {
        m_flueSheet.setDocument(m_documentService.findByPK(m_flueSheet.getDocumentId()));
      }
      if (m_flueSheet != null) {
        return SUCCESS;
      } else {
        return ERROR;
      }
    } catch (Exception e) {
      m_logger.error(e.getMessage(), e);
      return ERROR;
    }
  }