Commit 438e9e14 authored by mjadhav's avatar mjadhav

add hold_qty,invoice_no field in getData


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95759 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e032c1ea
...@@ -89,7 +89,9 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -89,7 +89,9 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
String lockType=""; String lockType="";
String resultString = ""; String resultString = "";
ResultSet rs1 = null,descrs = null; ResultSet rs1 = null,descrs = null;
PreparedStatement pstmt = null,descpstmt = null; ResultSet rs2 = null;
ResultSet rs3 = null;
PreparedStatement pstmt = null,descpstmt = null,pstmt1 = null, pstmt2 = null;
// 09/04/14 manoharan // 09/04/14 manoharan
//StringBuffer retTabSepStrBuff = new StringBuffer(); //StringBuffer retTabSepStrBuff = new StringBuffer();
StringBuffer retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>"); StringBuffer retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
...@@ -102,7 +104,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -102,7 +104,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
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;
String lotNoFrom="",lotNoTo=""; String lotNoFrom="",lotNoTo="",invoiceNo="",holdQuantity="";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
...@@ -378,6 +380,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -378,6 +380,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
" 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 and il.lock_type=? "; // 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 )
{ {
...@@ -426,6 +429,67 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -426,6 +429,67 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
// 09/04/14 manoharan return xml // 09/04/14 manoharan return xml
retTabSepStrBuff.append("<Detail2>"); retTabSepStrBuff.append("<Detail2>");
System.out.println("ref_id !!!!!"+rs1.getString("ref_id"));
System.out.println("site_code !!!!!"+rs1.getString("site_code"));
/*----------------changes done by mahendra dated 01/AUG/2014----------------------*/
System.out.println("ref id ::: "+rs1.getString("ref_id"));
System.out.println("Tran id ::: "+rs1.getString("ref_ser"));
System.out.println("site code ::: "+rs1.getString("site_code"));
if(rs1.getString("ref_id") != null)
{
sql = "select INVOICE_NO from porcp where tran_id=? and 'P-RCP'=? and site_code=?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,rs1.getString("ref_id"));
pstmt1.setString(2,rs1.getString("ref_ser"));
pstmt1.setString(3,rs1.getString("site_code"));
rs2 = pstmt1.executeQuery();
if (rs2.next())
{
invoiceNo = rs2.getString(1);
}
pstmt1.close();
rs2.close();
pstmt1 = null;
rs2 = null;
}
else
{
invoiceNo="";
}
System.out.println("invoiceNo "+invoiceNo);
System.out.println("item_code "+rs1.getString("item_code"));
System.out.println("loc_code "+rs1.getString("loc_code"));
System.out.println("lot_no "+rs1.getString("lot_no"));
sql = "select hold_qty from stock where item_code=? and loc_code=? and lot_no=? and lot_sl=? and site_code=? ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1,rs1.getString("item_code"));
pstmt2.setString(2,rs1.getString("loc_code"));
pstmt2.setString(3,rs1.getString("lot_no"));
pstmt2.setString(4,rs1.getString("lot_sl"));
pstmt2.setString(5,rs1.getString("site_code"));
rs3 = pstmt2.executeQuery();
if (rs3.next())
{
holdQuantity = rs3.getString(1);
System.out.println("holdQuantity : "+holdQuantity);
}
pstmt2.close();
rs3.close();
pstmt2 = null;
rs3 = null;
/*-------------------------------------------------------------------------------*/
//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");
...@@ -553,11 +617,13 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv ...@@ -553,11 +617,13 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
// 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>"); //remove confirmed column .changed by mahendra dated 01-AUG-2014
//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("<remarks>").append("<![CDATA[" + (rs1.getString(18)==null?" ":rs1.getString(18)) +"]]>").append("</remarks>");
retTabSepStrBuff.append("<invoice_no>").append("<![CDATA[" + (invoiceNo==null?" ":invoiceNo) +"]]>").append("</invoice_no>");
retTabSepStrBuff.append("<hold_quantity>").append("<![CDATA[" + (holdQuantity==null?" ":holdQuantity) +"]]>").append("</hold_quantity>");
//retTabSepStrBuff.append("\n"); //retTabSepStrBuff.append("\n");
retTabSepStrBuff.append("</Detail2>"); retTabSepStrBuff.append("</Detail2>");
...@@ -699,7 +765,7 @@ public String process(String xmlString, String xmlString2, String windowName, St ...@@ -699,7 +765,7 @@ public String process(String xmlString, String xmlString2, String windowName, St
java.sql.Timestamp chgDate = null,currDate = null; java.sql.Timestamp chgDate = null,currDate = null;
Date date = null; Date date = null;
String chgTerm = "",autoConfirmed=""; String chgTerm = "",autoConfirmed="";
String userId = "",siteCode="",confirmed="",empCode="",tranIdGenerate="",lineNo="",remark="",tranIdRel="",lineNoRel=""; String userId = "",siteCode="",confirmed="",empCode="",tranIdGenerate="",lineNo="",remark="",tranIdRel="",lineNoRel="",remarks="";
Document dom = null,headerDom=null,detailDom=null; Document dom = null,headerDom=null,detailDom=null;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
...@@ -728,6 +794,8 @@ public String process(String xmlString, String xmlString2, String windowName, St ...@@ -728,6 +794,8 @@ public String process(String xmlString, String xmlString2, String windowName, St
tranId = genericUtility.getColumnValue("tran_id",detailDom); tranId = genericUtility.getColumnValue("tran_id",detailDom);
autoConfirmed = genericUtility.getColumnValue("auto_confirmed",headerDom); autoConfirmed = genericUtility.getColumnValue("auto_confirmed",headerDom);
remarks = genericUtility.getColumnValue("remarks",headerDom);
System.out.println("remarks :::"+remarks);
if(autoConfirmed == null || autoConfirmed.trim().length() == 0 ) if(autoConfirmed == null || autoConfirmed.trim().length() == 0 )
{ {
autoConfirmed = "Y"; autoConfirmed = "Y";
...@@ -758,7 +826,7 @@ public String process(String xmlString, String xmlString2, String windowName, St ...@@ -758,7 +826,7 @@ public String process(String xmlString, String xmlString2, String windowName, St
pRelHdr.setString( 1, tranIdGenerate ); pRelHdr.setString( 1, tranIdGenerate );
pRelHdr.setTimestamp( 2, currDate ); pRelHdr.setTimestamp( 2, currDate );
pRelHdr.setString( 3, siteCode ); pRelHdr.setString( 3, siteCode );
pRelHdr.setString( 4, " " ); pRelHdr.setString( 4, remarks);
pRelHdr.setString( 5, confirmed ); pRelHdr.setString( 5, confirmed );
pRelHdr.setString( 6, empCode ); pRelHdr.setString( 6, empCode );
pRelHdr.setString( 7, userId ); pRelHdr.setString( 7, userId );
......
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