Commit 733f1837 authored by jshinde's avatar jshinde

Request ID:[W15JSUN017] Update PalletReqIC as requirement changes for BSR location inv_stat.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100190 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 55bbaade
......@@ -112,7 +112,9 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
double quantity=0,noArt=0,qtyPerArt,noArtQuot=0,noArtRem =0 , notArt = 0,palTcnt=0,quantityStock=0,noArtStock=0, noArtD=0,quantityStockQ=0;
int locCount = 0;
String quantityStr="",noArtStr="",tranId="",stkSql="",siteCode = "",userId = "",childNodeName = "",errString = "",
itemSql="",StatusSql="",status ="",itemRgSql="",locGroupDisp="",locSql="",locGroup="",itemSer="",itemSerRgDisparm="";
itemSql="",StatusSql="",status ="",itemRgSql="",locGroupDisp="",locSql="",locGroup="",itemSer="",itemSerRgDisparm=""
,locSuffixDisp , lastCharS="";
char lastChar ;
Document currFormDataDom = dom;
String loginSite = "",objName="",palletNoQ="";
ArrayList<String> palletList = new ArrayList();
......@@ -254,14 +256,10 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
//Change by Jagruti Shinde Request Id:[W15JSUN017] requirement change for Exempted/BSR location inv_stat[start]
locGroupDisp = checkNullAndTrim(discommon.getDisparams("999999", "EXTEMP_LOC_PARM", conn));
System.out.println("EXTEMP_LOC_PARM["+locGroupDisp+"]");
itemSerRgDisparm = checkNullAndTrim(discommon.getDisparams("999999", "ITEM_SER_RG1" , conn));
System.out.println("itemSerRgDisparm["+itemSerRgDisparm+"]");
String[] rg1 = itemSerRgDisparm.split(",");
System.out.println("Disparm Lenght for itemser="+rg1.length);
String[] locG = locGroupDisp.split(",");
System.out.println("Disparm Lenght for locgroup="+locG.length);
locSuffixDisp = checkNullAndTrim(discommon.getDisparams("999999", "AWMS_LOCATION_SUFFIX", conn));
System.out.println("AWMS_LOCATION_SUFFIX["+locSuffixDisp+"]");
String[] locS = locSuffixDisp.split(",");
System.out.println("Disparm Lenght for locSuffixDisp="+locS.length);
//Change by Jagruti Shinde Request Id:[W15JSUN017] requirement change for Exempted/BSR location inv_stat[End]
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
......@@ -332,91 +330,44 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
if(cntLoc > 0)
{
itemSql="SELECT ITEM_CODE,LOT_NO FROM STOCK WHERE LOC_CODE IN (?,?,?,?,?,?,?,?) AND QUANTITY>0";
pstmt = conn.prepareStatement(itemSql);
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");
rs = pstmt.executeQuery();
if(rs.next())
{
itemCode = rs.getString("ITEM_CODE");
lotNo = rs.getString("LOT_NO");
System.out.println( "item code:::"+itemCode);
System.out.println( "lotNo:::"+lotNo);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
StatusSql="SELECT STATUS FROM QC_ORDER WHERE ITEM_CODE=? AND SITE_CODE=? AND LOT_NO=? ";
pstmt = conn.prepareStatement(StatusSql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
pstmt.setString(3, lotNo);
rs = pstmt.executeQuery();
if(rs.next())
{
status = checkNullAndTrim(rs.getString("STATUS"));
System.out.println("Status["+status+"]");
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
stkSql = "SELECT COUNT(1) FROM STOCK WHERE INV_STAT IN(?,?) AND LOC_CODE IN (?,?,?,?,?,?,?,?) AND SITE_CODE=? AND QUANTITY>0";
if("".equalsIgnoreCase(status) ||"C".equalsIgnoreCase(status))
{
itemRgSql="SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE=?";
pstmt = conn.prepareStatement(itemRgSql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
pstmt = conn.prepareStatement(stkSql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, "AWMSQ");
pstmt.setString(3, palletNo);
pstmt.setString(4, palletNo+"Q");
pstmt.setString(5, palletNo+"B");
pstmt.setString(6, palletNo+"X");
pstmt.setString(7, palletNo+"M");
pstmt.setString(8, palletNo+"U");
pstmt.setString(9, palletNo+"P");
pstmt.setString(10,palletNo+"S");
pstmt.setString(11, loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSer = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
System.out.println( "itemSer:::"+itemSer);
palcnt = rs.getInt(1);
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
for (int y = 0; y < rg1.length; y++)
{
itemSerRgDisparm = rg1[y].trim();
System.out.println("item ser rg1 disparm=["+itemSerRgDisparm+"] and site item rg1["+itemSer+"]");
if (pstmt != null) { pstmt.close(); pstmt = null; }
if (rs != null) { rs.close(); rs = null; }
if(!itemSerRgDisparm.equalsIgnoreCase(itemSer))
{
locSql="SELECT L.LOC_GROUP FROM LOCATION L,STOCK S WHERE S.LOC_CODE =L.LOC_CODE AND S.QUANTITY>0 AND L.LOC_CODE IN(?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(locSql);
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");
rs = pstmt.executeQuery();
if(rs.next())
System.out.println("awms pallet quantity" +palcnt);
if(palcnt > 0)
{
locGroup = checkNullAndTrim(rs.getString("LOC_GROUP"));
System.out.println( "locGroup:::"+locGroup);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
for (int x = 0; x < locG.length; x++)
for (int z = 0; z < locS.length; z++)
{
locGroupDisp = locG[x].trim();
System.out.println("locGroup disparm=["+locGroupDisp+"] and locGroup["+locGroup+"]");
locSuffixDisp = locS[z].trim();
lastChar=palletNo.charAt(palletNo.trim().length()-1);
lastCharS = Character.toString(lastChar);
System.out.println("lastChar"+lastChar);
System.out.println("locSuffix disparm=["+locSuffixDisp+"] and lastChar["+lastChar+"]");
if(locGroupDisp.equalsIgnoreCase(locGroup))
if(locSuffixDisp.equalsIgnoreCase(lastCharS))
{
System.out.println("****Match found in disparm for"+locGroup);
System.out.println("exempted location found");
errCode = "VMPALLEEXT";//pallet
System.out.println("****Match found in disparm for"+lastChar);
System.out.println("location with suffix");
errCode = "VMPALLEEXT";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
......@@ -425,18 +376,8 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
}
else
{
System.out.println("****Match found in disparm for"+itemSer);
errCode = "VMPALLEEXT";//pallet
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}
}
else
{
System.out.println("quarentine location found" +cntLoc);
errCode = "VMPALLEEXT";//pallet
System.out.println("awms pallet count" +palcnt);
errCode = "VMPALLETQN";//pallet quantity should be more than zero
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
......@@ -450,38 +391,6 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
errFields.add( childNodeName.toLowerCase() );
break;
}
//Change by Jagruti Shinde Request Id:[W15JSUN017] requirement change for Exempted/BSR location inv_stat[End]
stkSql = "SELECT COUNT(1) FROM STOCK WHERE INV_STAT IN(?,?) AND LOC_CODE IN (?,?,?,?,?,?,?,?) AND SITE_CODE=? AND QUANTITY>0";
pstmt = conn.prepareStatement(stkSql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, "AWMSQ");
pstmt.setString(3, palletNo);
pstmt.setString(4, palletNo+"Q");
pstmt.setString(5, palletNo+"B");
pstmt.setString(6, palletNo+"X");
pstmt.setString(7, palletNo+"M");
pstmt.setString(8, palletNo+"U");
pstmt.setString(9, palletNo+"P");
pstmt.setString(10,palletNo+"S");
pstmt.setString(11, loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
palcnt = rs.getInt(1);
}
if (pstmt != null) { pstmt.close(); pstmt = null; }
if (rs != null) { rs.close(); rs = null; }
System.out.println("awms pallet quantity" +palcnt);
if(palcnt==0)
{
System.out.println("awms pallet count" +palcnt);
errCode = "VMPALLETQN";//pallet quantity should be more than zero
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
if ("pallet_req_stk".equalsIgnoreCase(objName))
{
......
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