Commit e11fa450 authored by pchavan's avatar pchavan

Add checkNullandTrim method.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@179488 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 225b0d09
......@@ -2138,13 +2138,13 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
if (errCode == null || errCode.trim().length() == 0) {
itemSer = distCommon.getItemSer(itemCode, siteCode, orderDate, custCode, "C", conn);
itemSerHdr = checkNull(genericUtility.getColumnValue("item_ser", dom1));
itemSerHdr = checkNullandTrim(genericUtility.getColumnValue("item_ser", dom1));
sql = "select oth_series from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSerHdr);
rs = pstmt.executeQuery();
if (rs.next()) {
mothSer = rs.getString("oth_series");
mothSer = checkNullandTrim(rs.getString("oth_series"));
}
rs.close();
rs = null;
......@@ -2154,7 +2154,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
if (mothSer == null || mothSer.trim().length() == 0) {
mothSer = "N";
}
itemSerProm = checkNull(genericUtility.getColumnValue("item_ser__prom", dom));
itemSerProm = checkNullandTrim(genericUtility.getColumnValue("item_ser__prom", dom));
sql = "select item_ser from item_credit_perc where item_code = ? and item_ser"
+ " in ( select item_ser from customer_series where cust_code = ? and item_ser = item_credit_perc.item_ser)";
pstmt = conn.prepareStatement(sql);
......@@ -2162,7 +2162,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(2, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemSerCrPerc = rs.getString("item_ser");
lsItemSerCrPerc = checkNullandTrim(rs.getString("item_ser"));
}
rs.close();
rs = null;
......@@ -2172,7 +2172,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
+ "] mothSer[" + mothSer + "] lsItemSerCrPerc[" + lsItemSerCrPerc
+ "] itemSerProm[" + itemSerProm + "]");
if (!itemSerHdr.equalsIgnoreCase(itemSer.trim()) && "N".equalsIgnoreCase(mothSer)
&& !(lsItemSerCrPerc.equalsIgnoreCase(itemSerProm.trim()))) {
&& !(lsItemSerCrPerc.equalsIgnoreCase(itemSerProm))) {
errCode = "VTITEM2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -2197,7 +2197,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemSerCrpolicy = rs.getString("item_ser__crpolicy");
lsItemSerCrpolicy = checkNullandTrim(rs.getString("item_ser__crpolicy"));
}
rs.close();
rs = null;
......@@ -2218,9 +2218,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsStopBusiness = rs.getString("stop_business");
saleOptionItem = rs.getString("sale_option");
contractReq = rs.getString("contract_req");
lsStopBusiness = checkNullandTrim(rs.getString("stop_business"));
saleOptionItem = checkNullandTrim(rs.getString("sale_option"));
contractReq = checkNullandTrim(rs.getString("contract_req"));
}
rs.close();
rs = null;
......@@ -2238,7 +2238,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
saleOption = rs.getString("sales_option");
saleOption = checkNullandTrim(rs.getString("sales_option"));
}
rs.close();
rs = null;
......@@ -2367,7 +2367,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
if (minQty > 0) {
nature = checkNull(genericUtility.getColumnValue("nature", dom));
nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom));
System.out.println("Nature" + nature);
if ("C".equalsIgnoreCase(nature)) {
......@@ -2400,7 +2400,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
}
}
orderType = checkNull(genericUtility.getColumnValue("order_type", dom1));
orderType = checkNullandTrim(genericUtility.getColumnValue("order_type", dom1));
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlag = false;
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
......@@ -2414,7 +2414,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
+ "nature" + nature + "]");
if (errCode == null || errCode.trim().length() == 0) {
nature = checkNull(genericUtility.getColumnValue("nature", dom));
nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom));
// NANDKUMAR GADKARI----------------------------------------START ------------------
discount = Double.parseDouble(checkDouble(genericUtility.getColumnValue("discount", dom)));
......@@ -2430,7 +2430,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(1, schemeCode);
rs = pstmt.executeQuery();
if (rs.next()) {
schemeFlag = rs.getString("scheme_flag");
schemeFlag = checkNullandTrim(rs.getString("scheme_flag"));
}
rs.close();
rs = null;
......@@ -2470,9 +2470,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
// unit
else if (childNodeName.equalsIgnoreCase("unit")) {
unit = checkNull(genericUtility.getColumnValue("unit", dom));
unitStd = checkNull(genericUtility.getColumnValue("unit__std", dom));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
unit = checkNullandTrim(genericUtility.getColumnValue("unit", dom));
unitStd = checkNullandTrim(genericUtility.getColumnValue("unit__std", dom));
itemCode = checkNullandTrim(genericUtility.getColumnValue("item_code", dom));
if (!(isExist(conn, "uom", "unit", unit))) {
errCode = "VTUNIT1";
......@@ -2517,9 +2517,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
// unit__rate
else if (childNodeName.equalsIgnoreCase("unit__rate")) {
unitRate = checkNull(genericUtility.getColumnValue("unit__rate", dom));
unitStd = checkNull(genericUtility.getColumnValue("unit__std", dom));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
unitRate = checkNullandTrim(genericUtility.getColumnValue("unit__rate", dom));
unitStd = checkNullandTrim(genericUtility.getColumnValue("unit__std", dom));
itemCode = checkNullandTrim(genericUtility.getColumnValue("item_code", dom));
if (!(isExist(conn, "uom", "unit", unitRate))) {
errCode = "VTUNIT1";
errList.add(errCode);
......@@ -2580,7 +2580,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
&& genericUtility.getColumnValue("quantity", dom).trim().length() > 0) {
quantity = Double.parseDouble(checkDouble(genericUtility.getColumnValue("quantity", dom)));
}
nature = checkNull(genericUtility.getColumnValue("nature", dom));
nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom));
if (checkNull(genericUtility.getColumnValue("pl_date", dom1)).trim().length() > 0) {
plDate = Timestamp.valueOf(
genericUtility.getValidDateString(genericUtility.getColumnValue("pl_date", dom1),
......@@ -2612,7 +2612,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
* itemCode,"","L",quantity, conn); }
*/
if (priceList != null && priceList.trim().length() > 0) {
lsListType = distCommon.getPriceListType(priceList, conn);
lsListType = checkNullandTrim(distCommon.getPriceListType(priceList, conn));
}
if ((priceList != null && priceList.length() > 0)
&& !"B".equalsIgnoreCase(lsListType)) {
......@@ -2798,9 +2798,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
else if (childNodeName.equalsIgnoreCase("item_ser")) {
String lsSer = "", lsCust = "", lsItemFlag = "";
lsSer = checkNull(genericUtility.getColumnValue("item_ser", dom1));
lsCust = checkNull(genericUtility.getColumnValue("cust_code", dom1));
lsItemFlag = checkNull(genericUtility.getColumnValue("item_flg", dom));
lsSer = checkNullandTrim(genericUtility.getColumnValue("item_ser", dom1));
lsCust = checkNullandTrim(genericUtility.getColumnValue("cust_code", dom1));
lsItemFlag = checkNullandTrim(genericUtility.getColumnValue("item_flg", dom));
if ("I".equalsIgnoreCase(lsItemFlag)) {
sql = "select count(*) as cnt from customer_series where cust_code = ? and item_ser = ?";
......@@ -2872,7 +2872,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
// orderDate=Timestamp.valueOf(genericUtility.getColumnValue("order_date",
// dom1));
quantity = Double.parseDouble(checkDouble(genericUtility.getColumnValue("quantity", dom)));
nature = checkNull(genericUtility.getColumnValue("nature", dom));
nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom));
if (checkNull(genericUtility.getColumnValue("pl_date", dom1)).trim().length() > 0) {
plDate = Timestamp.valueOf(
genericUtility.getValidDateString(genericUtility.getColumnValue("pl_date", dom1),
......@@ -2891,7 +2891,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
if (priceList != null && priceList.trim().length() > 0) {
lsListType = distCommon.getPriceListType(priceList, conn);
lsListType = checkNullandTrim(distCommon.getPriceListType(priceList, conn));
if (rate > 0) {
if (lcRateClg <= 0 && !"B".equalsIgnoreCase(lsListType)) {
errCode = "VTECRNZ";
......@@ -3121,12 +3121,12 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
String lcconvqtystduom1 = "", convRtuomStduomStr = "";
// double convRtuomStduom=0;
System.out.println("@@@@@ validation of conv__rtuom_stduom executed......");
convRtuomStduomStr = checkNull(genericUtility.getColumnValue("conv__rtuom_stduom", dom));
unit = checkNull(genericUtility.getColumnValue("unit__rate", dom));
unitStd = checkNull(genericUtility.getColumnValue("unit__std", dom));
convRtuomStduomStr = checkNullandTrim(genericUtility.getColumnValue("conv__rtuom_stduom", dom));
unit = checkNullandTrim(genericUtility.getColumnValue("unit__rate", dom));
unitStd = checkNullandTrim(genericUtility.getColumnValue("unit__std", dom));
convRtuomStduom = convRtuomStduomStr == null ? 0 : Double.parseDouble(convRtuomStduomStr);
if (unitStd == null || unitStd.length() == 0) {
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
itemCode = checkNullandTrim(genericUtility.getColumnValue("item_code", dom));
unit = setDescription("unit", "item", "item_code", itemCode, conn);
}
unit = unit == null ? "" : unit.trim();
......@@ -3386,7 +3386,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setTimestamp(2, orderDate);
rs = pstmt.executeQuery();
if (rs.next()) {
lsStatus = rs.getString("ls_status");
lsStatus = checkNullandTrim(rs.getString("ls_status"));
}
pstmt.close();
pstmt = null;
......@@ -7108,7 +7108,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
} else if (currentColumn.trim().equalsIgnoreCase("exch_rate")) {
lcExchRate = checkNull(genericUtility.getColumnValue("exch_rate", dom));
lsCurrCode = checkNull(genericUtility.getColumnValue("curr_code", dom));
lsCurrCode = checkNullandTrim(genericUtility.getColumnValue("curr_code", dom));
lsCurrCodeComm = checkNull(genericUtility.getColumnValue("curr_code__comm", dom));
lsCurrCodeComm1 = checkNull(genericUtility.getColumnValue("curr_code__comm1", dom));
lsCurrCodeComm2 = checkNull(genericUtility.getColumnValue("curr_code__comm2", dom));
......@@ -7851,7 +7851,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
rs = pstmt.executeQuery();
if (rs.next()) {
lsSchemeCode = checkNull(rs.getString("bom_code"));
lsType = checkNull(rs.getString("item_stru"));
lsType = checkNullandTrim(rs.getString("item_stru"));
}
rs.close();
rs = null;
......@@ -8018,7 +8018,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(1, itemCodeOrd);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemStru = checkNull(rs.getString("item_stru"));
lsItemStru = checkNullandTrim(rs.getString("item_stru"));
}
rs.close();
rs = null;
......@@ -13128,7 +13128,15 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
return valueXmlString;
}
//Added By PriyankaC on 1FEB2018..[START]
private String checkNullandTrim(String input) {
if (input == null)
{
input = "";
}
return input.trim();
}
//Added By PriyankaC on 1FEB2018..[END]
private String checkNull(String str) {
if (str == null) {
return "";
......@@ -14998,7 +15006,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
// parentNode = parentNodeList.item(ctr);
// childNode = childNodeList.item(ctr);
// childNodeName = childNode.getNodeName();
lineNo = checkNull(genericUtility.getColumnValueFromNode("line_no", currDetail1));
lineNo = checkNullandTrim(genericUtility.getColumnValueFromNode("line_no", currDetail1));
nature = checkNull(genericUtility.getColumnValueFromNode("nature", currDetail1));
browItemCode = checkNull(genericUtility.getColumnValueFromNode("item_code", currDetail1));
quantity = checkDoubleNull(genericUtility.getColumnValueFromNode("quantity", currDetail1));
......@@ -16056,7 +16064,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
rs = pstmt.executeQuery();
if (rs.next()) {
mastfact = rs.getDouble(1);
variencetype = rs.getString(1);
variencetype = checkNullandTrim(rs.getString(1));
varience = rs.getDouble(1);
recCnt++;
}
......
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