Commit bb0fe41c authored by cpandey's avatar cpandey

Changes in sql condition for selecting data according to indent no


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92475 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ea9bce8e
......@@ -11,10 +11,26 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import javax.ejb.Stateless;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless;
@Stateless
public class BillofQuantityAct extends ActionHandlerEJB
......@@ -117,6 +133,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
String itemCode = ""; String itemSer = ""; String unit = ""; String sql = ""; String sql1 = ""; String unitStd = ""; String unitRate = ""; String convRateStduom = ""; String packCode = ""; String remarks = ""; String amount = ""; String siteCode = ""; String indentNo = "";
String packInstr = ""; String specInstr = ""; String splInstr = ""; String hremarks = ""; String currCode = ""; String exchRate = ""; String projCode = ""; String hstatus = ""; String amountBc = ""; String suppCodePref = ""; String hunit = ""; String hamount = ""; String splInstrh = ""; String hsplInstr = "";
String hRate = ""; String tranId = ""; String hItemCode = ""; String htranType = ""; String hindentNo = ""; String hunitStd = ""; String hpackCode = ""; String hpackInstr = ""; String netAmountBc = ""; String hunitRate = ""; String hspecInstr = "",hsitecode = "",hitemSer = "",ditemCode = "",dItemCode = "",confirm = "", errString = "" ;
String loginSite = "";
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
PreparedStatement pstmt = null; PreparedStatement pstmt1 = null;
......@@ -130,9 +147,12 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("loginSite---->>>["+loginSite+"]------>>>>>");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
itemCode = genericUtility.getColumnValue("item_code", dom);
System.out.println("item code = " + itemCode);
indentNo = genericUtility.getColumnValue("ind_no", dom);
System.out.println("item code = " + itemCode+"indent no -->>"+indentNo);
conn = connDriver.getConnectDB("DriverITM");
//changes for temp test
sql = "select confirmed from boqhdr where item_code = ?";
......@@ -174,12 +194,15 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
"(case when h.site_code is null then ' ' else h.site_code end) as hsitecode , " +
"(case when h.indent_no is null then ' ' else h.indent_no end) as hindentno , " +
"(case when d.rate__stduom is null then 0 else d.rate__stduom end) as rate__stduom," +
"(case when d.amount is null then 0 else d.amount end) as amount from boqdet d,boqhdr h where d.tran_id = h.tran_id and h.item_code = ? ";
"(case when d.amount is null then 0 else d.amount end) as amount from boqdet d,boqhdr h where d.tran_id = h.tran_id and h.indent_no = ? and h.site_code = ?";
System.out.println("Detail data sql [PorderActEJB] sql==>" + sql);
pstmt = conn.prepareStatement(sql);
//dItemCode
pstmt.setString(1, itemCode);
pstmt.setString(1,indentNo);
//changes by cpandey according to new changes on purchase order on 04/01/13
pstmt.setString(2,loginSite);
//end of changes
rs = pstmt.executeQuery();
while (rs.next())
{
......@@ -208,7 +231,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
System.out.println("hItemCode-->>["+hItemCode+"]");
siteCode = checkNull(rs.getString("hsitecode"));
System.out.println("siteCode-->>["+siteCode+"]");
indentNo = checkNull(rs.getString("hindentno"));
hindentNo = checkNull(rs.getString("hindentno"));
System.out.println("indentNo-->>["+indentNo+"]");
rateStduom = rs.getDouble("rate__stduom");
System.out.println("te Stduom --[" + rateStduom + "]>>");
......@@ -232,7 +255,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
valueXmlString.append("<unit__std>").append("<![CDATA[").append(unitStd).append("]]>").append("</unit__std>\r\n");
valueXmlString.append("<quantity__stduom>").append("<![CDATA[").append(quantityStduom).append("]]>").append("</quantity__stduom>\r\n");
valueXmlString.append("<rate__stduom>").append("<![CDATA[").append(rateStduom).append("]]>").append("</rate__stduom>\r\n");
valueXmlString.append("<ind_no>").append("<![CDATA[").append(indentNo).append("]]>").append("</ind_no>\r\n");
valueXmlString.append("<ind_no>").append("<![CDATA[").append(hindentNo).append("]]>").append("</ind_no>\r\n");
valueXmlString.append("<remarks>").append("<![CDATA[").append(remarks).append("]]>").append("</remarks>\r\n");
valueXmlString.append("</Detail>\r\n");
......@@ -272,12 +295,15 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
"(case when h.conv__rate_stduom is null then 0 else h.conv__rate_stduom end) as conv__rate_stduom," +
"(case when h.spec_instr is null then ' ' else h.spec_instr end) as spec_instr, " +
"(case when h.no_art is null then 0 else h.no_art end) as no_art," +
"(case when h.rate__stduom is null then 0 else h.rate__stduom end) as rate__stduom from boqhdr h,item itm where itm.item_code = h.item_code and h.item_code = ? ";
"(case when h.rate__stduom is null then 0 else h.rate__stduom end) as rate__stduom from boqhdr h,item itm where itm.item_code = h.item_code and h.indent_no = ? and h.site_code = ?";
System.out.println("[Header Data for PorderActEJB] sql==>" + sql);
pstmt1 = conn.prepareStatement(sql1);
//
pstmt1.setString(1,hItemCode);
pstmt1.setString(1,hindentNo);
//changes by cpandey according to new changes on purchase order on 04/01/13
pstmt1.setString(2,loginSite);
//end oc changes
rs = pstmt1.executeQuery();
while (rs.next())
{
......
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