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, ...@@ -75,7 +75,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
String lineNoSord = ""; String lineNoSord = "";
String expLev = ""; String expLev = "";
String saleOrderHdr = "",tranId="",keyFlag=""; String saleOrderHdr = "",tranId="",keyFlag="";
String batchId = "";
int ctr=0; int ctr=0;
int cnt = 0; int cnt = 0;
int cnt1 = 0; int cnt1 = 0;
...@@ -301,9 +301,37 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal, ...@@ -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; break;
case 2 : case 2 :
...@@ -786,6 +814,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal, ...@@ -786,6 +814,7 @@ public class StockDeAllocIC extends ValidatorEJB implements StockDeAllocICLocal,
System.out.println("@@@@@ siteCodeShip["+siteCodeShip+"]siteCodeShipDescr["+siteCodeShipDescr+"]"); System.out.println("@@@@@ siteCodeShip["+siteCodeShip+"]siteCodeShipDescr["+siteCodeShipDescr+"]");
valueXmlString.append("<site_ship_descr>").append("<![CDATA[" + siteCodeShipDescr + "]]>").append("</site_ship_descr>"); valueXmlString.append("<site_ship_descr>").append("<![CDATA[" + siteCodeShipDescr + "]]>").append("</site_ship_descr>");
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
break; break;
......
...@@ -37,6 +37,7 @@ import javax.ejb.Stateless; // added for ejb3 ...@@ -37,6 +37,7 @@ import javax.ejb.Stateless; // added for ejb3
//public class StockDeallocationPrcEJB extends ProcessEJB implements SessionBean //public class StockDeallocationPrcEJB extends ProcessEJB implements SessionBean
public class StockDeallocationPrc extends ProcessEJB implements StockDeallocationPrcLocal,StockDeallocationPrcRemote //SessionBean public class StockDeallocationPrc extends ProcessEJB implements StockDeallocationPrcLocal,StockDeallocationPrcRemote //SessionBean
{ {
String batchId = null;
String siteCode = null; String siteCode = null;
String custCodeFr = null; String custCodeFr = null;
String custCodeTo = null; String custCodeTo = null;
...@@ -118,7 +119,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -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 public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{ {
System.out.println(" change done by RK."); System.out.println(" change done by RK.");
String batchsql= "";
String errCode = "" ; String errCode = "" ;
String errString = ""; String errString = "";
String getDataSql= ""; String getDataSql= "";
...@@ -145,7 +146,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -145,7 +146,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
String waveFlagRet = ""; String waveFlagRet = "";
String wavesql = ""; String wavesql = "";
//Changed by sumit on 27/11/12 end //Changed by sumit on 27/11/12 end
int cnt1=0;
String sql1="",waveType=""; String sql1="",waveType="";
PreparedStatement pstmt2 = null; PreparedStatement pstmt2 = null;
ResultSet rs2 = null; ResultSet rs2 = null;
...@@ -311,6 +312,43 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -311,6 +312,43 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
//added by Kunal on 22/10/12 //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) if( saleOrderFr.trim().length()>0 && saleOrderTo.trim().length()>0)
{ {
...@@ -352,10 +390,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -352,10 +390,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
+"AND SORDITEM.QTY_ALLOC> 0 " +"AND SORDITEM.QTY_ALLOC> 0 "
+"AND SORDITEM.LINE_TYPE = 'I'" +"AND SORDITEM.LINE_TYPE = 'I'"
//Changed by sumit on 27/11/12 adding wave flag condition in case of both wave //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"; "ORDER BY SORDER.SALE_ORDER,SORDITEM.EXP_LEV,SORDITEM.ITEM_CODE__ORD";
pstmt = conn.prepareStatement(getDataSql); pstmt = conn.prepareStatement(getDataSql);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
pstmt.setString(2,saleOrderFr); pstmt.setString(2,saleOrderFr);
pstmt.setString(3,saleOrderTo); pstmt.setString(3,saleOrderTo);
...@@ -367,10 +406,21 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -367,10 +406,21 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
pstmt.setTimestamp(9,dateTo); pstmt.setTimestamp(9,dateTo);
pstmt.setString(10,itemCodeFr); pstmt.setString(10,itemCodeFr);
pstmt.setString(11,itemCodeTo); pstmt.setString(11,itemCodeTo);
//Changed by sumit on 27/11/12 adding parameter start //Changed by sumit on 27/11/12 adding parameter start
if( !"B".equalsIgnoreCase(waveFlagRet) || "Y".equalsIgnoreCase(waveFlagRet) || "N".equalsIgnoreCase(waveFlagRet) ) if( !"B".equalsIgnoreCase(waveFlagRet) || "Y".equalsIgnoreCase(waveFlagRet) || "N".equalsIgnoreCase(waveFlagRet) )
{ {
pstmt.setString(12,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 //Changed by sumit on 27/11/12 adding parameter end
st = conn.createStatement(); 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