Commit 5b2e0c47 authored by jshinde's avatar jshinde

Updated PalletOutIC to consider Expire,NearExpire,Damage,Hold ,Distribution...

Updated PalletOutIC to consider Expire,NearExpire,Damage,Hold ,Distribution order in Pallet Out Bound transaction


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101449 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9a4c6d45
......@@ -190,8 +190,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
break;
}
}
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;
}
}
}
}
......@@ -253,8 +261,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
break;
}
}
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;
}
}
if(locCodeInput.equalsIgnoreCase(locCodeSugg))
{
......@@ -360,8 +376,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
msgType = rs.getString("MSG_TYPE");
}
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;
}
}
catch (Exception ex)
{
......@@ -445,7 +469,7 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
String sql = "", tranId = "", chgUser = "", chgTerm = "", loginEmpCode = "", loginSite = "", locCodeInput = "",
locCodeSuggest="",childNodeName="",sql1="",fld_value="",sqlU="",udf_str1="",bayNo="",lotNo="",lotSl="",invStat="",status=""
,sqlGen="",udfStr="",udfStr1="",stkSql="",locCode ="",sqlDB ="",sqlRef ="",refSer ="" ,sqlLock ="",lockCode =""
,sqlDamage ="",lockCodeDH ="",dispDamageLock="",dispHoldLock="",dispNexpLoc="",dispExpLoc="";
,sqlDamage ="",lockCodeDH ="",dispDamageLock="",dispHoldLock="",dispNexpLoc="",dispExpLoc="",sqlRej ="";
char lastChar;
StringBuffer valueXmlString;
ArrayList <String> errList = new ArrayList<String>();
......@@ -534,8 +558,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
palletNo = rs.getString("PALLET_NO");
System.out.println( "palletNo:::"+palletNo);
}
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;
}
sqlRef="SELECT REF_SER FROM SWMS_TO_AWMS WHERE PALLET_NO= ? AND IN_OUT=? AND SCHEDULE_STATUS =?";
pstmt = conn.prepareStatement(sqlRef);
......@@ -548,8 +580,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
refSer = checkNullAndTrim(rsRef.getString("REF_SER"));
System.out.println( "refSer:::["+refSer+"]");
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rsRef != null){rsRef.close();rsRef = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rsRef != null)
{
rsRef.close();
rsRef = null;
}
if("D-SO".equalsIgnoreCase(checkNullAndTrim(refSer))||"S-ORD".equalsIgnoreCase(checkNullAndTrim(refSer)))
{
......@@ -563,8 +603,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -593,54 +641,147 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
locCode = checkNullAndTrim(stkrs.getString("LOC_CODE"));
System.out.println( "LOC CODE:::"+locCode);
}
if(stkpstmt != null){ stkpstmt.close();stkpstmt = null;}
if(stkrs != null){stkrs.close();stkrs = null;}
if(stkpstmt != null)
{
stkpstmt.close();
stkpstmt = null;
}
if(stkrs != null)
{
stkrs.close();
stkrs = null;
}
lastChar=locCode.charAt(locCode.trim().length()-1);
System.out.println("lastChar:"+lastChar);
sqlLock=" SELECT I.LOCK_CODE FROM INV_HOLD_DET D,INV_HOLD I ,STOCK S WHERE S.ITEM_CODE = D.ITEM_CODE " +
" AND S.LOC_CODE = D.LOC_CODE AND S.LOT_NO = D.LOT_NO AND S.LOT_SL = D.LOT_SL AND " +
" S.SITE_CODE = D.SITE_CODE AND I.TRAN_ID = D.TRAN_ID AND D.HOLD_STATUS != ? " +
" AND S.INV_STAT IN( ?,?) AND S.SITE_CODE= ? AND S.QUANTITY>0 AND " +
" S.LOC_CODE= ? ";
pstmt = conn.prepareStatement(sqlLock);
pstmt.setString(1, "R");
pstmt.setString(2, "AWMS");
pstmt.setString(3, "AWMSQ");
pstmt.setString(4, loginSite);
pstmt.setString(5, locCode);
rs = pstmt.executeQuery();
if(rs.next())
{
lockCode = checkNullAndTrim(rs.getString("LOCK_CODE"));
System.out.println( "LOCK CODE:::"+lockCode);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
System.out.println("locCode from query::::::["+lockCode+"]");
System.out.println("locCode from disparm for expiry::::::["+dispExpLoc+"]");
System.out.println("locCode from disparm for near expiry::::::["+dispNexpLoc+"]");
if('R'==(lastChar))
{
sqlGen="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmtGen = conn.prepareStatement(sqlGen);
pstmtGen.setString(1, "LOC_CODE_SUGG");
pstmtGen.setString(2, "W_PALLETOUT");
pstmtGen.setString(3, "REJECTED");
rsGen = pstmtGen.executeQuery();
if(rsGen.next())
if(!lockCode.equalsIgnoreCase(checkNullAndTrim(dispExpLoc)) && !lockCode.equalsIgnoreCase(checkNullAndTrim(dispNexpLoc)))
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
sqlGen="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmtGen = conn.prepareStatement(sqlGen);
pstmtGen.setString(1, "LOC_CODE_SUGG");
pstmtGen.setString(2, "W_PALLETOUT");
pstmtGen.setString(3, "REJECTED");
rsGen = pstmtGen.executeQuery();
if(rsGen.next())
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for Rejected Pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
else
{
for (int j = 0; j < locE.length; j++)
{
if((dispExpLoc).equalsIgnoreCase(checkNullAndTrim(lockCode)))
{
sqlGen="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmtGen = conn.prepareStatement(sqlGen);
pstmtGen.setString(1, "LOC_CODE_SUGG");
pstmtGen.setString(2, "W_PALLETOUT");
pstmtGen.setString(3, "EXPIRE");
rsGen = pstmtGen.executeQuery();
if(rsGen.next())
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for Rejected Pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
System.out.println("UDF_STR1 from gencodes for Rejected Expire pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
}
}
for (int k = 0; k < locN.length; k++)
{
if((dispNexpLoc).equalsIgnoreCase(checkNullAndTrim(lockCode)))
{
sqlGen="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmtGen = conn.prepareStatement(sqlGen);
pstmtGen.setString(1, "LOC_CODE_SUGG");
pstmtGen.setString(2, "W_PALLETOUT");
pstmtGen.setString(3, "NEAREXPIRE");
rsGen = pstmtGen.executeQuery();
if(rsGen.next())
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for Rejected NearExpire pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
}
}
}
}
//Changed by Jagruti Shinde,for considering QC rejected locations in Pallet request,Pallet request with stock details.Request id:[W16ASUN022][end]
else
{
sqlLock=" SELECT I.LOCK_CODE FROM INV_HOLD_DET D,INV_HOLD I ,STOCK S WHERE S.ITEM_CODE = D.ITEM_CODE " +
" AND S.LOC_CODE = D.LOC_CODE AND S.LOT_NO = D.LOT_NO AND S.LOT_SL = D.LOT_SL AND " +
" S.SITE_CODE = D.SITE_CODE AND I.TRAN_ID = D.TRAN_ID AND D.HOLD_STATUS != ? " +
" AND S.INV_STAT IN( ?,?) AND S.SITE_CODE= ? AND S.QUANTITY>0 AND " +
" S.LOC_CODE= ? ";
pstmt = conn.prepareStatement(sqlLock);
pstmt.setString(1, "R");
pstmt.setString(2, "AWMS");
pstmt.setString(3, "AWMSQ");
pstmt.setString(4, loginSite);
pstmt.setString(5, locCode);
rs = pstmt.executeQuery();
if(rs.next())
{
lockCode = checkNullAndTrim(rs.getString("LOCK_CODE"));
System.out.println( "LOCK CODE:::"+lockCode);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
for (int z = 0; z < locD.length; z++)
{
dispDamageLock = locD[z].trim();
......@@ -656,8 +797,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for damage pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -678,8 +827,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for hold pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -700,8 +857,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for Expire pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -721,8 +886,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for NearExpire pallet["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -776,8 +949,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
udfStr1 = checkNullAndTrim(rsGen.getString("UDF_STR1"));
}
if(pstmtGen != null){pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("UDF_STR1 from gencodes for QC pending Pallets["+udfStr1+"]");
locCodeSugg = udfStr1 ;
......@@ -786,8 +967,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
System.out.println("Finally ending code while loop QC Order");
break;
}
if(pstmt1 != null){ pstmt1.close();pstmt1 = null;}
if(rs1 != null){rs1.close();rs1 = null;}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
System.out.println("Loc Code suggest Found from QC Order="+locCodeSugg);
......@@ -803,8 +992,16 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
itemSerRg = checkNullAndTrim(rsGen.getString("ITEM_SER__RG1"));
System.out.println("itemSerRg FROM SITEITEM::"+itemSerRg);
}
if(pstmtGen != null){ pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
System.out.println("ITEM_SER__RG1["+itemSerRg+"]");
//sql1="SELECT FLD_VALUE FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? ";
......@@ -825,15 +1022,31 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
System.out.println("udf_str1 :"+udf_str1);
locCodeSugg = udfStr ;
}
if(pstmtGen != null){ pstmtGen.close();pstmtGen = null;}
if(rsGen != null){rsGen.close();rsGen = null;}
if(pstmtGen != null)
{
pstmtGen.close();
pstmtGen = null;
}
if(rsGen != null)
{
rsGen.close();
rsGen = null;
}
}
System.out.println("Finally ending code of while loop");
break;
}
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;
}
}
}
}
......@@ -872,9 +1085,21 @@ public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, Palle
{
try
{
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
if(conn != null){conn.close();conn = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
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