コード例 #1
0
 public String beforeResModeView() {
   boolean valid = ValidateSession.checkSession();
   if (valid) {
     try {
       if (getMode() != null && getMode().equalsIgnoreCase("App")) {
         setMainHeaderName("Feedback >>Response Mobile App ");
         setGridColomnNamesNegative();
       } else if (getMode() != null && getMode().equalsIgnoreCase("Online")) {
         setMainHeaderName("Feedback >>Response Online ");
         setGridColomnNamesNegative();
       } else if (getMode() != null && getMode().equalsIgnoreCase("SMS")) {
         setMainHeaderName("Feedback >>Response SMS ");
         setGridColomnNamesNegative();
       } else if (getMode() != null && getMode().equalsIgnoreCase("Voice")) {
         setMainHeaderName("Feedback >>Response Voice ");
         setGridColomnNamesNegative();
       }
       return SUCCESS;
     } catch (Exception e) {
       e.printStackTrace();
       log.error(
           "Problem in method beforeResModeView of class"
               + getClass()
               + " on "
               + DateUtil.getCurrentDateIndianFormat()
               + " at "
               + DateUtil.getCurrentTimeHourMin(),
           e);
       return ERROR;
     }
   } else {
     return LOGIN;
   }
 }
コード例 #2
0
  public void run() {
    try {
      // method calling Alert generation.
      VSAH.alertGeneration(connection, VSAHU, CH);
      Runtime rt = Runtime.getRuntime();
      rt.gc();
      System.out.println(
          "Sleeping......................"
              + DateUtil.getCurrentDateIndianFormat()
              + " at "
              + DateUtil.getCurrentTime());
      Thread.sleep(1000 * 60);
      System.out.println(
          "Woke Up......................."
              + DateUtil.getCurrentDateIndianFormat()
              + " at "
              + DateUtil.getCurrentTime());

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
コード例 #3
0
  // Define A method for Creating Excel File
  public String createExcel(
      String titleString,
      String sheetString,
      String subTitleString,
      List data,
      String[] headerTitles,
      String titleKey,
      String filePath) {

    String file = null;
    Workbook wb;
    int col = 0;
    try {
      // check Header Title
      if (headerTitles != null && headerTitles.length > 0) col = headerTitles.length;

      wb = (Workbook) new HSSFWorkbook();
      // Hear we are getting whole property
      List<ConfigurationUtilBean> titleMap = new CustomerCommonPropertyMap().getTitles(titleKey);
      Map<String, CellStyle> styles = createStyles(wb);
      Sheet sheet = wb.createSheet(sheetString);
      PrintSetup printSetup = sheet.getPrintSetup();
      printSetup.setLandscape(true);
      sheet.setFitToPage(true);
      sheet.setHorizontallyCenter(true);

      Header header = sheet.getHeader();
      header.setCenter("Center Header");
      header.setLeft("Left Header");
      header.setRight("Right Footer");
      Footer footer = sheet.getFooter();
      footer.setCenter("center footer");
      footer.setLeft("left footer");
      footer.setRight("right footer");

      // Title Row....
      Row titleRow = sheet.createRow(0);
      titleRow.setHeightInPoints(20);
      Cell titleCell = titleRow.createCell(0);
      titleCell.setCellValue(titleString);
      titleCell.setCellStyle(styles.get("title"));
      sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, col - 1));

      // Sub Title Row.....
      // System.out.println("Sub Title String >>>>>>"+subTitleString);
      Row headerRow = null;
      if (subTitleString != "") {
        Row subTitleRow = sheet.createRow(1);
        subTitleRow.setHeightInPoints(18);
        Cell subTitleCell = subTitleRow.createCell(0);
        subTitleCell.setCellValue(subTitleString);
        subTitleCell.setCellStyle(styles.get("subTitle"));
        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, col - 1));
        headerRow = sheet.createRow(2);
        headerRow.setHeightInPoints(15);
        //
      } else {
        headerRow = sheet.createRow(1);
        headerRow.setHeightInPoints(15);
      }
      Cell headerCell = null;
      if (headerTitles != null) {
        for (ConfigurationUtilBean cell : titleMap) {
          int titleIndex = 0;
          for (int i = 0; i < headerTitles.length; i++) {
            if (cell.getKey().equalsIgnoreCase(headerTitles[titleIndex].trim())) {
              headerCell = headerRow.createCell(titleIndex);
              headerCell.setCellValue(cell.getValue());
              headerCell.setCellStyle(styles.get("header"));
            }
            titleIndex++;
          }
        }
      }
      Row dataRow = null;
      Cell dataCell = null;

      int rowIndex = 2;
      /* List Iteration text */
      try {
        if (data != null && data.size() > 0) {
          for (Iterator it = data.iterator(); it.hasNext(); ) {
            Object[] obdata = (Object[]) it.next();
            dataRow = sheet.createRow(rowIndex);
            for (int cellIndex = 0; cellIndex < headerTitles.length; cellIndex++) {
              dataCell = dataRow.createCell(cellIndex);

              if (obdata[cellIndex] != null && !obdata[cellIndex].toString().equalsIgnoreCase("")) {

                dataCell.setCellValue(obdata[cellIndex].toString());
              } else {
                dataCell.setCellValue("NA");
              }
            }

            rowIndex++;
          }
        }
      } catch (Exception e) {
        // TODO: handle exception
      }

      for (int titleIndex = 0; titleIndex < headerTitles.length; titleIndex++)
        sheet.autoSizeColumn(titleIndex); // adjust width of the column

      file =
          filePath
              + File.separator
              + "OpportunityReportDetail_"
              + DateUtil.getCurrentDateIndianFormat()
              + (DateUtil.getCurrentTimeHourMin()).replaceAll(":", "-")
              + ".xls";

      if (wb instanceof XSSFWorkbook) file += "x";
      FileOutputStream out = new FileOutputStream(file);
      wb.write(out);
      out.close();

    } catch (Exception e) {
      e.printStackTrace();
    } finally {

    }
    return file;
  }
