public String actionOnFeedback() {
   String returnResult = ERROR;
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       if (dashFor != null && getDeptId() == null && feedStatus.equals("Pending")) {
         headingTitle = "Pending Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("Snooze")) {
         headingTitle = "Snooze Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("High Priority")) {
         headingTitle = "High Priority Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("Resolved")) {
         fromDate = DateUtil.getNewDate("month", -1, DateUtil.getCurrentDateUSFormat());
         toDate = DateUtil.getCurrentDateUSFormat();
         headingTitle = "Resolved Feedback >> View";
         returnResult = SUCCESS;
       }
       setGridColomnNames();
     } catch (Exception e) {
       e.printStackTrace();
     }
   } else {
     returnResult = LOGIN;
   }
   return returnResult;
 }
 public String beforeAuditHeader() {
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       fromDate = DateUtil.getNewDate("day", -6, DateUtil.getCurrentDateUSFormat());
       toDate = DateUtil.getCurrentDateUSFormat();
       return SUCCESS;
     } catch (Exception e) {
       e.printStackTrace();
       return ERROR;
     }
   } else {
     return LOGIN;
   }
 }
 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;
   }
 }
 public String beforeActionOnFeedback() {
   String returnResult = ERROR;
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")
           && feedStatus != null
           && !feedStatus.equals("")
           && (feedStatus.equals("Pending")
               || feedStatus.equals("Snooze")
               || feedStatus.equals("High Priority"))) {
         setFromDate(DateUtil.getNewDate("week", -1, DateUtil.getCurrentDateUSFormat()));
         toDate = DateUtil.getCurrentDateUSFormat();
         statusList();
         deptList();
         returnResult = SUCCESS;
       } else if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")
           && feedStatus != null
           && !feedStatus.equals("")
           && feedStatus.equals("Resolved")) {
         setFromDate(DateUtil.getNewDate("week", -1, DateUtil.getCurrentDateUSFormat()));
         toDate = DateUtil.getCurrentDateUSFormat();
         statusList();
         deptList();
         returnResult = SUCCESS;
       }
       if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")) {
         setGridColomnNames();
       }
     } catch (Exception e) {
       e.printStackTrace();
     }
   } else {
     returnResult = LOGIN;
   }
   return returnResult;
 }
  public String beforeShowClientBirthdayTable() {
    String returnValue = ERROR;
    if (ValidateSession.checkSession()) {
      try {
        StringBuilder query7 = new StringBuilder("");
        query7.append(
            "select cbd.clientName, ccd.personName, ccd.birthday from client_basic_data as cbd, "
                + "client_contact_data as ccd where cbd.id = ccd.clientName  "
                + "and (ccd.birthday >= '"
                + DateUtil.getCurrentDateUSFormat()
                + "' and ccd.birthday <= '"
                + DateUtil.getDateAfterDays(7)
                + "') order by ccd.birthday ");
        List dataCount7 = coi.executeAllSelectQuery(query7.toString(), connectionSpace);

        if (dataCount7 != null && dataCount7.size() > 0) {
          birthdayList = new ArrayList<ArrayList<String>>();
          for (Iterator iterator = dataCount7.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object != null && object[2] != null && !object[2].toString().equalsIgnoreCase("")) {
              ArrayList<String> data = new ArrayList<String>();
              data.add(object[0].toString());
              data.add(object[1].toString());
              data.add(DateUtil.convertDateToIndianFormat(object[2].toString()));

              birthdayList.add(data);
            }
          }
        }

        returnValue = SUCCESS;
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      returnValue = LOGIN;
    }
    return returnValue;
  }
  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;
  }
  @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;
  }
  @SuppressWarnings("rawtypes")
  public String beforeReportView() {
    if (ValidateSession.checkSession()) {
      try {
        String userName = (String) session.get("uName");
        CommonOperInterface cbt = new CommonConFactory().createInterface();
        SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
        TaskRegistrationHelper TRH = new TaskRegistrationHelper();
        StringBuilder query = new StringBuilder();
        String userEmpID = null;
        String alltedTo = 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 = TRH.getEmpDetailsByUserName("DAR", userName, connectionSpace)[0];
        alltedTo = TRH.getContactListForReports(userEmpID, userContID, connectionSpace);

        query.append("SELECT DISTINCT (contact.id),emp.empName FROM task_registration AS tr ");
        query.append("INNER JOIN compliance_contacts as contact ON contact.id=tr.allotedto ");
        query.append(
            "INNER JOIN employee_basic as emp ON contact.emp_id=emp.id WHERE contact.id IN ("
                + alltedTo
                + ")");
        List data = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
        allotedTo = new LinkedHashMap<Integer, String>();

        if (data != null && data.size() > 0) {
          for (Iterator iterator = data.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object[1] != null) {
              allotedTo.put((Integer) object[0], object[1].toString());
            }
          }
        }
        allotedTo.put(-1, "All Employee");
        query.setLength(0);
        if (data != null && data.size() > 0) {
          data.clear();
        }
        query.append("SELECT id,tasktype FROM task_type");
        taskType = new LinkedHashMap<Integer, String>();
        data = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
        if (data != null && data.size() > 0) {
          for (Iterator iterator = data.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object[1] != null) {
              taskType.put((Integer) object[0], object[1].toString());
            }
          }
        }
        fromDate = DateUtil.getNewDate("day", -7, DateUtil.getCurrentDateUSFormat());
        return SUCCESS;
      } catch (Exception e) {
        e.printStackTrace();
        return ERROR;
      }
    } else {
      return ERROR;
    }
  }
