Commit 9336c6c2 authored by mchaudhari's avatar mchaudhari

Done Development


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96112 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 50246c31
/********************************************************
Title : DistIssWiz EJB
Date : 20 - Aug - 2014
Author: Deepak Sawant.
********************************************************/
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -17,13 +10,9 @@ import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.StringTokenizer;
import javax.ejb.Stateless;
......@@ -115,10 +104,9 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
String userId = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
String sql = "",locCode ="",invstat="",aval="",avalyn="";
double qtyConf=0,qtyShip=0,totQty=0,detquantity=0,stkquantity=0,quantity=0,totquantity=0;
String sql = "";
String squantity="",distOrder = "",itemCode="",confirmed="",tranId="",siteCode="",lotSl="",addUser="",tranCode="";
String distOrder = "",confirmed="",tranId="",siteCode="",lotSl="";
try {
System.out.println("editFlag>>>>wf"+editFlag);
......@@ -222,6 +210,24 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
else
{
//validation needs to added for checking dist order present in dist issue table
sql = "select count(1) from distord_iss where dist_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,distOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt == 0)
{
errCode = "VTDIST2";
errString = getErrorString("dist_order1",errCode,userId);
break;
}
}
}
......@@ -262,7 +268,8 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength+ ====>>>>>>> "+childNodeListLength);
System.out.println("childNodeName+ ==== "+childNodeName);
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
......@@ -287,7 +294,24 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
{
//add validation here for check lot sl present in detail table
sql = "select count(1) from distord_issdet where lot_sl = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt == 0)
{
errCode = "VTINVLOTSL";
errString = getErrorString("lot_sl",errCode,userId);
break;
}
}
......@@ -351,7 +375,7 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException {
StringBuffer valueXmlString = null;
int currentFormNo = 0, lineNo = 0;
int currentFormNo = 0;
Connection conn = null;
double squantity = 0.0;
PreparedStatement pstmt = null,pstmt1=null;
......@@ -361,49 +385,18 @@ public class DistIssDelWiz extends ValidatorEJB implements DistIssDelWizLocal, D
SimpleDateFormat simpleDateFormat = null;
GenericUtility genutility = new GenericUtility();
String locCode="",lotNo="",itmdesc="",siteCode="",locdesc="";
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
DistCommon disCommon = new DistCommon();
System.out.println("DOM111 Elements>>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM222 Elements>>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM322 Elements>>["+genericUtility.serializeDom(dom2).toString()+"]");
String distOrder = "",itemCode = "",sql="",unit="",packCode="",tranType ="";
String distOrder = "",itemCode = "",sql="";
java.sql.Timestamp currDate = null;
double grossWeight = 0,netWeight=0,tareWeight=0,noOfArt=0;
SimpleDateFormat sdf = null;
String currAppdate = "";
String tranid ="";
String rate = "";
double amount = 0;
int cnt = 0;
String tranCode = "",tranName="",transMode="";
StringBuffer detail2xml = new StringBuffer();
String tranDate = null;
PreparedStatement pstmt2 =null;
ResultSet rs2 = null,rs3 = null;
String unitAlt = null;
int count = 0;
double minputQty = 0d, remQuantity = 0d, stockQty = 0d, integralQty = 0d;
double grossPer = 0d,netPer = 0d,grossWt = 0d,tarePer = 0d,netWt = 0d,tareWt =0d, rateClgVal = 0d, rate2 = 0d;
double disAmount = 0d, shipperQty = 0d,discount =0;
int minShelfLife = 0, noArt1 = 0;
int mLineNoDist =0;
double qtyConfirm =0,qtyShipped =0,lcQtyOrderAlt =0,lcFact =0;
String siteCodeMfg = "", sundryCode = "";
String priceList = "", tabValue = "", priceListClg = "", chkDate = "";
String res = "", locCodeDamaged = "",availableYn ="";
String checkIntegralQty = "", tranTypeParent ="";
String rate1 = "";
String active = "",errCode ="",sql2 ="",noArt ="",itemDescr="";
String errString ="",siteCodeShip ="";
String lotSl ="",rateClg ="";
java.util.Date chkDate1 = null;
String prvDeptCode = null,deptCode ="";
String locGroupJwiss="";
String subSQL="";
String lotSl ="";
try
{
sdf=new SimpleDateFormat(genutility.getApplDateFormat());
......
......@@ -11,12 +11,12 @@ import javax.ejb.Local;
@Local
public interface DistIssDelWizLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String objContext, String editFlag, String xtraParams) 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, 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 objContext, String currentColumn, 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, 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
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.w3c.dom.Document;
@javax.ejb.Stateless
public class DistIssDelWizPostSave extends ValidatorEJB implements DistIssDelWizPostSaveLocal,DistIssDelWizPostSaveRemote{
public String postSave(String xmlString,String editFlag,String tranId, String xtraParams,Connection conn) throws RemoteException,ITMException
{
System.out.println(">>>>>>>>>>>>>>CONNECTION"+conn);
System.out.println("------------ DisIssDelWizPostSave postSave method called-----------------tranId : "+ tranId);
Document dom = null;
String errString="";
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
dom = genericUtility.parseString(xmlString);
System.out.println("xmlString d" + xmlString);
}
tranId = GenericUtility.getInstance().getColumnValue("tran_id",dom);
System.out.println("------------ DisIssDelWizPostSave postSave method called-----------------tranId from dom: "+ tranId);
conn = null;
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver= null;
errString = postSave(dom,tranId,editFlag,xtraParams,conn);
}
catch(Exception e)
{
System.out.println("Exception : DisIssDelWizPostSave : postSave : ==>\n"+e.getMessage());
throw new ITMException(e);
}
return errString;
}
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn)
{
System.out.println("post save dom data1 ---------------:"+dom);
String sql = "", error = "";
String lotSl="";
int cnt = 0;
PreparedStatement pstmt = null;
ResultSet rs=null;
try
{
lotSl = GenericUtility.getInstance().getColumnValue("lot_sl",dom);
sql = "delete from distord_issdet where tran_id = ? and lot_sl = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, lotSl);
cnt = pstmt.executeUpdate();
System.out.println(">>>>>>>successfully deleted record DisIssDelWizPostSave cnt = :" + cnt);
conn.commit();
}catch(Exception e)
{
try {
System.out.println(">>>>>>>>>>>>In catch Before rollback>>>");
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
error=e1.getMessage();
}
System.out.println("Exception ::"+e);
e.printStackTrace();
error=e.getMessage();
}
finally
{
try {
System.out.println(">>>>>>>>>>>>In finally Before Commit>>>");
if(pstmt != null)
pstmt.close();
if(conn != null)
{
conn.close();
}
if(rs != null)
rs.close();
pstmt = null;
rs = null;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
error=e.getMessage();
}
}
return error;
}
}
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
import org.w3c.dom.Document;
@Local // added for ejb3
public interface DistIssDelWizPostSaveLocal extends ValidatorLocal//, EJBObject
{
public String postSave(String xmlString,String tranId,String editFlag, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn);
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
import org.w3c.dom.Document;
@Remote // added for ejb3
public interface DistIssDelWizPostSaveRemote extends ValidatorRemote//, EJBObject
{
public String postSave(String xmlString,String tranId,String editFlag, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn);
}
\ No newline at end of file
......@@ -10,13 +10,13 @@ import javax.ejb.Remote;
@Remote
public interface DistIssDelWizRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlString1, String objContext, String editFlag, String xtraParams) 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, 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 objContext, String currentColumn, 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, 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
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