Commit 449d9c45 authored by prane's avatar prane

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188536 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9fba210f

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>webitm-dis</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ibase</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>webitm</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
[Dolphin]
HeaderColumnWidths=289,74,146
SortRole=date
Sorting=2
Timestamp=2018,7,12,14,50,45
Version=3
ViewMode=1
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dis</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
/*
Developed by : HATIM LAXMIDHAR
Discription : Post Save for the Adjustment Issue.
Date : 01/01/2006
*/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.lang.String;
import java.sql.*;
import javax.ejb.*;
import java.util.HashMap;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.system.config.*;
//public class AdjIssPosEJB extends ValidatorEJB implements SessionBean // commented for ejb3
import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
public class AdjIssPos extends ValidatorEJB implements AdjIssPosLocal, AdjIssPosRemote //added for ejb3
{
/* commented for ejb3
public void ejbCreate() throws RemoteException, CreateException
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}*/
public String postSaveRec()throws RemoteException,ITMException
{
return "";
}
public String postSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
Document dom = null;
System.out.println("AdjIssPosEJB called");
try
{
E12GenericUtility genericUtility= new E12GenericUtility();
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString1);
//dom = GenericUtility.getInstance().parseString(xmlString1);
executepostSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
System.out.println("Exception :AdjIssPosEJB ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return "";
}
private String executepostSaveRec(Document dom, String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
HashMap hashMap = new HashMap();
String lineNo = ""; //kfld2
String tranSer = "ADJISS";
String line = "";
String siteCode = "", itemCode = "", quantity = "", locCode = "", lotNo = "", lotSl = "";
DistStkUpd distStkUpd = null; // for ejb3
NodeList hdrDom = null;
Node currDetail = null;
String updateStatus = "",tranId = "";
try
{
E12GenericUtility genericUtility= new E12GenericUtility();
hdrDom = dom.getElementsByTagName("Detail1");
/*siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));*/
siteCode = genericUtility.getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = genericUtility.getColumnValueFromNode("tran_id",hdrDom.item(0));
System.out.println("tran_id (kfld1) : " + tranId);
currDetail = getCurrentDetailFromDom(dom,domID);
updateStatus = getCurrentUpdateFlag(currDetail);
if (currDetail != null && !updateStatus.equalsIgnoreCase("D"))
{
/* itemCode = GenericUtility.getInstance().getColumnValueFromNode("item_code",currDetail);
locCode = GenericUtility.getInstance().getColumnValueFromNode("loc_code",currDetail);
lotNo = GenericUtility.getInstance().getColumnValueFromNode("lot_no",currDetail);
lotSl = GenericUtility.getInstance().getColumnValueFromNode("lot_sl",currDetail);
quantity = GenericUtility.getInstance().getColumnValueFromNode("quantity",currDetail);
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no",currDetail);*/
itemCode = genericUtility.getColumnValueFromNode("item_code",currDetail);
locCode = genericUtility.getColumnValueFromNode("loc_code",currDetail);
lotNo = genericUtility.getColumnValueFromNode("lot_no",currDetail);
lotSl = genericUtility.getColumnValueFromNode("lot_sl",currDetail);
quantity = genericUtility.getColumnValueFromNode("quantity",currDetail);
lineNo = genericUtility.getColumnValueFromNode("line_no",currDetail);
System.out.println("lineNo: "+lineNo);
line = " "+lineNo.trim();
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser",tranSer);
hashMap.put("ref_id", tranId);
hashMap.put("ref_line", line.substring(line.length()-4));
hashMap.put("item_code", itemCode);
hashMap.put("site_code", siteCode);
hashMap.put("loc_code",locCode);
hashMap.put("lot_no",lotNo);
hashMap.put("lot_sl",lotSl);
hashMap.put("alloc_qty", new Double(quantity.trim().length() == 0?"0":quantity));
hashMap.put("chg_win","W_ADJ_ISS");
/*hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));*/
hashMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
//Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB.....");
distStkUpd = new DistStkUpd();
if (distStkUpd.updAllocTrace(hashMap, conn) > 0)
{
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
//TO BE ASKED!!!
}
distStkUpd = null;
}
}
/*catch(SQLException e)
{
System.out.println("Exception : AdjIssPosEJB : actionStock " +e.getMessage());
throw new ITMException(e);
}*/
catch(Exception e)
{
System.out.println("Exception : AdjIssPosEJB : actionHandler :" +e.getMessage());
throw new ITMException(e);
}
return "";
}
private Node getCurrentDetailFromDom(Document dom,String domId)
{
NodeList detailList = null;
Node currDetail = null,reqDetail = null;
String currDomId = "";
int detailListLength = 0;
detailList = dom.getElementsByTagName("Detail2");
detailListLength = detailList.getLength();
for (int ctr = 0;ctr < detailListLength;ctr++)
{
currDetail = detailList.item(ctr);
currDomId = currDetail.getAttributes().getNamedItem("domID").getNodeValue();
if (currDomId.equals(domId))
{
reqDetail = currDetail;
break;
}
}
return reqDetail;
}
private String getCurrentUpdateFlag(Node currDetail)
{
NodeList currDetailList = null;
String updateStatus = "",nodeName = "";
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
currDetailListLength = currDetailList.getLength();
for (int i=0;i< currDetailListLength;i++)
{
nodeName = currDetailList.item(i).getNodeName();
if (nodeName.equalsIgnoreCase("Attribute"))
{
updateStatus = currDetailList.item(i).getAttributes().getNamedItem("updateFlag").getNodeValue();
break;
}
}
return updateStatus;
}
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.Connection;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorLocal;
import javax.ejb.Local; // added for ejb3
//public interface AdjIssPos extends ValidatorLocal, EJBObject
@Local // added for ejb3
public interface AdjIssPosLocal extends ValidatorLocal
{
public String postSaveRec()throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.Connection;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorRemote;
import javax.ejb.Remote;// added for ejb3
//public interface AdjIssPos extends ValidatorRemote, EJBObject //commented for ejb3
@Remote // added for ejb3
public interface AdjIssPosRemote extends ValidatorRemote
{
public String postSaveRec()throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
/*
Developed by : HATIM LAXMIDHAR
Discription : Pre Save for the Adjustment Issue.
Date : 01/01/2006
*/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.lang.String;
import java.sql.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import java.util.HashMap;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.system.config.*;
import javax.ejb.Stateless; // added for ejb3
//public class AdjIssPrs extends ValidatorEJB implements AdjIssPrsRemote, AdjIssPrsLocal // commentd for ejb3
@Stateless // added for ejb3
public class AdjIssPrs extends ValidatorEJB implements AdjIssPrsRemote, AdjIssPrsLocal // added for ejb3
{
/* comments for ejb3
public void ejbCreate() throws RemoteException, CreateException
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}*/
public String preSaveRec() throws RemoteException,ITMException
{
return "";
}
public String preSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
System.out.println("AdjIssPrsEJB called");
Document dom = null;
try
{
E12GenericUtility genericUtility= new E12GenericUtility();
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString1);
//dom = GenericUtility.getInstance().parseString(xmlString1);
executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
System.out.println("Exception :AdjIssPrsEJB :preSaveRec() :" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return "";
}
private String executepreSaveRec(Document dom, String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
HashMap hashMap = new HashMap();
String errCode = "", errString = "";
String lineNo = ""; //kfld2
String tranSer = "ADJISS";
String line = "";
String siteCode = "", itemCode = "", quantity = "", locCode = "", lotNo = "", lotSl = "";
double allocQty = 0d;
int cnt = 0;
DistStkUpd distStkUpd = null; // for ejb3
String updateStatus = "",tranId = "";
NodeList hdrDom = null;
Node currDetail = null;
Statement stmt = null; // Added by Jiten 19/05/06
ResultSet rs = null; // Added by Jiten 19/05/06
String sql = ""; // Added by Jiten 19/05/06
try
{
stmt = conn.createStatement(); // Added by Jiten 19/05/06
E12GenericUtility genericUtility= new E12GenericUtility();
hdrDom = dom.getElementsByTagName("Detail1");
/*siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));*/
siteCode = genericUtility.getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = genericUtility.getColumnValueFromNode("tran_id",hdrDom.item(0));
System.out.println("tran_id (kfld1) : " + tranId);
currDetail = getCurrentDetailFromDom(dom,domID);
updateStatus = getCurrentUpdateFlag(currDetail);
if (currDetail != null && !updateStatus.equalsIgnoreCase("A"))
{
/*itemCode = GenericUtility.getInstance().getColumnValueFromNode("item_code",currDetail);
locCode = GenericUtility.getInstance().getColumnValueFromNode("loc_code",currDetail);
lotNo = GenericUtility.getInstance().getColumnValueFromNode("lot_no",currDetail);
lotSl = GenericUtility.getInstance().getColumnValueFromNode("lot_sl",currDetail);
quantity = GenericUtility.getInstance().getColumnValueFromNode("quantity",currDetail);
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no",currDetail);*/
itemCode = genericUtility.getColumnValueFromNode("item_code",currDetail);
locCode = genericUtility.getColumnValueFromNode("loc_code",currDetail);
lotNo = genericUtility.getColumnValueFromNode("lot_no",currDetail);
lotSl = genericUtility.getColumnValueFromNode("lot_sl",currDetail);
quantity = genericUtility.getColumnValueFromNode("quantity",currDetail);
lineNo = genericUtility.getColumnValueFromNode("line_no",currDetail);
if (updateStatus.equalsIgnoreCase("E") || updateStatus.equalsIgnoreCase("D")) //if condition added by jiten 19/05/06
{
//Commented And Changes Below - Gulzar 15/05/07
//sql = "SELECT QUANTITY FROM ADJ_ISSRCPDET WHERE TRAN_ID = '"+tranId+"' AND LINE_NO = "+lineNo+""; //Gulzar 15/05/07
sql = "SELECT ITEM_CODE, LOC_CODE, LOT_NO, LOT_SL, QUANTITY FROM ADJ_ISSRCPDET WHERE TRAN_ID = '"+tranId+"' AND LINE_NO = "+lineNo+""; //Gulzar 15/05/07
rs = stmt.executeQuery(sql);
if (rs.next())
{
itemCode = rs.getString("ITEM_CODE"); //Gulzar 15/05/07
locCode = rs.getString("LOC_CODE"); //Gulzar 15/05/07
lotNo = rs.getString("LOT_NO"); //Gulzar 15/05/07
lotSl = rs.getString("LOT_SL"); //Gulzar 15/05/07
quantity = rs.getString("QUANTITY");
}
//End Changes - Gulzar 15/05/07
}
System.out.println("lineNo :"+lineNo+" itemCode :"+itemCode+" locCode :"+locCode+" lotNo :"+lotNo+" lotSl :"+lotSl+" quantity :"+quantity); //Gulzar 15/05/07
allocQty = -1 * Double.parseDouble(quantity);
System.out.println("lineNo: "+lineNo);
line = " " + lineNo;
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser",tranSer);
hashMap.put("ref_id", tranId);
hashMap.put("ref_line", line.substring(line.length()-4));
hashMap.put("item_code", itemCode);
hashMap.put("site_code", siteCode);
hashMap.put("loc_code",locCode);
hashMap.put("lot_no",lotNo);
hashMap.put("lot_sl",lotSl);
hashMap.put("alloc_qty", new Double(allocQty));
hashMap.put("chg_win","W_ADJ_ISS");
/*hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));*/
hashMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
//Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB.....");
//pavan R 20/jul/18 changed the lookup to creating instance of the class using new keyword.
distStkUpd = new DistStkUpd();
if (distStkUpd.updAllocTrace(hashMap, conn) > 0)
{
distStkUpd= null;
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
//TO BE ASKED!!!
}
}
}
catch(SQLException e)
{
System.out.println("Exception : AdjIssPrsEJB : actionStock " +e.getMessage());
throw new ITMException(e);
}
catch(Exception e)
{
System.out.println("Exception : AdjIssPrsEJB : actionHandler :" +e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if (stmt !=null)
{
stmt.close();
}
if (rs != null)
{
rs.close();
}
}catch(Exception e){}
}
return errString;
}
private Node getCurrentDetailFromDom(Document dom,String domId)
{
NodeList detailList = null;
Node currDetail = null,reqDetail = null;
String currDomId = "";
int detailListLength = 0;
detailList = dom.getElementsByTagName("Detail2");
detailListLength = detailList.getLength();
for (int ctr = 0;ctr < detailListLength;ctr++)
{
currDetail = detailList.item(ctr);
currDomId = currDetail.getAttributes().getNamedItem("domID").getNodeValue();
if (currDomId.equals(domId))
{
reqDetail = currDetail;
break;
}
}
return reqDetail;
}
private String getCurrentUpdateFlag(Node currDetail)
{
NodeList currDetailList = null;
String updateStatus = "",nodeName = "";
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
currDetailListLength = currDetailList.getLength();
for (int i=0;i< currDetailListLength;i++)
{
nodeName = currDetailList.item(i).getNodeName();
if (nodeName.equalsIgnoreCase("Attribute"))
{
updateStatus = currDetailList.item(i).getAttributes().getNamedItem("updateFlag").getNodeValue();
break;
}
}
return updateStatus;
}
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.Connection;
//import javax.ejb.EJBObject; // commented for ejb3
import javax.ejb.Local; //added for ejb3
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorLocal;
//public interface AdjIssPrs extends ValidatorLocal, EJBObject // commented for ejb3
@Local // added for ejb3
public interface AdjIssPrsLocal extends ValidatorLocal //added for ejb3
{
public String preSaveRec()throws RemoteException,ITMException;
public String preSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.Connection;
//import javax.ejb.EJBObject; // commented for ejb3
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorRemote;
//public interface AdjIssPrs extends ValidatorRemote, EJBObject // commented for ejb3
@Remote // added for ejb3
public interface AdjIssPrsRemote extends ValidatorRemote //added for ejb3
{
public String preSaveRec()throws RemoteException,ITMException;
public String preSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
This diff is collapsed.
/********************************************************
Title : AdjIssueICLocal[D16ASUN021]
Date : 29/04/16
Developer: Chandrashekar
********************************************************/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorLocal;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface AdjIssueICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objCotext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
/********************************************************
Title : AdjIssueICRemote[D16ASUN021]
Date : 29/04/16
Developer: Chandrashekar
********************************************************/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ValidatorRemote;// added for ejb3
@Remote // added for ejb3
public interface AdjIssueICRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
/********************************************************
Title : AdjReceiptICLocal[F16ASUN011]
Date : 28/04/16
Developer: Sachin Satre
********************************************************/
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
@Local
public interface AdjReceiptICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
/********************************************************
Title : AdjReceiptICRemote[F16ASUN011]
Date : 28/04/16
Developer: Sachin Satre
********************************************************/
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
@Remote
public interface AdjReceiptICRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AdjustmentIssueConfWF
{
public String confirm(String tranId, String empCodeAprv, String xmlDataAll, String processId, String keyFlag, String userInfoStr) throws RemoteException, ITMException
{
System.out.println("Parameters ::: tranId[" + tranId + "],empCodeAprv[" + empCodeAprv + "],xmlDataAll[" + xmlDataAll + "],processId[" + processId + "],keyFlag[" + keyFlag + "]");
String retString = "";
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "";
ConnDriver connDriver = new ConnDriver();
int updcnt = 0;
try
{
//conn = connDriver.getConnectDB("DriverITM");
//conn = getConnection();
UserInfoBean userInfo = new UserInfoBean(userInfoStr);
String transDB = userInfo.getTransDB();
if (transDB != null && transDB.trim().length() > 0)
{
conn = connDriver.getConnectDB(transDB);
}
connDriver = null;
conn.setAutoCommit(false);
empCodeAprv = empCodeAprv == null ? "" : empCodeAprv.trim();
if ((xmlDataAll != null) && (xmlDataAll.trim().length() != 0)) {
sql = "update sample_iss set confirmed = 'Y', conf_date = sysdate where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
updcnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated Successfully:" + updcnt);
if (updcnt > 0) {
conn.commit();
retString = "Y";
}
conn.rollback();
retString = "N";
}
}
catch (Exception e)
{
try
{
conn.rollback();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
e.printStackTrace();
System.out.println("Exception occurred in catch of AdjustmentIssueWF.confirm()");
throw new ITMException(e);
}
finally
{
if (conn != null)
{
try
{
conn.close();
conn = null;
}
catch (SQLException e)
{
e.printStackTrace();
System.out.println("Exception in Finally");
}
}
}
return retString;
}
}
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AdjustmentReceiptConfWF
{
public String confirm(String tranId, String empCodeAprv, String xmlDataAll, String processId, String keyFlag, String userInfoStr) throws RemoteException, ITMException
{
String retString = "";
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "";
ConnDriver connDriver = new ConnDriver();
int updcnt = 0;
try {
System.out.println("Exception in Try block of AdjustmentReceiptWF.confirm()");
//conn = connDriver.getConnectDB("DriverITM");
UserInfoBean userInfo = new UserInfoBean(userInfoStr);
String transDB = userInfo.getTransDB();
if (transDB != null && transDB.trim().length() > 0)
{
conn = connDriver.getConnectDB(transDB);
}
connDriver = null;
conn.setAutoCommit(false);
empCodeAprv = empCodeAprv == null ? "" : empCodeAprv.trim();
if ((xmlDataAll != null) && (xmlDataAll.trim().length() != 0))
{
sql = "update sample_rcp set confirmed = 'Y', conf_date = sysdate where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
updcnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated Successfully:" + updcnt);
if (updcnt > 0)
{
conn.commit();
retString = "Y";
}
conn.rollback();
retString = "N";
}
}
catch (Exception e) {
try
{
conn.rollback();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
e.printStackTrace();
System.out.println("Exception occurred in catch block of AdjustmentReceiptWF.confirm()");
throw new ITMException(e);
}
finally
{
if (conn != null)
{
try
{
conn.close();
conn = null;
}
catch (SQLException e)
{
e.printStackTrace();
System.out.println("Exception occurred in finally block of AdjustmentReceiptWF.confirm()");
}
}
}
return retString;
}
}
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ITMDBAccessEJB;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.ejb.CreateException;
//import javax.ejb.SessionBean;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless; // added for ejb3
//public class ConsumeIssuePos extends ValidatorEJB implements SessionBean //commented for ejb3
@Stateless // added for ejb3
public class AssociateItmChg extends ValidatorEJB implements AssociateItmChgLocal ,AssociateItmChgRemote //SessionBean
{
/*public void ejbCreate() throws RemoteException, CreateException
{
//return "";
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}*/
public String wfValData() throws RemoteException,ITMException
{
return "";
}
public String itemChanged() throws RemoteException,ITMException
{
System.out.println("In item change ,.............");
return "";
}
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
}
valueXmlString = itemChanged(dom,dom1,dom2,objContext,currentColumn,editFlag,xtraParams);
}
catch(Exception e)
{
}
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
StringBuffer valueXmlString = new StringBuffer();
SimpleDateFormat sdf=null;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
int ctr = 0;
String childNodeName = null;
String columnValue = null,confirmed="";
String Col_name = "";
int currentFormNo = 0 ,cnt = 0;
String tranId="",deptCode = "", roleCodePrfmer = "", siteCode = "", empCode = "";
String sql = "",descr = "",empFName = "", empMName = "", empLName = "",roleCodeAprv="";
ConnDriver connDriver = new ConnDriver();
Timestamp tranDate =null;
String disptNo ="",currDate="";
Timestamp disptDate =null;
String InvcNo ="";
Timestamp InvcDate = null;
String exciseRef ="";
Timestamp exciseRefDate =null;
Timestamp exciseDateNew =null;
String dateFlag ="";
String siteCodeCurr ="" ;// genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
//java.sql.Timestamp toDate = new java.sql.Timestamp(System.currentTimeMillis());
try
{
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
Timestamp currDateTs = new Timestamp(System.currentTimeMillis());
siteCodeCurr = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
currDate = sdf.format(currDateTs).toString();
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver=null;
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
switch(currentFormNo)
{
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
valueXmlString.append("<Detail1>");
int childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue = childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("xtraParams>>>>>>>>>>>>>"+xtraParams);
if(currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
sql= "select descr from site where site_code='"+siteCodeCurr+"' ";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
descr = rs.getString("descr")==null ? "":rs.getString("descr");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
dateFlag =genericUtility.getColumnValue("date_flag",dom);
dateFlag = dateFlag == null ? "O":dateFlag.trim();
valueXmlString.append("<site_code protect =\"1\">").append("<![CDATA["+siteCodeCurr+"]]>").append("</site_code>");
valueXmlString.append("<date_flag>").append("<![CDATA["+dateFlag+"]]>").append("</date_flag>");
valueXmlString.append("<tran_date protect =\"1\">").append("<![CDATA["+currDate+"]]>").append("</tran_date>");
valueXmlString.append("<from_date protect =\"0\">").append("<![CDATA["+currDate+"]]>").append("</from_date>");
valueXmlString.append("<to_date protect =\"0\">").append("<![CDATA["+currDate+"]]>").append("</to_date>");
valueXmlString.append("<order_type protect =\"1\">").append("<![CDATA[F]]>").append("</order_type>");
valueXmlString.append("<site_code_descr protect =\"1\">").append("<![CDATA["+descr+"]]>").append("</site_code_descr>");
}//end of itm default
}
valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>");
}//END OF TRY
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::"+e.getMessage());
throw new ITMException(e);
}
finally
{
try{
if(conn!=null)
{
conn.close();
conn = null ;
}
}
catch(Exception ex)
{ex.printStackTrace();}
}
System.out.println("valueXmlString>>>>>>>>>>>"+valueXmlString);
return valueXmlString.toString();
}//END OF ITEMCHANGE
}// END OF MAIN CLASS
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorLocal;
import javax.ejb.Local; // added for ejb3
//public interface ConsumeIssuePos extends ValidatorRemote, EJBObject //commented for ejb3
@Local // added for ejb3
public interface AssociateItmChgLocal extends ValidatorLocal //,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.ValidatorRemote;
import javax.ejb.Remote; // added for ejb3
//public interface ConsumeIssuePos extends ValidatorRemote, EJBObject //commented for ejb3
@Remote // added for ejb3
public interface AssociateItmChgRemote extends ValidatorRemote //,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
//public interface ConsumeIssuePos extends ValidatorRemote, EJBObject //commented for ejb3
@Local // added for ejb3
public interface AssociatePrcLocal extends ProcessLocal //,EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
//public interface ConsumeIssuePos extends ValidatorRemote, EJBObject //commented for ejb3
@Remote // added for ejb3
public interface AssociatePrcRemote extends ProcessRemote //,EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
/***
* VALLABH KADAM
* AutoAllocOrdrSch.java
* 07/APR/2015
* Request Id:-[D15ASUN001]
* */
package ibase.webitm.ejb.dis;
import java.io.File;
import java.io.FileOutputStream;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.scheduler.utility.interfaces.Schedule;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
public class AutoAllocOrdrSch implements Schedule
{
FileOutputStream fos1 = null;
java.util.Date startDate = new java.util.Date(System.currentTimeMillis());
java.util.Date endDate = new java.util.Date(System.currentTimeMillis());
Calendar calendar = Calendar.getInstance();
String startDateStr = null;
String endDateStr = null;
E12GenericUtility genericUtility = new E12GenericUtility();
@Override
public String schedule(HashMap arg0) throws Exception
{
// TODO Auto-generated method stub
return null;
}
@Override
public String schedule(String scheduleParamXML) throws Exception
{
int childNodeListLength = 0;
String childNodeName = null;
String loginSiteCode="",autoAlloc="";
ibase.utility.UserInfoBean userInfo = null;
int noOfParam=0;
String sysDate ="";
String retString="";
String retString1="";
String xtraParams = "",siteCode="",logRetStr="",strToWrite="";
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null,childNode = null;
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
// String windowName="w_sordalloc";
String windowName="w_sordalloc_sh";
StockAllocationPrc stAlcPrc=new StockAllocationPrc();
System.out.println("scheduleParamXML :- "+scheduleParamXML);
Document dom = null;
userInfo = new ibase.utility.UserInfoBean( scheduleParamXML );
loginSiteCode = userInfo.getSiteCode();
autoAlloc="Y";
try
{
xtraParams = "loginCode="+userInfo.getLoginCode()+"~~termId="+userInfo.getRemoteHost()+"~~loginSiteCode="+loginSiteCode+
"~~loginEmpCode="+userInfo.getEmpCode()+"~~autoAlloc="+autoAlloc;
System.out.println("XTRAPARAMS:"+xtraParams);
dom=genericUtility.parseString(scheduleParamXML);
java.util.Date today=new java.util.Date();
Calendar cal = Calendar.getInstance();
cal.setTime(today);
today = cal.getTime();
SimpleDateFormat sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
sysDate=sdf.format(today);
NodeList paramList = dom.getElementsByTagName( "SCHEDULE" );
noOfParam = paramList.getLength();
parentNodeList = dom.getElementsByTagName("ACTUALPARAMETERS");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength :-["+childNodeListLength+"]");
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName!=null && !"#text".equalsIgnoreCase(childNodeName))
{
if(ctr==0)
{
siteCode = childNode.getFirstChild().getNodeValue();
}
}
}
System.out.println("Site code :-"+siteCode);
/**
* Initialize Log here.
* before getData();
* */
logRetStr=intializingLog("AutoAllocOdrSh_log");
System.out.println("Log Return String :- ["+logRetStr+"]");
String xmlString1="<Detail1 dbID=\"\" domID=\"1\" objContext=\"1\" objName=\"sordalloc\">"
+ "<attribute pkNames=\"\" selected=\"N\" status=\"N\" updateFlag=\"A\"/>"
+ "<site_code><![CDATA["+siteCode+"]]></site_code>" //TA821
+ "<post_order_flag><![CDATA[N]]></post_order_flag>" //Strictly N
+ "<default_qty_flag><![CDATA[Y]]></default_qty_flag>" //Strictly Y
+ "<item_ser__from><![CDATA[00]]></item_ser__from><item_ser__to><![CDATA[ZZ]]></item_ser__to>"
+ "<cust_code__from><![CDATA[00]]></cust_code__from><cust_code__to><![CDATA[ZZ]]></cust_code__to>"
+ "<sale_order__from><![CDATA[00]]></sale_order__from><sale_order__to><![CDATA[ZZ]]></sale_order__to>"
+ "<due_date__from><![CDATA["+sysDate+"]]></due_date__from><due_date__to><![CDATA["+sysDate+"]]></due_date__to>"
+ "<item_code__from><![CDATA[00]]></item_code__from><item_code__to><![CDATA[ZZ]]></item_code__to>"
+ "<active_pick_allow/><dis_opt><![CDATA[S]]></dis_opt>" //Strictly S
+ "<batch_id/></Detail1>";
String xmlString2="<DocumentRoot><description>Datawindow Root</description>"
+ "<group0><description>Group0 description</description><Header0><description>Header0 members</description>"
+ "<Detail1 dbID=\"\" domID=\"1\" objContext=\"1\" objName=\"sordalloc\">"
+ "<attribute pkNames=\"\" selected=\"N\" status=\"N\" updateFlag=\"A\"/>"
+ "<site_code><![CDATA["+siteCode+"]]></site_code>"
+ "<post_order_flag><![CDATA[N]]></post_order_flag>"
+ "<default_qty_flag><![CDATA[Y]]></default_qty_flag>"
+ "<item_ser__from><![CDATA[00]]></item_ser__from><item_ser__to><![CDATA[ZZ]]></item_ser__to>"
+ "<cust_code__from><![CDATA[00]]></cust_code__from><cust_code__to><![CDATA[ZZ]]></cust_code__to>"
+ "<sale_order__from><![CDATA[00]]></sale_order__from><sale_order__to><![CDATA[ZZ]]></sale_order__to>"
+ "<due_date__from><![CDATA["+sysDate+"]]></due_date__from><due_date__to><![CDATA["+sysDate+"]]></due_date__to>"
+ "<item_code__from><![CDATA[00]]></item_code__from><item_code__to><![CDATA[ZZ]]></item_code__to>"
+ "<active_pick_allow/><dis_opt><![CDATA[S]]></dis_opt>"
+ "<batch_id/></Detail1>"
+ "</Header0></group0></DocumentRoot>";
System.out.println("xmlString1@@@@@@@@@@@@@@@@:["+xmlString1+"]");
System.out.println("xmlString2@@@@@@@@@@@@@@@@:["+xmlString2+"]");
retString=stAlcPrc.getData(xmlString1, xmlString2, windowName, xtraParams);
System.out.println("Get DATA retString :- ["+retString+"]");
/**
* Writing log after getData();
* */
startDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
startDateStr = sdf1.format(startDate)+" "+calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
strToWrite=" For Site code:- "+siteCode+", Post order:-'N' , Default Qty flag :- 'Y'"
+", Item Sceries from:- 00 To:- ZZ, Cust Code :- 00 To:- ZZ, Sales Order from:- 00 To:- ZZ,"
+ " Due Date from:- "+sysDate+" To:- "+sysDate+", Item Code from :- 00 To:- ZZ, Display Option:- 'S';\r\n\r\n"
+ " selected :-"+retString+" ";
/**
* Append Start date
* */
strToWrite=strToWrite+startDate+"\r\n\r\n";
retString1=stAlcPrc.process(xmlString1, retString, windowName, xtraParams);
System.out.println("Process String :-["+retString1+"]");
/**
* Writing log after process();
* */
endDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
endDateStr = sdf1.format(endDate)+" "+calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
strToWrite=strToWrite+endDateStr;
strToWrite=" "+strToWrite+retString1+"\r\n\r\n";
System.out.println("Str write :-----------["+strToWrite+"]");
fos1.write(strToWrite.getBytes());
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite);
return retString;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
private String intializingLog(String fileName)
{
String log="intializingLog_Failed";
String currTime = null;
try{
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
try
{
currTime = sdf1.format(new Timestamp(System.currentTimeMillis())).toString();
currTime = currTime.replaceAll("-","");
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
fileName = fileName+currTime+calendar.get(Calendar.HOUR)+""+calendar.get(Calendar.MINUTE)+".txt";
fos1 = new FileOutputStream(CommonConstants.JBOSSHOME + File.separator +"EDI"+File.separator+fileName);
}
catch(Exception e)
{
System.out.println("Exception []::"+e.getMessage());
e.printStackTrace();
}
startDate = new java.util.Date(System.currentTimeMillis());
calendar.setTime(new java.sql.Timestamp(System.currentTimeMillis()));
startDateStr = sdf1.format(startDate)+" "+calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
fos1.write(("Fetching Records Started At " + startDateStr +"\r\n").getBytes());
}
catch(Exception e)
{
System.out.println("Exception []::"+e.getMessage());
e.printStackTrace();
}
log ="intializingLog_Successesfull";
return log;
}
@Override
public String schedulePriority(String arg0) throws Exception
{
// TODO Auto-generated method stub
return null;
}
}
/**************************
* VALLABH KADAM
* AutoFileUploadSh.java
* Request Id:- [D14KSUN003]
* 9/MAY/15
* *******************************/
package ibase.webitm.ejb.dis;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import ibase.scheduler.utility.interfaces.Schedule;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
//import org.apache.poi.hssf.usermodel.HSSFSheet;
//import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFCellUtil;
import org.apache.poi.ss.util.CellRangeAddress;
//import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLEncoder;
import ibase.webitm.ejb.ITMUploadFileEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import java.net.*;
import java.io.*;
public class AutoFileUploadSh implements Schedule
{
private static String loadedFileLocation, unloadedFileLocation;
public static File DUMP_DIR, LOG_DUMP_DIR;
UserInfoBean userInfo = null;
@Override
public String schedule(HashMap arg0) throws Exception
{
// TODO Auto-generated method stub
return null;
}
@Override
public String schedule(String scheduleParamXML) throws Exception
{
// TODO Auto-generated method stub
String retString = "";
if (CommonConstants.UPLOAD_LOC == null && CommonConstants.J2EE_VERSION.equals("1"))
{
DUMP_DIR = new File((new File(CommonConstants.APPLICATION_CONTEXT)).getParentFile().getParent() + File.separator + "dump");
LOG_DUMP_DIR = new File(DUMP_DIR.getParent() + File.separator + "logs");
} else
{
DUMP_DIR = new File((new File(CommonConstants.UPLOAD_LOC)) + File.separator + "dump");
if (!DUMP_DIR.exists())
{
DUMP_DIR.mkdir();
}
LOG_DUMP_DIR = new File((new File(CommonConstants.UPLOAD_LOC)) + File.separator + "logs");
if (!LOG_DUMP_DIR.exists())
{
LOG_DUMP_DIR.mkdir();
}
}
File[] files = DUMP_DIR.listFiles();
userInfo = new ibase.utility.UserInfoBean(scheduleParamXML);
for (File file : files)
{
processXLS(file);
}
return retString;
}
private void processXLS(File file)
{
String retString = "";
// TODO Auto-generated method stub
if (file != null)
{
try
{
FileInputStream fos = new FileInputStream(file);
HSSFWorkbook workbook = new HSSFWorkbook(fos);
HSSFSheet sheet = workbook.getSheetAt(0);
HSSFRow tempRow;
tempRow = sheet.getRow(1);
Object objName;
Object pkValue;
objName = getCellValue(HSSFCellUtil.getCell(tempRow, 0));
String fileObjName = objName == null ? "" : objName.toString();
pkValue = getCellValue(HSSFCellUtil.getCell(tempRow, 1));
String filePkValue = pkValue == null ? "" : pkValue.toString();
retString = insertFileData(file, fileObjName, filePkValue);
if ((retString != null || retString.trim().length() > 0) && retString.indexOf("Successfully Uploaded") >= 0)
{
loadedFileLocation = (new File(CommonConstants.UPLOAD_LOC)) + File.separator + "Loaded";
if (file.exists() && !file.isDirectory())
{
moveFile(loadedFileLocation, file);
} else
{
DUMP_DIR = new File((new File(CommonConstants.UPLOAD_LOC)) + File.separator + "dump_upd");
File tempFile = new File(DUMP_DIR, file.getName());
moveFile(loadedFileLocation, tempFile);
}
} else
{
unloadedFileLocation = (new File(CommonConstants.UPLOAD_LOC)) + File.separator + "Unloaded";
if (file.exists() && !file.isDirectory())
{
moveFile(unloadedFileLocation, file);
} else
{
DUMP_DIR = new File((new File(CommonConstants.UPLOAD_LOC)) + File.separator + "upload_log");
File tempFile = new File(DUMP_DIR, file.getName());
moveFile(unloadedFileLocation, tempFile);
}
}
} catch (IOException ioE)
{
ioE.printStackTrace();
} catch (Exception eX)
{
eX.printStackTrace();
}
}
}
private String insertFileData(File file, String fileObjName, String filePkValue)
{
String retString = "";
String menuObjName = fileObjName.trim();
boolean IS_INTERACTIVE = true;
String OBJ_NAME = fileObjName.trim();
boolean is_ExcelDriver = false;
String oriFileName = file.toString().trim();
String newFileName = file.getName().trim();
// TODO Auto-generated method stub
String[] fileInfoArr = new String[6];
try
{
fileInfoArr[0] = String.valueOf(IS_INTERACTIVE);
fileInfoArr[1] = newFileName;
fileInfoArr[2] = OBJ_NAME;
// fileInfoArr[3] = oriFileName;
// fileInfoArr[4] = menuObjName;
fileInfoArr[5] = String.valueOf(is_ExcelDriver);
ITMUploadFileEJB itmUpEJB = new ITMUploadFileEJB();
retString = itmUpEJB.insertFileData(fileInfoArr, userInfo, DUMP_DIR, CommonConstants.APPLICATION_CONTEXT, menuObjName, is_ExcelDriver);
} catch (Exception e)
{
e.printStackTrace();
}
return retString;
}
Object getCellValue(HSSFCell cell)
{
if (cell.getCellType() == 1)
return cell.getStringCellValue();
if (cell.getCellType() == 0)
{
return Double.valueOf(cell.getNumericCellValue());
}
return null;
}
public void moveFile(String fileLocation, File file)
{
File destPath = new File(fileLocation);
if (!destPath.exists())
{
destPath.mkdir();
}
file.renameTo(new File(destPath, file.getName()));
}
@Override
public String schedulePriority(String arg0) throws Exception
{
// TODO Auto-generated method stub
return null;
}
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface AwacsToES3ICLocal
{
public String wfValData(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6) throws RemoteException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface AwacsToES3ICRemote {
public String wfValData(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6) throws RemoteException;
}
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface AwacsToES3PrcLocal extends ProcessLocal{
public String process(String arg0, String arg1, String arg2, String arg3) throws RemoteException, ITMException;
}
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface AwacsToES3PrcRemote extends ProcessRemote{
public String process(String arg0, String arg1, String arg2, String arg3) throws RemoteException, ITMException;
}
package ibase.webitm.ejb.dis;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "BankDtl")
public class Bankdtl implements Serializable
{
private static final long serialVersionUID = 1L;
private String bankcode="";
private String bankname="";
public Bankdtl(){}
public Bankdtl ( String bankCode, String bankName)
{
this.bankcode = bankCode;
this.bankname = bankName;
}
public String getBankCode() {
return bankcode;
}
@XmlElement
public void setBankCode(String bankCode) {
this.bankcode = bankCode;
}
public String getBankName() {
return bankname;
}
@XmlElement
public void setBankName(String bankName) {
this.bankname = bankName;
}
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject; //commented for ejb3
import javax.ejb.Local; //added for ejb3
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@Local // added for ejb3
//public interface BarCodeReport extends ValidatorLocal,EJBObject //commented for ejb3
public interface BarCodeReportLocal extends ValidatorLocal //added for ejb3
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject; //commented for ejb3
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
//public interface BarCodeReport extends ValidatorRemote,EJBObject //commented for ejb3
@Remote // added for ejb3
public interface BarCodeReportRemote extends ValidatorRemote //added for ejb3
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface BenefitDisItmLocal extends ValidatorLocal//,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface BenefitDisItmRemote extends ValidatorRemote //,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface BenefitDisPrcLocal extends ProcessLocal //,EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface BenefitDisPrcRemote extends ProcessRemote //,EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
This diff is collapsed.
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface BenefitItmLocal extends ValidatorLocal //,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface BenefitItmRemote extends ValidatorRemote //,EJBObject
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
}
This diff is collapsed.
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface BenefitPrcLocal extends ProcessLocal //,EJBObject
{
public String process() throws RemoteException,ITMException;
public String process(String string1, String string2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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