コード例 #4
0
  // Define A method for Creating Excel File
  public String createExcelformate(
      String titleString,
      String sheetString,
      String[] headerTitles,
      String titleKey,
      String filePath) {

    String file = null;
    Workbook wb;
    int col = 0;
    try {
      // check Header Title
      if (headerTitles != null && headerTitles.length > 0) col = headerTitles.length;

      wb = (Workbook) new HSSFWorkbook();
      // Hear we are getting whole property
      List<ConfigurationUtilBean> titleMap = new CustomerCommonPropertyMap().getTitles(titleKey);
      Map<String, CellStyle> styles = createStyles(wb);
      Sheet sheet = wb.createSheet(sheetString);
      PrintSetup printSetup = sheet.getPrintSetup();
      printSetup.setLandscape(true);
      sheet.setFitToPage(true);
      sheet.setHorizontallyCenter(true);

      Header header = sheet.getHeader();
      header.setCenter("Center Header");
      header.setLeft("Left Header");
      header.setRight("Right Footer");
      Footer footer = sheet.getFooter();
      footer.setCenter("center footer");
      footer.setLeft("left footer");
      footer.setRight("right footer");

      // Title Row....
      Row titleRow = sheet.createRow(0);
      titleRow.setHeightInPoints(20);
      Cell titleCell = titleRow.createCell(0);
      titleCell.setCellValue(titleString);
      titleCell.setCellStyle(styles.get("title"));
      sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, col - 1));

      //
      Row headerRow = sheet.createRow(1);
      headerRow.setHeightInPoints(15);
      Cell headerCell = null;
      if (headerTitles != null) {
        for (ConfigurationUtilBean cell : titleMap) {
          int titleIndex = 0;
          for (int i = 0; i < headerTitles.length; i++) {
            if (cell.getKey().equalsIgnoreCase(headerTitles[titleIndex].trim())) {
              headerCell = headerRow.createCell(titleIndex);
              headerCell.setCellValue(cell.getValue());
              headerCell.setCellStyle(styles.get("header"));
            }
            titleIndex++;
          }
        }
      }

      for (int titleIndex = 0; titleIndex < headerTitles.length; titleIndex++)
        sheet.autoSizeColumn(titleIndex); // adjust width of the column

      file =
          filePath
              + File.separator
              + "ContactReport"
              + DateUtil.getCurrentDateIndianFormat()
              + (DateUtil.getCurrentTime()).replaceAll(":", "-")
              + ".xls";

      if (wb instanceof XSSFWorkbook) file += "x";
      FileOutputStream out = new FileOutputStream(file);
      wb.write(out);
      out.close();

    } catch (Exception e) {
      e.printStackTrace();
    } finally {

    }
    return file;
  }
