Commit 55c56c2e authored by vdhoble's avatar vdhoble

added changes for sale order to be fetched according to the batch id provided


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97161 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c8e2b306
......@@ -75,7 +75,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
String lineNoSord = "";
String expLev = "";
String saleOrderHdr = "",tranId="",keyFlag="";
String batchId = "";
int ctr=0;
int cnt = 0;
int cnt1 = 0;
......@@ -111,7 +111,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("tran_date"))
if(childNodeName.equalsIgnoreCase("tran_date"))
{
tranDate = genericUtility.getColumnValue("tran_date", dom);
if(tranDate == null || tranDate.trim().length() == 0)
......@@ -301,9 +301,37 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
}
}
}
if(childNodeName.equalsIgnoreCase("batch_id"))//added by vishakha on 23-JaN-2015 for D14JSUN006
{
batchId = genericUtility.getColumnValue("batch_id", dom);
System.out.println("batch_id----"+batchId);
if(batchId != null && batchId.trim().length() > 0 )
{
sql = "select count(*) from sord_alloc where batch_id = ? ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,batchId);
rs=pstmt.executeQuery();
if(rs.next()){
cnt1=rs.getInt(1);
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
System.out.println("Count value for BATCH ID -->"+cnt1);
if(cnt1 == 0){ errCode = "VMDBTCH";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
break;
case 2 :
......@@ -786,6 +814,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
System.out.println("@@@@@ siteCodeShip["+siteCodeShip+"]siteCodeShipDescr["+siteCodeShipDescr+"]");
valueXmlString.append("<site_ship_descr>").append("<![CDATA[" + siteCodeShipDescr + "]]>").append("</site_ship_descr>");
}
valueXmlString.append("</Detail1>");
break;
......
......@@ -37,6 +37,7 @@ import javax.ejb.Stateless; // added for ejb3
//public class StockDeallocationPrcEJB extends ProcessEJB implements SessionBean
public class StockDeallocationPrc extends ProcessEJB implements StockDeallocationPrcLocal,StockDeallocationPrcRemote //SessionBean
{
String batchId = null;
String siteCode = null;
String custCodeFr = null;
String custCodeTo = null;
......@@ -118,7 +119,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
System.out.println(" change done by RK.");
String batchsql= "";
String errCode = "" ;
String errString = "";
String getDataSql= "";
......@@ -145,7 +146,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
String waveFlagRet = "";
String wavesql = "";
//Changed by sumit on 27/11/12 end
int cnt1=0;
String sql1="",waveType="";
PreparedStatement pstmt2 = null;
ResultSet rs2 = null;
......@@ -310,8 +311,45 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
//Changed by sumit on 27/11/12 getting value of wave_flag end
//added by Kunal on 22/10/12
batchId = genericUtility.getColumnValue("batch_id",headerDom);
//changes by vishakha on 22-jan-2015 for D14JSUN006
if(batchId == null || batchId.trim().length() == 0)
{
batchsql = "";
}
else{
sql = "select count(*) from sordalloc where batch_id = ? ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,batchId);
rs=pstmt.executeQuery();
if(rs.next()){
cnt1=rs.getInt(1);
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
System.out.println("Count value for BATCH ID -->"+cnt1);
if(cnt1 == 0){
errString = itmDBAccessEJB.getErrorString("","VMDBTCH","","",conn);
return errString;
}
else
{
batchsql =" AND SORDALLOC.BATCH_ID = ? ";
}
}
System.out.println("Batch Id>>>>>"+batchId);
if( saleOrderFr.trim().length()>0 && saleOrderTo.trim().length()>0)
{
getDataSql = "SELECT SORDALLOC.SALE_ORDER,SORDDET.LINE_NO,SORDITEM.EXP_LEV ,"
......@@ -352,10 +390,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
+"AND SORDITEM.QTY_ALLOC> 0 "
+"AND SORDITEM.LINE_TYPE = 'I'"
//Changed by sumit on 27/11/12 adding wave flag condition in case of both wave
+wavesql+
+wavesql+batchsql+//changes by vishakha on 22-jan-2015 for D14JSUN006
"ORDER BY SORDER.SALE_ORDER,SORDITEM.EXP_LEV,SORDITEM.ITEM_CODE__ORD";
pstmt = conn.prepareStatement(getDataSql);
pstmt.setString(1,siteCode);
pstmt.setString(2,saleOrderFr);
pstmt.setString(3,saleOrderTo);
......@@ -367,10 +406,21 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
pstmt.setTimestamp(9,dateTo);
pstmt.setString(10,itemCodeFr);
pstmt.setString(11,itemCodeTo);
//Changed by sumit on 27/11/12 adding parameter start
if( !"B".equalsIgnoreCase(waveFlagRet) || "Y".equalsIgnoreCase(waveFlagRet) || "N".equalsIgnoreCase(waveFlagRet) )
{
pstmt.setString(12,waveFlagRet);
if(batchId != null ){
pstmt.setString(13,batchId);//changes by vishakha on 22-jan-2015 for D14JSUN006
}
}
else//changes by vishakha on 22-jan-2015 for D14JSUN006
{
if(batchId != null ){
pstmt.setString(12,batchId);
}
}
//Changed by sumit on 27/11/12 adding parameter end
st = conn.createStatement();
......
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