Commit 03aaf086 authored by jshinde's avatar jshinde

Request ID:W15HSUN003,palletrequest with stocks details


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99220 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1fb5b892
...@@ -111,9 +111,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp ...@@ -111,9 +111,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp
xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>"); xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>");
xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>"); xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>");
xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>"); xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
xmlString.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>"); xmlString.append("<lot_sl isSrvCallOnChg='1'>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
xmlString.append("<quantity>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>"); xmlString.append("<quantity isSrvCallOnChg='1'>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>");
xmlString.append("<no_art>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>"); xmlString.append("<no_art isSrvCallOnChg='1'>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>");
xmlString.append("</Detail>"); xmlString.append("</Detail>");
} }
...@@ -179,9 +179,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp ...@@ -179,9 +179,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp
xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>"); xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>");
xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>"); xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>");
xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>"); xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
xmlString.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>"); xmlString.append("<lot_sl isSrvCallOnChg='1'>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
xmlString.append("<quantity>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>"); xmlString.append("<quantity isSrvCallOnChg='1'>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>");
xmlString.append("<no_art>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>"); xmlString.append("<no_art isSrvCallOnChg='1'>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>");
xmlString.append("</Detail>"); xmlString.append("</Detail>");
} }
...@@ -223,7 +223,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp ...@@ -223,7 +223,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp
try try
{ {
String siteCode = checkNullAndTrim(genericUtility.getColumnValue("site_code",dom1)); String siteCode = checkNullAndTrim(genericUtility.getColumnValue("site_code",dom1));
String sql = " SELECT DISTINCT (S.LOC_CODE) AS PALLET_NO,S.ITEM_CODE,S.LOT_NO,S.LOT_SL,S.QUANTITY,S.NO_ART FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND S.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 "; String sql = " SELECT DISTINCT (S.LOC_CODE) AS PALLET_NO,S.ITEM_CODE,S.LOT_NO,S.LOT_SL,S.QUANTITY," +
"S.NO_ART FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND S.SITE_CODE=? " +
"AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 ";
PreparedStatement pstmt = conn.prepareStatement(sql); PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS"); pstmt.setString(1, "AWMS");
...@@ -243,9 +245,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp ...@@ -243,9 +245,9 @@ public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExp
xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>"); xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>");
xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>"); xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>");
xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>"); xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
xmlString.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>"); xmlString.append("<lot_sl isSrvCallOnChg='1'>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
xmlString.append("<quantity>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>"); xmlString.append("<quantity isSrvCallOnChg='1'>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>");
xmlString.append("<no_art>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>"); xmlString.append("<no_art isSrvCallOnChg='1'>").append("<![CDATA[").append(noArt).append("]]>").append("</no_art>");
xmlString.append("</Detail>"); xmlString.append("</Detail>");
} }
......
...@@ -111,7 +111,7 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -111,7 +111,7 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
int locCount = 0; int locCount = 0;
String quantityStr="",noArtStr=""; String quantityStr="",noArtStr="";
ResultSet rs= null; ResultSet rs= null;
Document currFormDataDom = null; Document currFormDataDom = dom;
String loginSite = "",objName=""; String loginSite = "",objName="";
ArrayList<String> palletList = new ArrayList(); ArrayList<String> palletList = new ArrayList();
ArrayList ArrList = new ArrayList(); ArrayList ArrList = new ArrayList();
...@@ -486,7 +486,8 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -486,7 +486,8 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
else else
{ {
System.out.println("lot number else---" +itemCode); System.out.println("lot number else---" +itemCode);
String sql = "SELECT COUNT(1) FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=?"; //String sql = "SELECT COUNT(1) FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=?";
String sql = "SELECT COUNT(1) FROM STOCK S WHERE S.INV_STAT=? AND S.LOC_CODE=? AND S.SITE_CODE=? AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS"); pstmt.setString(1, "AWMS");
...@@ -534,7 +535,8 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -534,7 +535,8 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
else else
{ {
System.out.println("lot sl else---" +itemCode); System.out.println("lot sl else---" +itemCode);
String sql = "SELECT COUNT(1) FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=? AND S.LOT_SL=?"; //String sql = "SELECT COUNT(1) FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=? AND S.LOT_SL=?";
String sql = "SELECT COUNT(1) FROM STOCK S WHERE S.INV_STAT=? AND S.LOC_CODE=? AND S.SITE_CODE=? AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=? AND S.LOT_SL=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS"); pstmt.setString(1, "AWMS");
...@@ -994,6 +996,26 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -994,6 +996,26 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
valueXmlString.append( "<location_descr><![CDATA[" ).append( "" ).append( "]]></location_descr>\r\n" ); valueXmlString.append( "<location_descr><![CDATA[" ).append( "" ).append( "]]></location_descr>\r\n" );
} }
} }
else if( currentColumn.trim().equalsIgnoreCase( "lot_no" ) )
{
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",currFormDataDom));
System.out.println( "lotNo>>>>>>>::"+lotNo);
}
else if( currentColumn.trim().equalsIgnoreCase( "item_code" ) )
{
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code",currFormDataDom));
System.out.println( "itemCode>>>>>>>::"+itemCode);
}
else if( currentColumn.trim().equalsIgnoreCase( "pallet_no" ) )
{
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",currFormDataDom));
System.out.println( "palletNo>>>>>>>::"+palletNo);
}
else if( currentColumn.trim().equalsIgnoreCase( "lot_sl" ) ) else if( currentColumn.trim().equalsIgnoreCase( "lot_sl" ) )
{ {
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",currFormDataDom)); lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",currFormDataDom));
...@@ -1037,6 +1059,13 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -1037,6 +1059,13 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
System.out.println( "qtyPerArt>>>>>>>::"+qtyPerArt); System.out.println( "qtyPerArt>>>>>>>::"+qtyPerArt);
System.out.println( "quantity()>>>>>>>::"+quantity); System.out.println( "quantity()>>>>>>>::"+quantity);
System.out.println( "quantity sl::"+quantity);
System.out.println( "noArt sl::"+noArt);
System.out.println( "lotSl sl::"+lotSl);
System.out.println( "itemCode sl::"+itemCode);
System.out.println( "lotNo sl::"+lotNo);
System.out.println( "palletNo sl::"+palletNo);
valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\r\n" ); valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\r\n" );
valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" ); valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" );
} }
...@@ -1059,7 +1088,11 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -1059,7 +1088,11 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
quantityStr = checkNullAndTrim(genericUtility.getColumnValue("quantity",currFormDataDom)); quantityStr = checkNullAndTrim(genericUtility.getColumnValue("quantity",currFormDataDom));
quantityStr = quantityStr.length() == 0 ? "0" : quantityStr; quantityStr = quantityStr.length() == 0 ? "0" : quantityStr;
quantity = Double.parseDouble(quantityStr); quantity = Double.parseDouble(quantityStr);
System.out.println( "noArt>>>>>>>::"+noArt);
System.out.println( "noArtQuot>>>>>>>::"+noArtQuot);
System.out.println( "noArtRem>>>>>>>::"+noArtRem);
System.out.println( "qtyPerArt>>>>>>>::"+qtyPerArt);
System.out.println( "quantity()>>>>>>>::"+quantity);
String sql = "SELECT S.QTY_PER_ART FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=? AND S.LOT_SL=? "; String sql = "SELECT S.QTY_PER_ART FROM STOCK S ,LOCATION L WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND S.LOT_NO=? AND S.LOT_SL=? ";
...@@ -1096,6 +1129,15 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -1096,6 +1129,15 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
System.out.println( "quantity q::"+quantity);
System.out.println( "noArt q::"+noArt);
System.out.println( "lotSl q::"+lotSl);
System.out.println( "itemCode q::"+itemCode);
System.out.println( "lotNo q::"+lotNo);
System.out.println( "palletNo q::"+palletNo);
if(quantity <= 0) if(quantity <= 0)
{ {
...@@ -1119,46 +1161,58 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -1119,46 +1161,58 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
noArtStr = checkNullAndTrim(genericUtility.getColumnValue("no_art",currFormDataDom)); noArtStr = checkNullAndTrim(genericUtility.getColumnValue("no_art",currFormDataDom));
noArtStr = noArtStr.length() == 0 ? "0" : noArtStr; noArtStr = noArtStr.length() == 0 ? "0" : noArtStr;
noArtD = Double.parseDouble(noArtStr); noArtD = Double.parseDouble(noArtStr);
System.out.println( "lotSl>>>>>>>::"+lotSl);
System.out.println( "lotNo>>>>>>>::"+lotNo);
System.out.println( "itemCode()>>>>>>>::"+itemCode);
if(itemCode.length() >0 && lotSl.length() >0 && lotNo.length() >0)
String sql = "SELECT S.QTY_PER_ART FROM STOCK S ,LOCATION L" +
" WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND" +
" S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND " +
"S.LOT_NO=? AND S.LOT_SL=? ";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, palletNo);
pstmt.setString(3, loginSite);
pstmt.setString(4, itemCode);
pstmt.setString(5, lotNo);
pstmt.setString(6, lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{ {
qtyPerArt = rs.getDouble("QTY_PER_ART"); String sql = "SELECT S.QTY_PER_ART FROM STOCK S ,LOCATION L" +
" WHERE L.INV_STAT=? AND L.LOC_CODE=? AND L.SITE_CODE=? AND" +
" S.LOC_CODE=L.LOC_CODE AND S.QUANTITY>0 AND S.ITEM_CODE=? AND " +
"S.LOT_NO=? AND S.LOT_SL=? ";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, palletNo);
pstmt.setString(3, loginSite);
pstmt.setString(4, itemCode);
pstmt.setString(5, lotNo);
pstmt.setString(6, lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
qtyPerArt = rs.getDouble("QTY_PER_ART");
}
rs.close();
pstmt.close();
quantity = noArtD * qtyPerArt ;
} System.out.println( "noArtD>>>>>>>::"+noArtD);
rs.close(); System.out.println( "qtyPerArt>>>>>>>::"+qtyPerArt);
pstmt.close(); System.out.println( "quantity()>>>>>>>::"+quantity);
quantity = noArtD* qtyPerArt ; System.out.println( "quantity n::"+quantity);
System.out.println( "noArt n::"+noArtD);
System.out.println( "lotSl n::"+lotSl);
System.out.println( "itemCode n::"+quantity);
System.out.println( "lotNo n::"+lotNo);
System.out.println( "palletNo n::"+palletNo);
System.out.println( "noArtD>>>>>>>::"+noArtD);
System.out.println( "qtyPerArt>>>>>>>::"+qtyPerArt);
System.out.println( "quantity()>>>>>>>::"+quantity);
if(noArtD <= 0)
{ if(noArtD <= 0)
valueXmlString.append( "<quantity><![CDATA[" ).append( 0 ).append( "]]></quantity>\r\n" ); {
valueXmlString.append( "<lot_sl><![CDATA[" ).append( " " ).append( "]]></lot_sl>\r\n" ); valueXmlString.append( "<quantity><![CDATA[" ).append( 0 ).append( "]]></quantity>\r\n" );
valueXmlString.append( "<no_art><![CDATA[" ).append( 0 ).append( "]]></no_art>\r\n" ); //valueXmlString.append( "<lot_sl><![CDATA[" ).append( " " ).append( "]]></lot_sl>\r\n" );
} valueXmlString.append( "<no_art><![CDATA[" ).append( 0 ).append( "]]></no_art>\r\n" );
else }
{ else
valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\r\n" ); {
valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\r\n" );
}
} }
} }
......
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