コード例 #5
0
  @SuppressWarnings("unchecked")
  public String createPdf(List data, String[] headerTitles, String titleKey, String filePath) {
    int col = 0;
    String fileName = null;
    PdfPCell cell = null;
    try {

      if (headerTitles != null && headerTitles.length > 0) col = headerTitles.length;

      List<ConfigurationUtilBean> titleMap = new CustomerCommonPropertyMap().getTitles(titleKey);
      Document document = new Document(PageSize.A4, 20, 20, 50, 50);
      fileName =
          filePath
              + File.separator
              + "Customer Report"
              + DateUtil.getCurrentDateIndianFormat()
              + (DateUtil.getCurrentTime()).replaceAll(":", "-")
              + ".pdf";
      PdfWriter.getInstance(document, new FileOutputStream(fileName));
      document.open();
      PdfPTable table = new PdfPTable(col);
      table.setWidthPercentage(100f);
      float[] widths = new float[col];
      for (int wx = 0; wx < col; wx++) widths[wx] = 100f / col;
      table.setWidths(widths);
      table.setHeaderRows(2);

      if (headerTitles != null) {
        for (ConfigurationUtilBean title : titleMap) {
          for (int i = 0; i < headerTitles.length; i++) {

            if (title.getKey().equalsIgnoreCase(headerTitles[i].trim())) {

              cell = new PdfPCell(new Paragraph(title.getValue()));
              cell.setBackgroundColor(new BaseColor(204, 204, 204));
              cell.setBorderColor(new BaseColor(170, 170, 170));
              cell.setHorizontalAlignment(Element.ALIGN_CENTER);
              cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
              table.addCell(cell);
            }
          }
        }
      }
      int altr = 1;
      String cellValue = "NA";
      try {
        if (data != null && data.size() > 0) {
          for (Iterator it = data.iterator(); it.hasNext(); ) {
            Object[] obdata = (Object[]) it.next();
            for (int cellIndex = 0; cellIndex < headerTitles.length; cellIndex++) {
              if (obdata[cellIndex] != null && !obdata[cellIndex].toString().equalsIgnoreCase("")) {
                cell = new PdfPCell(new Paragraph(obdata[cellIndex].toString()));
              } else {
                cell = new PdfPCell(new Paragraph(cellValue));
              }

              if (altr % 2 == 0) {
                cell.setBackgroundColor(new BaseColor(240, 240, 240));
                cell.setBorderColor(new BaseColor(170, 170, 170));

              } else {
                cell.setBackgroundColor(new BaseColor(255, 255, 255));
                cell.setBorderColor(new BaseColor(170, 170, 170));
              }
              cell.setHorizontalAlignment(Element.ALIGN_CENTER);
              cell.setVerticalAlignment(Element.ALIGN_MIDDLE);

              table.addCell(cell);
            }
            altr++;
          }
        }
      } catch (Exception e) {
        e.printStackTrace();
        // TODO: handle exception
      }
      document.add(table);
      document.close();

    } catch (Exception e) {
      e.printStackTrace();
      // TODO: handle exception
    }

    return fileName;
  }
コード例 #6
0
@SuppressWarnings("serial")
public class AssetComplaintDashAction extends ActionSupport {

  public Map session = ActionContext.getContext().getSession();

  SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
  public static final String DES_ENCRYPTION_KEY = "ankitsin";

  String dept = "", dept_id = "", empName = "", loginType;
  List<FeedbackPojo> ticketsList = null;
  List<DashboardPojo> dept_counterList = null;
  List<DashboardPojo> dept_subdeptcounterList = null;
  DashboardPojo dashObj;
  Map<String, Integer> graphCatgMap = null;

  private String fromDate = DateUtil.getNextDateFromDate(DateUtil.getCurrentDateIndianFormat(), -5);
  private String toDate = DateUtil.getCurrentDateUSFormat();

  List<FeedbackPojo> catgCountList = null;

  public Integer rows = 0;
  // Get the requested page. By default grid sets this to 1.
  public Integer page = 0;
  // sorting order - asc or desc
  public String sord = "";
  // get index row - i.e. user click to sort.
  public String sidx = "";
  // Search Field
  public String searchField = "";
  // The Search String
  public String searchString = "";
  // The Search Operation
  // ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
  public String searchOper = "";
  // Your Total Pages
  public Integer total = 0;
  // All Record
  public Integer records = 0;
  private boolean loadonce = true;
  // Grid colomn view
  public String oper;
  public String id;
  List<AssetDashboardBean> allAssetReminderList = null;
  List<AssetDashboardBean> allPendingPreventiveSupportList = null;

  // First method for Asset Complaint Dashboard
  public String beforeDashboardAction() {
    String returnResult = ERROR;
    boolean sessionFlag = ValidateSession.checkSession();
    if (sessionFlag) {
      try {
        String userName = (String) session.get("uName");
        ComplianceUniversalAction CUA = new ComplianceUniversalAction();
        AssetUniversalHelper AUH = new AssetUniversalHelper();
        String logedDeptId = null;
        logedDeptId = CUA.getEmpDataByUserName(userName)[3];
        String userEmpID = null;
        String empIdofuser = (String) session.get("empIdofuser");
        if (empIdofuser == null || empIdofuser.split("-")[1].trim().equals("")) return ERROR;
        userEmpID = empIdofuser.split("-")[1].trim();
        String userContID = null;
        userContID = CUA.getEmpDetailsByUserName("ASTM", userName)[0];

        if (logedDeptId != null) {
          allAssetReminderList = new ArrayList<AssetDashboardBean>();
          allAssetReminderList =
              AUH.getAllReminderOfAsset(logedDeptId, userEmpID, userContID, connectionSpace);
        }
        if (logedDeptId != null) {
          allPendingPreventiveSupportList = new ArrayList<AssetDashboardBean>();
          allPendingPreventiveSupportList =
              AUH.getPendingPreventiveSupportData(userEmpID, connectionSpace);
        }
        // ********************************************//
        // Scrolling Data(First Block)
        // getTicketDetail(loginType,dept_id,empName, connectionSpace);
        // ********************************************//

        // *******************************************/
        // Ticket Counters on the basis of status(Second Block)
        // getCounterData();
        // ********************************************//

        // ********************************************//
        // Level wise Ticket Detail in Table (Fifth Block)
        // getTicketDetailByLevel("T");

        // Level wise Ticket Detail in Graph (Fifth Block)
        // getTicketDetailByLevel("G");
        // ********************************************//

        // ********************************************//
        // Analytics for category in table (Third Block)
        // getAnalytics4SubCategory("T");

        // Analytics for category in graph (Third Block)
        // getAnalytics4SubCategory("G");
        // ********************************************//

        // getDataInBars(connectionSpace);
        return SUCCESS;
      } catch (Exception e) {
        addActionError(
            "Ooops There Is Some Problem In beforeDashboardAction in AssetComplaintDashAction !!!");
        e.printStackTrace();
        return ERROR;
      }
    } else {
      return LOGIN;
    }
  }

