Commit a38b8974 authored by rtiwari's avatar rtiwari

CHANGE GETDATA SQL


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94056 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8e4b153a
...@@ -85,8 +85,8 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -85,8 +85,8 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
String getDataSql= "" ; String getDataSql= "" ;
String resultString = ""; String resultString = "";
ResultSet rs1 = null; ResultSet rs1 = null,descrs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null,descpstmt = null;
StringBuffer retTabSepStrBuff = new StringBuffer(); StringBuffer retTabSepStrBuff = new StringBuffer();
int cnt=0,count=0,i=7; int cnt=0,count=0,i=7;
String sql=""; String sql="";
...@@ -310,7 +310,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -310,7 +310,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
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.ref_ser,ih.ref_id,ih.ref_no, ih.confirmed, ih.lock_code ,ihd.lot_no,ihd.lot_sl " +
" from inv_hold_det ihd,inv_hold ih where ( ihd.tran_id = ih.tran_id )" + " from inv_hold_det ihd,inv_hold ih where ( ihd.tran_id = ih.tran_id )" +
" 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' ";
...@@ -370,8 +370,46 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -370,8 +370,46 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
} }
//item_code //item_code
retTabSepStrBuff.append((rs1.getString(5)==null?" ":rs1.getString(5))).append("\t"); retTabSepStrBuff.append((rs1.getString(5)==null?" ":rs1.getString(5))).append("\t");
//ADDED BY RITESH ON 25/DEC/13 FOR SET ITEM DESCR. AND LOC CODE DESC. START
sql= " select descr from item where item_code = ?";
descpstmt = conn.prepareStatement(sql);
descpstmt.setString(1,rs1.getString(5));
descrs = descpstmt.executeQuery();
if(descrs.next())
{
retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t");
}else{
retTabSepStrBuff.append("").append("\t");
}
descpstmt.close();
descpstmt = null;
descrs.close();
descrs = null;
//loc_code //loc_code
retTabSepStrBuff.append((rs1.getString(6)==null?" ":rs1.getString(6))).append("\t"); retTabSepStrBuff.append((rs1.getString(6)==null?" ":rs1.getString(6))).append("\t");
//lock code
retTabSepStrBuff.append((rs1.getString(15)==null?" ":rs1.getString(15))).append("\t");
sql= " select descr from inv_lock where lock_code = ?";
descpstmt = conn.prepareStatement(sql);
descpstmt.setString(1,rs1.getString(15));
descrs = descpstmt.executeQuery();
if(descrs.next())
{
retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t");
}else{
retTabSepStrBuff.append("").append("\t");
}
descpstmt.close();
descpstmt = null;
descrs.close();
descrs = null;
//ADDED BY RITESH ON 25/DEC/13 FOR SET ITEM DESCR. AND LOCK CODE DESC. end
//site_code //site_code
retTabSepStrBuff.append((rs1.getString(7)==null?" ":rs1.getString(7))).append("\t"); retTabSepStrBuff.append((rs1.getString(7)==null?" ":rs1.getString(7))).append("\t");
//status_date //status_date
...@@ -399,10 +437,15 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -399,10 +437,15 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
//ref_id //ref_id
retTabSepStrBuff.append((rs1.getString(12)==null?" ":rs1.getString(12))).append("\t"); retTabSepStrBuff.append((rs1.getString(12)==null?" ":rs1.getString(12))).append("\t");
//ref_no //ref_no
retTabSepStrBuff.append((rs1.getString(13)==null?" ":rs1.getString(13))).append("\t"); //added by ritesh on 27/05/13 start retTabSepStrBuff.append((rs1.getString(13)==null?" ":rs1.getString(13))).append("\t"); //added by ritesh on 27/05/13
//lot_no
retTabSepStrBuff.append((rs1.getString(16)==null?" ":rs1.getString(16))).append("\t"); //added by ritesh on 25/12/13
//lot_sl
retTabSepStrBuff.append((rs1.getString(17)==null?" ":rs1.getString(17))).append("\t"); //added by ritesh on 25/12/13
// confirmed // confirmed
retTabSepStrBuff.append((rs1.getString(14)==null?" ":rs1.getString(14))).append("\t"); //added by ritesh on 27/05/13 start retTabSepStrBuff.append((rs1.getString(14)==null?" ":rs1.getString(14))).append("\t"); //added by ritesh on 27/05/13
//added by ritesh on 27/05/13
retTabSepStrBuff.append("\n"); retTabSepStrBuff.append("\n");
count++; count++;
System.out.println("#####Counter:["+count+"]"); System.out.println("#####Counter:["+count+"]");
......
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