public String takeActionForAudit() {
   boolean validFlag = ValidateSession.checkSession();
   if (validFlag) {
     try {
       System.out.println(">>>>>edit>>>>>");
       Map<String, Object> wherClause = new HashMap<String, Object>();
       Map<String, Object> condtnBlock = new HashMap<String, Object>();
       wherClause.put("action_type", request.getParameter("actionType"));
       wherClause.put("comments", request.getParameter("comments"));
       wherClause.put("action_by", userName);
       wherClause.put(
           "action_date_time",
           DateUtil.getCurrentDateUSFormat() + ", " + DateUtil.getCurrentTime());
       System.out.println("id>>>>>" + getId());
       condtnBlock.put("id", getId());
       boolean b =
           cbt.updateTableColomn(
               "feedback_audit_report", wherClause, condtnBlock, connectionSpace);
       if (b) {
         addActionMessage("Action Taken Successfullly!!!");
         return SUCCESS;
       } else {
         addActionMessage("Oops!!! There is some error.");
         return ERROR;
       }
     } catch (Exception e) {
       e.printStackTrace();
       return ERROR;
     }
   } else {
     return LOGIN;
   }
 }
Exemplo n.º 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();
    }
  }
  public boolean addMessageHR(
      String name,
      String dept,
      String mobone,
      String msg,
      String ticketno,
      String status,
      String statusflag,
      String module,
      SessionFactory connectionSpace) {
    System.out.println("mobone >>addMessageHR>>" + mobone);
    System.out.println("INSIDE THIS");
    boolean flag = false;
    @SuppressWarnings("unused")
    String returnResult = ERROR;
    // boolean sessionFlag = ValidateSession.checkSession();

    // System.out.println("sessionFlag"+sessionFlag);
    {
      try {
        // Map session = ActionContext.getContext().getSession();
        // String userName = (String)session.get("uName");
        // SessionFactory connectionSpace =(SessionFactory) session.get("connectionSpace");
        CommonOperInterface cot = new CommonConFactory().createInterface();
        TableColumes ob1 = new TableColumes();
        List<TableColumes> TableColumnName = new ArrayList<TableColumes>();

        ob1.setColumnname("name");
        ob1.setDatatype("varchar(80)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("dept");
        ob1.setDatatype("varchar(80)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("mobno");
        ob1.setDatatype("varchar(15)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("msg_text");
        ob1.setDatatype("varchar(250)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("flag");
        ob1.setDatatype("varchar(10)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("status");
        ob1.setDatatype("varchar(100)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("module");
        ob1.setDatatype("varchar(20)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("user");
        ob1.setDatatype("varchar(100)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("date");
        ob1.setDatatype("varchar(10)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("time");
        ob1.setDatatype("varchar(10)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("update_date");
        ob1.setDatatype("varchar(10)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("update_time");
        ob1.setDatatype("varchar(10)");
        ob1.setConstraint("default NULL");
        TableColumnName.add(ob1);

        cot.createTable22("instant_msg", TableColumnName, connectionSpace);

        InsertDataTable ob = new InsertDataTable();
        List<InsertDataTable> insertData = new ArrayList<InsertDataTable>();
        ob.setColName("name");
        ob.setDataName(name);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("dept");
        ob.setDataName(dept);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("mobno");
        ob.setDataName(mobone);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("msg_text");
        ob.setDataName(msg);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("flag");
        ob.setDataName(statusflag);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("status");
        ob.setDataName(status);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("module");
        ob.setDataName(module);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("user");
        ob.setDataName("Shailendra");
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("date");
        ob.setDataName(DateUtil.getCurrentDateUSFormat());
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("time");
        ob.setDataName(DateUtil.getCurrentTime());
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("update_date");
        ob.setDataName("0000-00-00");
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("update_time");
        ob.setDataName("00-00-00");
        insertData.add(ob);

        cot.insertIntoTable("instant_msg", insertData, connectionSpace);
        insertData.clear();
        flag = true;
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    return flag;
  }
  public boolean addMail(
      String emailid,
      String subject,
      String mailtext,
      String ticketno,
      String status,
      String statusflag,
      String attachment,
      String module,
      SessionFactory connection) {
    boolean flag = false;

    try {
      CommonOperInterface cot = new CommonConFactory().createInterface();

      InsertDataTable ob = new InsertDataTable();
      List<InsertDataTable> insertData = new ArrayList<InsertDataTable>();
      ob.setColName("ticket_no");
      ob.setDataName(ticketno);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("emailid");
      ob.setDataName(emailid);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("subject");
      ob.setDataName(subject);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("mail_text");
      ob.setDataName(mailtext);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("flag");
      ob.setDataName(statusflag);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("status");
      ob.setDataName(status);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("attachment");
      ob.setDataName(attachment);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("module");
      ob.setDataName(module);
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("userName");
      ob.setDataName("escalate");
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("date");
      ob.setDataName(DateUtil.getCurrentDateUSFormat());
      insertData.add(ob);

      ob = new InsertDataTable();
      ob.setColName("time");
      ob.setDataName(DateUtil.getCurrentTime());
      insertData.add(ob);

      cot.insertIntoTable("instant_mail", insertData, connection);
      insertData.clear();
      flag = true;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return flag;
  }
  public boolean addMail(
      String name,
      String dept,
      String emailid,
      String subject,
      String mailtext,
      String ticketno,
      String status,
      String statusflag,
      String attachment,
      String module) {
    boolean flag = false;
    @SuppressWarnings("unused")
    String returnResult = ERROR;
    boolean sessionFlag = ValidateSession.checkSession();
    if (sessionFlag) {
      try {
        Map session = ActionContext.getContext().getSession();
        String userName = (String) session.get("uName");
        SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
        CommonOperInterface cot = new CommonConFactory().createInterface();
        List<TableColumes> tablecolumn = new ArrayList<TableColumes>();

        TableColumes tc = new TableColumes();

        tc.setColumnname("name");
        tc.setDatatype("varchar(80)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("sub_type_id");
        tc.setDatatype("varchar(80)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("email_id");
        tc.setDatatype("varchar(100)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("subject");
        tc.setDatatype("varchar(100)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("mail_text");
        tc.setDatatype("text");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("flag");
        tc.setDatatype("varchar(10)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("status");
        tc.setDatatype("varchar(50)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("attachment");
        tc.setDatatype("varchar(300)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("module");
        tc.setDatatype("varchar(300)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("userName");
        tc.setDatatype("varchar(25)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("date");
        tc.setDatatype("varchar(10)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("time");
        tc.setDatatype("varchar(10)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("update_date");
        tc.setDatatype("varchar(10)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        tc = new TableColumes();
        tc.setColumnname("update_time");
        tc.setDatatype("varchar(10)");
        tc.setConstraint("default NULL");
        tablecolumn.add(tc);

        @SuppressWarnings("unused")
        boolean aa = cot.createTable22("instant_mail", tablecolumn, connectionSpace);

        InsertDataTable ob = new InsertDataTable();
        List<InsertDataTable> insertData = new ArrayList<InsertDataTable>();
        ob.setColName("name");
        ob.setDataName(name);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("sub_type_id");
        ob.setDataName(dept);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("email_id");
        ob.setDataName(emailid);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("subject");
        ob.setDataName(subject);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("mail_text");
        ob.setDataName(mailtext);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("flag");
        ob.setDataName(statusflag);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("status");
        ob.setDataName(status);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("attachment");
        ob.setDataName(attachment);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("module");
        ob.setDataName(module);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("userName");
        ob.setDataName(userName);
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("date");
        ob.setDataName(DateUtil.getCurrentDateUSFormat());
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("time");
        ob.setDataName(DateUtil.getCurrentTime());
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("update_date");
        ob.setDataName("0000:00:00");
        insertData.add(ob);

        ob = new InsertDataTable();
        ob.setColName("update_time");
        ob.setDataName("00:00:00");
        insertData.add(ob);

        cot.insertIntoTable("instant_mail", insertData, connectionSpace);
        insertData.clear();
        flag = true;
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      returnResult = LOGIN;
    }
    return flag;
  }
  // Add Sms to client and server.
  public boolean addMessageClientServer(
      String mobone,
      String msg,
      String ticketno,
      String status,
      String statusflag,
      String module,
      SessionFactory connection) {
    boolean flag = false;
    boolean statusserver = false;
    try {
      // CommonOperInterface cot = new CommonConFactory().createInterface();
      CommonOperInterface cbt = new CommonConFactory().createInterface();

      /* InsertDataTable ob=new InsertDataTable();
         List <InsertDataTable> insertData=new ArrayList<InsertDataTable>();
      ob.setColName("ticket_no");
      ob.setDataName(ticketno);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("mobno");
      ob.setDataName(mobone);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("msg_text");
      ob.setDataName(msg);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("flag");
      ob.setDataName(statusflag);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("status");
      ob.setDataName(status);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("module");
      ob.setDataName(module);
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("user");
      ob.setDataName("escalate");
      insertData.add(ob);


      ob=new InsertDataTable();
      ob.setColName("date");
      ob.setDataName(DateUtil.getCurrentDateUSFormat());
      insertData.add(ob);

      ob=new InsertDataTable();
      ob.setColName("time");
      ob.setDataName(DateUtil.getCurrentTime());
      insertData.add(ob);

            cot.insertIntoTable("instant_msg",insertData,connection);
            insertData.clear();*/

      /** Code to insert data on server database. */
      PreRequestserviceStub objstatus = new PreRequestserviceStub();
      //	InsertIntoTable obj=new InsertIntoTable();
      List<String> Tablecolumename = new ArrayList<String>();
      List<String> Tablecolumevalue = new ArrayList<String>();
      /*Tablecolumename.add("ticket_no");
      Tablecolumevalue.add(ticketno);*/
      Tablecolumename.add("mobno");
      Tablecolumevalue.add(mobone);
      Tablecolumename.add("msg_text");
      Tablecolumevalue.add(msg);
      Tablecolumename.add("flag");
      Tablecolumevalue.add(statusflag);
      Tablecolumename.add("status");
      Tablecolumevalue.add(status);
      Tablecolumename.add("module");
      Tablecolumevalue.add(module);
      Tablecolumename.add("user");
      Tablecolumevalue.add("escalate");
      Tablecolumename.add("date");
      Tablecolumevalue.add(DateUtil.getCurrentDateUSFormat());
      Tablecolumename.add("time");
      Tablecolumevalue.add(DateUtil.getCurrentTime());
      StringBuilder createTableQuery = new StringBuilder("INSERT INTO " + "instant_msg" + " (");

      int i = 1;
      // append Column
      for (String h : Tablecolumename) {
        if (i < Tablecolumename.size()) createTableQuery.append(h + ", ");
        else createTableQuery.append(h + ")");
        i++;
      }

      createTableQuery.append(" VALUES (");
      i = 1;
      for (String h : Tablecolumevalue) {
        if (i < Tablecolumevalue.size()) createTableQuery.append("'" + h + "', ");
        else createTableQuery.append("'" + h + "')");
        i++;
      }
      createTableQuery.append(" ;");
      // System.out.println(">>>>>>>>>>>>>"+createTableQuery);
      //	obj.setCreateTableQuery(createTableQuery.toString());

      // insert into local database.
      int maxId = cbt.insertIntoTable(createTableQuery.toString(), connection);
      // insert into Server database.
      //    statusserver= objstatus.insertIntoTable(obj).get_return();
      if (statusserver) {
        flag = true;
      } else {
        flag = false;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return flag;
  }
  // 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;
  }
  @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;
  }
Exemplo n.º 9
0
  @SuppressWarnings("rawtypes")
  public String updateFeedbackStatus() {
    String returnResult = ERROR;
    boolean sessionFlag = ValidateSession.checkSession();
    if (sessionFlag) {
      try {
        HelpdeskUniversalHelper HUH = new HelpdeskUniversalHelper();
        new HelpdeskUniversalAction();
        MsgMailCommunication MMC = new MsgMailCommunication();
        FeedbackPojo fbp = new FeedbackPojo();
        String duration = "NA";
        Map<String, Object> wherClause = new HashMap<String, Object>();
        Map<String, Object> condtnBlock = new HashMap<String, Object>();

        String snDate = "", snTime = "", snUpToDate = "", snUpToTime = "", snDuration = "";
        List ticketData =
            new HelpdeskUniversalAction()
                .getMultipleColumns(
                    "complaint_status",
                    "sn_on_date",
                    "sn_on_time",
                    "sn_upto_date",
                    "sn_upto_time",
                    "sn_duration",
                    "id",
                    getFeedid(),
                    "",
                    "",
                    connectionSpace);
        if (ticketData != null && ticketData.size() > 0) {
          for (Iterator iterator = ticketData.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object[0] != null && !object[0].toString().equals("")) {
              snDate = object[0].toString();
            } else {
              snDate = "NA";
            }
            if (object[1] != null && !object[1].toString().equals("")) {
              snTime = object[1].toString();
            } else {
              snTime = "NA";
            }
            if (object[2] != null && !object[2].toString().equals("")) {
              snUpToDate = object[2].toString();
            } else {
              snUpToDate = "NA";
            }
            if (object[3] != null && !object[3].toString().equals("")) {
              snUpToTime = object[3].toString();
            } else {
              snUpToTime = "NA";
            }
            if (object[4] != null && !object[4].toString().equals("")) {
              snDuration = object[4].toString();
            } else {
              snDuration = "NA";
            }
          }
        }

        if (getStatus().equalsIgnoreCase("Resolved")) {
          String cal_duration = "";
          if (open_date != null
              && !open_date.equals("")
              && open_time != null
              && !open_time.equals("")) {
            duration =
                DateUtil.time_difference(
                    DateUtil.convertDateToUSFormat(open_date),
                    open_time,
                    DateUtil.getCurrentDateUSFormat(),
                    DateUtil.getCurrentTime());
          }
          if (!snDuration.equals("") && !snDuration.equals("NA")) {
            boolean flag = DateUtil.time_update(snUpToDate, snUpToTime);
            if (flag) {
              cal_duration = DateUtil.getTimeDifference(duration, snDuration);
              if (cal_duration != null && !cal_duration.equals("") && !cal_duration.contains("-")) {
                duration = cal_duration;
              }
            } else {
              String newduration =
                  DateUtil.time_difference(
                      snDate, snTime, DateUtil.getCurrentDateUSFormat(), DateUtil.getCurrentTime());
              if (newduration != null && !newduration.equals("") && !newduration.equals("NA")) {
                String new_cal_duration = DateUtil.getTimeDifference(duration, newduration);
                if (new_cal_duration != null
                    && !new_cal_duration.equals("")
                    && !new_cal_duration.contains("-")) {
                  duration = new_cal_duration;
                }
              }
            }
          }
          wherClause.put("status", getStatus());
          wherClause.put("action_by", userName);
          wherClause.put("resolve_date", DateUtil.getCurrentDateUSFormat());
          wherClause.put("resolve_time", DateUtil.getCurrentTime());
          wherClause.put("resolve_duration", duration);
          wherClause.put("resolve_remark", DateUtil.makeTitle(getRemark()));
          wherClause.put("resolve_by", getResolver());
          wherClause.put("spare_used", getSpareused());
          wherClause.put("resolve_rca", getRca());
          wherClause.put("resolve_capa", getCapa());
          condtnBlock.put("id", getFeedid());
        } else if (getStatus().equalsIgnoreCase("Snooze")) {
          if (snDate.equals("NA") || snTime.equals("NA")) {
            if (snoozeDate != null
                && !snoozeDate.equals("")
                && snoozeTime != null
                && !snoozeTime.equals("")) {
              duration =
                  DateUtil.time_difference(
                      DateUtil.getCurrentDateUSFormat(),
                      DateUtil.getCurrentTime(),
                      DateUtil.convertDateToUSFormat(snoozeDate),
                      snoozeTime);
            }
          } else {
            if (snoozeDate != null
                && !snoozeDate.equals("")
                && snoozeTime != null
                && !snoozeTime.equals("")) {
              duration =
                  DateUtil.time_difference(
                      snDate, snTime, DateUtil.convertDateToUSFormat(snoozeDate), snoozeTime);
            }
          }

          wherClause.put("status", getStatus());
          wherClause.put("sn_reason", DateUtil.makeTitle(getSnoozecomment()));
          if (snDate.equals("NA") || snTime.equals("NA")) {
            wherClause.put("sn_on_date", DateUtil.getCurrentDateUSFormat());
            wherClause.put("sn_on_time", DateUtil.getCurrentTime());
          }
          wherClause.put("sn_upto_date", DateUtil.convertDateToUSFormat(snoozeDate));
          wherClause.put("sn_upto_time", snoozeTime);
          wherClause.put("sn_duration", duration);
          wherClause.put("action_by", userName);
          condtnBlock.put("id", getFeedid());
        } else if (getStatus().equalsIgnoreCase("High Priority")) {
          wherClause.put("status", getStatus());
          wherClause.put("hp_date", DateUtil.getCurrentDateUSFormat());
          wherClause.put("hp_time", DateUtil.getCurrentTime());
          wherClause.put("hp_reason", DateUtil.makeTitle(getHpcomment()));
          wherClause.put("action_by", userName);
          condtnBlock.put("id", getFeedid());
        } else if (getStatus().equalsIgnoreCase("Ignore")) {
          wherClause.put("status", getStatus());
          wherClause.put("ig_date", DateUtil.getCurrentDateUSFormat());
          wherClause.put("ig_time", DateUtil.getCurrentTime());
          wherClause.put("ig_reason", DateUtil.makeTitle(getIgnorecomment()));
          wherClause.put("action_by", userName);
          condtnBlock.put("id", getFeedid());
        }
        /*else if (getStatus().equalsIgnoreCase("Re-Assign"))
        {
        	String feedBy="NA",mobNo="NA",emailId="NA",bysubdept="NA",feedBrief="NA",location="NA";
        	List existTicketData = new HelpdeskUniversalHelper().getTransferTicketData(getFeedid(), connectionSpace);
        	if (existTicketData!=null && existTicketData.size()>0) {
        		for (Iterator iterator = existTicketData.iterator(); iterator
        				.hasNext();) {
        			Object[] object = (Object[]) iterator.next();
        			if (object[0]!=null && !object[0].toString().equals("")) {
        				feedBy=object[0].toString();
        			}
        			if (object[1]!=null && !object[1].toString().equals("")) {
        				mobNo=object[1].toString();
        			}
        			if (object[2]!=null && !object[2].toString().equals("")) {
        				emailId=object[2].toString();
        			}
        			if (object[3]!=null && !object[3].toString().equals("")) {
        				bysubdept=object[3].toString();
        			}
        			if (object[4]!=null && !object[4].toString().equals("")) {
        				feedBrief=object[4].toString();
        			}
        			if (object[5]!=null && !object[5].toString().equals("")) {
        				location=object[5].toString();
        			}
        		}
        		boolean flag = transferComplaint(feedBy,mobNo,emailId,bysubdept,feedBrief,location,getFeedid());
        		if (flag) {
        			wherClause.put("status", "Transfer");
        			wherClause.put("transfer_date", DateUtil.getCurrentDateUSFormat());
        			wherClause.put("transfer_time", DateUtil.getCurrentTime());
        			wherClause.put("transfer_reason", DateUtil.makeTitle(getReAssignRemark()));
        			wherClause.put("action_by", userName);
        			condtnBlock.put("id", getFeedid());
        		}
        	}

        }*/
        boolean updateFeed =
            HUH.updateTableColomn("complaint_status", wherClause, condtnBlock, connectionSpace);
        if (updateFeed) {
          ComplaintLodgeHelper CLH = new ComplaintLodgeHelper();

          String levelMsg = "",
              complainatMsg = "",
              mailText = "",
              mailSubject = "",
              mailheading = "";
          List data = CLH.getFeedbackDetail(getFeedid(), getStatus(), connectionSpace);
          if (data != null && data.size() > 0) {
            fbp = CLH.setFeedbackDataValues(data, getStatus(), connectionSpace);
          }
          if (getStatus().equalsIgnoreCase("Resolved")) {
            // levelMsg = "Close Feedback Alert: Ticket No: " + fbp.getTicket_no() + ", Reg. By: " +
            // DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ", Location: " +
            // fbp.getLocation() + ", Brief: " + remark + " is Closed.";
            // complainatMsg = "Dear " + DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ",
            // Ticket No: " + fbp.getTicket_no() + ", Location: " + fbp.getLocation() + ", Brief: "
            // + remark + " is Closed.";
            mailSubject = "Close Ticket Alert: " + fbp.getTicket_no();
            mailheading = "Close Ticket Alert: " + fbp.getTicket_no();
          } else if (getStatus().equalsIgnoreCase("High Priority")) {
            // levelMsg = "High Priority Alert: Ticket No: " + fbp.getTicket_no() + ", Reg. By : " +
            // DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ", Location: " +
            // fbp.getLocation() + ", Brief: " + fbp.getFeed_brief() + ",Reason: " +
            // fbp.getHp_reason() + ".";
            // complainatMsg = "Dear " + DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ",
            // Ticket No: " + fbp.getTicket_no() + ", Location: " + fbp.getLocation() + ", Brief: "
            // + fbp.getFeed_brief() + ",Reason: " + fbp.getHp_reason() + " is on High Priority.";
            mailSubject = "High Priority Feedback Alert: " + fbp.getTicket_no();
            mailheading = "High Priority Case Ticket Alert";
          } else if (getStatus().equalsIgnoreCase("Snooze")) {
            // levelMsg = "Snooze Alert: Ticket No: " + fbp.getTicket_no() + ", Reg. By: " +
            // DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ", Location: " +
            // fbp.getLocation() + ", Brief: " + fbp.getFeed_brief() + " will be Snoozed till " +
            // fbp.getSn_duration() + ",Reason: " + fbp.getSn_reason() + ".";
            // complainatMsg = "Dear " + DateUtil.makeTitle(fbp.getFeed_registerby().trim()) + ",
            // Ticket No: " + fbp.getTicket_no() + ", Location: " + fbp.getLocation() + ", Brief: "
            // + fbp.getFeed_brief() + ",Status: Snoozed to " + fbp.getSn_on_date() + " " +
            // fbp.getSn_on_time() + " Hrs, Reason:" + fbp.getSn_reason() + ".";
            mailSubject = "Snooze Feedback Alert: " + fbp.getTicket_no();
            mailheading = "Snooze Case Ticket Alert";
          } else if (getStatus().equalsIgnoreCase("Ignore")) {
            // levelMsg = "Ignore Feedback Alert: Ticket No: " + fbp.getTicket_no() + ", Reg. By: "
            // + DateUtil.makeTitle(fbp.getFeed_registerby()) + ", Location: " + fbp.getLocation() +
            // ", Brief: " + fbp.getFeed_brief() + ",Reason: " + fbp.getIg_reason() + " should be
            // Ignored.";
            // complainatMsg = "Dear " + DateUtil.makeTitle(fbp.getFeed_registerby()) + ", Ticket
            // No: " + fbp.getTicket_no() + ", Location: " + fbp.getLocation() + ", Brief: " +
            // fbp.getFeed_brief() + ",Reason: " + fbp.getIg_reason() + " is Ignored.";
            mailSubject = "Ignore Feedback Alert: " + fbp.getTicket_no();
            mailheading = "Ignore Case Ticket Alert";
          }

          if (getStatus().equalsIgnoreCase("Resolved")) {
            /*if (fbp.getFeedback_by_mobno() != null && fbp.getFeedback_by_mobno() != "" && fbp.getFeedback_by_mobno().trim().length() == 10 && (fbp.getFeedback_by_mobno().startsWith("9") || fbp.getFeedback_by_mobno().startsWith("8") || fbp.getFeedback_by_mobno().startsWith("7")))
            {
            	MMC.addMessage(fbp.getFeed_registerby(), fbp.getFeedback_by_dept(), fbp.getFeedback_by_mobno(), complainatMsg, ticket_no, getStatus(), "0", "HDM");
            }*/
            if (fbp.getFeedback_by_emailid() != null && !fbp.getFeedback_by_emailid().equals("")) {
              mailText =
                  CLH.getConfigMessage(
                      fbp,
                      mailheading,
                      getStatus(),
                      false,
                      fbp.getClientFor(),
                      fbp.getClientName(),
                      fbp.getOfferingName());
              MMC.addMail(
                  fbp.getFeed_registerby(),
                  fbp.getFeedback_by_dept(),
                  fbp.getFeedback_by_emailid(),
                  mailSubject,
                  mailText,
                  ticket_no,
                  getStatus(),
                  "0",
                  "",
                  "DREAM_HDM");
            }
            /*if (fbp.getResolve_by_mobno() != null && fbp.getResolve_by_mobno() != "" && fbp.getResolve_by_mobno().trim().length() == 10 && (fbp.getResolve_by_mobno().startsWith("9") || fbp.getResolve_by_mobno().startsWith("8") || fbp.getResolve_by_mobno().startsWith("7")))
            {
            	MMC.addMessage(fbp.getResolve_by(), fbp.getFeedback_to_dept(), fbp.getResolve_by_mobno(), levelMsg, ticket_no, getStatus(), "0", "HDM");
            }*/
            if (fbp.getResolve_by_emailid() != null && !fbp.getResolve_by_emailid().equals("")) {
              mailText =
                  CLH.getConfigMessage(
                      fbp,
                      mailheading,
                      getStatus(),
                      true,
                      fbp.getClientFor(),
                      fbp.getClientName(),
                      fbp.getOfferingName());
              MMC.addMail(
                  fbp.getResolve_by(),
                  fbp.getFeedback_to_dept(),
                  fbp.getResolve_by_emailid(),
                  mailSubject,
                  mailText,
                  fbp.getTicket_no(),
                  "Pending",
                  "0",
                  "",
                  "DREAM_HDM");
            }
          } else if (getStatus().equalsIgnoreCase("High Priority")
              || getStatus().equalsIgnoreCase("Snooze")
              || getStatus().equalsIgnoreCase("Ignore")) {

            /*	if (fbp.getFeedback_by_mobno() != null && fbp.getFeedback_by_mobno() != "" && fbp.getFeedback_by_mobno().trim().length() == 10 && (fbp.getFeedback_by_mobno().startsWith("9") || fbp.getFeedback_by_mobno().startsWith("8") || fbp.getFeedback_by_mobno().startsWith("7")))
            {
            	MMC.addMessage(fbp.getFeed_registerby(), fbp.getFeedback_by_dept(), fbp.getFeedback_by_mobno(), complainatMsg, ticket_no, getStatus(), "0", "HDM");
            }
            	*/
            if (fbp.getFeedback_by_emailid() != null && !fbp.getFeedback_by_emailid().equals("")) {
              mailText =
                  CLH.getConfigMessage(
                      fbp,
                      mailheading,
                      getStatus(),
                      false,
                      fbp.getClientFor(),
                      fbp.getClientName(),
                      fbp.getOfferingName());
              MMC.addMail(
                  fbp.getFeed_registerby(),
                  fbp.getFeedback_by_dept(),
                  fbp.getFeedback_by_emailid(),
                  mailSubject,
                  mailText,
                  ticket_no,
                  getStatus(),
                  "0",
                  "",
                  "DREAM_HDM");
            }
            /*if (fbp.getMobOne() != null && fbp.getMobOne() != "" && fbp.getMobOne().trim().length() == 10 && (fbp.getMobOne().startsWith("9") || fbp.getMobOne().startsWith("8") || fbp.getMobOne().startsWith("7")))
            {
            	MMC.addMessage(fbp.getFeedback_allot_to(), fbp.getFeedback_to_dept(), fbp.getMobOne(), levelMsg, ticket_no, getStatus(), "0", "HDM");
            }*/

            if (fbp.getEmailIdOne() != null && !fbp.getEmailIdOne().equals("")) {
              mailText =
                  CLH.getConfigMessage(
                      fbp,
                      mailheading,
                      getStatus(),
                      true,
                      fbp.getClientFor(),
                      fbp.getClientName(),
                      fbp.getOfferingName());
              MMC.addMail(
                  fbp.getFeedback_allot_to(),
                  fbp.getFeedback_to_dept(),
                  fbp.getEmailIdOne(),
                  mailSubject,
                  mailText,
                  fbp.getTicket_no(),
                  "Pending",
                  "0",
                  "",
                  "DREAM_HDM");
            }
          }
          addActionMessage("Feedback Updated in " + getStatus() + " Successfully !!!");
          returnResult = SUCCESS;
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      returnResult = LOGIN;
    }
    return returnResult;
  }