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