@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;
  }
}
Beispiel #13
0
@Entity
@org.hibernate.annotations.Proxy(lazy = false)
@Table(name = "registation_sinup")
public class Registation {
  @Id
  @Column(name = "id", nullable = false, unique = true)
  @GeneratedValue(strategy = GenerationType.AUTO)
  private int id;

  @Column(name = "org_reg_name")
  private String org_Registation_name;

  @Column(name = "org_name")
  private String orgname;

  @Column(name = "org_type")
  private String orgtype = "PRL";

  @Column(name = "industry")
  private String industry = "DS-10011";

  @Column(name = "regAddress")
  private String regaddress;

  @Column(name = "city")
  private String city;

  @Column(name = "pincode")
  private String pincode;

  @Column(name = "contactNo")
  private String contactNo;

  @Column(name = "contact_emailid")
  private String contact_emailid;

  @Column(name = "country")
  private String country;

  @Column(name = "confirm_key")
  private String confirm_key;

  @Column(name = "confirm_agreement")
  private boolean confirm_agreement;

  @Column(name = "created_datetime")
  private String create_datetime = "NA";

  @Column(name = "update_datetime")
  private String update_datetime = "NA";

  @Column(name = "brief")
  private String brief = "NA";

  @Column(name = "accountType")
  private String accountType = "NA";

  @Column(name = "accountid")
  private String accountid = "0";

  @Column(name = "uuid")
  private String uuid = "0";

  @Column(name = "isAccountActive")
  private String isAccountActive = "D";

  @Column(name = "signupstep")
  private String iscomplited = "N";

  @Column(name = "reg_user")
  private String reguser = null;

  @Column(name = "user_accountid")
  private String useraccountid;

  @Column(name = "companysize")
  private String companysize;

  @Column(name = "jobfunctionalArea")
  private String jobfunctionalArea;

  @Column(name = "jobtitle")
  private String jobtitle;

  @Column(name = "bPhonenumber")
  private String bPhonenumber;

  @Column(name = "demoAccount")
  private String demoAccount = "0";

  @Column(name = "date")
  private String date = DateUtil.getCurrentDateUSFormat();

  public Registation() {}

  public Registation(
      String city,
      boolean confirm_agreement,
      String confirm_key,
      String contactNo,
      String contact_emailid,
      String country,
      String create_datetime,
      String industry,
      String orgname,
      String orgtype,
      String pincode,
      String regaddress,
      String org_Registation_name,
      String bief,
      String accountType,
      String accountid,
      String uuid,
      String isAccountActive,
      String reguser,
      String useraccountid,
      String companysize,
      String jobfunctionalArea,
      String jobtitle,
      String bPhonenumber) {
    this.companysize = companysize;
    this.jobfunctionalArea = jobfunctionalArea;
    this.jobtitle = jobtitle;
    this.bPhonenumber = bPhonenumber;
    this.accountType = accountType;
    this.reguser = reguser;
    this.brief = bief;
    this.org_Registation_name = org_Registation_name;
    this.city = city;
    this.confirm_agreement = confirm_agreement;
    this.confirm_key = confirm_key;
    this.contactNo = contactNo;
    this.contact_emailid = contact_emailid;
    this.country = country;
    this.create_datetime = create_datetime;
    this.industry = industry;
    this.orgname = orgname;
    this.orgtype = orgtype;
    this.pincode = pincode;
    this.regaddress = regaddress;
    this.accountid = accountid;
    this.uuid = uuid;
    this.isAccountActive = isAccountActive;
    this.useraccountid = useraccountid;
  }

  public String getCompanysize() {
    return companysize;
  }

  public void setCompanysize(String companysize) {
    this.companysize = companysize;
  }

  public String getJobfunctionalArea() {
    return jobfunctionalArea;
  }

  public void setJobfunctionalArea(String jobfunctionalArea) {
    this.jobfunctionalArea = jobfunctionalArea;
  }

  public String getJobtitle() {
    return jobtitle;
  }

  public void setJobtitle(String jobtitle) {
    this.jobtitle = jobtitle;
  }

  public String getBPhonenumber() {
    return bPhonenumber;
  }

  public void setBPhonenumber(String phonenumber) {
    bPhonenumber = phonenumber;
  }

  public String getUseraccountid() {
    return useraccountid;
  }

  public void setUseraccountid(String useraccountid) {
    this.useraccountid = useraccountid;
  }

  public String getReguser() {
    return reguser;
  }

  public void setReguser(String reguser) {
    this.reguser = reguser;
  }

  public String getIscomplited() {
    return iscomplited;
  }

  public void setIscomplited(String iscomplited) {
    this.iscomplited = iscomplited;
  }

