Commit f87928bb authored by mnair's avatar mnair

Updated changes in stocktransferAct and StockTransferEjb

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@185910 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0de4d01f
...@@ -90,7 +90,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe ...@@ -90,7 +90,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
int noOfChilds = 0; int noOfChilds = 0;
int noOfParent = 0; int noOfParent = 0;
double lc_Num = 0d,lc_Num2 = 0d,lc_old_qty = 0d,lc_stk_qty = 0d,shipperSize = 0; double lc_Num = 0d,lc_Num2 = 0d,lc_old_qty = 0d,lc_stk_qty = 0d,shipperSize = 0;
double qty = 0d;
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
...@@ -283,6 +284,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe ...@@ -283,6 +284,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
else if ( "quantity".equalsIgnoreCase( childNodeName ) ) else if ( "quantity".equalsIgnoreCase( childNodeName ) )
{ {
lc_Num = Double.parseDouble(genericUtility.getColumnValue( "quantity", currDom )); lc_Num = Double.parseDouble(genericUtility.getColumnValue( "quantity", currDom ));
System.out.println("Input quantity["+lc_Num+"]");
if (lc_Num <= 0) if (lc_Num <= 0)
{ {
errList.add( "VTQTY" ); errList.add( "VTQTY" );
...@@ -297,12 +300,48 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe ...@@ -297,12 +300,48 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
lpnNo = genericUtility.getColumnValue( "lot_sl__fr", currDom ); lpnNo = genericUtility.getColumnValue( "lot_sl__fr", currDom );
tranId = genericUtility.getColumnValue( "tran_id", currDom ); tranId = genericUtility.getColumnValue( "tran_id", currDom );
lineNo = genericUtility.getColumnValue( "line_no", currDom ); lineNo = genericUtility.getColumnValue( "line_no", currDom );
//Changes by mayur on 04-June-2018----start
refSer = genericUtility.getColumnValue( "ref_ser__for", hdrDom );
System.out.println("Reference series::::::::["+refSer+"]");
refId = genericUtility.getColumnValue("ref_id__for", hdrDom);
System.out.println("Reference id::::::::["+refId+"]");
if(tranId == null || tranId.trim().length() == 0) if(tranId == null || tranId.trim().length() == 0)
{ {
tranId = "@@@"; tranId = "@@@";
} }
if("S-REQ".equalsIgnoreCase(refSer))
{
sql = "SELECT sum(quantity) As qty from ser_req_item where req_id = ? AND item_code = ? ";
System.out.println("SQL ::"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
pstmt.setString(2,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
qty = rs.getDouble("qty");
System.out.println("Service order item quantity:["+qty+"]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lc_Num > qty)
{
System.out.println("If input quantity > service order quantity["+lc_Num+">"+qty+"]");
errList.add( "INVQTY1" );
errFields.add( childNodeName.toLowerCase() );
}
} //end of if
//Changes by mayur on 04-June-2018----end
else {
sql = "SELECT quantity FROM stock_transfer_det WHERE tran_id = ? AND line_no = ? "; sql = "SELECT quantity FROM stock_transfer_det WHERE tran_id = ? AND line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
...@@ -361,8 +400,10 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe ...@@ -361,8 +400,10 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
errList.add( "VTSTK02" ); errList.add( "VTSTK02" );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
}
} }
} }
else if ( "loc_code__fr".equalsIgnoreCase( childNodeName ) ) else if ( "loc_code__fr".equalsIgnoreCase( childNodeName ) )
{ {
......
...@@ -189,7 +189,7 @@ public class StockTransferAct extends ActionHandlerEJB implements ...@@ -189,7 +189,7 @@ public class StockTransferAct extends ActionHandlerEJB implements
System.out.println(":::SER_REQUEST TABLE DETAIL:::"); System.out.println(":::SER_REQUEST TABLE DETAIL:::");
System.out.println("siteCodeReq::["+siteCodeReq+"]"); System.out.println("siteCodeReq::["+siteCodeReq+"]");
System.out.println("locCodeTo::["+locCodeTo+"]"); System.out.println("locCodeTo as emp code::["+locCodeTo+"]");
System.out.println(":::SER_REQ_ITEM TABLE DETAIL:::"); System.out.println(":::SER_REQ_ITEM TABLE DETAIL:::");
System.out.println("lineNo ::["+lineNo+"]"); System.out.println("lineNo ::["+lineNo+"]");
...@@ -320,19 +320,22 @@ public class StockTransferAct extends ActionHandlerEJB implements ...@@ -320,19 +320,22 @@ public class StockTransferAct extends ActionHandlerEJB implements
// System.out.println("remainingQty :["+remainingQty+"]"); // System.out.println("remainingQty :["+remainingQty+"]");
String mapKey = itemCode + "~" + siteCodeReq + "~"+ locCodeTo + "~" + lotNum + "~" + lotSerial; String mapKey = itemCode + "~" + siteCodeReq + "~"+ locCodeTo + "~" + lotNum + "~" + lotSerial;
System.out.println("mapKey-->"+mapKey);
if (!hm.containsKey(mapKey)) if (!hm.containsKey(mapKey))
{ {
hm.put(mapKey, new Double(rs1.getDouble(10))); hm.put(mapKey, new Double(rs1.getDouble(10)));
} }
hmQty = Double.parseDouble((hm.get(mapKey)).toString()); hmQty = Double.parseDouble((hm.get(mapKey)).toString());
System.out.println("hmQty is ["+hmQty+"]");
if (remainingQty == 0) { if (remainingQty == 0) {
break; break;
} }
else if (hmQty >= remainingQty) { else if (hmQty >= remainingQty) {
System.out.println("Inside hmQty >= remainingQty");
inputQty = remainingQty; inputQty = remainingQty;
System.out.println("inputQty :["+inputQty+"]"); System.out.println("inputQty :["+inputQty+"]");
remainingQty = 0; remainingQty = 0;
...@@ -343,7 +346,7 @@ public class StockTransferAct extends ActionHandlerEJB implements ...@@ -343,7 +346,7 @@ public class StockTransferAct extends ActionHandlerEJB implements
} }
else if (hmQty < remainingQty) { else if (hmQty < remainingQty) {
System.out.println("Inside hmQty < remainingQty");
inputQty = hmQty; inputQty = hmQty;
System.out.println("inputQty :["+inputQty+"]"); System.out.println("inputQty :["+inputQty+"]");
......
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