public void setContactAddPageDataFields() {
    try {
      CommonOperInterface cbt = new CommonConFactory().createInterface();
      List<GridDataPropertyView> gridFields =
          Configuration.getConfigurationData(
              "mapped_common_contact_configuration",
              accountID,
              connectionSpace,
              "",
              0,
              "table_name",
              "common_contact_configuration");
      if (gridFields != null) {
        contactDD = new ArrayList<ConfigurationUtilBean>();
        for (GridDataPropertyView gdp : gridFields) {
          ConfigurationUtilBean objdata = new ConfigurationUtilBean();
          if (gdp.getColType().trim().equalsIgnoreCase("D")) {
            objdata.setKey(gdp.getColomnName());
            objdata.setValue(gdp.getHeadingName());
            objdata.setColType(gdp.getColType());
            objdata.setValidationType(gdp.getValidationType());
            if (gdp.getMandatroy() == null) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("0")) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("1")) objdata.setMandatory(true);
            contactDD.add(objdata);

            if (gdp.getColomnName().equalsIgnoreCase("regLevel")) {
              officeMap = new HashMap<Integer, String>();
              List data =
                  cbt.executeAllSelectQuery(
                      " select levelName from mapped_orgleinfo_level ", connectionSpace);

              if (data != null && data.size() > 0 && data.get(0) != null) {
                String arr[] = data.get(0).toString().split("#");
                for (int i = 0; i < arr.length; i++) {
                  officeMap.put(i + 1, arr[i].toString());
                }
              }
            }
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  @SuppressWarnings("rawtypes")
  public void setContactDataFieldsToAdd(String mappedTable, String configTable) {
    try {
      CommonOperInterface cbt = new CommonConFactory().createInterface();
      List<GridDataPropertyView> gridFields =
          Configuration.getConfigurationData(
              mappedTable, accountID, connectionSpace, "", 0, "table_name", configTable);

      if (gridFields != null) {
        deptMap = new HashMap<Integer, String>();
        contactFormDDBox = new ArrayList<ConfigurationUtilBean>();
        contactTextBox = new ArrayList<ConfigurationUtilBean>();
        industryMap = new HashMap<Integer, String>();
        contactFileBox = new ArrayList<ConfigurationUtilBean>();
        contactDateTimeBox = new ArrayList<ConfigurationUtilBean>();
        for (GridDataPropertyView gdp : gridFields) {
          ConfigurationUtilBean objdata = new ConfigurationUtilBean();
          if (gdp.getColType().trim().equalsIgnoreCase("T")
              && !gdp.getColomnName().equalsIgnoreCase("userName")
              && !gdp.getColomnName().equalsIgnoreCase("createdDate")
              && !gdp.getColomnName().equalsIgnoreCase("createdAt")
              && !gdp.getColomnName().equalsIgnoreCase("userAccountId")
              && !gdp.getColomnName().equalsIgnoreCase("flag")) {
            objdata.setKey(gdp.getColomnName());
            objdata.setValue(gdp.getHeadingName());
            objdata.setColType(gdp.getColType());
            objdata.setValidationType(gdp.getValidationType());
            if (gdp.getMandatroy() == null) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("0")) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("1")) objdata.setMandatory(true);
            contactTextBox.add(objdata);
          } else if (gdp.getColType().trim().equalsIgnoreCase("F")
              && !gdp.getColomnName().equalsIgnoreCase("userName")
              && !gdp.getColomnName().equalsIgnoreCase("createdDate")
              && !gdp.getColomnName().equalsIgnoreCase("createdAt")) {
            objdata.setKey(gdp.getColomnName());
            objdata.setValue(gdp.getHeadingName());
            objdata.setColType(gdp.getColType());
            objdata.setValidationType(gdp.getValidationType());
            if (gdp.getMandatroy() == null) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("0")) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("1")) objdata.setMandatory(true);
            contactFileBox.add(objdata);

          } else if (gdp.getColType().trim().equalsIgnoreCase("date")) {
            objdata.setKey(gdp.getColomnName());
            objdata.setValue(gdp.getHeadingName());
            objdata.setColType(gdp.getColType());
            objdata.setValidationType(gdp.getValidationType());
            if (gdp.getMandatroy() == null) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("0")) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("1")) objdata.setMandatory(true);
            contactDateTimeBox.add(objdata);
          } else if (gdp.getColType().trim().equalsIgnoreCase("D")) {
            objdata.setKey(gdp.getColomnName());
            objdata.setValue(gdp.getHeadingName());
            objdata.setColType(gdp.getColType());
            objdata.setValidationType(gdp.getValidationType());
            if (gdp.getMandatroy() == null) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("0")) objdata.setMandatory(false);
            else if (gdp.getMandatroy().equalsIgnoreCase("1")) objdata.setMandatory(true);
            contactFormDDBox.add(objdata);

            if (gdp.getColomnName().equalsIgnoreCase("industry")) {
              List data =
                  cbt.executeAllSelectQuery(
                      "select id,industry from industrydatalevel1", connectionSpace);
              if (data != null && data.size() > 0) {
                for (Iterator iterator = data.iterator(); iterator.hasNext(); ) {
                  Object[] object = (Object[]) iterator.next();
                  if (object[0] != null && object[1] != null) {
                    industryMap.put(Integer.parseInt(object[0].toString()), object[1].toString());
                  }
                }
              }
            } /*else if (getRegLevel() != null) {
              	List data = cbt.executeAllSelectQuery(
              			"select id,deptName from department where mappedOrgnztnId='"
              					+ getRegLevel() + "'",
              			connectionSpace);
              	if (data != null && data.size() > 0) {
              		for (Iterator iterator = data.iterator(); iterator
              				.hasNext();) {
              			Object[] object = (Object[]) iterator
              					.next();
              			if (object[0] != null && object[1] != null) {
              				deptMap.put(Integer.parseInt(object[0]
              						.toString()), object[1]
              						.toString());
              			}
              		}
              	}
              }*/
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 3
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  public String viewDARReportData() {
    if (ValidateSession.checkSession()) {
      try {
        SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
        CommonOperInterface cbt = new CommonConFactory().createInterface();
        String accountID = (String) session.get("accountid");
        String userName = (String) session.get("uName");
        DARReportHelper DRH = new DARReportHelper();
        TaskRegistrationHelper TRH = new TaskRegistrationHelper();
        StringBuilder query = new StringBuilder("");
        query.append("select count(*) from task_registration");
        List dataCount = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
        if (dataCount != null) {
          BigInteger count = new BigInteger("3");
          Object obdata = null;
          for (Iterator it = dataCount.iterator(); it.hasNext(); ) {
            obdata = (Object) it.next();
            count = (BigInteger) obdata;
          }
          setRecords(count.intValue());
          int to = (getRows() * getPage());
          if (to > getRecords()) to = getRecords();
          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);

          // System.out.println(">>>>>> FINAL CONTACT LIST IS AS ::::  "+alltedTo);
          query.setLength(0);
          query.append("SELECT  ");
          List fieldNames =
              Configuration.getColomnList(
                  "mapped_dar_configuration", accountID, connectionSpace, "dar_configuration");
          List<Object> Listhb = new ArrayList<Object>();
          int i = 0;
          for (Iterator it = fieldNames.iterator(); it.hasNext(); ) {
            obdata = (Object) it.next();
            if (obdata != null) {
              if (!obdata.toString().equalsIgnoreCase("userName")
                  && !obdata.toString().equalsIgnoreCase("date")
                  && !obdata.toString().equalsIgnoreCase("time")) {
                if (obdata.toString().equalsIgnoreCase("tasktype")) {
                  query.append("ty.tasktype" + ",");
                } else if (obdata.toString().equalsIgnoreCase("allotedto")) {
                  query.append("emp1.empName as allotedto,");
                } else if (obdata.toString().equalsIgnoreCase("allotedby")) {
                  query.append("emp2.empName as allotedby,");
                } else if (obdata.toString().equalsIgnoreCase("validate_By_2")) {
                  query.append("emp3.empName as val2,");
                } else if (obdata.toString().equalsIgnoreCase("validate_By_1")) {
                  query.append("emp4.empName as val1,");
                } else if (obdata.toString().equalsIgnoreCase("guidance")) {
                  query.append("emp5.empName as guidance,");
                } else {
                  query.append("tr." + obdata.toString() + ",");
                }
              }
            }
            i++;
          }
          fieldNames.remove("userName");
          fieldNames.remove("date");
          fieldNames.remove("time");

          i = 0;
          List gridFields = new ArrayList();
          List fieldNames1 =
              Configuration.getColomnList(
                  "mapped_dar_configuration",
                  accountID,
                  connectionSpace,
                  "dar_submission_configuration");
          for (Iterator it = fieldNames1.iterator(); it.hasNext(); ) {
            obdata = (Object) it.next();
            if (obdata != null) {
              if (!obdata.toString().equalsIgnoreCase("taskname")
                  && !obdata.toString().equalsIgnoreCase("id")
                  && !obdata.toString().equalsIgnoreCase("userName")) {
                gridFields.add(obdata.toString());
                if (i < fieldNames1.size() - 1) query.append("ds." + obdata.toString() + ",");
                else query.append("ds." + obdata.toString());
              }
            }
            i++;
          }
          query.append(" FROM task_registration AS tr ");
          query.append(" LEFT JOIN dar_submission AS ds ON ds.taskname=tr.id ");
          query.append("LEFT JOIN compliance_contacts AS cc1 ON tr.allotedto=cc1.id ");
          query.append("LEFT JOIN compliance_contacts AS cc2 ON tr.allotedby=cc2.id ");
          query.append("LEFT JOIN compliance_contacts AS cc3 ON tr.validate_By_2=cc3.id ");
          query.append("LEFT JOIN compliance_contacts AS cc4 ON tr.validate_By_1=cc4.id ");
          query.append("LEFT JOIN compliance_contacts AS cc5 ON tr.guidance=cc5.id  ");
          query.append("LEFT JOIN employee_basic emp1 ON cc1.emp_id= emp1.id  ");
          query.append("LEFT JOIN employee_basic emp2 ON cc2.emp_id= emp2.id  ");
          query.append("LEFT JOIN employee_basic emp3 ON cc3.emp_id= emp3.id ");
          query.append("LEFT JOIN employee_basic emp4 ON cc4.emp_id= emp4.id ");
          query.append("LEFT JOIN employee_basic emp5 ON cc5.emp_id= emp5.id ");
          query.append("LEFT JOIN task_type ty ON tr.tasktype= ty.id   ");
          if (fdate.split("-")[0].length() < 3) {
            fdate = DateUtil.convertDateToUSFormat(fdate);
            tdate = DateUtil.convertDateToUSFormat(tdate);
          }
          query.append(" WHERE  ds.date BETWEEN '" + fdate + "' AND '" + tdate + "'  ");
          if (allotTo != null && !allotTo.equalsIgnoreCase("-1")) {
            query.append(" AND  tr.allotedTo='" + allotTo + "' ");
          }
          if (clientFor != null && !clientFor.equalsIgnoreCase("-1")) {
            query.append(" AND  tr.clientfor='" + clientFor + "' ");
          }
          if (taskTyp != null && !taskTyp.equalsIgnoreCase("-1")) {
            query.append(" AND  tr.tasktype='" + taskTyp + "' ");
          }
          if (taskPriority != null && !taskPriority.equalsIgnoreCase("-1")) {
            query.append(" AND  tr.priority='" + taskPriority + "' ");
          }
          if (statusWork != null && !statusWork.equalsIgnoreCase("-1")) {
            query.append(" AND  tr.status='" + statusWork + "' ");
          }
          if (alltedTo != null && alltedTo.length() > 0) {
            query.append(" AND  tr.allotedTo IN (" + alltedTo + ") ");
          }
          if (getSearchField() != null
              && getSearchString() != null
              && !getSearchField().equalsIgnoreCase("")
              && !getSearchString().equalsIgnoreCase("")) {
            query.append(" and ");
            if (getSearchOper().equalsIgnoreCase("eq")) {
              query.append(" " + getSearchField() + " = '" + getSearchString() + "'");
            } else if (getSearchOper().equalsIgnoreCase("cn")) {
              query.append(" " + getSearchField() + " like '%" + getSearchString() + "%'");
            } else if (getSearchOper().equalsIgnoreCase("bw")) {
              query.append(" " + getSearchField() + " like '" + getSearchString() + "%'");
            } else if (getSearchOper().equalsIgnoreCase("ne")) {
              query.append(" " + getSearchField() + " <> '" + getSearchString() + "'");
            } else if (getSearchOper().equalsIgnoreCase("ew")) {
              query.append(" " + getSearchField() + " like '%" + getSearchString() + "'");
            }
          }
          System.out.println("QUERY OF REPORT IS AS ::::  " + query.toString());
          List data = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
          for (int k = 0; k < gridFields.size(); k++) {
            fieldNames.add(gridFields.get(k).toString());
          }
          if (data != null && data.size() > 0) {

            String clientData = null;
            String clientVal = null;
            Object[] obdata11 = null;
            for (Iterator it = data.iterator(); it.hasNext(); ) {
              obdata11 = (Object[]) it.next();
              Map<String, Object> one = new HashMap<String, Object>();
              for (int k = 0; k < fieldNames.size(); k++) {
                if (fieldNames.get(k) != null
                    && obdata11[k] != null
                    && !obdata11[k].toString().equalsIgnoreCase("")) {
                  if (obdata11[k].toString().matches("\\d{4}-[01]\\d-[0-3]\\d")) {
                    one.put(
                        fieldNames.get(k).toString(),
                        DateUtil.convertDateToIndianFormat(obdata11[k].toString()));
                  }
                  /*else if(fieldNames.get(k).toString().equalsIgnoreCase("attachment")||  fieldNames.get(k).toString().equalsIgnoreCase("attachmentt")||fieldNames.get(k).toString().equalsIgnoreCase("reviewDoc")  )
                  {
                  	String str=obdata11[k].toString().substring(obdata11[k].toString().indexOf("//"), obdata11[k].toString().length());
                  	String docName=str.substring(14,str.length());
                  	one.put(fieldNames.get(k).toString(),docName);
                  }*/
                  else if (fieldNames.get(k).toString().equalsIgnoreCase("clientfor")) {
                    clientVal = obdata11[k].toString();
                    if (obdata11[k].toString().equalsIgnoreCase("PA")) {
                      one.put(fieldNames.get(k).toString(), "Prospect Associate");
                    } else if (obdata11[k].toString().equalsIgnoreCase("PC")) {
                      one.put(fieldNames.get(k).toString(), "Prospect Client");
                    } else if (obdata11[k].toString().equalsIgnoreCase("N")) {
                      one.put(fieldNames.get(k).toString(), "Other");
                    } else if (obdata11[k].toString().equalsIgnoreCase("EC")) {
                      one.put(fieldNames.get(k).toString(), "Existing Client");
                    } else if (obdata11[k].toString().equalsIgnoreCase("EA")) {
                      one.put(fieldNames.get(k).toString(), "Existing Associate");
                    } else if (obdata11[k].toString().equalsIgnoreCase("IN")) {
                      one.put(fieldNames.get(k).toString(), "Internal");
                    }
                  } else if (fieldNames.get(k).toString().equalsIgnoreCase("cName")) {
                    clientData = obdata11[k].toString();
                    one.put(
                        fieldNames.get(k).toString(),
                        DRH.clientName(clientVal, obdata11[k].toString(), connectionSpace));
                  } else if (fieldNames.get(k).toString().equalsIgnoreCase("offering")) {
                    one.put(
                        fieldNames.get(k).toString(),
                        DRH.offeringName(
                            clientVal, clientData, obdata11[k].toString(), connectionSpace));
                  } else {
                    one.put(fieldNames.get(k).toString(), obdata11[k].toString());
                  }
                } else {
                  one.put(fieldNames.get(k).toString(), "NA");
                }
              }
              Listhb.add(one);
            }
            setViewList(Listhb);
            setTotal((int) Math.ceil((double) getRecords() / (double) getRows()));
          }
        }
        return SUCCESS;
      } catch (Exception exp) {
        exp.printStackTrace();
        return ERROR;
      }
    } else {
      return ERROR;
    }
  }
 public void setViewPageProps() {
   try {
     if (empForAddBasic == 1) {
       setContactAddPageDataFields();
       setContactDataFieldsToAdd("mapped_emp_contact_configuration", "emp_contact_configuration");
     }
     if (empForAddPrsl == 1) {
       List<GridDataPropertyView> empPer =
           Configuration.getConfigurationData(
               "mapped_employee_basic_configuration",
               accountID,
               connectionSpace,
               "",
               0,
               "table_name",
               "employee_personal_configuration");
       ConfigurationUtilBean objEjb = null;
       if (empPer != null) {
         empPerFileBox = new ArrayList<ConfigurationUtilBean>();
         for (GridDataPropertyView gdp : empPer) {
           objEjb = new ConfigurationUtilBean();
           if (gdp.getColType().equalsIgnoreCase("T")) {
             if (!gdp.getColomnName().equalsIgnoreCase("userName")
                 && !gdp.getColomnName().equalsIgnoreCase("date")
                 && !gdp.getColomnName().equalsIgnoreCase("time")) {
               objEjb.setKey(gdp.getColomnName());
               objEjb.setValue(gdp.getHeadingName());
               objEjb.setColType(gdp.getColType());
               objEjb.setValidationType(gdp.getValidationType());
               if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
               empPerLevels.add(objEjb);
             }
           }
           if (gdp.getColType().trim().equalsIgnoreCase("F")
               && !gdp.getColomnName().equalsIgnoreCase("userName")
               && !gdp.getColomnName().equalsIgnoreCase("date")
               && !gdp.getColomnName().equalsIgnoreCase("time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             empPerFileBox.add(objEjb);
             // System.out.println("empPerFileBox" +empPerFileBox.size());
           } else if (gdp.getColType().equalsIgnoreCase("Time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             empPerCalendr.add(objEjb);
           } else if (gdp.getColType().equalsIgnoreCase("D"))
             empNameForOther = gdp.getHeadingName();
         }
       }
     }
     if (empForAddWorkQua == 1) {
       List<GridDataPropertyView> empQua =
           Configuration.getConfigurationData(
               "mapped_employee_basic_configuration",
               accountID,
               connectionSpace,
               "",
               0,
               "table_name",
               "employee_work_exprience_configuration");
       ConfigurationUtilBean objEjb = null;
       if (empQua != null) {
         empWorkExpFileBox = new ArrayList<ConfigurationUtilBean>();
         for (GridDataPropertyView gdp : empQua) {
           objEjb = new ConfigurationUtilBean();
           if (gdp.getColType().equalsIgnoreCase("T")) {
             if (!gdp.getColomnName().equalsIgnoreCase("userName")
                 && !gdp.getColomnName().equalsIgnoreCase("date")
                 && !gdp.getColomnName().equalsIgnoreCase("time")) {
               objEjb.setKey(gdp.getColomnName());
               objEjb.setValue(gdp.getHeadingName());
               objEjb.setColType(gdp.getColType());
               objEjb.setValidationType(gdp.getValidationType());
               if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
               empWorkExpLevels.add(objEjb);
             }
           } else if (gdp.getColType().equalsIgnoreCase("Time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             empWorkExpCalendr.add(objEjb);
           }
           if (gdp.getColType().trim().equalsIgnoreCase("F")
               && !gdp.getColomnName().equalsIgnoreCase("userName")
               && !gdp.getColomnName().equalsIgnoreCase("date")
               && !gdp.getColomnName().equalsIgnoreCase("time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             empWorkExpFileBox.add(objEjb);
             // System.out.println("empWorkExpFileBox" +empWorkExpFileBox.size());
           } else if (gdp.getColType().equalsIgnoreCase("D"))
             empNameForOther = gdp.getHeadingName();
         }
       }
     }
     // System.out.println("empForAddWorkExpirence" +empForAddWorkExpirence);
     if (empForAddWorkExpirence == 1) {
       // System.out.println("empForAddWorkExpirence" +empForAddWorkExpirence);
       List<GridDataPropertyView> empQua =
           Configuration.getConfigurationData(
               "mapped_employee_basic_configuration",
               accountID,
               connectionSpace,
               "",
               0,
               "table_name",
               "employee_work_exprience_configuration");
       ConfigurationUtilBean objEjb = null;
       if (empQua != null) {
         bankFileBox = new ArrayList<ConfigurationUtilBean>();
         for (GridDataPropertyView gdp : empQua) {
           objEjb = new ConfigurationUtilBean();
           if (gdp.getColType().equalsIgnoreCase("T")) {
             if (!gdp.getColomnName().equalsIgnoreCase("userName")
                 && !gdp.getColomnName().equalsIgnoreCase("date")
                 && !gdp.getColomnName().equalsIgnoreCase("time")) {
               objEjb.setKey(gdp.getColomnName());
               objEjb.setValue(gdp.getHeadingName());
               objEjb.setColType(gdp.getColType());
               objEjb.setValidationType(gdp.getValidationType());
               if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
               empWorkExpLevels.add(objEjb);
             }
           } else if (gdp.getColType().equalsIgnoreCase("Time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             empWorkExpCalendr.add(objEjb);
           } else if (gdp.getColType().equalsIgnoreCase("D"))
             empNameForOther = gdp.getHeadingName();
         }
       }
     }
     if (empForAddBaank == 1) {
       // for bank details
       List<GridDataPropertyView> empBank =
           Configuration.getConfigurationData(
               "mapped_employee_basic_configuration",
               accountID,
               connectionSpace,
               "",
               0,
               "table_name",
               "employee_bank_details_configuration");
       ConfigurationUtilBean objEjb = null;
       if (empBank != null) {
         bankFileBox = new ArrayList<ConfigurationUtilBean>();
         for (GridDataPropertyView gdp : empBank) {
           objEjb = new ConfigurationUtilBean();
           if (gdp.getColType().equalsIgnoreCase("T")) {
             if (!gdp.getColomnName().equalsIgnoreCase("userName")
                 && !gdp.getColomnName().equalsIgnoreCase("date")
                 && !gdp.getColomnName().equalsIgnoreCase("time")) {
               objEjb.setKey(gdp.getColomnName());
               objEjb.setValue(gdp.getHeadingName());
               objEjb.setColType(gdp.getColType());
               objEjb.setValidationType(gdp.getValidationType());
               if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
               else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
               empBankLevels.add(objEjb);
             }
           }
           // System.out.println("getColomnName" +gdp.getColomnName());
           if (gdp.getColType().trim().equalsIgnoreCase("F")
               && !gdp.getColomnName().equalsIgnoreCase("userName")
               && !gdp.getColomnName().equalsIgnoreCase("date")
               && !gdp.getColomnName().equalsIgnoreCase("time")) {
             objEjb.setKey(gdp.getColomnName());
             objEjb.setValue(gdp.getHeadingName());
             objEjb.setColType(gdp.getColType());
             objEjb.setValidationType(gdp.getValidationType());
             if (gdp.getMandatroy() == null) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("0")) objEjb.setMandatory(false);
             else if (gdp.getMandatroy().equalsIgnoreCase("1")) objEjb.setMandatory(true);
             bankFileBox.add(objEjb);
             // System.out.println("bankFileBox" +bankFileBox.size());
           } else if (gdp.getColType().equalsIgnoreCase("D")
               && gdp.getColomnName().equalsIgnoreCase("empName"))
             empNameForOther = gdp.getHeadingName();
           else if (gdp.getColType().equalsIgnoreCase("D"))
             accountTypeLevel = gdp.getHeadingName();
         }
       }
     }
   } catch (Exception me) {
     me.printStackTrace();
   }
 }
Exemplo n.º 5
0
  public void setReportViewProp() {
    try {
      String accountID = (String) session.get("accountid");
      SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
      reportViewProp = new ArrayList<GridDataPropertyView>();
      GridDataPropertyView gpv = new GridDataPropertyView();

      gpv.setColomnName("id");
      gpv.setHeadingName("Id");
      gpv.setHideOrShow("true");
      reportViewProp.add(gpv);
      List<GridDataPropertyView> statusColName =
          Configuration.getConfigurationData(
              "mapped_dar_configuration",
              accountID,
              connectionSpace,
              "",
              0,
              "table_name",
              "dar_configuration");
      if (statusColName != null && statusColName.size() > 0) {
        for (GridDataPropertyView gdp : statusColName) {
          if (!gdp.getColomnName().equalsIgnoreCase("userName")
              && !gdp.getColomnName().equalsIgnoreCase("date")
              && !gdp.getColomnName().equalsIgnoreCase("time")) {
            gpv = new GridDataPropertyView();
            gpv.setColomnName(gdp.getColomnName());
            gpv.setHeadingName(gdp.getHeadingName());
            gpv.setEditable(gdp.getEditable());
            gpv.setSearch(gdp.getSearch());
            gpv.setHideOrShow(gdp.getHideOrShow());
            gpv.setWidth(gdp.getWidth());
            /*if(gdp.getColomnName().equalsIgnoreCase("attachment"))
            {
            	gpv.setFormatter(gdp.getFormatter());
            }*/
            reportViewProp.add(gpv);
          }
        }
      }
      List<GridDataPropertyView> darSubmitColName =
          Configuration.getConfigurationData(
              "mapped_dar_configuration",
              accountID,
              connectionSpace,
              "",
              0,
              "table_name",
              "dar_submission_configuration");
      if (darSubmitColName != null && darSubmitColName.size() > 0) {
        for (GridDataPropertyView gdp : darSubmitColName) {
          if (!gdp.getColomnName().equalsIgnoreCase("taskname")
              && !gdp.getColomnName().equalsIgnoreCase("userName")) {
            gpv = new GridDataPropertyView();
            gpv.setColomnName(gdp.getColomnName());
            gpv.setHeadingName(gdp.getHeadingName());
            gpv.setEditable(gdp.getEditable());
            gpv.setSearch(gdp.getSearch());
            gpv.setHideOrShow(gdp.getHideOrShow());
            gpv.setWidth(gdp.getWidth());
            /*if(gdp.getColomnName().equalsIgnoreCase("attachmentt"))
            {
            	gpv.setFormatter(gdp.getFormatter());
            }*/
            reportViewProp.add(gpv);
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }