Commit daacb97c authored by cpatil's avatar cpatil

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91776 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 41fcb566
......@@ -20,6 +20,7 @@ import java.lang.*;
import java.io.*;
import java.rmi.RemoteException;
import java.sql.*;
import javax.ejb.*;
import java.text.*;
import java.util.*;
......@@ -32,7 +33,7 @@ public class InvHoldGen
public String generateHoldTrans( String lockCode, String refID, String refSer, String siteCode, ArrayList stockList, String xtraParams, Connection conn )throws RemoteException,ITMException
{
String sql = "";
String sql = "",sqlIn="";
String confirmed = "";
String itemCode = "";
String locCode = "";
......@@ -42,15 +43,15 @@ public class InvHoldGen
String chgTerm = "";
String retString = "";
String tranId = "";
java.sql.Timestamp chgDate = null,currDate = null;
int lineNo = 0;
java.sql.Timestamp chgDate = null,currDate = null,currDate2 = null;
int lineNo = 0,stdDays=0;
boolean isError = false;
PreparedStatement pstmtHold = null;
PreparedStatement pstmtHold = null,pstmtIn=null;
PreparedStatement pstmtHolddet = null;
PreparedStatement pstmtSel = null;
ResultSet rsSel = null;
ResultSet rsSel = null,rsIn=null;
java.util.Date date = null;
......@@ -66,7 +67,7 @@ public class InvHoldGen
pstmtHold = conn.prepareStatement(holdInsertSql);
String holddetInsertSql = "INSERT INTO INV_HOLD_DET(TRAN_ID,LINE_NO,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL,HOLD_STATUS) VALUES(?,?,?,?,?,?,?,?)";
String holddetInsertSql = "INSERT INTO INV_HOLD_DET(TRAN_ID,LINE_NO,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL,HOLD_STATUS,SCH_REL_DATE) VALUES(?,?,?,?,?,?,?,?,?)";
pstmtHolddet = conn.prepareStatement(holddetInsertSql);
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -148,6 +149,31 @@ public class InvHoldGen
{
lotSl = (String)dataMap.get("lot_sl");
}
//add by cpatil start on 28-07-12 as per manoharan sir
sqlIn="select std_days from inv_lock where lock_code = ?";
pstmtIn = conn.prepareStatement(sql);
pstmtIn.setString(1,lockCode);
rsIn = pstmtIn.executeQuery();
if(rsIn.next())
{
stdDays = rsIn.getInt("std_days");
}
rsIn.close();
rsIn= null;
pstmtIn.close();
pstmtIn=null;
Calendar c = Calendar.getInstance();
c.setTime(currDate);
c.add(Calendar.DATE, stdDays);
currDate2 = new Timestamp(c.getTimeInMillis());
//add by cpatil on 28-07-12 end
pstmtHolddet.setString( 1, tranId );
pstmtHolddet.setInt( 2, lineNo );
pstmtHolddet.setString( 3, itemCode );
......@@ -156,6 +182,7 @@ public class InvHoldGen
pstmtHolddet.setString( 6, lotNo );
pstmtHolddet.setString( 7, lotSl );
pstmtHolddet.setString( 8, "H" );
pstmtHolddet.setTimestamp( 9, currDate2 ); //add by cpatil on 28-07-12 as per manoharan sir
pstmtHolddet.addBatch();
pstmtHolddet.clearParameters();
dataMap.clear();
......
......@@ -73,16 +73,16 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
Node childNode = null;
int ctr = 0;
String childNodeName = null;
String errCode = null;
String userId = null;
int cnt = 0;
int cnt = 0,quantity=0;
int currentFormNo = 0;
int childNodeListLength;
Connection conn = null;
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = null;
PreparedStatement pstmt=null,pstmtQuant=null;
ResultSet rs = null,rsQuant=null;
String sql = null,sqlQuant=null;
String tranDateStr = null;
......@@ -145,6 +145,8 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
pstmt.close();
pstmt = null;
}
}
if ( childNodeName.equalsIgnoreCase( "emp_code__aprv" ) )
......@@ -230,10 +232,9 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
lockCode = genericUtility.getColumnValue( "lock_code", dom, "1" );
if(lockCode == null)//checking for null
{
errString = getErrorString("lock_code","NULLLOCKCD",userId);
break;
// errString = getErrorString("lock_code","NULLLOCKCD",userId); //commented by cpatil on 1/08/12 as per manoharan sir
// break;
}
else //To check exist in INV_LOCK master
{
sql = "SELECT COUNT(*) COUNT FROM INV_LOCK WHERE LOCK_CODE = ? " ;
......@@ -328,6 +329,76 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
pstmt.close();
pstmt = null;
//added by cpatil start on 01/08/12 as per manoharan sir
String siteCode = genericUtility.getColumnValue( "site_code", dom, "2" );
String locCode = genericUtility.getColumnValue( "loc_code", dom, "2" );
String lotNo = genericUtility.getColumnValue( "lot_no", dom, "2" );
String lotSl = genericUtility.getColumnValue( "lot_sl", dom, "2" );
int i=2;
//System.out.println("@@@@@@::siteCode:["+siteCode+"]::locCode["+locCode+"]::lotNo:["+lotNo+"]::lotSl:["+lotSl+"]");
sqlQuant="select sum(quantity) from stock where item_code= ? ";
if( siteCode!=null )
{
sqlQuant = sqlQuant + " and site_code = ?";
}
if( locCode!=null )
{
sqlQuant = sqlQuant + " and loc_code = ?";
}
if( lotNo !=null )
{
sqlQuant = sqlQuant + " and lot_no = ?";
}
if( lotSl!=null )
{
sqlQuant = sqlQuant + " and lot_sl = ?";
}
pstmtQuant = conn.prepareStatement( sqlQuant );
pstmtQuant.setString(1,itemCode);
if( siteCode!=null )
{
pstmtQuant.setString(i,siteCode);
i++;
}
if( locCode!=null )
{
pstmtQuant.setString(i,locCode);
i++;
}
if( lotNo !=null )
{
pstmtQuant.setString(i,lotNo);
i++;
}
if( lotSl!=null )
{
pstmtQuant.setString(i,lotSl);
}
rsQuant = pstmtQuant.executeQuery();
if( rsQuant.next() )
{
quantity = rsQuant.getInt( 1 );
}
rsQuant.close();
rsQuant = null;
pstmtQuant.close();
pstmtQuant = null;
if(quantity == 0)
{
errString = getErrorString( "item_code", "VTINQTY09" , userId );
}
// cpatil end
}
else
{
......@@ -381,7 +452,7 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
{
if(lineNoSlPrsnt)
{
errString = getErrorString( "SITE_CODE", "NULLSITECD" , userId );
// errString = getErrorString( "SITE_CODE", "NULLSITECD" , userId ); //commented by cpatil on 01/08/12 as per manoharan sir
}
}
//changed by Dharmesh on 12-08-2011 [WM1ESUN004] to validate null site code if Line No is present.end
......@@ -389,8 +460,11 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
else if( childNodeName.equalsIgnoreCase( "loc_code" ) )
{
String locCode = null;
locCode = genericUtility.getColumnValue( "loc_code", dom, "2" );
if( locCode != null )
{
//Changed by Dharmesh on 09/08/11 [WM1ESUN004] to bind variable dynamically instead of statically.start
......@@ -423,14 +497,17 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
pstmt.close();
pstmt = null;
}
//changed by Dharmesh on 12-08-2011 [WM1ESUN004] to validate null location code if Line No is present.start
else
{
if(lineNoSlPrsnt)
{
errString = getErrorString( "LOC_CODE", "NULLLOCCD" , userId );
// errString = getErrorString( "LOC_CODE", "NULLLOCCD" , userId ); // commented by cpatil on 01/08/12 as per manoharan sir
}
}
//changed by Dharmesh on 12-08-2011 [WM1ESUN004] to validate null location code if Line No is present.end
......@@ -446,7 +523,7 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
{
if( lotNo == null )
{
errString = getErrorString( "LOT_NO", "NULLLOTNO", userId );
// errString = getErrorString( "LOT_NO", "NULLLOTNO", userId ); //commented by cpatil on 01/08/12 as per manoharan sir
}
}
}
......@@ -459,7 +536,7 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
{
if( lotSl == null )
{
errString = getErrorString( "LOT_SL", "NULLLOTSL", userId );
// errString = getErrorString( "LOT_SL", "NULLLOTSL", userId ); //commented by cpatil on 01/08/12 as per manoharan sir
}
}
}
......@@ -515,7 +592,8 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
System.out.println("Exception ::" +e);
e.printStackTrace();
errCode = "VALEXCEP";
errString = getErrorString( "", errCode, userId );
errString = getErrorString( "", errCode, userId );
throw new ITMException(e);
}
finally
{
......@@ -571,6 +649,7 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
catch(Exception e)
{
System.out.println("Exception : [EpaymentICEJB][itemChanged(String,String)] :==>\n"+e.getMessage());
throw new ITMException(e);
}
return valueXmlString;
}
......@@ -908,6 +987,7 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
{
System.out.println("Exception ::" + e);
e.printStackTrace();
throw new ITMException(e);
}
}
return valueXmlString.toString();
......
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 javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface InvHoldRelGenLocal extends ibase.webitm.ejb.ProcessLocal
{
@Override
public String process() throws RemoteException,ITMException;
@Override
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) 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 javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface InvHoldRelGenRemote extends ibase.webitm.ejb.ProcessRemote
{
@Override
public String process() throws RemoteException,ITMException;
@Override
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
}
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