  public int getId() {
    return id;
  }

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

  public String getAccountid() {

    return accountid;
  }

  public void setAccountid(String accountid) {
    this.accountid = accountid;
  }

  public String getUuid() {
    return uuid;
  }

  public void setUuid(String uuid) {
    this.uuid = uuid;
  }

  public String getIsAccountActive() {
    return isAccountActive;
  }

  public void setIsAccountActive(String isAccountActive) {
    this.isAccountActive = isAccountActive;
  }

  public String getPincode() {
    return pincode;
  }

  public void setPincode(String pincode) {
    this.pincode = pincode;
  }

  public String getContactNo() {
    return contactNo;
  }

  public void setContactNo(String contactNo) {
    this.contactNo = contactNo;
  }

  public String getAccountType() {
    return accountType;
  }

  public void setAccountType(String accountType) {
    this.accountType = accountType;
  }

  public String getBrief() {
    return brief;
  }

  public void setBrief(String brief) {
    this.brief = brief;
  }

  public String getOrg_Registation_name() {
    return org_Registation_name;
  }

  public void setOrg_Registation_name(String org_Registation_name) {
    this.org_Registation_name = org_Registation_name;
  }

  public String getOrgname() {
    return orgname;
  }

  public void setOrgname(String orgname) {
    this.orgname = orgname;
  }

  public String getOrgtype() {
    return orgtype;
  }

  public void setOrgtype(String orgtype) {
    this.orgtype = orgtype;
  }

  public String getIndustry() {
    return industry;
  }

  public void setIndustry(String industry) {
    this.industry = industry;
  }

  public String getRegaddress() {
    return regaddress;
  }

  public void setRegaddress(String regaddress) {
    this.regaddress = regaddress;
  }

  public String getCity() {
    return city;
  }

  public void setCity(String city) {
    this.city = city;
  }

  public String getContact_emailid() {
    return contact_emailid;
  }

  public void setContact_emailid(String contact_emailid) {
    this.contact_emailid = contact_emailid;
  }

  public String getCountry() {
    return country;
  }

  public void setCountry(String country) {
    this.country = country;
  }

  public String getConfirm_key() {
    return confirm_key;
  }

  public void setConfirm_key(String confirm_key) {
    this.confirm_key = confirm_key;
  }

  public boolean isConfirm_agreement() {
    return confirm_agreement;
  }

  public void setConfirm_agreement(boolean confirm_agreement) {
    this.confirm_agreement = confirm_agreement;
  }

  public String getCreate_datetime() {
    return create_datetime;
  }

  public void setCreate_datetime(String create_datetime) {
    this.create_datetime = create_datetime;
  }

  public String getUpdate_datetime() {
    return update_datetime;
  }

  public void setUpdate_datetime(String update_datetime) {
    this.update_datetime = update_datetime;
  }

  public String getDemoAccount() {
    return demoAccount;
  }

  public void setDemoAccount(String demoAccount) {
    this.demoAccount = demoAccount;
  }

  public String getDate() {
    return date;
  }

  public void setDate(String date) {
    this.date = date;
  }
}
  public String addEscalationConfig() {
    boolean sessionFlag = ValidateSession.checkSession();
    if (sessionFlag) {
      try {
        String query = "SELECT esc_type FROM feedback_escalation_type_config";
        List dataList = cbt.executeAllSelectQuery(query, connectionSpace);
        if (dataList != null && dataList.size() > 0) {
          for (Iterator iterator = dataList.iterator(); iterator.hasNext(); ) {
            String type = (String) iterator.next();
            if (type.equalsIgnoreCase(request.getParameter("escType"))) {
              addActionMessage("Opps. Escalation Type is already exist!!!");
              return SUCCESS;
            }
          }
        }
        List<InsertDataTable> insertData = new ArrayList<InsertDataTable>();
        InsertDataTable ob = null;
        List<TableColumes> tableColume = new ArrayList<TableColumes>();
        TableColumes ob1 = new TableColumes();
        ob1.setColumnname("esc_type");
        ob1.setDatatype("varchar(20)");
        ob1.setConstraint("default NULL");
        tableColume.add(ob1);

        ob1 = new TableColumes();
        ob1.setColumnname("user_name");
        ob1.setDatatype("varchar(30)");
        ob1.setConstraint("default NULL");
        tableColume.add(ob1);

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

        cbt.createTable22("feedback_escalation_type_config", tableColume, connectionSpace);

        ob = new InsertDataTable();
        ob.setColName("esc_type");
        ob.setDataName(request.getParameter("openType"));
        insertData.add(ob);

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

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

        boolean status =
            cbt.insertIntoTable("feedback_escalation_type_config", insertData, connectionSpace);
        if (status) {
          addActionMessage("Data saved sucessfully.");
          return SUCCESS;
        } else {
          addActionMessage("Opps. There are some problem in data save!!!");
          return ERROR;
        }
      } catch (Exception e) {
        e.printStackTrace();
        addActionMessage("Opps. There are some problem in data save!!!");
        return ERROR;
      }
    } else {
      return LOGIN;
    }
  }