Commit e76858a6 authored by smestry's avatar smestry

W15FSUN008, Updated class file for Palletization.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99366 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1d38b880
......@@ -488,6 +488,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
try
{
if (conn != null)
{
conn.close();
......@@ -519,7 +520,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
while( rs.next() )
{
msgType = rs.getString("MSG_TYPE");
}
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
catch (Exception ex)
{
......@@ -628,6 +631,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
count = rs.getInt(1);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
}
catch(Exception e)
{
......@@ -670,6 +675,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
count = rs.getInt(1);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
}
catch(Exception e)
{
......@@ -715,7 +722,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
lotNoDB = checkNullAndTrim(rs.getString("lot_no"));
lotSlDB = checkNullAndTrim(rs.getString("lot_sl"));
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
hm.put("ITEM_CODE", itemCodeDB);
hm.put("LOT_NO", lotNoDB);
hm.put("LOT_SL", lotSlDB);
......@@ -764,6 +773,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
status = checkNullAndTrim(rs.getString("status"));
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
}
catch(Exception e)
{
......@@ -1204,6 +1215,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
try
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if ( conn != null )
{
conn.close();
......@@ -1250,41 +1271,64 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String sql = "";
int lineNo = 0;
if( tranId != null && tranId.trim().length() > 0 ) // edit mode
{
sql = "select max(line_no)+1 as line_no from pallet_det where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs= pstmt.executeQuery();
if(rs.next())
try
{
if( tranId != null && tranId.trim().length() > 0 ) // edit mode
{
lineNo = rs.getInt("line_no");
sql = "select max(line_no)+1 as line_no from pallet_det where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs= pstmt.executeQuery();
if(rs.next())
{
lineNo = rs.getInt("line_no");
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
else // add mode
{
sql = "select max(line_no)+1 as line_no from pallet_det det, pallet_hdr hdr where "
+ " hdr.pallet_no = ? and hdr.confirmed = ? and hdr.site_code = ? and hdr.tran_id = det.tran_id ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
pstmt.setString(3, siteCode);
rs= pstmt.executeQuery();
if(rs.next())
{
lineNo = rs.getInt("line_no");
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
}
if(lineNo == 0)
{
lineNo = 1;
}
}
else // add mode
catch(Exception e)
{
sql = "select max(line_no)+1 as line_no from pallet_det det, pallet_hdr hdr where "
+ " hdr.pallet_no = ? and hdr.confirmed = ? and hdr.site_code = ? and hdr.tran_id = det.tran_id ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
pstmt.setString(3, siteCode);
rs= pstmt.executeQuery();
if(rs.next())
System.out.println("Exception in getItemQcStatus ::::::: " + e);
e.printStackTrace();
throw new Exception(e);
}
finally
{
if(rs!=null)
{
lineNo = rs.getInt("line_no");
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
}
if(lineNo == 0)
{
lineNo = 1;
}
System.out.println("return lineNo from getMaxLineNo :::::::::::::::::; "+lineNo);
return lineNo;
}
......
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