Commit 1fa8c3e3 authored by mjadhav's avatar mjadhav

filter lock_type to get data


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95168 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bdc8563d
...@@ -86,7 +86,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -86,7 +86,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
String errCode = ""; String errCode = "";
String errString = ""; String errString = "";
String getDataSql= "" ; String getDataSql= "" ;
String lockType="";
String resultString = ""; String resultString = "";
ResultSet rs1 = null,descrs = null; ResultSet rs1 = null,descrs = null;
PreparedStatement pstmt = null,descpstmt = null; PreparedStatement pstmt = null,descpstmt = null;
...@@ -98,7 +98,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -98,7 +98,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
retTabSepStrBuff.append("<group0>"); retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>"); retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>"); retTabSepStrBuff.append("<Header0>");
int cnt=0,count=0,i=7; int cnt=0,count=0,i=8;
String sql=""; String sql="";
String lockCodeFrom = "",lockCodeTo = "",tranIdFrom = "",tranIdTo="",refIdFrom="",refIdTo="",autoConfirmed="",schRelDateFromstr="",schRelDateTostr=""; String lockCodeFrom = "",lockCodeTo = "",tranIdFrom = "",tranIdTo="",refIdFrom="",refIdTo="",autoConfirmed="",schRelDateFromstr="",schRelDateTostr="";
Timestamp schRelDateFrom=null,schRelDateTo=null; Timestamp schRelDateFrom=null,schRelDateTo=null;
...@@ -109,6 +109,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -109,6 +109,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
Connection conn= null; Connection conn= null;
try try
{ {
System.out.println("mahendra testing@@@@@@@@@!!!!");
System.out.println("windowName!!!!! "+windowName);
if(conn==null) if(conn==null)
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -159,7 +163,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -159,7 +163,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
System.out.println("lockCodeTo=>"+lockCodeTo); //added by Ritesh on 08/05/13 System.out.println("lockCodeTo=>"+lockCodeTo); //added by Ritesh on 08/05/13
System.out.println("lotNoFrom=>"+lotNoFrom); System.out.println("lotNoFrom=>"+lotNoFrom);
System.out.println("lotNoTo=>"+lotNoTo); System.out.println("lotNoTo=>"+lotNoTo);
/*if ( tranIdFrom == null || tranIdFrom.trim().length() == 0 ) /*if ( tranIdFrom == null || tranIdFrom.trim().length() == 0 )
{ {
...@@ -334,17 +338,46 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -334,17 +338,46 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
return errString; return errString;
}*/ }*/
/*
* changes done by mahendra on 29-05-2014
* [to get data by filtering lock_type]
* [value of lock_type is 0==warehouse lock,1==quality lock,2==Administrative lock,3==-System managed locks]
* [if menu is InvHoldRelGen then data filter with lock type 'warehouse lock'
* If menu is InvHoldRelGen For Quality then data filter with lock type 'quality lock'
* if menu is InvHoldRelGen For Administrative then data filter with lock type 'Administrative lock'
* */
if(windowName.equalsIgnoreCase("w_inv_hold_rel_gen"))
{
System.out.println("windowName 0"+windowName);
lockType="0";
}
if(windowName.equalsIgnoreCase("w_invholdrelgen_quality"))
{
System.out.println("windowName 1"+windowName);
lockType="1";
}
if(windowName.equalsIgnoreCase("w_invholdrelgen_adm"))
{
System.out.println("windowName 2"+windowName);
lockType="2";
}
System.out.println("windowName !!! "+windowName +"lockType !!!!"+lockType);
System.out.println("lockType :"+lockType);
System.out.println("refIdFrom["+refIdFrom+"]:::::::refIdTo["+refIdTo+"]"); System.out.println("refIdFrom["+refIdFrom+"]:::::::refIdTo["+refIdTo+"]");
//ih.lock_code ,ihd.lot_no,ihd.lot_sl,ihd.remarks ADDED BY RITESH //ih.lock_code ,ihd.lot_no,ihd.lot_sl,ihd.remarks ADDED BY RITESH
getDataSql= " select ihd.tran_id,ihd.line_no,ihd.line_no_sl," + getDataSql= " select ihd.tran_id,ihd.line_no,ihd.line_no_sl," +
" case when ihd.hold_status is null then 'H' else ihd.hold_status end as hold_status ," + " case when ihd.hold_status is null then 'H' else ihd.hold_status end as hold_status ," +
" ihd.item_code,ihd.loc_code,ihd.site_code,ihd.status_date,ihd.reas_code,ihd.sch_rel_date," + " ihd.item_code,ihd.loc_code,ihd.site_code,ihd.status_date,ihd.reas_code,ihd.sch_rel_date," +
" ih.ref_ser,ih.ref_id,ih.ref_no, ih.confirmed, ih.lock_code ,ihd.lot_no,ihd.lot_sl,ihd.remarks " + " ih.ref_ser,ih.ref_id,ih.ref_no, ih.confirmed, ih.lock_code ,ihd.lot_no,ihd.lot_sl,ihd.remarks " +
" from inv_hold_det ihd,inv_hold ih where ( ihd.tran_id = ih.tran_id )" + " from inv_hold_det ihd,inv_hold ih , inv_lock il where ( ihd.tran_id = ih.tran_id ) and (ih.lock_code=il.lock_code) " +
" and ( ihd.tran_id >= ? and ihd.tran_id <= ? ) and ( ih.lock_code >= ? and ih.lock_code <= ? )" + " and ( ihd.tran_id >= ? and ihd.tran_id <= ? ) and ( ih.lock_code >= ? and ih.lock_code <= ? )" +
" and ( ihd.sch_rel_date between ? and ? ) and ihd.hold_status <> 'R' " " and ( ihd.sch_rel_date between ? and ? ) and ihd.hold_status <> 'R' "
+" and ( ihd.lot_no >= '"+lotNoFrom+"' and ihd.lot_no <= '"+lotNoTo+"' ) and ih.confirmed='Y' " //Added by Manoj dtd 15/04/2014 to retrieve data based on entered lot No range +" and ( ihd.lot_no >= '"+lotNoFrom+"' and ihd.lot_no <= '"+lotNoTo+"' ) and ih.confirmed='Y' " //Added by Manoj dtd 15/04/2014 to retrieve data based on entered lot No range
+ " and nvl((select count(1) from inv_hold_rel_det r where r.tran_id__hold = ihd.tran_id and r.line_no__hold = ihd.line_no ),0) = 0 "; // 14/04/14 manoharan this condition added + " and nvl((select count(1) from inv_hold_rel_det r where r.tran_id__hold = ihd.tran_id and r.line_no__hold = ihd.line_no ),0) = 0 and il.lock_type=? "; // 14/04/14 manoharan this condition added
//and ( ihd.lock_code between ? and ? ) //and ( ihd.lock_code between ? and ? )
if(refIdFrom != null ) if(refIdFrom != null )
{ {
...@@ -356,6 +389,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -356,6 +389,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
getDataSql = getDataSql + " and ( ih.ref_id <= ? or ih.ref_id is null ) "; getDataSql = getDataSql + " and ( ih.ref_id <= ? or ih.ref_id is null ) ";
} }
System.out.println("Sql Fired :::::"+getDataSql.trim().length()); System.out.println("Sql Fired :::::"+getDataSql.trim().length());
if (getDataSql.trim().length()>0) if (getDataSql.trim().length()>0)
{ {
...@@ -367,6 +404,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -367,6 +404,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
pstmt.setString(4,lockCodeTo); //added by Ritesh on 08/05/13 pstmt.setString(4,lockCodeTo); //added by Ritesh on 08/05/13
pstmt.setTimestamp(5,schRelDateFrom); pstmt.setTimestamp(5,schRelDateFrom);
pstmt.setTimestamp(6,schRelDateTo); pstmt.setTimestamp(6,schRelDateTo);
pstmt.setString(7,lockType);
if(refIdFrom != null ) if(refIdFrom != null )
{ {
......
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