  public void generalMethod() {
    try {
      String userName = (String) session.get("uName");
      List empData =
          new HelpdeskUniversalAction()
              .getEmpDataByUserName(Cryptography.encrypt(userName, DES_ENCRYPTION_KEY), "2");
      if (empData != null && empData.size() > 0) {
        for (Iterator iterator = empData.iterator(); iterator.hasNext(); ) {
          Object[] object = (Object[]) iterator.next();
          empName = object[0].toString();
          dept_id = object[3].toString();
          dept = object[4].toString();
          loginType = object[7].toString();

          /*	if(loginType.equalsIgnoreCase("H"))
          {
          	hodFlag=true;
          	headerValue=dept;
          }
          else if (loginType.equalsIgnoreCase("M")) {
          	mgmtFlag=true;
          	headerValue="All Department";
          }
          else if (loginType.equalsIgnoreCase("N")) {
          	headerValue=DateUtil.makeTitle(empName);
          	normalFlag=true;
          }*/
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  @SuppressWarnings("unchecked")
  public void getTicketDetail(
      String status_for, String deptid, String empName, SessionFactory connectionSpace) {
    try {
      //	System.out.println("ddddddd  "+deptid);
      List ticketData =
          new AssetDashboardHelper().getLodgedTickets(deptid, status_for, empName, connectionSpace);
      ticketsList = new ArrayList<FeedbackPojo>();
      System.out.println(">>>>>>> " + ticketData.size());
      if (ticketData != null && ticketData.size() > 0) {
        for (Iterator iterator = ticketData.iterator(); iterator.hasNext(); ) {
          Object[] object = (Object[]) iterator.next();
          FeedbackPojo fp = new FeedbackPojo();
          fp.setId(Integer.parseInt(object[0].toString()));
          fp.setTicket_no(object[1].toString());
          fp.setFeed_by(DateUtil.makeTitle(object[2].toString()));
          fp.setOpen_date(DateUtil.convertDateToIndianFormat(object[3].toString()));
          fp.setOpen_time(object[4].toString().substring(0, 5));
          fp.setStatus(object[5].toString());
          ticketsList.add(fp);
        }
      }
      System.out.println(" >>>>>> " + ticketsList.size());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  // Ticket Counters on the basis of status At HOD Level
  @SuppressWarnings("unchecked")
  public void getCounterData() {
    dashObj = new DashboardPojo();
    // subdeptdashList=new ArrayList<DashboardPojo>();
    DashboardPojo DP = null;
    try {
      this.generalMethod();
      // dept_subdeptcounterList  = new ArrayList<DashboardPojo>();
      // String uid = new HelpdeskUniversalAction().getData("useraccount", "id", "userID",
      // Cryptography.encrypt(userName,DES_ENCRYPTION_KEY));
      List dept_subdeptNameList = new AssetDashboardHelper().getDeptList(connectionSpace);
      if (dept_subdeptNameList != null && dept_subdeptNameList.size() > 0) {
        for (Iterator iterator = dept_subdeptNameList.iterator(); iterator.hasNext(); ) {
          Object[] object1 = (Object[]) iterator.next();
          DP = new DashboardPojo();
          DP.setId(object1[0].toString());
          DP.setDeptName(object1[1].toString());
          // List for counters for Pending/ Snooze/ High Priority/ Ignore Status
          List dept_subdeptCounterList = new ArrayList();
          dept_subdeptCounterList =
              new AssetDashboardHelper()
                  .getDashboardCounter("All", empName, object1[0].toString(), connectionSpace);

          if (dept_subdeptCounterList != null && dept_subdeptCounterList.size() > 0) {
            for (Iterator iterator2 = dept_subdeptCounterList.iterator(); iterator2.hasNext(); ) {
              Object[] object2 = (Object[]) iterator2.next();
              if (object2[0].toString().equals("High Priority")) {
                DP.setHpc(object2[1].toString());
              } else if (object2[0].toString().equals("Ignore")) {
                DP.setIgc(object2[1].toString());
              } else if (object2[0].toString().equals("Pending")) {
                DP.setPc(object2[1].toString());
              } else if (object2[0].toString().equals("Snooze")) {
                DP.setSc(object2[1].toString());
              }
            }
          }
          // List for counters for Resolved Status
          List dept_subdeptRSCounterList = new ArrayList();
          dept_subdeptRSCounterList =
              new AssetDashboardHelper()
                  .getDashboardCounter("Resolved", empName, object1[0].toString(), connectionSpace);

          if (dept_subdeptRSCounterList != null && dept_subdeptRSCounterList.size() > 0) {
            for (Iterator iterator3 = dept_subdeptRSCounterList.iterator(); iterator3.hasNext(); ) {
              Object[] object3 = (Object[]) iterator3.next();
              if (object3[0].toString().equals("Resolved")) {
                DP.setRc(object3[1].toString());
              }
            }
          }
          dept_subdeptcounterList.add(DP);
          dashObj.setDashList(dept_subdeptcounterList);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  @SuppressWarnings("unchecked")
  public void getAnalytics4SubCategory(String status_for) {
    try {
      this.generalMethod();
      List catgData =
          new AssetDashboardHelper()
              .getAnalyticalData(
                  "C",
                  fromDate,
                  toDate,
                  dept_id,
                  "-1",
                  "",
                  empName,
                  searchField,
                  searchString,
                  searchOper,
                  connectionSpace);
      if (catgData != null && catgData.size() > 0) {
        if (status_for.equalsIgnoreCase("T")) {
          catgCountList = new ArrayList<FeedbackPojo>();
          for (Iterator iterator = catgData.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (status_for.equalsIgnoreCase("T")) {
              FeedbackPojo fp = new FeedbackPojo();
              fp.setId(Integer.parseInt(object[0].toString()));
              fp.setFeedback_catg(object[1].toString());
              fp.setCounter(object[2].toString());
              catgCountList.add(fp);
            }
          }
        } else if (status_for.equalsIgnoreCase("G")) {
          System.out.println("Inside G Block");
          graphCatgMap = new LinkedHashMap<String, Integer>();
          for (Iterator iterator = catgData.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            graphCatgMap.put(object[1].toString(), Integer.parseInt(object[2].toString()));
          }
          System.out.println(
              "Map Size for graph  is:::::::::::::::::::::::: " + graphCatgMap.size());
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public List<FeedbackPojo> getCatgCountList() {
    return catgCountList;
  }

  public void setCatgCountList(List<FeedbackPojo> catgCountList) {
    this.catgCountList = catgCountList;
  }

  public List<FeedbackPojo> getTicketsList() {
    return ticketsList;
  }

  public void setTicketsList(List<FeedbackPojo> ticketsList) {
    this.ticketsList = ticketsList;
  }

  public List<DashboardPojo> getDept_counterList() {
    return dept_counterList;
  }

  public void setDept_counterList(List<DashboardPojo> dept_counterList) {
    this.dept_counterList = dept_counterList;
  }

  public Integer getRows() {
    return rows;
  }

  public void setRows(Integer rows) {
    this.rows = rows;
  }

  public Integer getPage() {
    return page;
  }

  public void setPage(Integer page) {
    this.page = page;
  }

  public String getSord() {
    return sord;
  }

  public void setSord(String sord) {
    this.sord = sord;
  }

  public String getSidx() {
    return sidx;
  }

  public void setSidx(String sidx) {
    this.sidx = sidx;
  }

  public String getSearchField() {
    return searchField;
  }

  public void setSearchField(String searchField) {
    this.searchField = searchField;
  }

  public String getSearchString() {
    return searchString;
  }

  public void setSearchString(String searchString) {
    this.searchString = searchString;
  }

  public String getSearchOper() {
    return searchOper;
  }

  public void setSearchOper(String searchOper) {
    this.searchOper = searchOper;
  }

  public Integer getTotal() {
    return total;
  }

  public void setTotal(Integer total) {
    this.total = total;
  }

  public Integer getRecords() {
    return records;
  }

  public void setRecords(Integer records) {
    this.records = records;
  }

  public boolean isLoadonce() {
    return loadonce;
  }

  public void setLoadonce(boolean loadonce) {
    this.loadonce = loadonce;
  }

  public String getOper() {
    return oper;
  }

  public void setOper(String oper) {
    this.oper = oper;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Map<String, Integer> getGraphCatgMap() {
    return graphCatgMap;
  }

  public void setGraphCatgMap(Map<String, Integer> graphCatgMap) {
    this.graphCatgMap = graphCatgMap;
  }

  public List<AssetDashboardBean> getAllAssetReminderList() {
    return allAssetReminderList;
  }

  public void setAllAssetReminderList(List<AssetDashboardBean> allAssetReminderList) {
    this.allAssetReminderList = allAssetReminderList;
  }

  public List<AssetDashboardBean> getAllPendingPreventiveSupportList() {
    return allPendingPreventiveSupportList;
  }

  public void setAllPendingPreventiveSupportList(
      List<AssetDashboardBean> allPendingPreventiveSupportList) {
    this.allPendingPreventiveSupportList = allPendingPreventiveSupportList;
  }
}
コード例 #7
0
  public String viewCustomerResInGrid() {
    boolean valid = ValidateSession.checkSession();
    if (valid) {
      try {

        CommonOperInterface cbt = new CommonConFactory().createInterface();
        {
          custDataList = new ArrayList<CustomerPojo>();
          Map session = ActionContext.getContext().getSession();
          SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");

          StringBuilder queryNew2 = new StringBuilder("");
          if (getMode() != null) {
            // System.out.println(">>>>>>>>>>>>Online"+getMode());
            queryNew2.append(
                "select feedbt.id as feedback_ticketId,feedbt.feedTicketNo,feedData.openDate,feedData.openTime,"
                    + " feedbck.escalation_date,feedbck.escalation_time,feedbck.level,feedData.clientId,feedData.clientName,feedData.mobNo,"
                    + " feedData.emailId,feedData.refNo,feedData.centerCode,feedData.centreName, feedData.id,feedData.problem,"
                    + " feedData.compType,feedData.handledBy,feedData.remarks,"
                    + " feedData.kword,feedData.ip from feedback_ticket as feedbt"
                    + " inner join feedback_status as feedbck on feedbt.feed_stat_id=feedbck.id "
                    + " inner join feedbackdata as feedData on feedbt.feed_data_id=feedData.id where (feedData.targetOn='No' || feedData.targetOn='Yes') && feedData.mode='"
                    + getMode()
                    + "'");

            queryNew2.append(" order by feedData.openDate DESC");
          }
          //   System.out.println("Querry is as >>>>>>>>>>>>>>>>"+queryNew2);
          List ticketDataList = cbt.executeAllSelectQuery(queryNew2.toString(), connectionSpace);
          // System.out.println("size of the list ticketDataList>>>>>>"+ticketDataList.size());
          List<CustomerPojo> tempList = new ArrayList<CustomerPojo>();
          int i = 1;
          if (ticketDataList != null && ticketDataList.size() > 0) {
            for (Iterator iterator = ticketDataList.iterator(); iterator.hasNext(); ) {
              CustomerPojo feed = new CustomerPojo();
              Object[] type = (Object[]) iterator.next();

              if (type[14] != null) {
                feed.setId(Integer.parseInt(type[14].toString()));
              }

              if (type[0] != null) {
                feed.setFeedTicketId(Integer.parseInt(type[0].toString()));
              }
              if (type[1] != null) {
                feed.setTicketNo(type[1].toString());
              }
              if (type[2] != null) {
                feed.setOpenDate(DateUtil.convertDateToIndianFormat(type[2].toString()));
              }

              if (type[3] != null) {
                feed.setOpenTime(type[3].toString());
              }

              if (type[4] != null) {
                feed.setEscalationDate(DateUtil.convertDateToIndianFormat(type[4].toString()));
              }

              if (type[5] != null) {
                feed.setEscalationTime(type[5].toString());
              }

              if (type[6] != null) {
                feed.setLevel(type[6].toString());
              }

              if (type[7] != null) {
                feed.setClientId(type[7].toString());
              }

              if (type[8] != null) {
                feed.setClientName(type[8].toString());
              }

              if (type[9] != null) {
                feed.setMobNo(type[9].toString());
              }

              if (type[10] != null) {
                feed.setEmailId(type[10].toString());
              }

              if (type[11] != null) {
                feed.setRefNo(type[12].toString());
              }

              if (type[12] != null) {
                feed.setCentreCode(type[12].toString());
              }

              if (type[13] != null) {
                feed.setCentreName(type[13].toString());
              }

              if (type[15] != null) {
                feed.setProblem(type[15].toString());
              }

              if (type[16] != null) {
                feed.setComplaintType(type[16].toString());
              }

              if (type[17] != null) {
                feed.setHandledBy(type[17].toString());
              }

              if (type[18] != null) {
                feed.setRemarks(type[18].toString());
              }

              if (type[19] != null) {
                feed.setKeyWord(type[19].toString());
              }

              if (type[20] != null) {
                feed.setIp(type[20].toString());
              }

              tempList.add(feed);
            }
            setCustDataList(tempList);
          }
        }
        return SUCCESS;
      } catch (Exception e) {
        e.printStackTrace();
        log.error(
            "Problem in method viewCustomerResInGrid of class "
                + getClass()
                + " on "
                + DateUtil.getCurrentDateIndianFormat()
                + " at "
                + DateUtil.getCurrentTimeHourMin(),
            e);
        return ERROR;
      }
    } else {
      return LOGIN;
    }
  }