Commit 53baa5b3 authored by rtiwari's avatar rtiwari

UPDATED


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94111 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1391d9e4
...@@ -72,15 +72,16 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -72,15 +72,16 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
String sql= "",worder="",locCodeTo="",batchQuantity=""; String sql= "",worder="",locCodeTo="",batchQuantity="";
String resultString = "",errCode=""; String resultString = "",errCode="";
String invstat="",invstat1="",tranIdInvAlloc=""; String invstat="",invstat1="",tranIdInvAlloc="";
int cnt=0; int cnt=0,lineno=1;
Connection conn = null; Connection conn = null;
ResultSet rs = null,rs1= null; ResultSet rs = null,rs1= null;
double issQty=0.0,allocQty=0,allocatedQty=0.0,integralQty=0.0; double issQty=0.0,allocQty=0,allocatedQty=0.0,integralQty=0.0,potencyadj=0.0;
PreparedStatement pstmt = null,pstmt1=null; PreparedStatement pstmt = null,pstmt1=null;
double quantity=0.0; double quantity=0.0;
StringBuffer retTabSepStrBuff = new StringBuffer(); StringBuffer retTabSepStrBuff = new StringBuffer();
MfgCommon mfgComm = new MfgCommon(); MfgCommon mfgComm = new MfgCommon();
DecimalFormat df = new DecimalFormat("0.000"); DecimalFormat df = new DecimalFormat("0.000");
String siteCode="",remarks="",reasCode="",explev="";
retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>"); retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>"); retTabSepStrBuff.append("<DocumentRoot>");
...@@ -205,8 +206,12 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -205,8 +206,12 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
invstat1 = mfgComm.getEnvMfg("999999","MAIN_ST_INVSTAT", conn); invstat1 = mfgComm.getEnvMfg("999999","MAIN_ST_INVSTAT", conn);
System.out.println("::: XML Cretation::::"); System.out.println("::: XML Cretation::::");
sql = "select tran_id,line_no,item_code,site_code,lot_no,lot_sl,remarks,loc_code,reas_code,quantity,exp_lev,potency_adj from inv_alloc_det where tran_id = ? " + // sql = "select tran_id,line_no,item_code,site_code,lot_no,lot_sl,remarks,loc_code,reas_code,quantity,exp_lev,potency_adj from inv_alloc_det where tran_id = ? " +
" and loc_code in(select loc_code from location where inv_stat = ?) "; // " and loc_code in(select loc_code from location where inv_stat = ?) ";
sql = " select tran_id,item_code,lot_no,lot_sl,loc_code,sum(quantity) as quantity "
+" from inv_alloc_det GROUP BY tran_id, item_code, lot_no, lot_sl, loc_code having tran_id = ? "
+" and loc_code in(select loc_code from location where inv_stat = ? ) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdInvAlloc); pstmt.setString(1,tranIdInvAlloc);
pstmt.setString(2,invstat1); pstmt.setString(2,invstat1);
...@@ -234,6 +239,32 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -234,6 +239,32 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt1 != null) if(pstmt1 != null)
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
sql = " select site_code,remarks,reas_code,potency_adj,line_no,exp_lev " +
" from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("tran_id"));
pstmt1.setString(2, rs.getString("item_code"));
pstmt1.setString(3, rs.getString("lot_no"));
pstmt1.setString(4, rs.getString("lot_sl"));
pstmt1.setString(5, rs.getString("loc_code"));
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
siteCode = rs1.getString("site_code");
remarks = rs1.getString("remarks");
reasCode = rs1.getString("reas_code");
potencyadj = rs1.getDouble("potency_adj");
lineno = rs1.getInt("line_no");
explev = rs1.getString("exp_lev");
}
if(rs1 != null)
rs1.close();
rs1 = null;
if(pstmt1 != null)
pstmt1.close();
pstmt1 = null;
if(quantity > 0) if(quantity > 0)
{ {
//allocQty = ((issQty-allocatedQty)/quantity) * Double.parseDouble(batchQuantity); //allocQty = ((issQty-allocatedQty)/quantity) * Double.parseDouble(batchQuantity);
...@@ -247,9 +278,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -247,9 +278,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
retTabSepStrBuff.append("<tran_id>").append("<![CDATA[" + rs.getString("tran_id") +"]]>").append("</tran_id>"); retTabSepStrBuff.append("<tran_id>").append("<![CDATA[" + rs.getString("tran_id") +"]]>").append("</tran_id>");
retTabSepStrBuff.append("<line_no>").append("<![CDATA[" + rs.getInt("line_no") +"]]>").append("</line_no>"); retTabSepStrBuff.append("<line_no>").append("<![CDATA[" + lineno +"]]>").append("</line_no>");
retTabSepStrBuff.append("<site_code>").append("<![CDATA[" + rs.getString("site_code") +"]]>").append("</site_code>"); retTabSepStrBuff.append("<site_code>").append("<![CDATA[" + siteCode +"]]>").append("</site_code>");
retTabSepStrBuff.append("<item_code>").append("<![CDATA[" + rs.getString("item_code") +"]]>").append("</item_code>"); retTabSepStrBuff.append("<item_code>").append("<![CDATA[" + rs.getString("item_code") +"]]>").append("</item_code>");
...@@ -293,15 +324,15 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -293,15 +324,15 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
} }
retTabSepStrBuff.append("<allocated_qty>").append("<![CDATA[" + df.format(allocatedQty) +"]]>").append("</allocated_qty>"); retTabSepStrBuff.append("<allocated_qty>").append("<![CDATA[" + df.format(allocatedQty) +"]]>").append("</allocated_qty>");
retTabSepStrBuff.append("<remarks>").append("<![CDATA[" + rs.getString("remarks") +"]]>").append("</remarks>"); retTabSepStrBuff.append("<remarks>").append("<![CDATA[" + remarks +"]]>").append("</remarks>");
retTabSepStrBuff.append("<reas_code>").append("<![CDATA[" + checkNull(rs.getString("reas_code")) +"]]>").append("</reas_code>"); retTabSepStrBuff.append("<reas_code>").append("<![CDATA[" + checkNull(reasCode) +"]]>").append("</reas_code>");
retTabSepStrBuff.append("<loc_code>").append("<![CDATA[" + rs.getString("loc_code") +"]]>").append("</loc_code>"); retTabSepStrBuff.append("<loc_code>").append("<![CDATA[" + rs.getString("loc_code") +"]]>").append("</loc_code>");
retTabSepStrBuff.append("<exp_lev>").append("<![CDATA[" + rs.getString("exp_lev") +"]]>").append("</exp_lev>"); retTabSepStrBuff.append("<exp_lev>").append("<![CDATA[" + explev +"]]>").append("</exp_lev>");
retTabSepStrBuff.append("<potency_adj>").append("<![CDATA[" + rs.getDouble("potency_adj") +"]]>").append("</potency_adj>"); retTabSepStrBuff.append("<potency_adj>").append("<![CDATA[" + potencyadj +"]]>").append("</potency_adj>");
retTabSepStrBuff.append("<loc_code__to>").append("<![CDATA[" +locCodeTo +"]]>").append("</loc_code__to>"); retTabSepStrBuff.append("<loc_code__to>").append("<![CDATA[" +locCodeTo +"]]>").append("</loc_code__to>");
......
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