Commit a46a281d authored by nsawalakhe's avatar nsawalakhe

Added new Win name changes for manual transaction.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102533 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 773cda69
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.scheduler.utility.interfaces.Schedule; import ibase.scheduler.utility.interfaces.Schedule;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean; import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.MasterApplyEJBLocal; import ibase.webitm.ejb.MasterApplyEJBLocal;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.sql.Connection;
import java.sql.*; import java.sql.PreparedStatement;
import java.io.*; import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.xml.rpc.ParameterMode; import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.w3c.dom.Document;
public class BatchLoadIdSpecificSch implements Schedule public class BatchLoadIdSpecificSch implements Schedule
...@@ -40,9 +33,10 @@ public class BatchLoadIdSpecificSch implements Schedule ...@@ -40,9 +33,10 @@ public class BatchLoadIdSpecificSch implements Schedule
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String batchId = null; String batchId = null;
int count=0;
ibase.utility.UserInfoBean userInfoBean = new ibase.utility.UserInfoBean( scheduleParamXML ); ibase.utility.UserInfoBean userInfoBean = new ibase.utility.UserInfoBean( scheduleParamXML );
String objName=""; String objName="";
String sql="",retString=""; String sql="",update_sql="",retString="";
HashMap<String, ArrayList<String>> batchIdHashMap=new HashMap<String, ArrayList<String>>(); HashMap<String, ArrayList<String>> batchIdHashMap=new HashMap<String, ArrayList<String>>();
ArrayList<String> tempBatchIdList=null; ArrayList<String> tempBatchIdList=null;
ArrayList<String> batchIdList=new ArrayList<String>(); ArrayList<String> batchIdList=new ArrayList<String>();
...@@ -126,8 +120,28 @@ public class BatchLoadIdSpecificSch implements Schedule ...@@ -126,8 +120,28 @@ public class BatchLoadIdSpecificSch implements Schedule
InitialContext ctx = new InitialContext ( appConnect.getProperty() ); InitialContext ctx = new InitialContext ( appConnect.getProperty() );
MasterApplyEJBLocal masterApplyLocal = ( MasterApplyEJBLocal ) ctx.lookup("ibase/MasterApplyEJB/local"); MasterApplyEJBLocal masterApplyLocal = ( MasterApplyEJBLocal ) ctx.lookup("ibase/MasterApplyEJB/local");
/*Added update sql to change the window name by Nikhil on dated 15/07/16*/
int upCnt= 0;
update_sql= " UPDATE BATCHLOAD SET WIN_NAME='w_dist_order_mid' WHERE WIN_NAME='w_dist_order' " +
" AND LOAD_STAT='N' AND TRAN_ID__REF IS NULL AND BATCH_ID LIKE '900%' ";
pstmt = conn.prepareStatement(update_sql);
upCnt = pstmt.executeUpdate();
if (upCnt != 0)
{
conn.commit();
System.out.println("Update Successfully");
}
pstmt.close();
pstmt = null;
/*Ended update sql to change the window name by Nikhil on dated 15/07/16*/
/*Change win_name w_dist_order_mid by Nikhil on dated 15-Jul-16*/
sql="SELECT BATCH_ID,WIN_NAME FROM BATCHLOAD WHERE LOAD_STAT='N' AND TRAN_ID__REF IS NULL" sql="SELECT BATCH_ID,WIN_NAME FROM BATCHLOAD WHERE LOAD_STAT='N' AND TRAN_ID__REF IS NULL"
+ " AND BATCH_ID LIKE '900%' AND WIN_NAME IN('w_dist_order','w_adj_rcp','w_dist_issue')"; + " AND BATCH_ID LIKE '900%' AND WIN_NAME IN('w_dist_order_mid','w_adj_rcp','w_dist_issue')";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
while(rs.next()) while(rs.next())
...@@ -137,7 +151,8 @@ public class BatchLoadIdSpecificSch implements Schedule ...@@ -137,7 +151,8 @@ public class BatchLoadIdSpecificSch implements Schedule
* Collect batch_id * Collect batch_id
* for Distribution order 'w_dist_order' * for Distribution order 'w_dist_order'
* */ * */
if(keyWinName.equalsIgnoreCase("w_dist_order")) /*Change win_name w_dist_order_mid by Nikhil on dated 15-Jul-16*/
if(keyWinName.equalsIgnoreCase("w_dist_order_mid"))
{ {
if(batchIdHashMap.get(keyWinName)==null) if(batchIdHashMap.get(keyWinName)==null)
{ {
...@@ -215,7 +230,10 @@ public class BatchLoadIdSpecificSch implements Schedule ...@@ -215,7 +230,10 @@ public class BatchLoadIdSpecificSch implements Schedule
* Get batch_id list * Get batch_id list
* according win_name 'w_dist_order' * according win_name 'w_dist_order'
* */ * */
batchIdList=batchIdHashMap.get("w_dist_order");
/*Change win_name w_dist_order_mid by Nikhil on dated 15-Jul-16*/
System.out.println("Dist_order map size :- ["+batchIdHashMap.size()+"]");
batchIdList=batchIdHashMap.get("w_dist_order_mid");
System.out.println("Dist_order batch id list size :- ["+batchIdList.size()+"]"); System.out.println("Dist_order batch id list size :- ["+batchIdList.size()+"]");
/** /**
* Get batch_id from * Get batch_id from
...@@ -347,7 +365,9 @@ public class BatchLoadIdSpecificSch implements Schedule ...@@ -347,7 +365,9 @@ public class BatchLoadIdSpecificSch implements Schedule
catch(Exception e) catch(Exception e)
{ {
conn.rollback();
System.out.println(">>>>>>>>>>>>>BatchLoadIdSpecificSch In catch:"); System.out.println(">>>>>>>>>>>>>BatchLoadIdSpecificSch In catch:");
e.printStackTrace();
System.out.println(e); System.out.println(e);
} }
finally finally
......
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