Commit f2d100ff authored by psawant's avatar psawant

Changes in customer Master

Field set from customer Default Master

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190442 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0deba401
...@@ -116,7 +116,7 @@ implements CustomerLocal, CustomerRemote ...@@ -116,7 +116,7 @@ implements CustomerLocal, CustomerRemote
} }
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>"); valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>"); valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
...@@ -126,7 +126,7 @@ implements CustomerLocal, CustomerRemote ...@@ -126,7 +126,7 @@ implements CustomerLocal, CustomerRemote
int childNodeListLength = childNodeList.getLength(); int childNodeListLength = childNodeList.getLength();
tranId = checkNull(this.genericUtility.getColumnValue("tran_id", dom)); tranId = checkNull(this.genericUtility.getColumnValue("tran_id", dom));
System.out.println("tran id from boqdet --4-->>>>[" + tranId + "]"); System.out.println("tran id from boqdet --4-->>>>[" + tranId + "]");
for (ctr = 0; ctr < childNodeListLength; ctr++) for (ctr = 0; ctr < childNodeListLength; ctr++)
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
...@@ -137,7 +137,7 @@ implements CustomerLocal, CustomerRemote ...@@ -137,7 +137,7 @@ implements CustomerLocal, CustomerRemote
sql = "select key_flag from transetup where tran_window = 'w_customer'"; sql = "select key_flag from transetup where tran_window = 'w_customer'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
keyFlag = rs.getString("key_flag"); keyFlag = rs.getString("key_flag");
} }
...@@ -157,15 +157,15 @@ implements CustomerLocal, CustomerRemote ...@@ -157,15 +157,15 @@ implements CustomerLocal, CustomerRemote
errCode = "VMCODNULL"; errCode = "VMCODNULL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if ("A".equalsIgnoreCase(editFlag)) else if ("A".equalsIgnoreCase(editFlag))
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as ll_count from customer where cust_code =?"; sql = "select count(*) as ll_count from customer where cust_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode); pstmt.setString(1, custCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("ll_count"); cnt = rs.getInt("ll_count");
} }
...@@ -174,7 +174,7 @@ implements CustomerLocal, CustomerRemote ...@@ -174,7 +174,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt > 0) if (cnt > 0)
{ {
errCode = "VMDUPL1"; errCode = "VMDUPL1";
errList.add(errCode); errList.add(errCode);
...@@ -183,20 +183,20 @@ implements CustomerLocal, CustomerRemote ...@@ -183,20 +183,20 @@ implements CustomerLocal, CustomerRemote
} }
} }
//Changed by Sneha on 10-11-2016, for validating the field customer priority [Start] //Changed by Sneha on 10-11-2016, for validating the field customer priority [Start]
else if (childNodeName.equalsIgnoreCase("cust_priority")) else if (childNodeName.equalsIgnoreCase("cust_priority"))
{ {
String custPriority = checkNull(genericUtility.getColumnValue("cust_priority", dom)); String custPriority = checkNull(genericUtility.getColumnValue("cust_priority", dom));
/* System.out.println("custPriority======>>"+custPriority); /* System.out.println("custPriority======>>"+custPriority);
System.out.println("custPriority length======>>"+custPriority.length());*/ System.out.println("custPriority length======>>"+custPriority.length());*/
if (custPriority.length() > 1) if (custPriority.length() > 1)
{ {
// System.out.println("custPriority found larger value--------->>"); // System.out.println("custPriority found larger value--------->>");
errCode = "VMCUSTPRIT"; errCode = "VMCUSTPRIT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if (!custPriority.matches("[0-9A-Za-z-]+")) else if (!custPriority.matches("[0-9A-Za-z-]+"))
{ {
// System.out.println("Special character found for custPriority ---------"); // System.out.println("Special character found for custPriority ---------");
errCode = "VMCUSTINVD"; errCode = "VMCUSTINVD";
...@@ -229,7 +229,7 @@ implements CustomerLocal, CustomerRemote ...@@ -229,7 +229,7 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("available_yn")) else if (childNodeName.equalsIgnoreCase("available_yn"))
{ {
availableYn = this.genericUtility.getColumnValue("available_yn", dom); availableYn = this.genericUtility.getColumnValue("available_yn", dom);
...@@ -240,7 +240,7 @@ implements CustomerLocal, CustomerRemote ...@@ -240,7 +240,7 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("round")) else if (childNodeName.equalsIgnoreCase("round"))
{ {
round = this.genericUtility.getColumnValue("round", dom); round = this.genericUtility.getColumnValue("round", dom);
...@@ -291,17 +291,17 @@ implements CustomerLocal, CustomerRemote ...@@ -291,17 +291,17 @@ implements CustomerLocal, CustomerRemote
ignoreCredit = checkNull(genericUtility.getColumnValue("ignore_credit", dom)); ignoreCredit = checkNull(genericUtility.getColumnValue("ignore_credit", dom));
cnt = 0; cnt = 0;
if (ignoreCredit != null && ignoreCredit.trim().length() > 0) if (ignoreCredit != null && ignoreCredit.trim().length() > 0)
{ {
cnt = Integer.parseInt(ignoreCredit.trim()); cnt = Integer.parseInt(ignoreCredit.trim());
if (cnt < 0) if (cnt < 0)
{ {
errCode = "VMIGCRT"; errCode = "VMIGCRT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else else
{ {
errCode = "VMIGCRTNLL"; errCode = "VMIGCRTNLL";
errList.add(errCode); errList.add(errCode);
...@@ -325,10 +325,10 @@ implements CustomerLocal, CustomerRemote ...@@ -325,10 +325,10 @@ implements CustomerLocal, CustomerRemote
ignoreDays = checkNull(genericUtility.getColumnValue("ignore_days", dom)); ignoreDays = checkNull(genericUtility.getColumnValue("ignore_days", dom));
cnt = 0; cnt = 0;
if (ignoreDays != null && ignoreDays.trim().length() > 0) if (ignoreDays != null && ignoreDays.trim().length() > 0)
{ {
cnt = Integer.parseInt(ignoreDays.trim()); cnt = Integer.parseInt(ignoreDays.trim());
if (cnt < 0) if (cnt < 0)
{ {
errCode = "VMCRDYS"; errCode = "VMCRDYS";
errList.add(errCode); errList.add(errCode);
...@@ -336,7 +336,7 @@ implements CustomerLocal, CustomerRemote ...@@ -336,7 +336,7 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("acct_code__adv")) else if (childNodeName.equalsIgnoreCase("acct_code__adv"))
{ {
acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom)); acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom));
...@@ -347,7 +347,7 @@ implements CustomerLocal, CustomerRemote ...@@ -347,7 +347,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv); pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -356,13 +356,13 @@ implements CustomerLocal, CustomerRemote ...@@ -356,13 +356,13 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt != 0) if (cnt != 0)
{ {
sql = "select active from accounts where acct_code =?"; sql = "select active from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv); pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
active = rs.getString("active"); active = rs.getString("active");
} }
...@@ -407,7 +407,7 @@ implements CustomerLocal, CustomerRemote ...@@ -407,7 +407,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAdv); pstmt.setString(1, cctrCodeAdv);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -416,20 +416,20 @@ implements CustomerLocal, CustomerRemote ...@@ -416,20 +416,20 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTCCTRCD1"; errCode = "VTCCTRCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("group_code")) else if (childNodeName.equalsIgnoreCase("group_code"))
{ {
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom)); groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
if (groupCode != null && groupCode.trim().length() > 0) if (groupCode != null && groupCode.trim().length() > 0)
{ {
if (!groupCode.equalsIgnoreCase(custCode)) if (!groupCode.equalsIgnoreCase(custCode))
{ {
...@@ -438,7 +438,7 @@ implements CustomerLocal, CustomerRemote ...@@ -438,7 +438,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, groupCode); pstmt.setString(1, groupCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -450,7 +450,7 @@ implements CustomerLocal, CustomerRemote ...@@ -450,7 +450,7 @@ implements CustomerLocal, CustomerRemote
sql = "select key_flag from transetup where tran_window = 'w_customer'"; sql = "select key_flag from transetup where tran_window = 'w_customer'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
keyFlag = rs.getString("key_flag"); keyFlag = rs.getString("key_flag");
} }
...@@ -459,7 +459,7 @@ implements CustomerLocal, CustomerRemote ...@@ -459,7 +459,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0 && !("A".equalsIgnoreCase(keyFlag))) if (cnt == 0 && !("A".equalsIgnoreCase(keyFlag)))
{ {
errCode = "VMCUST1"; errCode = "VMCUST1";
errList.add(errCode); errList.add(errCode);
...@@ -473,10 +473,10 @@ implements CustomerLocal, CustomerRemote ...@@ -473,10 +473,10 @@ implements CustomerLocal, CustomerRemote
errCode = "VMGRPCNULL";// Group Code is null errCode = "VMGRPCNULL";// Group Code is null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
//Comment By Nasruddin [16-SEP-16] END*/ //Comment By Nasruddin [16-SEP-16] END*/
} }
else if (childNodeName.equalsIgnoreCase("cust_code__bil")) else if (childNodeName.equalsIgnoreCase("cust_code__bil"))
{ {
custCodeBil = checkNull(genericUtility.getColumnValue("cust_code__bil", dom)); custCodeBil = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
...@@ -499,15 +499,15 @@ implements CustomerLocal, CustomerRemote ...@@ -499,15 +499,15 @@ implements CustomerLocal, CustomerRemote
errCode = "VEBILLTO"; errCode = "VEBILLTO";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if (!custCodeBil.equalsIgnoreCase(custCode)) else if (!custCodeBil.equalsIgnoreCase(custCode))
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from customer where cust_code =?"; sql = "select count(*) as cnt from customer where cust_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeBil); pstmt.setString(1, custCodeBil);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -516,7 +516,7 @@ implements CustomerLocal, CustomerRemote ...@@ -516,7 +516,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMBILLTO"; errCode = "VMBILLTO";
errList.add(errCode); errList.add(errCode);
...@@ -531,8 +531,8 @@ implements CustomerLocal, CustomerRemote ...@@ -531,8 +531,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
Comment By Nasruddin [16-SEP-16] END*/ Comment By Nasruddin [16-SEP-16] END*/
} }
else if (childNodeName.equalsIgnoreCase("stan_code")) else if (childNodeName.equalsIgnoreCase("stan_code"))
{ {
stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom)); stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom));
cnt = 0; cnt = 0;
...@@ -543,7 +543,7 @@ implements CustomerLocal, CustomerRemote ...@@ -543,7 +543,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode); pstmt.setString(1, stanCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -552,7 +552,7 @@ implements CustomerLocal, CustomerRemote ...@@ -552,7 +552,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTSTAN1"; errCode = "VTSTAN1";
errList.add(errCode); errList.add(errCode);
...@@ -568,12 +568,12 @@ implements CustomerLocal, CustomerRemote ...@@ -568,12 +568,12 @@ implements CustomerLocal, CustomerRemote
} }
Comment By Nasruddin [16-SEP-16] END*/ Comment By Nasruddin [16-SEP-16] END*/
} }
else if (childNodeName.equalsIgnoreCase("terr_code")) else if (childNodeName.equalsIgnoreCase("terr_code"))
{ {
terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom)); terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom));
if (terrCode != null && terrCode.trim().length() > 0) if (terrCode != null && terrCode.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as ll_count from territory where terr_code =?"; sql = "select count(*) as ll_count from territory where terr_code =?";
...@@ -589,15 +589,15 @@ implements CustomerLocal, CustomerRemote ...@@ -589,15 +589,15 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTTERRCD"; errCode = "VTTERRCD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("state_code")) else if (childNodeName.equalsIgnoreCase("state_code"))
{ {
stateCode = checkNull(genericUtility.getColumnValue("state_code", dom)); stateCode = checkNull(genericUtility.getColumnValue("state_code", dom));
...@@ -617,26 +617,26 @@ implements CustomerLocal, CustomerRemote ...@@ -617,26 +617,26 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTSTATE1"; errCode = "VTSTATE1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("count_code")) else if (childNodeName.equalsIgnoreCase("count_code"))
{ {
countCode = checkNull(genericUtility.getColumnValue("count_code", dom)); countCode = checkNull(genericUtility.getColumnValue("count_code", dom));
if (countCode != null && countCode.trim().length() > 0) if (countCode != null && countCode.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from country where count_code =?"; sql = "select count(*) as cnt from country where count_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, countCode); pstmt.setString(1, countCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -645,15 +645,15 @@ implements CustomerLocal, CustomerRemote ...@@ -645,15 +645,15 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTCONTCD1"; errCode = "VTCONTCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("cr_term")) else if (childNodeName.equalsIgnoreCase("cr_term"))
{ {
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom)); crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
...@@ -680,8 +680,8 @@ implements CustomerLocal, CustomerRemote ...@@ -680,8 +680,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("curr_code")) else if (childNodeName.equalsIgnoreCase("curr_code"))
{ {
currCode = checkNull(genericUtility.getColumnValue("curr_code", dom)); currCode = checkNull(genericUtility.getColumnValue("curr_code", dom));
cnt = 0; cnt = 0;
...@@ -690,7 +690,7 @@ implements CustomerLocal, CustomerRemote ...@@ -690,7 +690,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode); pstmt.setString(1, currCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -704,10 +704,10 @@ implements CustomerLocal, CustomerRemote ...@@ -704,10 +704,10 @@ implements CustomerLocal, CustomerRemote
errCode = "VTCURRCD1"; errCode = "VTCURRCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else else
{ {
if (editFlag.equalsIgnoreCase("E")) if (editFlag.equalsIgnoreCase("E"))
{ {
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
...@@ -715,7 +715,7 @@ implements CustomerLocal, CustomerRemote ...@@ -715,7 +715,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode); pstmt.setString(1, custCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
currCode1 = rs.getString("curr_code"); currCode1 = rs.getString("curr_code");
} }
...@@ -734,7 +734,7 @@ implements CustomerLocal, CustomerRemote ...@@ -734,7 +734,7 @@ implements CustomerLocal, CustomerRemote
pstmt.setString(1, custCode); pstmt.setString(1, custCode);
pstmt.setString(2, lsVal3); pstmt.setString(2, lsVal3);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("ll_count"); cnt = rs.getInt("ll_count");
} }
...@@ -750,7 +750,7 @@ implements CustomerLocal, CustomerRemote ...@@ -750,7 +750,7 @@ implements CustomerLocal, CustomerRemote
pstmt.setString(2, lsVal3); pstmt.setString(2, lsVal3);
pstmt.setString(3, currCode1); pstmt.setString(3, currCode1);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt1 = rs.getInt("cnt"); cnt1 = rs.getInt("cnt");
} }
...@@ -759,7 +759,7 @@ implements CustomerLocal, CustomerRemote ...@@ -759,7 +759,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt1 != 0 && cnt > 1) if (cnt1 != 0 && cnt > 1)
{ {
errCode = "VXCURRCD1"; errCode = "VXCURRCD1";
errList.add(errCode); errList.add(errCode);
...@@ -780,7 +780,7 @@ implements CustomerLocal, CustomerRemote ...@@ -780,7 +780,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr); pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -795,7 +795,7 @@ implements CustomerLocal, CustomerRemote ...@@ -795,7 +795,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr); pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
active = rs.getString("active"); active = rs.getString("active");
} }
...@@ -827,14 +827,14 @@ implements CustomerLocal, CustomerRemote ...@@ -827,14 +827,14 @@ implements CustomerLocal, CustomerRemote
{ {
cctrCodeAr = checkNull(genericUtility.getColumnValue("cctr_code__ar", dom)); cctrCodeAr = checkNull(genericUtility.getColumnValue("cctr_code__ar", dom));
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0) if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from costctr where cctr_code =?"; sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAr); pstmt.setString(1, cctrCodeAr);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -843,7 +843,7 @@ implements CustomerLocal, CustomerRemote ...@@ -843,7 +843,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTCCTRCD1"; errCode = "VTCCTRCD1";
errList.add(errCode); errList.add(errCode);
...@@ -863,12 +863,12 @@ implements CustomerLocal, CustomerRemote ...@@ -863,12 +863,12 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
// //Changed By PriyankaC on 09/01/2018..[END] // //Changed By PriyankaC on 09/01/2018..[END]
*/ } */ }
else if (childNodeName.equalsIgnoreCase("tax_class")) else if (childNodeName.equalsIgnoreCase("tax_class"))
{ {
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom)); taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
if (taxClass != null && taxClass.trim().length() > 0) if (taxClass != null && taxClass.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from taxclass where tax_class =?"; sql = "select count(*) as cnt from taxclass where tax_class =?";
...@@ -884,14 +884,14 @@ implements CustomerLocal, CustomerRemote ...@@ -884,14 +884,14 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTTAXCLA1"; errCode = "VTTAXCLA1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("tax_chap")) else if (childNodeName.equalsIgnoreCase("tax_chap"))
{ {
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom)); taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
...@@ -919,8 +919,8 @@ implements CustomerLocal, CustomerRemote ...@@ -919,8 +919,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("price_list")) else if (childNodeName.equalsIgnoreCase("price_list"))
{ {
priceList = checkNull(genericUtility.getColumnValue("price_list", dom)); priceList = checkNull(genericUtility.getColumnValue("price_list", dom));
...@@ -947,8 +947,8 @@ implements CustomerLocal, CustomerRemote ...@@ -947,8 +947,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("price_list__clg")) else if (childNodeName.equalsIgnoreCase("price_list__clg"))
{ {
priceListClg = checkNull(genericUtility.getColumnValue("price_list__clg", dom)); priceListClg = checkNull(genericUtility.getColumnValue("price_list__clg", dom));
...@@ -959,7 +959,7 @@ implements CustomerLocal, CustomerRemote ...@@ -959,7 +959,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, priceListClg); pstmt.setString(1, priceListClg);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -968,7 +968,7 @@ implements CustomerLocal, CustomerRemote ...@@ -968,7 +968,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTPLIST1"; errCode = "VTPLIST1";
errList.add(errCode); errList.add(errCode);
...@@ -976,18 +976,18 @@ implements CustomerLocal, CustomerRemote ...@@ -976,18 +976,18 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("sales_pers")) else if (childNodeName.equalsIgnoreCase("sales_pers"))
{ {
salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom)); salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom));
if (salesPers != null && salesPers.trim().length() > 0) if (salesPers != null && salesPers.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?"; sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers); pstmt.setString(1, salesPers);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1011,18 +1011,18 @@ implements CustomerLocal, CustomerRemote ...@@ -1011,18 +1011,18 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
Comment By Nasruddin [16-SEP-16] END*/ Comment By Nasruddin [16-SEP-16] END*/
} }
else if (childNodeName.equalsIgnoreCase("sales_pers__1")) else if (childNodeName.equalsIgnoreCase("sales_pers__1"))
{ {
salesPers1 = checkNull(genericUtility.getColumnValue("sales_pers__1", dom)); salesPers1 = checkNull(genericUtility.getColumnValue("sales_pers__1", dom));
if (salesPers1 != null && salesPers1.trim().length() > 0) if (salesPers1 != null && salesPers1.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?"; sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers1); pstmt.setString(1, salesPers1);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1031,7 +1031,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1031,7 +1031,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMSLPERS1"; errCode = "VMSLPERS1";
errList.add(errCode); errList.add(errCode);
...@@ -1039,17 +1039,17 @@ implements CustomerLocal, CustomerRemote ...@@ -1039,17 +1039,17 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("sales_pers__2")) else if (childNodeName.equalsIgnoreCase("sales_pers__2"))
{ {
salesPers2 = checkNull(genericUtility.getColumnValue("sales_pers__2", dom)); salesPers2 = checkNull(genericUtility.getColumnValue("sales_pers__2", dom));
if (salesPers2 != null && salesPers2.trim().length() > 0) if (salesPers2 != null && salesPers2.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?"; sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers2); pstmt.setString(1, salesPers2);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1058,26 +1058,26 @@ implements CustomerLocal, CustomerRemote ...@@ -1058,26 +1058,26 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMSLPERS1"; errCode = "VMSLPERS1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("tran_code")) else if (childNodeName.equalsIgnoreCase("tran_code"))
{ {
tranCode = checkNull(genericUtility.getColumnValue("tran_code", dom)); tranCode = checkNull(genericUtility.getColumnValue("tran_code", dom));
if (tranCode != null && tranCode.trim().length() > 0) if (tranCode != null && tranCode.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from transporter where tran_code = ?"; sql = "select count(*) as cnt from transporter where tran_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranCode); pstmt.setString(1, tranCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1086,15 +1086,15 @@ implements CustomerLocal, CustomerRemote ...@@ -1086,15 +1086,15 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTTRANCD1"; errCode = "VTTRANCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("site_code__rcp")) else if (childNodeName.equalsIgnoreCase("site_code__rcp"))
{ {
siteCodeRcp = checkNull(genericUtility.getColumnValue("site_code__rcp", dom)); siteCodeRcp = checkNull(genericUtility.getColumnValue("site_code__rcp", dom));
...@@ -1105,7 +1105,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1105,7 +1105,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeRcp); pstmt.setString(1, siteCodeRcp);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1114,14 +1114,14 @@ implements CustomerLocal, CustomerRemote ...@@ -1114,14 +1114,14 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTSITECD1"; errCode = "VTSITECD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("site_code")) else if (childNodeName.equalsIgnoreCase("site_code"))
{ {
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
...@@ -1133,10 +1133,10 @@ implements CustomerLocal, CustomerRemote ...@@ -1133,10 +1133,10 @@ implements CustomerLocal, CustomerRemote
errCode = "VMSITECD1"; errCode = "VMSITECD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else else
{ {
//if ("N".equalsIgnoreCase(channelPartner) && (siteCode != null)) Comment By Nasruddin //if ("N".equalsIgnoreCase(channelPartner) && (siteCode != null)) Comment By Nasruddin
if ("N".equalsIgnoreCase(channelPartner) && (siteCode.trim().length() > 0)) if ("N".equalsIgnoreCase(channelPartner) && (siteCode.trim().length() > 0))
{ {
errCode = "VNRSITE"; errCode = "VNRSITE";
...@@ -1150,7 +1150,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1150,7 +1150,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1172,14 +1172,14 @@ implements CustomerLocal, CustomerRemote ...@@ -1172,14 +1172,14 @@ implements CustomerLocal, CustomerRemote
{ {
blackListing = checkNull(genericUtility.getColumnValue("black_listing", dom)); blackListing = checkNull(genericUtility.getColumnValue("black_listing", dom));
if (!"P".equalsIgnoreCase(blackListing)) if (!"P".equalsIgnoreCase(blackListing))
{ {
errCode = "VMBLACKLIS"; errCode = "VMBLACKLIS";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("contact_code")) else if (childNodeName.equalsIgnoreCase("contact_code"))
{ {
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom)); contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
...@@ -1188,7 +1188,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1188,7 +1188,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode); pstmt.setString(1, contactCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1197,14 +1197,14 @@ implements CustomerLocal, CustomerRemote ...@@ -1197,14 +1197,14 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMCONTCD1"; errCode = "VMCONTCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("bank_code")) else if (childNodeName.equalsIgnoreCase("bank_code"))
{ {
bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom)); bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom));
...@@ -1216,7 +1216,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1216,7 +1216,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode); pstmt.setString(1, bankCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1225,7 +1225,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1225,7 +1225,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt <= 0) if (cnt <= 0)
{ {
errCode = "VMBANK1"; errCode = "VMBANK1";
errList.add(errCode); errList.add(errCode);
...@@ -1233,7 +1233,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1233,7 +1233,7 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("price_list__disc")) else if (childNodeName.equalsIgnoreCase("price_list__disc"))
{ {
priceListDisc = checkNull(genericUtility.getColumnValue("price_list__disc", dom)); priceListDisc = checkNull(genericUtility.getColumnValue("price_list__disc", dom));
...@@ -1256,19 +1256,19 @@ implements CustomerLocal, CustomerRemote ...@@ -1256,19 +1256,19 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTPLIST1"; errCode = "VTPLIST1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("sales_option")) else if (childNodeName.equalsIgnoreCase("sales_option"))
{ {
salesOption = checkNull(genericUtility.getColumnValue("sales_option", dom)); salesOption = checkNull(genericUtility.getColumnValue("sales_option", dom));
if (salesOption == null || salesOption.trim().length() <= 0) if (salesOption == null || salesOption.trim().length() <= 0)
{ {
errCode = "VTSLOPT"; errCode = "VTSLOPT";
errList.add(errCode); errList.add(errCode);
...@@ -1279,14 +1279,14 @@ implements CustomerLocal, CustomerRemote ...@@ -1279,14 +1279,14 @@ implements CustomerLocal, CustomerRemote
{ {
dlvTerm = checkNull(genericUtility.getColumnValue("dlv_term", dom)); dlvTerm = checkNull(genericUtility.getColumnValue("dlv_term", dom));
System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@" + dlvTerm); System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@" + dlvTerm);
if (dlvTerm != null && dlvTerm.trim().length() > 0) if (dlvTerm != null && dlvTerm.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from delivery_term where dlv_term =?"; sql = "select count(*) as cnt from delivery_term where dlv_term =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, dlvTerm); pstmt.setString(1, dlvTerm);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1295,18 +1295,18 @@ implements CustomerLocal, CustomerRemote ...@@ -1295,18 +1295,18 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMDLVTERM1"; errCode = "VMDLVTERM1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("loss_perc")) else if (childNodeName.equalsIgnoreCase("loss_perc"))
{ {
lossPerc = genericUtility.getColumnValue("loss_perc", dom); lossPerc = genericUtility.getColumnValue("loss_perc", dom);
if (lossPerc != null && lossPerc.trim().length() > 0) if (lossPerc != null && lossPerc.trim().length() > 0)
{ {
cnt1 = Integer.parseInt(lossPerc); cnt1 = Integer.parseInt(lossPerc);
} }
...@@ -1316,38 +1316,38 @@ implements CustomerLocal, CustomerRemote ...@@ -1316,38 +1316,38 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc")) else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc"))
{ {
adhocReplPerc = checkNull(genericUtility.getColumnValue("adhoc_repl_perc", dom)); adhocReplPerc = checkNull(genericUtility.getColumnValue("adhoc_repl_perc", dom));
double adhocvalue = 0.00; double adhocvalue = 0.00;
if (adhocReplPerc != null && adhocReplPerc.trim().length() > 0) if (adhocReplPerc != null && adhocReplPerc.trim().length() > 0)
{ {
adhocvalue = Double.valueOf(adhocReplPerc.trim()); adhocvalue = Double.valueOf(adhocReplPerc.trim());
// cnt1=Integer.parseInt(adhocReplPerc.trim()); // cnt1=Integer.parseInt(adhocReplPerc.trim());
// if(cnt1<0 || cnt1>100){ // if(cnt1<0 || cnt1>100){
if (adhocvalue < 0 || adhocvalue > 100) if (adhocvalue < 0 || adhocvalue > 100)
{ {
errCode = "VTADH"; errCode = "VTADH";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("term_table__no")) else if (childNodeName.equalsIgnoreCase("term_table__no"))
{ {
termTableNo = checkNull(genericUtility.getColumnValue("term_table__no", dom)); termTableNo = checkNull(genericUtility.getColumnValue("term_table__no", dom));
// if( termTableNo != null) Changed By Nasruddin [16-sep-16] // if( termTableNo != null) Changed By Nasruddin [16-sep-16]
if (termTableNo != null && termTableNo.trim().length() > 0) if (termTableNo != null && termTableNo.trim().length() > 0)
{ {
sql = "select count(1) as cnt from sale_term_table where term_table = ?"; sql = "select count(1) as cnt from sale_term_table where term_table = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, termTableNo); pstmt.setString(1, termTableNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1356,26 +1356,26 @@ implements CustomerLocal, CustomerRemote ...@@ -1356,26 +1356,26 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMSALETERM"; errCode = "VMSALETERM";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("emp_code__ord")) else if (childNodeName.equalsIgnoreCase("emp_code__ord"))
{ {
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom)); empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
if (empCodeOrd != null && empCodeOrd.trim().length() > 0) if (empCodeOrd != null && empCodeOrd.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from employee where emp_code=?"; sql = "select count(*) as cnt from employee where emp_code=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd); pstmt.setString(1, empCodeOrd);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1384,7 +1384,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1384,7 +1384,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMEMPORD2"; errCode = "VMEMPORD2";
errList.add(errCode); errList.add(errCode);
...@@ -1403,7 +1403,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1403,7 +1403,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd1); pstmt.setString(1, empCodeOrd1);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1412,7 +1412,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1412,7 +1412,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMEMPORD2"; errCode = "VMEMPORD2";
errList.add(errCode); errList.add(errCode);
...@@ -1440,7 +1440,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1440,7 +1440,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VMCOMMTBCD"; errCode = "VMCOMMTBCD";
errList.add(errCode); errList.add(errCode);
...@@ -1451,7 +1451,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1451,7 +1451,7 @@ implements CustomerLocal, CustomerRemote
} // Changed By Nasruddin khan [19/JUL/16] END } // Changed By Nasruddin khan [19/JUL/16] END
// Changed By Nasruddin khan [16/SEP/16] START // Changed By Nasruddin khan [16/SEP/16] START
else if (childNodeName.equalsIgnoreCase("disc_list")) else if (childNodeName.equalsIgnoreCase("disc_list"))
{ {
discList = checkNull(genericUtility.getColumnValue("disc_list", dom)); discList = checkNull(genericUtility.getColumnValue("disc_list", dom));
...@@ -1464,7 +1464,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1464,7 +1464,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, discList); pstmt.setString(1, discList);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1603,7 +1603,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1603,7 +1603,7 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>"); valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++) for (ctr = 0; ctr < childNodeListLength; ctr++)
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
...@@ -1611,14 +1611,14 @@ implements CustomerLocal, CustomerRemote ...@@ -1611,14 +1611,14 @@ implements CustomerLocal, CustomerRemote
{ {
regCode = checkNull(genericUtility.getColumnValue("reg_code", dom)); regCode = checkNull(genericUtility.getColumnValue("reg_code", dom));
if (regCode != null && regCode.trim().length() > 0) if (regCode != null && regCode.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from reg_requirements where reg_code=?"; sql = "select count(*) as cnt from reg_requirements where reg_code=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, regCode); pstmt.setString(1, regCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
...@@ -1627,31 +1627,31 @@ implements CustomerLocal, CustomerRemote ...@@ -1627,31 +1627,31 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if (cnt == 0)
{ {
errCode = "VTRCODEXT"; errCode = "VTRCODEXT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else else
{ {
errCode = "VTRCODNULL"; errCode = "VTRCODNULL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.trim().equalsIgnoreCase("reg_date")) else if (childNodeName.trim().equalsIgnoreCase("reg_date"))
{ {
regDate = genericUtility.getColumnValue("reg_date", dom); regDate = genericUtility.getColumnValue("reg_date", dom);
if (regDate == null) if (regDate == null)
{ {
errCode = "VTREGNULL"; errCode = "VTREGNULL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.trim().equalsIgnoreCase("valid_upto")) else if (childNodeName.trim().equalsIgnoreCase("valid_upto"))
{ {
validUpto = genericUtility.getColumnValue("valid_upto", dom); validUpto = genericUtility.getColumnValue("valid_upto", dom);
regDate = genericUtility.getColumnValue("reg_date", dom); regDate = genericUtility.getColumnValue("reg_date", dom);
...@@ -1660,8 +1660,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1660,8 +1660,8 @@ implements CustomerLocal, CustomerRemote
errCode = "VTVALNULL"; errCode = "VTVALNULL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if (regDate != null) else if (regDate != null)
{ {
Timestamp validUptoDate = Timestamp.valueOf(genericUtility.getValidDateString(validUpto, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); Timestamp validUptoDate = Timestamp.valueOf(genericUtility.getValidDateString(validUpto, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
Timestamp regDateNew = Timestamp.valueOf(genericUtility.getValidDateString(regDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); Timestamp regDateNew = Timestamp.valueOf(genericUtility.getValidDateString(regDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
...@@ -1680,41 +1680,41 @@ implements CustomerLocal, CustomerRemote ...@@ -1680,41 +1680,41 @@ implements CustomerLocal, CustomerRemote
int errListSize = errList.size(); int errListSize = errList.size();
cnt = 0; cnt = 0;
String errFldName = null; String errFldName = null;
if ((errList != null) && (errListSize > 0)) if ((errList != null) && (errListSize > 0))
{ {
for (cnt = 0; cnt < errListSize; cnt++) for (cnt = 0; cnt < errListSize; cnt++)
{ {
errCode = (String) errList.get(cnt); errCode = (String) errList.get(cnt);
errFldName = (String) errFields.get(cnt); errFldName = (String) errFields.get(cnt);
errString = getErrorString(errFldName, errCode, userId); errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode); errorType = errorType(conn, errCode);
if (errString.length() > 0) if (errString.length() > 0)
{ {
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>")); String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>")); bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString); errStringXml.append(bifurErrString);
errString = ""; errString = "";
} }
if (errorType.equalsIgnoreCase("E")) if (errorType.equalsIgnoreCase("E"))
{ {
break; break;
} }
} }
errStringXml.append("</Errors> </Root> \r\n"); errStringXml.append("</Errors> </Root> \r\n");
} }
else else
{ {
errStringXml = new StringBuffer(""); errStringXml = new StringBuffer("");
} }
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
throw new ITMException(e); throw new ITMException(e);
} }
finally finally
{ {
try try
{ {
// Commented and Added by sarita on 13NOV2017 // Commented and Added by sarita on 13NOV2017
/*if (conn != null) /*if (conn != null)
...@@ -1733,7 +1733,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1733,7 +1733,7 @@ implements CustomerLocal, CustomerRemote
conn.close(); conn.close();
} }
conn = null;*/ conn = null;*/
if (conn != null) if (conn != null)
{ {
conn.close(); conn.close();
conn = null; conn = null;
...@@ -1743,13 +1743,13 @@ implements CustomerLocal, CustomerRemote ...@@ -1743,13 +1743,13 @@ implements CustomerLocal, CustomerRemote
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} }
catch (Exception d) catch (Exception d)
{ {
d.printStackTrace(); d.printStackTrace();
throw new ITMException(d); throw new ITMException(d);
...@@ -1769,15 +1769,15 @@ implements CustomerLocal, CustomerRemote ...@@ -1769,15 +1769,15 @@ implements CustomerLocal, CustomerRemote
{ {
dom = parseString(xmlString); dom = parseString(xmlString);
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) if (xmlString2.trim().length() > 0)
{ {
dom2 = parseString(xmlString2); dom2 = parseString(xmlString2);
} }
System.out.println("HELLO1 PRINT"); System.out.println("HELLO1 PRINT");
valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams); valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
System.out.println("valueXmlString[" + valueXmlString + "]"); System.out.println("valueXmlString[" + valueXmlString + "]");
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Exception : [MiscVal][itemChanged( String, String )] :==>\n" + e.getMessage()); System.out.println("Exception : [MiscVal][itemChanged( String, String )] :==>\n" + e.getMessage());
throw new ITMException(e); throw new ITMException(e);
...@@ -1844,13 +1844,13 @@ implements CustomerLocal, CustomerRemote ...@@ -1844,13 +1844,13 @@ implements CustomerLocal, CustomerRemote
connDriver = null; connDriver = null;
this.finCommon = new FinCommon(); this.finCommon = new FinCommon();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if ((objContext != null) && (objContext.trim().length() > 0)) if ((objContext != null) && (objContext.trim().length() > 0))
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>"); valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>"); valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
...@@ -1858,18 +1858,18 @@ implements CustomerLocal, CustomerRemote ...@@ -1858,18 +1858,18 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>"); valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
do do
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if (childNodeName.equals(currentColumn)) if (childNodeName.equals(currentColumn))
{ {
childNode.getFirstChild(); childNode.getFirstChild();
} }
ctr++; ctr++;
} while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn))); } while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println("CURRENT COLUMN [" + currentColumn + "]"); System.out.println("CURRENT COLUMN [" + currentColumn + "]");
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom)); resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?"; sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
...@@ -1886,17 +1886,17 @@ implements CustomerLocal, CustomerRemote ...@@ -1886,17 +1886,17 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>"); valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom)); lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if (lsBKListed.equalsIgnoreCase("N")) if (lsBKListed.equalsIgnoreCase("N"))
{ {
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>"); valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
} }
else else
{ {
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("itm_default")) else if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom)); resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?"; sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
...@@ -1913,26 +1913,26 @@ implements CustomerLocal, CustomerRemote ...@@ -1913,26 +1913,26 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>"); valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom)); lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if ("N".equalsIgnoreCase(lsBKListed)) if ("N".equalsIgnoreCase(lsBKListed))
{ {
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>"); valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
} }
else else
{ {
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
} }
//Change by Pooja S.Start //Change by Pooja S.Start
String sitecode1 = checkNull(genericUtility.getColumnValue("site_code", dom)); String sitecode1 = checkNull(genericUtility.getColumnValue("site_code", dom));
if(sitecode1==null || "".equals(sitecode1)||sitecode1.trim().length() == 0) if(sitecode1==null || "".equals(sitecode1)||sitecode1.trim().length() == 0)
{ {
sitecode1 = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"); sitecode1 = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.print("value of sitecode " + sitecode1); System.out.print("value of sitecode " + sitecode1);
valueXmlString.append("<site_code><![CDATA[" + sitecode1 + "]]></site_code>"); valueXmlString.append("<site_code><![CDATA[" + sitecode1 + "]]></site_code>");
} }
} }
//Change by Pooja S.End //Change by Pooja S.End
else if (currentColumn.trim().equalsIgnoreCase("cust_code")) else if (currentColumn.trim().equalsIgnoreCase("cust_code"))
{ {
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
...@@ -1943,7 +1943,7 @@ implements CustomerLocal, CustomerRemote ...@@ -1943,7 +1943,7 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<group_code><![CDATA[" + custCode + "]]></group_code>"); valueXmlString.append("<group_code><![CDATA[" + custCode + "]]></group_code>");
// } // }
} }
else if (currentColumn.trim().equalsIgnoreCase("stan_code")) else if (currentColumn.trim().equalsIgnoreCase("stan_code"))
{ {
stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom)); stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom));
sql = "select state_code, city, pin from station where stan_code = ?"; sql = "select state_code, city, pin from station where stan_code = ?";
...@@ -1998,21 +1998,21 @@ implements CustomerLocal, CustomerRemote ...@@ -1998,21 +1998,21 @@ implements CustomerLocal, CustomerRemote
{ {
custName = checkNull(genericUtility.getColumnValue("cust_name", dom)); custName = checkNull(genericUtility.getColumnValue("cust_name", dom));
chqName = checkNull(genericUtility.getColumnValue("chq_name", dom)); chqName = checkNull(genericUtility.getColumnValue("chq_name", dom));
if (chqName == null || chqName.trim().length() <= 0) if (chqName == null || chqName.trim().length() <= 0)
{ {
valueXmlString.append("<chq_name><![CDATA[" + custName + "]]></chq_name>"); valueXmlString.append("<chq_name><![CDATA[" + custName + "]]></chq_name>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("terr_code")) else if (currentColumn.trim().equalsIgnoreCase("terr_code"))
{ {
terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom)); terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom));
if (terrCode != null && terrCode.trim().length() > 0) if (terrCode != null && terrCode.trim().length() > 0)
{ {
sql = "select descr from territory where terr_code =?"; sql = "select descr from territory where terr_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, terrCode); pstmt.setString(1, terrCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
terrDesc = checkNull(rs.getString("descr")); terrDesc = checkNull(rs.getString("descr"));
} }
...@@ -2022,8 +2022,8 @@ implements CustomerLocal, CustomerRemote ...@@ -2022,8 +2022,8 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
} }
valueXmlString.append("<territory_descr><![CDATA[" + terrDesc + "]]></territory_descr>"); valueXmlString.append("<territory_descr><![CDATA[" + terrDesc + "]]></territory_descr>");
} }
else if (currentColumn.trim().equalsIgnoreCase("sales_pers")) else if (currentColumn.trim().equalsIgnoreCase("sales_pers"))
{ {
salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom)); salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom));
sql = "select sp_name from sales_pers where sales_pers=?"; sql = "select sp_name from sales_pers where sales_pers=?";
...@@ -2040,7 +2040,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2040,7 +2040,7 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<sp_name><![CDATA[" + spName + "]]></sp_name>"); valueXmlString.append("<sp_name><![CDATA[" + spName + "]]></sp_name>");
} }
else if (currentColumn.trim().equalsIgnoreCase("contact_code")) else if (currentColumn.trim().equalsIgnoreCase("contact_code"))
{ {
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom)); contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
...@@ -2048,7 +2048,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2048,7 +2048,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode); pstmt.setString(1, contactCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
name = checkNull(rs.getString("name")); name = checkNull(rs.getString("name"));
shName = checkNull(rs.getString("sh_name")); shName = checkNull(rs.getString("sh_name"));
...@@ -2084,19 +2084,19 @@ implements CustomerLocal, CustomerRemote ...@@ -2084,19 +2084,19 @@ implements CustomerLocal, CustomerRemote
contPfx1 = checkNull(genericUtility.getColumnValue("cont_pfx", dom)); contPfx1 = checkNull(genericUtility.getColumnValue("cont_pfx", dom));
if (contPfx1 == null || contPfx1.trim().length() <= 0) if (contPfx1 == null || contPfx1.trim().length() <= 0)
{ {
valueXmlString.append("<cont_pfx><![CDATA[" + contPfx + "]]></cont_pfx>"); valueXmlString.append("<cont_pfx><![CDATA[" + contPfx + "]]></cont_pfx>");
} }
contPers1 = checkNull(genericUtility.getColumnValue("cont_pers", dom)); contPers1 = checkNull(genericUtility.getColumnValue("cont_pers", dom));
if (contPers1 == null || contPers1.trim().length() <= 0) if (contPers1 == null || contPers1.trim().length() <= 0)
{ {
valueXmlString.append("<cont_pers><![CDATA[" + contPers + "]]></cont_pers>"); valueXmlString.append("<cont_pers><![CDATA[" + contPers + "]]></cont_pers>");
} }
Add1 = checkNull(genericUtility.getColumnValue("addr1", dom)); Add1 = checkNull(genericUtility.getColumnValue("addr1", dom));
if (Add1 == null || Add1.trim().length() <= 0) if (Add1 == null || Add1.trim().length() <= 0)
{ {
valueXmlString.append("<addr1><![CDATA[" + addr1 + "]]></addr1>"); valueXmlString.append("<addr1><![CDATA[" + addr1 + "]]></addr1>");
valueXmlString.append("<addr2><![CDATA[" + addr2 + "]]></addr2>"); valueXmlString.append("<addr2><![CDATA[" + addr2 + "]]></addr2>");
...@@ -2123,7 +2123,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2123,7 +2123,7 @@ implements CustomerLocal, CustomerRemote
} }
ediAddr1 = checkNull(genericUtility.getColumnValue("edi_addr", dom)); ediAddr1 = checkNull(genericUtility.getColumnValue("edi_addr", dom));
if (ediAddr1 == null || ediAddr1.trim().length() <= 0) if (ediAddr1 == null || ediAddr1.trim().length() <= 0)
{ {
valueXmlString.append("<edi_addr ><![CDATA[" + ediAddr + "]]></edi_addr>"); valueXmlString.append("<edi_addr ><![CDATA[" + ediAddr + "]]></edi_addr>");
} }
...@@ -2141,14 +2141,14 @@ implements CustomerLocal, CustomerRemote ...@@ -2141,14 +2141,14 @@ implements CustomerLocal, CustomerRemote
pstmt2.close(); pstmt2.close();
pstmt2 = null; pstmt2 = null;
if (custCode == null && !(keyFlag.equalsIgnoreCase("A"))) if (custCode == null && !(keyFlag.equalsIgnoreCase("A")))
{ {
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom)); contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<cust_code ><![CDATA[" + contactCode + "]]></cust_code>"); valueXmlString.append("<cust_code ><![CDATA[" + contactCode + "]]></cust_code>");
} }
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom)); custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
if (custCodeBill == null || custCodeBill.trim().length() <= 0) if (custCodeBill == null || custCodeBill.trim().length() <= 0)
{ {
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom)); contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<cust_code__bil ><![CDATA[" + contactCode + "]]></cust_code__bil>"); valueXmlString.append("<cust_code__bil ><![CDATA[" + contactCode + "]]></cust_code__bil>");
...@@ -2157,7 +2157,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2157,7 +2157,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode); pstmt.setString(1, contactCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
custName = checkNull(rs.getString("cust_name")); custName = checkNull(rs.getString("cust_name"));
} }
...@@ -2173,7 +2173,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2173,7 +2173,7 @@ implements CustomerLocal, CustomerRemote
} }
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom)); groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
if (groupCode == null || groupCode.trim().length() <= 0) if (groupCode == null || groupCode.trim().length() <= 0)
{ {
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom)); contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<group_code ><![CDATA[" + contactCode + "]]></group_code>"); valueXmlString.append("<group_code ><![CDATA[" + contactCode + "]]></group_code>");
...@@ -2182,7 +2182,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2182,7 +2182,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode); pstmt.setString(1, contactCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
custName = checkNull(rs.getString("cust_name")); custName = checkNull(rs.getString("cust_name"));
} }
...@@ -2196,7 +2196,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2196,7 +2196,7 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>"); valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>");
} }
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("bank_code")) else if (currentColumn.trim().equalsIgnoreCase("bank_code"))
{ {
bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom)); bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom));
...@@ -2215,7 +2215,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2215,7 +2215,7 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<bank_name ><![CDATA[" + bankName + "]]></bank_name>"); valueXmlString.append("<bank_name ><![CDATA[" + bankName + "]]></bank_name>");
} }
else if (currentColumn.trim().equalsIgnoreCase("channel_partner")) else if (currentColumn.trim().equalsIgnoreCase("channel_partner"))
{ {
channelPartner = checkNull(genericUtility.getColumnValue("channel_partner", dom)); channelPartner = checkNull(genericUtility.getColumnValue("channel_partner", dom));
...@@ -2232,13 +2232,13 @@ implements CustomerLocal, CustomerRemote ...@@ -2232,13 +2232,13 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<fin_link protect = \"1\"><![CDATA[" + nullVarr + "]]></fin_link>"); valueXmlString.append("<fin_link protect = \"1\"><![CDATA[" + nullVarr + "]]></fin_link>");
valueXmlString.append("<dis_link protect = \"1\"><![CDATA[" + nullVarr + "]]></dis_link>"); valueXmlString.append("<dis_link protect = \"1\"><![CDATA[" + nullVarr + "]]></dis_link>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("black_listed")) else if (currentColumn.trim().equalsIgnoreCase("black_listed"))
{ {
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom)); lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
System.out.println("black_listed :- " + lsBKListed); System.out.println("black_listed :- " + lsBKListed);
if (lsBKListed.equalsIgnoreCase("N")) if (lsBKListed.equalsIgnoreCase("N"))
{ {
valueXmlString.append("<black_listed_date protect = \"1\"><![CDATA[" + ldDate + "]]></black_listed_date>"); valueXmlString.append("<black_listed_date protect = \"1\"><![CDATA[" + ldDate + "]]></black_listed_date>");
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
...@@ -2249,7 +2249,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2249,7 +2249,7 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<reas_code__bklist protect = \"0\"><![CDATA[]]></reas_code__bklist>"); valueXmlString.append("<reas_code__bklist protect = \"0\"><![CDATA[]]></reas_code__bklist>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("reas_code__bklist")) else if (currentColumn.trim().equalsIgnoreCase("reas_code__bklist"))
{ {
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom)); resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
...@@ -2276,7 +2276,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2276,7 +2276,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm); pstmt.setString(1, crTerm);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
crDays = checkNull(rs.getString("cr_days")); crDays = checkNull(rs.getString("cr_days"));
} }
...@@ -2287,20 +2287,20 @@ implements CustomerLocal, CustomerRemote ...@@ -2287,20 +2287,20 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<credit_prd ><![CDATA[" + crDays + "]]></credit_prd>"); valueXmlString.append("<credit_prd ><![CDATA[" + crDays + "]]></credit_prd>");
} }
else if (currentColumn.trim().equalsIgnoreCase("rate_round")) else if (currentColumn.trim().equalsIgnoreCase("rate_round"))
{ {
rateRound = checkNull(this.genericUtility.getColumnValue("rate_round", dom)); rateRound = checkNull(this.genericUtility.getColumnValue("rate_round", dom));
if (rateRound.equalsIgnoreCase("N")) if (rateRound.equalsIgnoreCase("N"))
{ {
valueXmlString.append("<rate_round_to protect = \"1\"><![CDATA[]]></rate_round_to>"); valueXmlString.append("<rate_round_to protect = \"1\"><![CDATA[]]></rate_round_to>");
} }
else else
{ {
valueXmlString.append("<rate_round_to protect = \"0\"><![CDATA[]]></rate_round_to>"); valueXmlString.append("<rate_round_to protect = \"0\"><![CDATA[]]></rate_round_to>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("group_code")) else if (currentColumn.trim().equalsIgnoreCase("group_code"))
{ {
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom)); groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
...@@ -2318,7 +2318,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2318,7 +2318,7 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>"); valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>");
} }
else if (currentColumn.trim().equalsIgnoreCase("cust_code__bil")) { else if (currentColumn.trim().equalsIgnoreCase("cust_code__bil")) {
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom)); custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
...@@ -2336,7 +2336,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2336,7 +2336,7 @@ implements CustomerLocal, CustomerRemote
pstmt = null; pstmt = null;
valueXmlString.append("<customer_cust_name_1 ><![CDATA[" + custName + "]]></customer_cust_name_1>"); valueXmlString.append("<customer_cust_name_1 ><![CDATA[" + custName + "]]></customer_cust_name_1>");
} }
else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord")) else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord"))
{ {
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom)); empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
...@@ -2346,7 +2346,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2346,7 +2346,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd); pstmt.setString(1, empCodeOrd);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
empFname = checkNull(rs.getString("emp_fname")); empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname")); empLname = checkNull(rs.getString("emp_lname"));
...@@ -2361,17 +2361,17 @@ implements CustomerLocal, CustomerRemote ...@@ -2361,17 +2361,17 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<emp_lname ><![CDATA[" + empLname + "]]></emp_lname>"); valueXmlString.append("<emp_lname ><![CDATA[" + empLname + "]]></emp_lname>");
valueXmlString.append("<dept_code ><![CDATA[" + deptCode + "]]></dept_code>"); valueXmlString.append("<dept_code ><![CDATA[" + deptCode + "]]></dept_code>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord1")) else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord1"))
{ {
empCodeOrd1 = checkNull(genericUtility.getColumnValue("emp_code__ord1", dom)); empCodeOrd1 = checkNull(genericUtility.getColumnValue("emp_code__ord1", dom));
if (empCodeOrd1 != null) if (empCodeOrd1 != null)
{ {
sql = "select emp_fname,emp_lname,dept_code from employee where emp_code=?"; sql = "select emp_fname,emp_lname,dept_code from employee where emp_code=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd1); pstmt.setString(1, empCodeOrd1);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
empFname = checkNull(rs.getString("emp_fname")); empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname")); empLname = checkNull(rs.getString("emp_lname"));
...@@ -2388,7 +2388,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2388,7 +2388,7 @@ implements CustomerLocal, CustomerRemote
} }
} }
//Added by Pooja S. Start //Added by Pooja S. Start
else if (currentColumn.trim().equalsIgnoreCase("cust_type")) else if (currentColumn.trim().equalsIgnoreCase("cust_type"))
{ {
custType = checkNull(genericUtility.getColumnValue("cust_type", dom)); custType = checkNull(genericUtility.getColumnValue("cust_type", dom));
sql = "select * from Customer_default where cust_type = ?"; sql = "select * from Customer_default where cust_type = ?";
...@@ -2399,12 +2399,18 @@ implements CustomerLocal, CustomerRemote ...@@ -2399,12 +2399,18 @@ implements CustomerLocal, CustomerRemote
int columnCount = rsmd.getColumnCount(); int columnCount = rsmd.getColumnCount();
ResultSet rset = null; ResultSet rset = null;
PreparedStatement pstm = null; PreparedStatement pstm = null;
while (rs.next()) while (rs.next())
{ {
for (int i = 1; i <= columnCount; i++) for (int i = 1; i <= columnCount; i++)
{ {
colName = rsmd.getColumnName(i).toLowerCase(); colName = rsmd.getColumnName(i).toLowerCase();
colValue = checkNull(rs.getString(colName)); colValue = checkNull(rs.getString(colName));
//Changes by Pooja S. on 06/09/18 [value of column does not set if field is not blank] START
if (colValue != null && colValue.trim().length() > 0)
{
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + colValue + "]]>").append("</" + colName + ">");
}
//Changes by Pooja S. on 06/09/18 [value of column does not set if field is not blank] END
if (colName.equals("site_code__pay")) if (colName.equals("site_code__pay"))
{ {
if (colValue == null || colValue.trim().length() == 0) if (colValue == null || colValue.trim().length() == 0)
...@@ -2412,8 +2418,9 @@ implements CustomerLocal, CustomerRemote ...@@ -2412,8 +2418,9 @@ implements CustomerLocal, CustomerRemote
siteCodePay = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"); siteCodePay = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodePay + "]]>").append("</" + colName + ">"); valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodePay + "]]>").append("</" + colName + ">");
} }
} }
/*else if (colName.equals("part_Qty")) /*else if (colName.equals("part_Qty"))
{ {
if (colValue == null || colValue.trim().length() == 0) if (colValue == null || colValue.trim().length() == 0)
{ {
...@@ -2428,10 +2435,11 @@ implements CustomerLocal, CustomerRemote ...@@ -2428,10 +2435,11 @@ implements CustomerLocal, CustomerRemote
siteCodeRcp = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"); siteCodeRcp = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodeRcp + "]]>").append("</" + colName + ">"); valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodeRcp + "]]>").append("</" + colName + ">");
} }
} }
else if (colName.equals("curr_code")) else if (colName.equals("curr_code"))
{ {
if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0))) if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0)))
{ {
String countCode2 = checkNull(genericUtility.getColumnValue("count_code", dom)); String countCode2 = checkNull(genericUtility.getColumnValue("count_code", dom));
String stateCode1 = checkNull(genericUtility.getColumnValue("state_code", dom)); String stateCode1 = checkNull(genericUtility.getColumnValue("state_code", dom));
...@@ -2440,20 +2448,22 @@ implements CustomerLocal, CustomerRemote ...@@ -2440,20 +2448,22 @@ implements CustomerLocal, CustomerRemote
pstm.setString(1, countCode2); pstm.setString(1, countCode2);
pstm.setString(2, stateCode1); pstm.setString(2, stateCode1);
rset = pstm.executeQuery(); rset = pstm.executeQuery();
if (rset.next()) if (rset.next())
{ {
currCode2 = checkNull(rset.getString("curr_code")); currCode2 = checkNull(rset.getString("curr_code"));
valueXmlString.append("<curr_code ><![CDATA[" + currCode2 + "]]></curr_code>"); valueXmlString.append("<curr_code ><![CDATA[" + currCode2 + "]]></curr_code>");
} }
rset.close(); rset.close();
rset = null; rset = null;
pstm.close(); pstm.close();
pstm = null; pstm = null;
} }
} }
else if (colName.equals("price_list")) else if (colName.equals("price_list"))
{ {
System.out.print("Value colvalue5 \n [" + colValue + "]"); System.out.print("Value colvalue5 \n [" + colValue + "]");
if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0))) if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0)))
{ {
...@@ -2464,23 +2474,25 @@ implements CustomerLocal, CustomerRemote ...@@ -2464,23 +2474,25 @@ implements CustomerLocal, CustomerRemote
pstm.setString(1, countCode3); pstm.setString(1, countCode3);
pstm.setString(2, stateCode1); pstm.setString(2, stateCode1);
rset = pstm.executeQuery(); rset = pstm.executeQuery();
if (rset.next()) if (rset.next())
{ {
priceList = checkNull(rset.getString("price_list")); priceList = checkNull(rset.getString("price_list"));
valueXmlString.append("<price_list ><![CDATA[" + priceList + "]]></price_list>"); valueXmlString.append("<price_list ><![CDATA[" + priceList + "]]></price_list>");
valueXmlString.append("<price_list__disc ><![CDATA[" + priceList + "]]></price_list__disc>"); valueXmlString.append("<price_list__disc ><![CDATA[" + priceList + "]]></price_list__disc>");
} }
rset.close(); rset.close();
rset = null; rset = null;
pstm.close(); pstm.close();
pstm = null; pstm = null;
} }
} }
else //Changes by Pooja S. on 06/09/18 [value of column does not set if field is not blank] START
/*else
{ {
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + colValue + "]]>").append("</" + colName + ">"); valueXmlString.append("<" + colName + ">").append("<![CDATA[" + colValue + "]]>").append("</" + colName + ">");
} }*/
//Changes by Pooja S. on 06/09/18 [value of column does not set if field is not blank] END
} }
} }
rs.close(); rs.close();
...@@ -2491,7 +2503,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2491,7 +2503,7 @@ implements CustomerLocal, CustomerRemote
else if (currentColumn.trim().equalsIgnoreCase("full_name")) else if (currentColumn.trim().equalsIgnoreCase("full_name"))
{ {
String fullName1 = checkNull(genericUtility.getColumnValue("full_name", dom)); String fullName1 = checkNull(genericUtility.getColumnValue("full_name", dom));
if (fullName1 != null) if (fullName1 != null && fullName1.length()>=0)
{ {
valueXmlString.append("<chq_name ><![CDATA[" + fullName1 + "]]></chq_name>"); valueXmlString.append("<chq_name ><![CDATA[" + fullName1 + "]]></chq_name>");
valueXmlString.append("<eng_name ><![CDATA[" + fullName1 + "]]></eng_name>"); valueXmlString.append("<eng_name ><![CDATA[" + fullName1 + "]]></eng_name>");
...@@ -2506,7 +2518,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2506,7 +2518,7 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>"); valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
do do
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
...@@ -2541,18 +2553,18 @@ implements CustomerLocal, CustomerRemote ...@@ -2541,18 +2553,18 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("</Detail2>"); valueXmlString.append("</Detail2>");
} }
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
} }
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
System.out.println("Exception ::" + e.getMessage()); System.out.println("Exception ::" + e.getMessage());
throw new ITMException(e); throw new ITMException(e);
} }
finally finally
{ {
try try
{ {
if (conn != null) if (conn != null)
{ {
if (pstmt != null) if (pstmt != null)
pstmt.close(); pstmt.close();
...@@ -2564,7 +2576,7 @@ implements CustomerLocal, CustomerRemote ...@@ -2564,7 +2576,7 @@ implements CustomerLocal, CustomerRemote
conn = null; conn = null;
} }
} }
catch (Exception d) catch (Exception d)
{ {
d.printStackTrace(); d.printStackTrace();
throw new ITMException(d); throw new ITMException(d);
...@@ -2573,24 +2585,24 @@ implements CustomerLocal, CustomerRemote ...@@ -2573,24 +2585,24 @@ implements CustomerLocal, CustomerRemote
return valueXmlString.toString(); return valueXmlString.toString();
} }
private String checkNull(String str) private String checkNull(String str)
{ {
if (str == null) if (str == null)
{ {
return ""; return "";
} }
else else
{ {
return str; return str;
} }
} }
private double checkDoubleNull(String str) private double checkDoubleNull(String str)
{ {
if (str == null || str.trim().length() == 0) if (str == null || str.trim().length() == 0)
{ {
return 0.0; return 0.0;
} }
else else
{ {
return Double.parseDouble(str); return Double.parseDouble(str);
...@@ -2608,16 +2620,16 @@ implements CustomerLocal, CustomerRemote ...@@ -2608,16 +2620,16 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode); pstmt.setString(1, errorCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
msgType = rs.getString("MSG_TYPE"); msgType = rs.getString("MSG_TYPE");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
ex.printStackTrace(); ex.printStackTrace();
try { try {
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
...@@ -2627,22 +2639,22 @@ implements CustomerLocal, CustomerRemote ...@@ -2627,22 +2639,22 @@ implements CustomerLocal, CustomerRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} catch (Exception e) } catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
} }
finally finally
{ {
try try
{ {
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment