Пример #1
0
  @Override
  public List<ClientData> mergeClientConformation(String partyIds, int buId) {
    List<ClientData> clientDatas = new ArrayList<ClientData>();

    jdbcTemplate.setDataSource(dataSourceProvider.getDataSource(buId));
    String result = FiinfraConstants.fail;
    List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
    CommonStoredProcedure myStoredProcedure =
        new CommonStoredProcedure(jdbcTemplate, "usp_cp_mergeClientConformation");
    SqlParameter partyIdsParam = new SqlParameter("partyIds", Types.VARCHAR);

    SqlParameter[] paramArray = {partyIdsParam};
    myStoredProcedure.setParameters(paramArray);
    myStoredProcedure.compile();
    Map<String, Object> paranValues = new HashMap<String, Object>();
    paranValues.put("partyIds", partyIds);

    logger.debug("paranValues:--" + paranValues);
    Map<String, Object> storedProcResult = myStoredProcedure.execute(paranValues);

    l = (List<Map<String, Object>>) storedProcResult.get("#result-set-1");
    // System.out.println("l:--" + l);
    if (l != null) {
      ClientData clientData = null;
      for (Map<String, Object> row : l) {
        clientData = new ClientData();
        clientData.setPartyId((Integer) row.get("partyId"));
        clientData.setFirstName((String) row.get("firstName"));
        clientDatas.add(clientData);
      }
    }

    return clientDatas;
  }
Пример #2
0
  public List<ClientData> getClientListToMerge(
      int partyId,
      int buId,
      int contactpartyId,
      boolean isAllClients,
      boolean isFromProfile,
      int nodeId,
      String searchText) {
    jdbcTemplate.setDataSource(dataSourceProvider.getDataSource(buId));
    //		return jdbcTemplate.query(SP_RETRIVE_ClIENTS_TO_MERGE,new Object[]
    // {partyId,contactpartyId,isAllClients},
    //				new BeanPropertyRowMapper<ClientData>(ClientData.class));

    List<ClientData> clientDatas = new ArrayList<ClientData>();
    try {
      jdbcTemplate.setDataSource(dataSourceProvider.getDataSource(buId));

      List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
      CommonStoredProcedure myStoredProcedure =
          new CommonStoredProcedure(jdbcTemplate, "usp_cp_getClientListToMerge");
      SqlParameter partyIdParam = new SqlParameter("partyId", Types.INTEGER);
      SqlParameter contactpartyIdParam = new SqlParameter("contactpartyId", Types.INTEGER);
      SqlParameter isAllClientsParam = new SqlParameter("isAllClients", Types.BOOLEAN);
      SqlParameter isFromProfileParam = new SqlParameter("isFromProfile", Types.BOOLEAN);
      SqlParameter nodeIdParam = new SqlParameter("nodeId", Types.INTEGER);
      SqlParameter searchTextParam = new SqlParameter("searchText", Types.VARCHAR);
      SqlParameter[] paramArray = {
        partyIdParam,
        contactpartyIdParam,
        isAllClientsParam,
        isFromProfileParam,
        nodeIdParam,
        searchTextParam
      };
      myStoredProcedure.setParameters(paramArray);
      myStoredProcedure.compile();
      Map<String, Object> paranValues = new HashMap<String, Object>();
      paranValues.put("partyId", partyId);
      paranValues.put("contactpartyId", contactpartyId);
      paranValues.put("isAllClients", isAllClients);
      paranValues.put("isFromProfile", isFromProfile);
      paranValues.put("nodeId", nodeId);
      paranValues.put("searchText", searchText);
      // System.out.println("paranValues:--" + paranValues);
      Map<String, Object> storedProcResult = myStoredProcedure.execute(paranValues);
      // System.out.println("storedProcResult:---" + storedProcResult);
      // personal details
      l = (List<Map<String, Object>>) storedProcResult.get("#result-set-1");
      // System.out.println("l:--" + l);
      if (l != null) {
        ClientData clientData = null;
        for (Map<String, Object> row : l) {
          clientData = new ClientData();
          clientData.setFirstName((String) row.get("firstName"));
          clientData.setLastName((String) row.get("lastName"));
          clientData.setPanNo((String) row.get("panNo"));
          clientData.setEmail((String) row.get("contactEmail"));
          clientData.setPartyId((Integer) row.get("partyId"));
          clientData.setAddress((String) row.get("address"));
          clientDatas.add(clientData);
        }
      }

      //		System.out.println("App Client Data........."+clientDatas);

    } catch (Exception e) {
      // e.printStackTrace();
      logger.debug(e.getMessage());
    }
    return clientDatas;

    //		List<ClientData> mergeClientData = new ArrayList<ClientData>();
    //		return mergeClientData;
  }