Commit beeb109e authored by asikarwar's avatar asikarwar

changeCondition as par pb code in getItemSer


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93584 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c3579b13
...@@ -3254,12 +3254,12 @@ public class DistCommon ...@@ -3254,12 +3254,12 @@ public class DistCommon
//locCode = getTokenList(aLotNo,"~t"); // commented by cpatil //locCode = getTokenList(aLotNo,"~t"); // commented by cpatil
//lotNo = getTokenList(aLotNo,"~t"); // commented by cpatil //lotNo = getTokenList(aLotNo,"~t"); // commented by cpatil
//lotSl = getTokenList(aLotNo,"~t"); // commented by cpatil //lotSl = getTokenList(aLotNo,"~t"); // commented by cpatil
///System.out.println("siteCode..**..*>"+siteCode); ///System.out.println("siteCode..**..*>"+siteCode);
//System.out.println("locCode..**..*>"+locCode); //System.out.println("locCode..**..*>"+locCode);
//System.out.println("lotNo..**..*>"+lotNo); //System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotSl..**..*>"+lotSl); //System.out.println("lotSl..**..*>"+lotSl);
// modify by cpatil start // modify by cpatil start
String MulStr[] = aLotNo.split("~t"); String MulStr[] = aLotNo.split("~t");
siteCode = MulStr[0]; siteCode = MulStr[0];
...@@ -3374,9 +3374,9 @@ public class DistCommon ...@@ -3374,9 +3374,9 @@ public class DistCommon
rs2 = null; rs2 = null;
rate = pickRate(priceListParent,tempDate,itemCode,aLotNo,listType, quantity,conn); rate = pickRate(priceListParent,tempDate,itemCode,aLotNo,listType, quantity,conn);
return rate; return rate;
//return -1; //change done by kunal on 29/11/12 as per Manoj Sharma instruction //return -1; //change done by kunal on 29/11/12 as per Manoj Sharma instruction
} }
}//try 3 }//try 3
catch(Exception e) catch(Exception e)
...@@ -5792,19 +5792,23 @@ public class DistCommon ...@@ -5792,19 +5792,23 @@ public class DistCommon
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null; rs = null;
sql = "SELECT item_ser FROM item " if( itemSer == null || itemSer.trim().length() == 0)
+ "WHERE ITEM_CODE = '" + itemCode + "'"; //Condition added by Asikarwar on 06/Sep/2013 as par pb code
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{ {
itemSer = rs.getString(1); sql = "SELECT item_ser FROM item "
System.out.println("itemSer........"+itemSer); + "WHERE ITEM_CODE = '" + itemCode + "'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
} }
pstmt.close();
pstmt = null;
rs.close();
rs = null;
} }
} }
} }
...@@ -7909,7 +7913,7 @@ public class DistCommon ...@@ -7909,7 +7913,7 @@ public class DistCommon
public double pickRate(String priceList,String trDate,String itemCode,String aLotNo,Connection conn)throws ITMException,SQLException public double pickRate(String priceList,String trDate,String itemCode,String aLotNo,Connection conn)throws ITMException,SQLException
{ {
System.out.println("@@@@@--------------[pickRate]--[(String priceList,String trDate,String itemCode,String aLotNo,Connection conn)]-called------------------------------"); System.out.println("@@@@@--------------[pickRate]--[(String priceList,String trDate,String itemCode,String aLotNo,Connection conn)]-called------------------------------");
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ResultSet rs2 = null; ResultSet rs2 = null;
...@@ -7941,7 +7945,7 @@ public class DistCommon ...@@ -7941,7 +7945,7 @@ public class DistCommon
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00"); tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
if(listType.equalsIgnoreCase("I")) // replace listType instead of list by cpatil on 10-oct-12 if(listType.equalsIgnoreCase("I")) // replace listType instead of list by cpatil on 10-oct-12
{ {
if (aLotNo.indexOf("~t") > 0) if (aLotNo.indexOf("~t") > 0)
...@@ -8052,12 +8056,12 @@ public class DistCommon ...@@ -8052,12 +8056,12 @@ public class DistCommon
} }
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
if (rs != null ) //&& !rs.isClosed()) if (rs != null ) //&& !rs.isClosed())
...@@ -8116,7 +8120,7 @@ public class DistCommon ...@@ -8116,7 +8120,7 @@ public class DistCommon
pstmt.setTimestamp(2,tranDate); pstmt.setTimestamp(2,tranDate);
pstmt.setTimestamp(3,tranDate); pstmt.setTimestamp(3,tranDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
rate = rs.getDouble(1); rate = rs.getDouble(1);
...@@ -8137,7 +8141,7 @@ public class DistCommon ...@@ -8137,7 +8141,7 @@ public class DistCommon
pstmt = null; pstmt = null;
sql = "SELECT (CASE WHEN PRICE_LIST__PARENT IS NULL THEN '' ELSE PRICE_LIST__PARENT END) " sql = "SELECT (CASE WHEN PRICE_LIST__PARENT IS NULL THEN '' ELSE PRICE_LIST__PARENT END) "
+ "FROM pricelist_mst WHERE PRICE_LIST = '"+priceList+"' "; + "FROM pricelist_mst WHERE PRICE_LIST = '"+priceList+"' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -8397,7 +8401,7 @@ public class DistCommon ...@@ -8397,7 +8401,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8405,7 +8409,7 @@ public class DistCommon ...@@ -8405,7 +8409,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8541,7 +8545,7 @@ public class DistCommon ...@@ -8541,7 +8545,7 @@ public class DistCommon
} }
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8549,7 +8553,7 @@ public class DistCommon ...@@ -8549,7 +8553,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8672,7 +8676,7 @@ public class DistCommon ...@@ -8672,7 +8676,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8744,14 +8748,14 @@ public class DistCommon ...@@ -8744,14 +8748,14 @@ public class DistCommon
} }
} }
} }
return(rate); return(rate);
} }
public double pickRate(String priceList,String trDate,String itemCode,Connection conn)throws ITMException,SQLException public double pickRate(String priceList,String trDate,String itemCode,Connection conn)throws ITMException,SQLException
{ {
System.out.println("@@@@@--------------[pickRate]--[(String priceList,String trDate,String itemCode,Connection conn)]-called------------------------------"); System.out.println("@@@@@--------------[pickRate]--[(String priceList,String trDate,String itemCode,Connection conn)]-called------------------------------");
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ResultSet rs2 = null; ResultSet rs2 = null;
...@@ -8783,7 +8787,7 @@ public class DistCommon ...@@ -8783,7 +8787,7 @@ public class DistCommon
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00"); tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -8881,7 +8885,7 @@ public class DistCommon ...@@ -8881,7 +8885,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
if (rs != null && !rs.isClosed()) if (rs != null && !rs.isClosed())
...@@ -8915,7 +8919,7 @@ public class DistCommon ...@@ -8915,7 +8919,7 @@ public class DistCommon
pstmt = null; pstmt = null;
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -9147,7 +9151,7 @@ public class DistCommon ...@@ -9147,7 +9151,7 @@ public class DistCommon
} }
else else
{ {
try try
{ {
rs2.close(); rs2.close();
...@@ -9218,7 +9222,7 @@ public class DistCommon ...@@ -9218,7 +9222,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -9226,7 +9230,7 @@ public class DistCommon ...@@ -9226,7 +9230,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -9361,7 +9365,7 @@ public class DistCommon ...@@ -9361,7 +9365,7 @@ public class DistCommon
} }
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -9369,11 +9373,11 @@ public class DistCommon ...@@ -9369,11 +9373,11 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -9494,7 +9498,7 @@ public class DistCommon ...@@ -9494,7 +9498,7 @@ public class DistCommon
throw new ITMException(e); throw new ITMException(e);
} }
} }
} }
catch(Exception e) catch(Exception e)
{ {
......
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