Commit b9f8e8df authored by jshinde's avatar jshinde

Request Id:W15JSUN017,Consider Exempted /BSR Location in Pallet Out.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100014 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9e69a1fd
...@@ -187,15 +187,23 @@ implements PalletReqConfLocal, PalletReqConfRemote ...@@ -187,15 +187,23 @@ implements PalletReqConfLocal, PalletReqConfRemote
System.out.println(" in null trantype"); System.out.println(" in null trantype");
if ((itemCode != null) && (itemCode.length() > 0)) if ((itemCode != null) && (itemCode.length() > 0))
{ {
sql = "SELECT S.QTY_PER_ART,I.DESCR ,S.UNIT,I.ITEM_TYPE ,S.MFG_DATE,S.EXP_DATE FROM STOCK S ,ITEM I WHERE S.SITE_CODE=? AND S.LOC_CODE IN (?,?) AND S.ITEM_CODE= ? AND S.LOT_NO= ? AND S.LOT_SL= ? AND S.ITEM_CODE=I.ITEM_CODE"; //Change by Jagruti Shinde for Exempted /BSR Location Request Id:W15JSUN017
//sql = "SELECT S.QTY_PER_ART,I.DESCR ,S.UNIT,I.ITEM_TYPE ,S.MFG_DATE,S.EXP_DATE FROM STOCK S ,ITEM I WHERE S.SITE_CODE=? AND S.LOC_CODE IN (?,?) AND S.ITEM_CODE= ? AND S.LOT_NO= ? AND S.LOT_SL= ? AND S.ITEM_CODE=I.ITEM_CODE";
sql = "SELECT S.QTY_PER_ART,I.DESCR ,S.UNIT,I.ITEM_TYPE ,S.MFG_DATE,S.EXP_DATE FROM STOCK S ,ITEM I WHERE S.SITE_CODE=? AND S.LOC_CODE IN (?,?,?,?,?,?,?,?) AND S.ITEM_CODE= ? AND S.LOT_NO= ? AND S.LOT_SL= ? AND S.ITEM_CODE=I.ITEM_CODE AND S.QUANTITY>0";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, siteCode); pstmt1.setString(1, siteCode);
pstmt1.setString(2, palletNo); pstmt1.setString(2, palletNo);
pstmt1.setString(3, palletNo + "Q"); pstmt1.setString(3, palletNo + "Q");
pstmt1.setString(4, itemCode); pstmt1.setString(4, palletNo + "B");
pstmt1.setString(5, lotNo); pstmt1.setString(5, palletNo + "X");
pstmt1.setString(6, lotSl); pstmt1.setString(6, palletNo + "M");
pstmt1.setString(7, palletNo + "U");
pstmt1.setString(8, palletNo + "P");
pstmt1.setString(9, palletNo + "S");
pstmt1.setString(10, itemCode);
pstmt1.setString(11, lotNo);
pstmt1.setString(12, lotSl);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next())
......
...@@ -559,8 +559,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -559,8 +559,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
catch ( Exception e ) catch ( Exception e )
{ {
System.out.println ( "Exception: PalletizationIC: wfValData( Document currFormDataDom ): " + e.getMessage() + ":" ); System.out.println ( "Exception: PalletizationIC: wfValData( Document currFormDataDom ): " + e.getMessage() + ":" );
//throw new ITMException(e); throw new ITMException(e);
e.printStackTrace();
} }
finally finally
{ {
...@@ -629,7 +628,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -629,7 +628,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
return msgType; return msgType;
} }
private Double getPalletNoQty(String palletNo, String loginSite, Connection conn) throws Exception //Change by Jagruti Shinde to consider Exempted /BSR Location
/*private Double getPalletNoQty(String palletNo, String loginSite, Connection conn) throws Exception
{ {
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
ResultSet rs = null ; ResultSet rs = null ;
...@@ -689,8 +689,61 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -689,8 +689,61 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
} }
System.out.println("Return from getPalletNoQty ------>>" + quantity); System.out.println("Return from getPalletNoQty ------>>" + quantity);
return quantity; return quantity;
} }*/
//Change by Jagruti Shinde for Exempted /BSR Location [START]
private Double getPalletNoQty(String palletNo, String loginSite, Connection conn) throws Exception
{
PreparedStatement pstmt = null ;
ResultSet rs = null ;
String sql = "";
double quantity = 0;
try
{
sql = "SELECT SUM(QUANTITY) FROM STOCK WHERE LOC_CODE IN(?,?,?,?,?,?,?,?) AND SITE_CODE = ? AND INV_STAT IN(?,?) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, palletNo+"Q");
pstmt.setString(3, palletNo+"B");
pstmt.setString(4, palletNo+"X");
pstmt.setString(5, palletNo+"M");
pstmt.setString(6, palletNo+"U");
pstmt.setString(7, palletNo+"P");
pstmt.setString(8, palletNo+"S");
pstmt.setString(9, loginSite);
pstmt.setString(10, "AWMS");
pstmt.setString(11, "AWMSQ");
rs = pstmt.executeQuery();
if(rs.next())
{
quantity = rs.getInt(1);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
}
catch(Exception e)
{
System.out.println("Exception in getPalletNoQty ::::::::: " + e);
e.printStackTrace();
throw new Exception(e);
}
finally
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
System.out.println("Return from getPalletNoQty ------>>" + quantity);
return quantity;
}
//Change by Jagruti Shinde for Exempted /BSR Location [END]
private int getPalletNoCount(String palletNo, String loginSite, Connection conn) throws Exception private int getPalletNoCount(String palletNo, String loginSite, Connection conn) throws Exception
{ {
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
...@@ -699,11 +752,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -699,11 +752,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
int count = 0; int count = 0;
try try
{ {
sql = "select count(loc_code) from location where site_code = ? and inv_stat = ? and loc_code = ? "; // Change by Jagruti Shinde as site_code is not consider for location master
//sql = "select count(loc_code) from location where site_code = ? and inv_stat = ? and loc_code = ? ";
sql = "select count(loc_code) from location where inv_stat = ? and loc_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite); //pstmt.setString(1, loginSite);
pstmt.setString(2, "AWMS"); pstmt.setString(1, "AWMS");
pstmt.setString(3, palletNo); pstmt.setString(2, palletNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -904,10 +959,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -904,10 +959,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if(pstmt != null){ pstmt.close(); pstmt = null; } if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; } if(rs != null){ rs.close(); rs = null; }
sql ="SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ? AND SITE_CODE = ? " ; // Change by Jagruti Shinde as site_code is not consider for location master
//sql ="SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ? AND SITE_CODE = ? " ;
sql ="SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCode); pstmt.setString(1, locCode);
pstmt.setString(2, siteCode); //pstmt.setString(2, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
......
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