Commit d9177518 authored by manohar's avatar manohar

getdata returned xml instead of tab delimited string


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94534 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8a4d0a9a
...@@ -87,7 +87,14 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -87,7 +87,14 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
String resultString = ""; String resultString = "";
ResultSet rs1 = null,descrs = null; ResultSet rs1 = null,descrs = null;
PreparedStatement pstmt = null,descpstmt = null; PreparedStatement pstmt = null,descpstmt = null;
StringBuffer retTabSepStrBuff = new StringBuffer(); // 09/04/14 manoharan
//StringBuffer retTabSepStrBuff = new StringBuffer();
StringBuffer retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>");
retTabSepStrBuff.append("<description>").append("Datawindow Root").append("</description>");
retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>");
int cnt=0,count=0,i=7; int cnt=0,count=0,i=7;
String sql=""; String sql="";
String lockCodeFrom = "",lockCodeTo = "",tranIdFrom = "",tranIdTo="",refIdFrom="",refIdTo="",autoConfirmed="",schRelDateFromstr="",schRelDateTostr=""; String lockCodeFrom = "",lockCodeTo = "",tranIdFrom = "",tranIdTo="",refIdFrom="",refIdTo="",autoConfirmed="",schRelDateFromstr="",schRelDateTostr="";
...@@ -353,23 +360,34 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -353,23 +360,34 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
System.out.println("QUERY PROCESS FINISED......."); System.out.println("QUERY PROCESS FINISED.......");
while(rs1.next()) while(rs1.next())
{ {
// 09/04/14 manoharan return xml
retTabSepStrBuff.append("<Detail2>");
//tran_id //tran_id
retTabSepStrBuff.append((rs1.getString(1)==null?" ":rs1.getString(1))).append("\t"); //retTabSepStrBuff.append((rs1.getString(1)==null?" ":rs1.getString(1))).append("\t");
retTabSepStrBuff.append("<tran_id>").append("<![CDATA[" + (rs1.getString(1)==null?" ":rs1.getString(1)) +"]]>").append("</tran_id>");
//line_no //line_no
retTabSepStrBuff.append((rs1.getString(2)==null?" ":rs1.getString(2))).append("\t"); //retTabSepStrBuff.append((rs1.getString(2)==null?" ":rs1.getString(2))).append("\t");
retTabSepStrBuff.append("<line_no>").append("<![CDATA[" + (rs1.getString(2)==null?" ":rs1.getString(2)) +"]]>").append("</line_no>");
//line_no_sl //line_no_sl
retTabSepStrBuff.append((rs1.getString(3)==null?" ":rs1.getString(3))).append("\t"); //retTabSepStrBuff.append((rs1.getString(3)==null?" ":rs1.getString(3))).append("\t");
retTabSepStrBuff.append("<line_no_sl>").append("<![CDATA[" + (rs1.getString(3)==null?" ":rs1.getString(3)) +"]]>").append("</line_no_sl>");
//hold_status //hold_status
if(rs1.getString(4)!=null) if(rs1.getString(4)!=null)
{ {
retTabSepStrBuff.append((rs1.getString(4)==null?" ":rs1.getString(4))).append("\t"); //retTabSepStrBuff.append((rs1.getString(4)==null?" ":rs1.getString(4))).append("\t");
retTabSepStrBuff.append("<hold_status>").append("<![CDATA[" + (rs1.getString(4)==null?" ":rs1.getString(4)) +"]]>").append("</hold_status>");
} }
else else
{ {
retTabSepStrBuff.append("H").append("\t"); //retTabSepStrBuff.append("H").append("\t");
retTabSepStrBuff.append("<hold_status>").append("<![CDATA[H]]>").append("</hold_status>");
} }
//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");
retTabSepStrBuff.append("<item_code>").append("<![CDATA[" + (rs1.getString(5)==null?" ":rs1.getString(5)) +"]]>").append("</item_code>");
//ADDED BY RITESH ON 25/DEC/13 FOR SET ITEM DESCR. AND LOC CODE DESC. START //ADDED BY RITESH ON 25/DEC/13 FOR SET ITEM DESCR. AND LOC CODE DESC. START
sql= " select descr from item where item_code = ?"; sql= " select descr from item where item_code = ?";
...@@ -378,9 +396,11 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -378,9 +396,11 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
descrs = descpstmt.executeQuery(); descrs = descpstmt.executeQuery();
if(descrs.next()) if(descrs.next())
{ {
retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t"); //retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t");
retTabSepStrBuff.append("<item_descr>").append("<![CDATA[" + (descrs.getString(1)==null?" ":descrs.getString(1)) +"]]>").append("</item_descr>");
}else{ }else{
retTabSepStrBuff.append("").append("\t"); //retTabSepStrBuff.append("").append("\t");
retTabSepStrBuff.append("<item_descr>").append("<![CDATA[]]>").append("</item_descr>");
} }
descpstmt.close(); descpstmt.close();
...@@ -389,13 +409,17 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -389,13 +409,17 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
descrs = null; 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");
retTabSepStrBuff.append("<loc_code>").append("<![CDATA[" + (rs1.getString(6)==null?" ":rs1.getString(6)) +"]]>").append("</loc_code>");
//lot_no //lot_no
retTabSepStrBuff.append((rs1.getString(16)==null?" ":rs1.getString(16))).append("\t"); //added by ritesh on 25/12/13 //retTabSepStrBuff.append((rs1.getString(16)==null?" ":rs1.getString(16))).append("\t"); //added by ritesh on 25/12/13
retTabSepStrBuff.append("<lot_no>").append("<![CDATA[" + (rs1.getString(16)==null?" ":rs1.getString(16)) +"]]>").append("</lot_no>");
//lot_sl //lot_sl
retTabSepStrBuff.append((rs1.getString(17)==null?" ":rs1.getString(17))).append("\t"); //added by ritesh on 25/12/13 //retTabSepStrBuff.append((rs1.getString(17)==null?" ":rs1.getString(17))).append("\t"); //added by ritesh on 25/12/13
retTabSepStrBuff.append("<lot_sl>").append("<![CDATA[" + (rs1.getString(17)==null?" ":rs1.getString(17)) +"]]>").append("</lot_sl>");
//lock code //lock code
retTabSepStrBuff.append((rs1.getString(15)==null?" ":rs1.getString(15))).append("\t"); //retTabSepStrBuff.append((rs1.getString(15)==null?" ":rs1.getString(15))).append("\t");
retTabSepStrBuff.append("<lock_code>").append("<![CDATA[" + (rs1.getString(15)==null?" ":rs1.getString(15)) +"]]>").append("</lock_code>");
sql= " select descr from inv_lock where lock_code = ?"; sql= " select descr from inv_lock where lock_code = ?";
descpstmt = conn.prepareStatement(sql); descpstmt = conn.prepareStatement(sql);
...@@ -403,9 +427,11 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -403,9 +427,11 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
descrs = descpstmt.executeQuery(); descrs = descpstmt.executeQuery();
if(descrs.next()) if(descrs.next())
{ {
retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t"); //retTabSepStrBuff.append((descrs.getString(1)==null?" ":descrs.getString(1))).append("\t");
retTabSepStrBuff.append("<lock_descr>").append("<![CDATA[" + (descrs.getString(1)==null?" ":descrs.getString(1)) +"]]>").append("</lock_descr>");
}else{ }else{
retTabSepStrBuff.append("").append("\t"); //retTabSepStrBuff.append("").append("\t");
retTabSepStrBuff.append("<lock_descr>").append("<![CDATA[]]>").append("</lock_descr>");
} }
descpstmt.close(); descpstmt.close();
...@@ -415,40 +441,53 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -415,40 +441,53 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
//ADDED BY RITESH ON 25/DEC/13 FOR SET ITEM DESCR. AND LOCK CODE DESC. end //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");
retTabSepStrBuff.append("<site_code>").append("<![CDATA[" + (rs1.getString(7)==null?" ":rs1.getString(7)) +"]]>").append("</site_code>");
//status_date //status_date
if(rs1.getTimestamp(8)!=null) if(rs1.getTimestamp(8)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(8).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(8).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<status_date>").append("<![CDATA[" + (this.genericUtility.getValidDateString(rs1.getTimestamp(8).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())) +"]]>").append("</status_date>");
} }
else else
{ {
retTabSepStrBuff.append(" ").append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<status_date>").append("<![CDATA[]]>").append("</status_date>");
} }
//reas_code //reas_code
retTabSepStrBuff.append((rs1.getString(9)==null?" ":rs1.getString(9))).append("\t"); //retTabSepStrBuff.append((rs1.getString(9)==null?" ":rs1.getString(9))).append("\t");
retTabSepStrBuff.append("<reas_code>").append("<![CDATA[" + (rs1.getString(9)==null?" ":rs1.getString(9)) +"]]>").append("</reas_code>");
//sch_rel_date //sch_rel_date
if(rs1.getTimestamp(10)!=null) if(rs1.getTimestamp(10)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(10).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(10).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<sch_rel_date>").append("<![CDATA[" + (this.genericUtility.getValidDateString(rs1.getTimestamp(10).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())) +"]]>").append("</sch_rel_date>");
} }
else else
{ {
retTabSepStrBuff.append(" ").append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<sch_rel_date>").append("<![CDATA[]]>").append("</sch_rel_date>");
} }
//ref_ser //ref_ser
retTabSepStrBuff.append((rs1.getString(11)==null?" ":rs1.getString(11))).append("\t"); //retTabSepStrBuff.append((rs1.getString(11)==null?" ":rs1.getString(11))).append("\t");
retTabSepStrBuff.append("<ref_ser>").append("<![CDATA[" + (rs1.getString(11)==null?" ":rs1.getString(11)) +"]]>").append("</ref_ser>");
//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");
retTabSepStrBuff.append("<ref_id>").append("<![CDATA[" + (rs1.getString(12)==null?" ":rs1.getString(12)) +"]]>").append("</ref_id>");
//ref_no //ref_no
retTabSepStrBuff.append((rs1.getString(13)==null?" ":rs1.getString(13))).append("\t"); //added by ritesh on 27/05/13 //retTabSepStrBuff.append((rs1.getString(13)==null?" ":rs1.getString(13))).append("\t"); //added by ritesh on 27/05/13
retTabSepStrBuff.append("<ref_no>").append("<![CDATA[" + (rs1.getString(13)==null?" ":rs1.getString(13)) +"]]>").append("</ref_no>");
// confirmed // confirmed
retTabSepStrBuff.append((rs1.getString(14)==null?" ":rs1.getString(14))).append("\t"); //added by ritesh on 27/05/13 //retTabSepStrBuff.append((rs1.getString(14)==null?" ":rs1.getString(14))).append("\t"); //added by ritesh on 27/05/13
retTabSepStrBuff.append("<confirmed>").append("<![CDATA[" + (rs1.getString(14)==null?" ":rs1.getString(14)) +"]]>").append("</confirmed>");
//remarks //remarks
retTabSepStrBuff.append((rs1.getString(18)==null?" ":rs1.getString(18))).append("\t"); //added by ritesh on 27/05/13 //retTabSepStrBuff.append((rs1.getString(18)==null?" ":rs1.getString(18))).append("\t"); //added by ritesh on 27/05/13
retTabSepStrBuff.append("<remarks>").append("<![CDATA[" + (rs1.getString(18)==null?" ":rs1.getString(18)) +"]]>").append("</remarks>");
//retTabSepStrBuff.append("\n");
retTabSepStrBuff.append("</Detail2>");
retTabSepStrBuff.append("\n");
count++; count++;
System.out.println("#####Counter:["+count+"]"); System.out.println("#####Counter:["+count+"]");
}//END WHILE }//END WHILE
...@@ -456,6 +495,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -456,6 +495,10 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
pstmt.close(); pstmt.close();
rs1=null; rs1=null;
pstmt=null; pstmt=null;
retTabSepStrBuff.append("</Header0>");
retTabSepStrBuff.append("</group0>");
retTabSepStrBuff.append("</DocumentRoot>");
if (count == 0 ) if (count == 0 )
{ {
errString = itmDBAccessEJB.getErrorString("","VTNOREC1","","",conn); errString = itmDBAccessEJB.getErrorString("","VTNOREC1","","",conn);
......
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