Commit 40f6f31c authored by agaikwad's avatar agaikwad

Added validation for tran id


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100053 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5dc8b6bb
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
import java.sql.*; import java.sql.*;
import java.util.*; import java.util.*;
import org.w3c.dom.*; import org.w3c.dom.*;
...@@ -13,52 +14,50 @@ import ibase.webitm.utility.GenericUtility; ...@@ -13,52 +14,50 @@ import ibase.webitm.utility.GenericUtility;
import javax.ejb.Stateless; import javax.ejb.Stateless;
@Stateless @Stateless
public class InvPackUndo extends ProcessEJB implements InvPackUndoLocal, InvPackUndoRemote public class InvPackUndo extends ProcessEJB implements InvPackUndoLocal,
{ InvPackUndoRemote {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String process(String xmlString, String xmlString2,
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException String windowName, String xtraParams) throws RemoteException,
{ ITMException {
String retStr = ""; String retStr = "";
Document detailDom = null; Document detailDom = null;
Document headerDom = null; Document headerDom = null;
System.out.println("xmlString2-->"+ xmlString2); System.out.println("xmlString2-->" + xmlString2);
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
try try {
{
System.out.println("xmlString [" + xmlString + "]");
System.out.println("xmlString ["+xmlString+"]"); System.out.println("xmlString2 [" + xmlString2 + "]");
System.out.println("xmlString2 ["+xmlString2+"]"); System.out.println("windowName [" + windowName + "]");
System.out.println("windowName ["+windowName+"]"); System.out.println("xtraParams [" + xtraParams + "]");
System.out.println("xtraParams ["+xtraParams+"]"); if (xmlString != null && xmlString.trim().length() != 0) {
if(xmlString != null && xmlString.trim().length()!=0)
{
headerDom = genericUtility.parseString(xmlString); headerDom = genericUtility.parseString(xmlString);
} }
if(xmlString2 != null && xmlString2.trim().length()!=0) if (xmlString2 != null && xmlString2.trim().length() != 0) {
{
detailDom = genericUtility.parseString(xmlString2); detailDom = genericUtility.parseString(xmlString2);
} }
retStr = process(headerDom, detailDom, windowName, xtraParams); retStr = process(headerDom, detailDom, windowName, xtraParams);
} }
catch (Exception e) catch (Exception e) {
{
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
return retStr; return retStr;
} }
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{ public String process(Document headerDom, Document detailDom,
String windowName, String xtraParams) throws RemoteException,
ITMException {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = null; ConnDriver connDriver = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null,pstmt2 = null,pstmt4= null,pstmt5= null,pstmtInsert=null; PreparedStatement pstmt1 = null, pstmt2 = null, pstmt4 = null, pstmt5 = null, pstmtInsert = null;
ResultSet rs = null; ResultSet rs = null;
ResultSet rs1 = null; ResultSet rs1 = null;
ResultSet rs2 = null; ResultSet rs2 = null;
...@@ -67,550 +66,553 @@ public class InvPackUndo extends ProcessEJB implements InvPackUndoLocal, InvPack ...@@ -67,550 +66,553 @@ public class InvPackUndo extends ProcessEJB implements InvPackUndoLocal, InvPack
String tranId = null; String tranId = null;
String confirm = ""; String confirm = "";
String errString = ""; String errString = "";
String errCode = "";
String returnString = "";
String lsErrcode = "";
String chgUser = ""; String chgUser = "";
String userId = null; String userId = null;
String chgTerm = ""; String chgTerm = "";
String lineno=""; String lineno = "";
String linenorcp=""; String linenorcp = "";
String itemcode=""; String itemcode = "";
String itemcodercp=""; String itemcodercp = "";
String loccode=""; String loccode = "";
String loccodercp=""; String loccodercp = "";
String lotno=""; String lotno = "";
String lotnorcp=""; String lotnorcp = "";
String lotsl="",unit="",orderno="",packcode="",packinstr="",acctcodeinv ="",cctrcodeinv = "", grade="",linenoord=""; String lotsl = "", unit = "", orderno = "", packcode = "", packinstr = "", acctcodeinv = "", cctrcodeinv = "", grade = "", linenoord = "";
String lotslrcp="",unitrcp="",ordernorcp="",packcodercp="",packinstrrcp ="",acctcodeinvrcp ="",cctrcodeinvrcp = "", gradercp="",linenoordrcp=""; String lotslrcp = "", unitrcp = "", ordernorcp = "", packcodercp = "", packinstrrcp = "", acctcodeinvrcp = "", cctrcodeinvrcp = "", gradercp = "", linenoordrcp = "";
boolean result=false; boolean result = false;
boolean updateFlag=false; boolean updateFlag = false;
String [] douhold = null; String[] douhold = null;
String loccodeiss=""; String loccodeiss = "";
String lslotsliss =""; String lslotsliss = "";
String sql = null, mfgDateOn = ""; String sql = null;
String siteCode = "",oldcompstr=""; String siteCode = "", oldcompstr = "";
String xmlString = "",sitecodemfg="",unitalt="",loccodeexcessshort=""; String xmlString = "", sitecodemfg = "", unitalt = "", loccodeexcessshort = "";
double quantity = 0,grossweight=0,tareweight=0,netweight=0,potencyperc=0,rate=0,grossrate=0; double grossweight = 0, tareweight = 0, netweight = 0, potencyperc = 0, rate = 0, grossrate = 0;
double quantityrcp = 0,grossweightrcp=0,tareweightrcp=0,netweightrcp=0,potencypercrcp=0,ratercp =0,grossratercp =0; double quantityrcp = 0, grossweightrcp = 0, tareweightrcp = 0, netweightrcp = 0, potencypercrcp = 0, ratercp = 0, grossratercp = 0;
double convqtystduom=0 ,holdqty=0, exshtqty=0,palletwt=0; double convqtystduom = 0, holdqty = 0, exshtqty = 0, palletwt = 0;
int count = 0,noart=0,i=0,noartrcp=0,newSl = 0; int count = 0, noart = 0, i = 0, noartrcp = 0, newSl = 0;
HashMap invrevUpdMap = null; HashMap invrevUpdMap = null;
HashMap invrevUpdMap1 = null; HashMap invrevUpdMap1 = null;
String newLotSl="",dimensionrcp=""; String newLotSl = "", dimensionrcp = "";
java.sql.Timestamp dueDate = null, mfgDate = null, mfgDatercp = null, expDate = null, expDatercp = null,retestdate = null, mfgDateWO = null, expDateWO = null, completionDate = null,trandate = null,lastphycdate=null; java.sql.Timestamp dueDate = null, mfgDate = null, mfgDatercp = null, expDate = null, expDatercp = null, retestdate = null, mfgDateWO = null, expDateWO = null, completionDate = null, trandate = null, lastphycdate = null;
//oracle.jdbc.OracleConnection oracleConnection = null; change done by kunal on 12/Sep/13 // oracle.jdbc.OracleConnection oracleConnection = null; change done by
String sitecodemfgrcp ="", retestdatercp=""; // kunal on 12/Sep/13
String suppcodemfg=""; String sitecodemfgrcp = "", retestdatercp = "";
double rateoh=0; String suppcodemfg = "";
String acctcodeoh=""; double rateoh = 0;
String cctrcodeoh=""; String acctcodeoh = "";
String unitaltercp=""; String cctrcodeoh = "";
double conv=0; String unitaltercp = "";
double sumqty=0; double conv = 0;
String batchno=""; double sumqty = 0;
String quarantineLock=""; String batchno = "";
double actualrate =0 ,batchsize=0; String quarantineLock = "";
String sitecodemfgrcpstk =""; double actualrate = 0, batchsize = 0;
String sitecodemfgrcpstk = "";
java.sql.Timestamp retestdatercpstk = null; java.sql.Timestamp retestdatercpstk = null;
double potencypercrcpstk = 0,convqtystduomrcpstk=0,actualratercpstk = 0, batchsizercpstk=0; double potencypercrcpstk = 0, convqtystduomrcpstk = 0, actualratercpstk = 0, batchsizercpstk = 0;
String batchnorcpstk ="",unitaltrcpstk=""; String batchnorcpstk = "", unitaltrcpstk = "";
int ratercpstk = 0,rateohrcpstk=0,grossratercpstk=0; int ratercpstk = 0, rateohrcpstk = 0, grossratercpstk = 0, checkCount = 0;
String suppcodemfgrcpstk="",acctcodeinvrcpstk ="",cctrcodeinvstk="",acctcodeohrcpstk="", cctrcodeohrcpstk="",gradercpstk =""; String suppcodemfgrcpstk = "", acctcodeinvrcpstk = "", cctrcodeinvstk = "", acctcodeohrcpstk = "", cctrcodeohrcpstk = "", gradercpstk = "";
String linenotemp = "", itemcodetemp="",loccodetemp ="",lotnotemp = "", lotsltemp = ""; String linenotemp = "", itemcodetemp = "", loccodetemp = "", lotnotemp = "", lotsltemp = "";
double quantitytemp=0,alocqty=0,stkQty=0,checkqty=0; double quantitytemp = 0, alocqty = 0, stkQty = 0, checkqty = 0;
try double quantityiss = 0;
{ try {
System.out.println("Enter in process ======================"); System.out.println("Enter in process ======================");
connDriver = new ConnDriver(); connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" ); conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit( false ); conn.setAutoCommit(false);
connDriver = null; connDriver = null;
//oracleConnection = new ConnDriver().getOracleConnection("DriverITM"); // oracleConnection = new
chgUser = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" ); // ConnDriver().getOracleConnection("DriverITM");
chgTerm = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "termId" ); chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,
"loginCode");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,
"termId");
userId = chgUser; userId = chgUser;
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
invrevUpdMap = new HashMap(); invrevUpdMap = new HashMap();
invrevUpdMap1 = new HashMap(); invrevUpdMap1 = new HashMap();
ibase.webitm.ejb.dis.StockUpdate stkUpd = new ibase.webitm.ejb.dis.StockUpdate(); ibase.webitm.ejb.dis.StockUpdate stkUpd = new ibase.webitm.ejb.dis.StockUpdate();
tranId = genericUtility.getColumnValue( "tran_id", headerDom ); tranId = genericUtility.getColumnValue("tran_id", headerDom);
System.out.println("tran_id========"+tranId); System.out.println("tran_id========" + tranId);
sql="select confirmed,site_code,tran_date from inv_pack where tran_id=? "; sql = "select count(1) from inv_pack where tran_id=? ";
pstmt = conn.prepareStatement( sql ); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1, tranId);
rs=pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{ checkCount = rs.getInt(1);
confirm= rs.getString("confirmed"); }
siteCode= rs.getString("site_code"); rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ((tranId == null || tranId.trim().length() == 0 || checkCount == 0)) {
System.out.println("NOt COnfirm");
errString = "VTTRNUNDO";
errString = itmDBAccessEJB.getErrorString("", errString, "",
"", conn);
return errString;
}
sql = "select confirmed,site_code,tran_date from inv_pack where tran_id=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if (rs.next()) {
confirm = rs.getString("confirmed");
siteCode = rs.getString("site_code");
trandate = rs.getTimestamp("tran_date"); trandate = rs.getTimestamp("tran_date");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(confirm.equalsIgnoreCase("Y")) if (confirm.equalsIgnoreCase("Y")) {
{
System.out.println("Tran id is confirmed"); System.out.println("Tran id is confirmed");
sql="select line_no,item_code,loc_code,lot_no,lot_sl, quantity from inv_pack_rcp where tran_id = ?"; sql = "select line_no,item_code,loc_code,lot_no,lot_sl, quantity from inv_pack_rcp where tran_id = ?";
pstmt4 = conn.prepareStatement( sql ); pstmt4 = conn.prepareStatement(sql);
pstmt4.setString(1,tranId); pstmt4.setString(1, tranId);
rs4=pstmt4.executeQuery(); rs4 = pstmt4.executeQuery();
while (rs4.next()) while (rs4.next()) {
{ linenotemp = rs4.getString(1);
linenotemp = rs4.getString(1); itemcodetemp = rs4.getString(2);
itemcodetemp = rs4.getString(2); loccodetemp = rs4.getString(3);
loccodetemp = rs4.getString(3); lotnotemp = rs4.getString(4);
lotnotemp = rs4.getString(4); lotsltemp = rs4.getString(5);
lotsltemp = rs4.getString(5); quantitytemp = rs4.getDouble(6);
quantitytemp=rs4.getDouble(6); System.out.println("QUANTITY IS " + quantitytemp);
System.out.println("QUANTITY IS "+quantitytemp); sql = "select alloc_qty,quantity from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
sql="select alloc_qty,quantity from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?"; pstmt5 = conn.prepareStatement(sql);
pstmt5 = conn.prepareStatement( sql ); pstmt5.setString(1, siteCode);
pstmt5.setString(1,siteCode); pstmt5.setString(2, itemcodetemp);
pstmt5.setString(2,itemcodetemp); pstmt5.setString(3, loccodetemp);
pstmt5.setString(3,loccodetemp); pstmt5.setString(4, lotnotemp);
pstmt5.setString(4,lotnotemp); pstmt5.setString(5, lotsltemp);
pstmt5.setString(5,lotsltemp); rs5 = pstmt5.executeQuery();
rs5=pstmt5.executeQuery(); if (rs5.next()) {
if (rs5.next()) alocqty = rs5.getDouble(1);
{ stkQty = rs5.getDouble(2);
alocqty=rs5.getDouble(1); System.out.println("ALLOC QTY is" + alocqty);
stkQty=rs5.getDouble(2); System.out.println("STOCK QTY is" + stkQty);
System.out.println("ALLOC QTY is" + alocqty);
System.out.println("STOCK QTY is" + stkQty); }
rs5.close();
rs5 = null;
pstmt5.close();
pstmt5 = null;
checkqty = stkQty - alocqty;
sql = "select sum(a.quantity - a.alloc_qty - case when a.hold_qty is null then 0 else a.hold_qty end) from stock a, location b, invstat c w"
+ "here a.loc_code = b.loc_code and b.inv_stat = c.inv_stat and a.site_code = ? and a.item_code = ? and a.loc_code = ?"
+ " and a.lot_no = ? and a.lot_sl = ? and"
+ " c.stat_type <> 'S'";
pstmt5 = conn.prepareStatement(sql);
pstmt5.setString(1, siteCode);
pstmt5.setString(2, itemcodetemp);
pstmt5.setString(3, loccodetemp);
pstmt5.setString(4, lotnotemp);
pstmt5.setString(5, lotsltemp);
rs5 = pstmt5.executeQuery();
if (rs5.next()) {
sumqty = rs5.getDouble(1);
System.out.println("SUMQTY is" + sumqty);
}
rs5.close();
rs5 = null;
pstmt5.close();
pstmt5 = null;
System.out.println("QTy1" + quantitytemp + "QTY2"
+ checkqty);
if (sumqty >= quantitytemp && quantitytemp == checkqty) {
System.out.println("Not issue");
} else {
System.out.println("NOt confirm");
errString = "VTINVUNDO";
errString = itmDBAccessEJB.getErrorString("",
errString, "", "", conn);
return errString;
}
}
rs4.close();
rs4 = null;
pstmt4.close();
pstmt4 = null;
} quarantineLock = distCommon.getDisparams("999999",
rs5.close(); "QUARNTINE_LOCKCODE", conn);
rs5 = null; System.out.println("quarantineLock:::::" + quarantineLock);
pstmt5.close(); sql = "select line_no,item_code,loc_code,lot_no,lot_sl,quantity from inv_pack_iss where tran_id = ?";
pstmt5 = null; pstmt1 = conn.prepareStatement(sql);
checkqty = stkQty - alocqty; pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
sql = "select sum(a.quantity - a.alloc_qty - case when a.hold_qty is null then 0 else a.hold_qty end) from stock a, location b, invstat c w" + while (rs1.next()) {
"here a.loc_code = b.loc_code and b.inv_stat = c.inv_stat and a.site_code = ? and a.item_code = ? and a.loc_code = ?" +
" and a.lot_no = ? and a.lot_sl = ? and" +
" c.stat_type <> 'S'";
pstmt5 = conn.prepareStatement( sql );
pstmt5.setString(1,siteCode);
pstmt5.setString(2,itemcodetemp);
pstmt5.setString(3,loccodetemp);
pstmt5.setString(4,lotnotemp);
pstmt5.setString(5,lotsltemp);
rs5=pstmt5.executeQuery();
if (rs5.next())
{
sumqty=rs5.getDouble(1);
System.out.println("SUMQTY is" + sumqty );
} lineno = rs1.getString("line_no");
rs5.close(); itemcode = rs1.getString("item_code");
rs5 = null; loccode = rs1.getString("loc_code");
pstmt5.close(); lotno = rs1.getString("lot_no");
pstmt5 = null; lotsl = rs1.getString("lot_sl");
quantityiss = rs1.getDouble("quantity");
System.out.println("QTy1" +quantitytemp+"QTY2"+checkqty ); System.out.println("Line_no is" + linenorcp);
if(sumqty >= quantitytemp && quantitytemp == checkqty) System.out.println("Item code is" + itemcode);
{ System.out.println("Location code is" + loccode);
System.out.println("Not issue"); System.out.println("Lot no is" + lotno);
} System.out.println("Lot sl is" + lotsl);
else System.out.println("@@@@@@@@@Quantity @@@@@@@@@ "
{ + quantityiss);
System.out.println("NOt confirm");
errString = "VTINVUNDO"; sql = "select order_no,line_no__ord,unit, "
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn); + "pack_code,pack_instr, "
return errString; + " gross_weight, tare_weight,net_weight,loc_code__excess_short, nvl(excess_short_qty,0),no_art "
} + "from inv_pack_iss where tran_id = ? and line_no=? and item_code=? and loc_code=? and lot_no=? and lot_sl = ? and quantity =?";
} pstmt = conn.prepareStatement(sql);
rs4.close(); pstmt.setString(1, tranId);
rs4 = null; pstmt.setString(2, lineno);
pstmt4.close(); pstmt.setString(3, itemcode);
pstmt4 = null; pstmt.setString(4, loccode);
pstmt.setString(5, lotno);
quarantineLock = distCommon.getDisparams("999999", "QUARNTINE_LOCKCODE", conn); pstmt.setString(6, lotsl);
System.out.println("quarantineLock:::::" + quarantineLock); pstmt.setDouble(7, quantityiss);
sql="select line_no,item_code,loc_code,lot_no,lot_sl from inv_pack_iss where tran_id = ?"; rs = pstmt.executeQuery();
pstmt1 = conn.prepareStatement( sql ); if (rs.next()) {
pstmt1.setString(1,tranId); // lineno = rs.getString(1);
rs1=pstmt1.executeQuery(); orderno = rs.getString(1);
while(rs1.next()) linenoord = rs.getString(2);
{ // itemcode = rs.getString(4);
lineno = rs1.getString("line_no"); unit = rs.getString(3);
itemcode = rs1.getString("item_code"); // loccode = rs.getString(6);
loccode = rs1.getString("loc_code"); packcode = rs.getString(4);
lotno = rs1.getString("lot_no"); packinstr = rs.getString(5);
lotsl = rs1.getString("lot_sl"); // lotno = rs.getString(9);
System.out.println("Line_no is" +linenorcp); // lotsl = rs.getString(10);
System.out.println("Item code is" +itemcode); grossweight = rs.getDouble(6);
System.out.println("Location code is" +loccode); tareweight = rs.getDouble(7);
System.out.println("Lot no is" +lotno); netweight = rs.getDouble(8);
System.out.println("Lot sl is" +lotsl); loccodeexcessshort = rs.getString(9);
exshtqty = rs.getDouble(10);
sql= "select order_no,line_no__ord,unit, " + noart = rs.getInt(11);
"pack_code,pack_instr, " + // quantity=rs.getDouble(12);
" gross_weight, tare_weight,net_weight,loc_code__excess_short, nvl(excess_short_qty,0),no_art" +
",quantity " + System.out.println("Exchange Quantity is: " + exshtqty);
"from inv_pack_iss where tran_id = ? and line_no=? and item_code=? and loc_code=? and lot_no=? and lot_sl = ?"; sql = "select site_code__mfg,mfg_date,exp_date,retest_date,potency_perc, rate,gross_rate,"
pstmt = conn.prepareStatement( sql ); + " unit__alt, conv__qty_stduom, acct_code__inv, cctr_code__inv, grade , hold_qty"
pstmt.setString(1,tranId); + ",BATCH_SIZE,last_phyc_date "
pstmt.setString(2,lineno); + "from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt.setString(3,itemcode); pstmt2 = conn.prepareStatement(sql);
pstmt.setString(4,loccode); pstmt2.setString(1, siteCode);
pstmt.setString(5,lotno); pstmt2.setString(2, itemcode);
pstmt.setString(6,lotsl); pstmt2.setString(3, loccode);
rs=pstmt.executeQuery(); pstmt2.setString(4, lotno);
if (rs.next()) pstmt2.setString(5, lotsl);
{ rs2 = pstmt2.executeQuery();
// lineno = rs.getString(1); if (rs2.next()) {
orderno = rs.getString(1); sitecodemfg = rs2.getString("site_code__mfg");
linenoord = rs.getString(2); mfgDate = rs2.getTimestamp("mfg_date");
// itemcode = rs.getString(4); expDate = rs2.getTimestamp("exp_date");
unit=rs.getString(3); retestdate = rs2.getTimestamp("retest_date");
// loccode = rs.getString(6); potencyperc = rs2.getDouble("potency_perc");
packcode=rs.getString(4); rate = rs2.getDouble("rate");
packinstr=rs.getString(5); grossrate = rs2.getDouble("gross_rate");
// lotno = rs.getString(9); unitalt = rs2.getString("unit__alt");
// lotsl = rs.getString(10); convqtystduom = rs2.getDouble("conv__qty_stduom");
grossweight=rs.getDouble(6); acctcodeinv = rs2.getString("acct_code__inv");
tareweight=rs.getDouble(7); cctrcodeinv = rs2.getString("cctr_code__inv");
netweight=rs.getDouble(8); grade = rs2.getString("grade");
loccodeexcessshort=rs.getString(9); holdqty = rs2.getDouble("hold_qty");
exshtqty=rs.getDouble(10); batchsize = rs2.getDouble("BATCH_SIZE");
noart=rs.getInt(11); lastphycdate = rs2.getTimestamp("last_phyc_date");
quantity=rs.getDouble(12); }
rs2.close();
System.out.println("Exchange Quantity is: " + exshtqty); rs2 = null;
sql="select site_code__mfg,mfg_date,exp_date,retest_date,potency_perc, rate,gross_rate," + pstmt2.close();
" unit__alt, conv__qty_stduom, acct_code__inv, cctr_code__inv, grade , hold_qty" + pstmt2 = null;
",BATCH_SIZE,last_phyc_date " +
"from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?"; invrevUpdMap.put("acct_code__inv", acctcodeinv);
pstmt2 = conn.prepareStatement( sql ); invrevUpdMap.put("cctr_code__inv", cctrcodeinv);
pstmt2.setString(1,siteCode); invrevUpdMap.put("grade", grade);
pstmt2.setString(2,itemcode); invrevUpdMap.put("tran_date", trandate);
pstmt2.setString(3,loccode); invrevUpdMap.put("tran_id", tranId);
pstmt2.setString(4,lotno); invrevUpdMap.put("tran_ser", "I-PKR");
pstmt2.setString(5,lotsl); invrevUpdMap.put("sorder_no", orderno);
rs2=pstmt2.executeQuery(); invrevUpdMap.put("item_code", itemcode);
if (rs2.next()) invrevUpdMap.put("site_code", siteCode);
{ invrevUpdMap.put("loc_code", loccode);
sitecodemfg = rs2.getString("site_code__mfg"); invrevUpdMap.put("unit", unit);
mfgDate = rs2.getTimestamp("mfg_date"); invrevUpdMap.put("lot_no", lotno);
expDate = rs2.getTimestamp("exp_date"); invrevUpdMap.put("lot_sl", lotsl);
retestdate = rs2.getTimestamp("retest_date"); System.out.println("QUANTITY IN MAP ######### "
potencyperc=rs2.getDouble("potency_perc"); + quantityiss);
rate=rs2.getDouble("rate"); invrevUpdMap.put("quantity", quantityiss);
grossrate=rs2.getDouble("gross_rate"); System.out.println("QTY STDUOM");
unitalt = rs2.getString("unit__alt"); invrevUpdMap.put("qty_stduom", quantityiss);
convqtystduom=rs2.getDouble("conv__qty_stduom"); invrevUpdMap.put("rate", rate);
acctcodeinv = rs2.getString("acct_code__inv"); invrevUpdMap.put("gross_rate", grossrate);
cctrcodeinv = rs2.getString("cctr_code__inv"); invrevUpdMap.put("tran_type", "R");
grade = rs2.getString("grade"); invrevUpdMap.put("pack_code", packcode);
holdqty=rs2.getDouble("hold_qty"); invrevUpdMap.put("gross_weight", grossweight);
batchsize= rs2.getDouble("BATCH_SIZE"); invrevUpdMap.put("tare_weight", tareweight);
lastphycdate = rs2.getTimestamp("last_phyc_date"); invrevUpdMap.put("net_weight", netweight);
} invrevUpdMap.put("pack_instr", packinstr);
rs2.close(); invrevUpdMap.put("mfg_date", mfgDate);
rs2 = null; invrevUpdMap.put("exp_date", expDate);
pstmt2.close(); invrevUpdMap.put("retest_date", retestdate);
pstmt2 = null; invrevUpdMap.put("unit__alt", unitalt);
invrevUpdMap.put("acct_code__inv",acctcodeinv); invrevUpdMap.put("conv__qty_stduom", convqtystduom);
invrevUpdMap.put("cctr_code__inv",cctrcodeinv); invrevUpdMap.put("no_art", noart);
invrevUpdMap.put("grade",grade); invrevUpdMap.put("BATCH_SIZE", batchsizercpstk);
invrevUpdMap.put("tran_date",trandate); invrevUpdMap.put("last_phyc_date", lastphycdate);
invrevUpdMap.put("tran_id",tranId); errString = stkUpd.updateStock(invrevUpdMap,
invrevUpdMap.put("tran_ser","I-PKR"); xtraParams, conn);
invrevUpdMap.put("sorder_no",orderno); System.out.println(":: ErrorString" + errString);
invrevUpdMap.put("item_code",itemcode); if (errString != null && errString.trim().length() > 0) {
invrevUpdMap.put("site_code",siteCode); System.out.println("Returning Result " + errString);
invrevUpdMap.put("loc_code",loccode);
invrevUpdMap.put("unit",unit);
invrevUpdMap.put("lot_no",lotno);
invrevUpdMap.put("lot_sl",lotsl);
invrevUpdMap.put("quantity",quantity);
invrevUpdMap.put("rate",rate);
invrevUpdMap.put("gross_rate",grossrate);
invrevUpdMap.put("tran_type","R");
invrevUpdMap.put("pack_code",packcode);
invrevUpdMap.put("gross_weight",grossweight);
invrevUpdMap.put("tare_weight",tareweight);
invrevUpdMap.put("net_weight",netweight);
invrevUpdMap.put("pack_instr",packinstr);
invrevUpdMap.put("mfg_date",mfgDate);
invrevUpdMap.put("exp_date",expDate);
invrevUpdMap.put("retest_date",retestdate);
invrevUpdMap.put("unit__alt",unitalt);
invrevUpdMap.put("conv__qty_stduom",convqtystduom);
invrevUpdMap.put("no_art",noart);
invrevUpdMap.put("BATCH_SIZE",batchsizercpstk);
invrevUpdMap.put("last_phyc_date",lastphycdate);
errString = stkUpd.updateStock(invrevUpdMap,xtraParams,conn);
System.out.println(":: ErrorString" + errString);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
return errString; return errString;
} }
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
/*
* } rs4.close(); rs4 = null; pstmt4.close(); pstmt4 = null;
*/
} errString = " ";
rs.close(); System.out.println("IN RCp");
rs = null; sql = "select line_no,item_code,loc_code,lot_no,lot_sl from inv_pack_rcp where tran_id = ?";
pstmt.close(); pstmt = conn.prepareStatement(sql);
pstmt = null; pstmt.setString(1, tranId);
} rs = pstmt.executeQuery();
rs1.close(); while (rs.next()) {
rs1 = null; linenorcp = rs.getString("line_no");
pstmt1.close(); itemcodercp = rs.getString("item_code");
pstmt1 = null; loccodercp = rs.getString("loc_code");
/*} lotnorcp = rs.getString("lot_no");
rs4.close(); lotslrcp = rs.getString("lot_sl");
rs4 = null; System.out.println("Line_no is" + linenorcp);
pstmt4.close(); System.out.println("Item code is" + itemcodercp);
pstmt4 = null;*/ System.out.println("Location code is" + loccodercp);
System.out.println("Lot no is" + lotnorcp);
System.out.println("Lot sl is" + lotslrcp);
errString=" "; sql = "select order_no,line_no__ord, quantity,unit, "
System.out.println("IN RCp"); + "pack_code,pack_instr, "
sql="select line_no,item_code,loc_code,lot_no,lot_sl from inv_pack_rcp where tran_id = ?"; + "gross_weight, tare_weight,net_weight,dimension,no_art,mfg_date, exp_date,"
pstmt = conn.prepareStatement( sql ); + "pallet_wt "
pstmt.setString(1,tranId); + "from inv_pack_rcp where tran_id = ? and line_no=? and item_code=? and loc_code=? and lot_no=? and lot_sl = ?";
rs=pstmt.executeQuery(); pstmt1 = conn.prepareStatement(sql);
while(rs.next()) pstmt1.setString(1, tranId);
{ pstmt1.setString(2, linenorcp);
linenorcp = rs.getString("line_no"); pstmt1.setString(3, itemcodercp);
itemcodercp = rs.getString("item_code"); pstmt1.setString(4, loccodercp);
loccodercp = rs.getString("loc_code"); pstmt1.setString(5, lotnorcp);
lotnorcp = rs.getString("lot_no"); pstmt1.setString(6, lotslrcp);
lotslrcp = rs.getString("lot_sl"); rs1 = pstmt1.executeQuery();
System.out.println("Line_no is" +linenorcp); if (rs1.next()) {
System.out.println("Item code is" +itemcodercp); ordernorcp = rs1.getString("order_no");
System.out.println("Location code is" +loccodercp); linenoordrcp = rs1.getString("line_no__ord");
System.out.println("Lot no is" +lotnorcp); quantityrcp = rs1.getDouble("quantity");
System.out.println("Lot sl is" +lotslrcp); unitrcp = rs1.getString("unit");
packcodercp = rs1.getString("pack_code");
sql="select order_no,line_no__ord, quantity,unit, " + packinstrrcp = rs1.getString("pack_instr");
"pack_code,pack_instr, " + grossweightrcp = rs1.getDouble("tare_weight");
"gross_weight, tare_weight,net_weight,dimension,no_art,mfg_date, exp_date,"+ netweightrcp = rs1.getDouble("net_weight");
"pallet_wt " + dimensionrcp = rs1.getString("dimension");
"from inv_pack_rcp where tran_id = ? and line_no=? and item_code=? and loc_code=? and lot_no=? and lot_sl = ?"; noartrcp = rs1.getInt("no_art");
pstmt1 = conn.prepareStatement( sql ); mfgDatercp = rs1.getTimestamp("mfg_date");
pstmt1.setString(1,tranId); expDatercp = rs1.getTimestamp("exp_date");
pstmt1.setString(2,linenorcp); palletwt = rs1.getDouble("pallet_wt");
pstmt1.setString(3,itemcodercp); if (mfgDatercp == null) {
pstmt1.setString(4,loccodercp); sql = "SELECT mfg_date FROM stock WHERE site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt1.setString(5,lotnorcp); pstmt2 = conn.prepareStatement(sql);
pstmt1.setString(6,lotslrcp); pstmt2.setString(1, siteCode);
rs1=pstmt1.executeQuery(); pstmt2.setString(2, itemcodercp);
if (rs1.next()) pstmt2.setString(3, loccodercp);
{ pstmt2.setString(4, lotnorcp);
ordernorcp = rs1.getString("order_no"); pstmt2.setString(5, lotslrcp);
linenoordrcp = rs1.getString("line_no__ord"); rs2 = pstmt2.executeQuery();
quantityrcp = rs1.getDouble("quantity"); if (rs2.next()) {
unitrcp=rs1.getString("unit"); mfgDatercp = rs2.getTimestamp("mfg_date");
packcodercp =rs1.getString("pack_code"); }
packinstrrcp =rs1.getString("pack_instr"); rs2.close();
grossweightrcp =rs1.getDouble("tare_weight"); rs2 = null;
netweightrcp= rs1.getDouble("net_weight"); pstmt2.close();
dimensionrcp= rs1.getString("dimension"); pstmt2 = null;
noartrcp=rs1.getInt("no_art");
mfgDatercp = rs1.getTimestamp("mfg_date");
expDatercp = rs1.getTimestamp("exp_date");
palletwt= rs1.getDouble("pallet_wt");
if (mfgDatercp== null)
{
sql = "SELECT mfg_date FROM stock WHERE site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt2 = conn.prepareStatement( sql );
pstmt2.setString(1,siteCode);
pstmt2.setString(2,itemcodercp);
pstmt2.setString(3,loccodercp);
pstmt2.setString(4,lotnorcp);
pstmt2.setString(5,lotslrcp);
rs2= pstmt2.executeQuery();
if( rs2.next() )
{
mfgDatercp = rs2.getTimestamp("mfg_date");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
}
if (expDatercp== null)
{
sql = "SELECT exp_date FROM stock WHERE site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt2 = conn.prepareStatement( sql );
pstmt2.setString(1,siteCode);
pstmt2.setString(2,itemcodercp);
pstmt2.setString(3,loccodercp);
pstmt2.setString(4,lotnorcp);
pstmt2.setString(5,lotslrcp);
rs2 = pstmt2.executeQuery();
if( rs2.next() )
{
expDatercp = rs2.getTimestamp("exp_date");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
}
sql = "select site_code__mfg ,retest_date,potency_perc,rate,supp_code__mfg,acct_code__inv, cctr_code__inv,rate__oh,acct_code__oh,cctr_code__oh,site_code__mfg, grade, gross_rate, unit__alt," +
" conv__qty_stduom, batch_no, ACTUAL_RATE, BATCH_SIZE from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt2 = conn.prepareStatement( sql );
pstmt2.setString(1,siteCode);
pstmt2.setString(2,itemcode);
pstmt2.setString(3,loccodercp);
pstmt2.setString(4,lotno);
pstmt2.setString(5,lotslrcp);
rs2 = pstmt2.executeQuery();
if( rs2.next() )
{
sitecodemfgrcpstk =rs2.getString("site_code__mfg");
retestdatercpstk = rs2.getTimestamp("retest_date");
potencypercrcpstk = rs2.getDouble("potency_perc");
ratercpstk =rs2.getInt("rate");
suppcodemfgrcpstk=rs2.getString("supp_code__mfg");
acctcodeinvrcpstk = rs2.getString("acct_code__inv");
cctrcodeinvstk =rs2.getString("cctr_code__inv");
rateohrcpstk =rs2.getInt("rate__oh");
acctcodeohrcpstk = rs2.getString("acct_code__oh");
cctrcodeohrcpstk = rs2.getString("cctr_code__oh");
sitecodemfgrcpstk = rs2.getString("site_code__mfg");
gradercpstk = rs2.getString("grade");
grossratercpstk =rs2.getInt("gross_rate");
unitaltrcpstk =rs2.getString("unit__alt");
convqtystduomrcpstk = rs2.getDouble("conv__qty_stduom");
batchnorcpstk = rs2.getString("batch_no");
actualratercpstk= rs2.getDouble("ACTUAL_RATE");
batchsizercpstk= rs2.getDouble("BATCH_SIZE");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
invrevUpdMap1.put("tran_date",trandate);
invrevUpdMap1.put("tran_id",tranId);
invrevUpdMap1.put("tran_ser","I-PKI");
invrevUpdMap1.put("sorder_no",orderno);
invrevUpdMap1.put("item_code",itemcodercp);
invrevUpdMap1.put("site_code",siteCode);
invrevUpdMap1.put("loc_code",loccodercp);
invrevUpdMap1.put("unit",unit);
invrevUpdMap1.put("lot_no",lotnorcp);//take in issue value
invrevUpdMap1.put("lot_sl",lotslrcp);
invrevUpdMap1.put("quantity",quantityrcp);
invrevUpdMap1.put("qty_stduom",quantityrcp);
invrevUpdMap1.put("site_code__mfg",sitecodemfgrcpstk);
invrevUpdMap1.put("mfg_date",mfgDate);
invrevUpdMap1.put("exp_date",expDate);
invrevUpdMap1.put("retest_date",retestdatercpstk);
invrevUpdMap1.put("potency_perc",potencypercrcpstk);
invrevUpdMap1.put("tran_type","I");
invrevUpdMap1.put("pack_code",packcodercp);
invrevUpdMap1.put("gross_weight",grossweightrcp);
invrevUpdMap1.put("tare_weight",tareweightrcp);
invrevUpdMap1.put("net_weight",netweightrcp);
invrevUpdMap1.put("pack_instr",packinstrrcp);
invrevUpdMap1.put("dimension",dimensionrcp);
invrevUpdMap1.put("rate",ratercpstk);
invrevUpdMap1.put("gross_rate",grossratercpstk);
invrevUpdMap1.put("grade",gradercpstk);
invrevUpdMap1.put("gross_rate",grossratercpstk);
invrevUpdMap1.put("unit__alt",unitaltrcpstk);
invrevUpdMap1.put("conv__qty_stduom",convqtystduomrcpstk);
invrevUpdMap1.put ("batch_no",batchnorcpstk);
invrevUpdMap1.put ("ACTUAL_RATE",actualratercpstk);//pallet_wt
invrevUpdMap1.put("BATCH_SIZE",batchsizercpstk);
invrevUpdMap1.put("pallet_wt",palletwt);
errString = stkUpd.updateStock(invrevUpdMap1,xtraParams,conn);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
}
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update inv_pack set status = 'X' "
+ " where tran_id = ? " ;
pstmtInsert = conn.prepareStatement( sql ); }
pstmtInsert.setString(1,tranId); if (expDatercp == null) {
sql = "SELECT exp_date FROM stock WHERE site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode);
pstmt2.setString(2, itemcodercp);
pstmt2.setString(3, loccodercp);
pstmt2.setString(4, lotnorcp);
pstmt2.setString(5, lotslrcp);
rs2 = pstmt2.executeQuery();
if (rs2.next()) {
expDatercp = rs2.getTimestamp("exp_date");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
}
sql = "select site_code__mfg ,retest_date,potency_perc,rate,supp_code__mfg,acct_code__inv, cctr_code__inv,rate__oh,acct_code__oh,cctr_code__oh,site_code__mfg, grade, gross_rate, unit__alt,"
+ " conv__qty_stduom, batch_no, ACTUAL_RATE, BATCH_SIZE from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode);
pstmt2.setString(2, itemcode);
pstmt2.setString(3, loccodercp);
pstmt2.setString(4, lotno);
pstmt2.setString(5, lotslrcp);
rs2 = pstmt2.executeQuery();
if (rs2.next()) {
sitecodemfgrcpstk = rs2.getString("site_code__mfg");
retestdatercpstk = rs2.getTimestamp("retest_date");
potencypercrcpstk = rs2.getDouble("potency_perc");
ratercpstk = rs2.getInt("rate");
suppcodemfgrcpstk = rs2.getString("supp_code__mfg");
acctcodeinvrcpstk = rs2.getString("acct_code__inv");
cctrcodeinvstk = rs2.getString("cctr_code__inv");
rateohrcpstk = rs2.getInt("rate__oh");
acctcodeohrcpstk = rs2.getString("acct_code__oh");
cctrcodeohrcpstk = rs2.getString("cctr_code__oh");
sitecodemfgrcpstk = rs2.getString("site_code__mfg");
gradercpstk = rs2.getString("grade");
grossratercpstk = rs2.getInt("gross_rate");
unitaltrcpstk = rs2.getString("unit__alt");
convqtystduomrcpstk = rs2
.getDouble("conv__qty_stduom");
batchnorcpstk = rs2.getString("batch_no");
actualratercpstk = rs2.getDouble("ACTUAL_RATE");
batchsizercpstk = rs2.getDouble("BATCH_SIZE");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
invrevUpdMap1.put("tran_date", trandate);
invrevUpdMap1.put("tran_id", tranId);
invrevUpdMap1.put("tran_ser", "I-PKI");
invrevUpdMap1.put("sorder_no", orderno);
invrevUpdMap1.put("item_code", itemcodercp);
invrevUpdMap1.put("site_code", siteCode);
invrevUpdMap1.put("loc_code", loccodercp);
invrevUpdMap1.put("unit", unit);
invrevUpdMap1.put("lot_no", lotnorcp);// take in issue
// value
invrevUpdMap1.put("lot_sl", lotslrcp);
invrevUpdMap1.put("quantity", quantityrcp);
invrevUpdMap1.put("qty_stduom", quantityrcp);
invrevUpdMap1.put("site_code__mfg", sitecodemfgrcpstk);
invrevUpdMap1.put("mfg_date", mfgDate);
invrevUpdMap1.put("exp_date", expDate);
invrevUpdMap1.put("retest_date", retestdatercpstk);
invrevUpdMap1.put("potency_perc", potencypercrcpstk);
invrevUpdMap1.put("tran_type", "I");
invrevUpdMap1.put("pack_code", packcodercp);
invrevUpdMap1.put("gross_weight", grossweightrcp);
invrevUpdMap1.put("tare_weight", tareweightrcp);
invrevUpdMap1.put("net_weight", netweightrcp);
invrevUpdMap1.put("pack_instr", packinstrrcp);
invrevUpdMap1.put("dimension", dimensionrcp);
invrevUpdMap1.put("rate", ratercpstk);
invrevUpdMap1.put("gross_rate", grossratercpstk);
invrevUpdMap1.put("grade", gradercpstk);
invrevUpdMap1.put("gross_rate", grossratercpstk);
invrevUpdMap1.put("unit__alt", unitaltrcpstk);
invrevUpdMap1.put("conv__qty_stduom",
convqtystduomrcpstk);
invrevUpdMap1.put("batch_no", batchnorcpstk);
invrevUpdMap1.put("ACTUAL_RATE", actualratercpstk);// pallet_wt
invrevUpdMap1.put("BATCH_SIZE", batchsizercpstk);
invrevUpdMap1.put("pallet_wt", palletwt);
errString = stkUpd.updateStock(invrevUpdMap1,
xtraParams, conn);
if (errString != null && errString.trim().length() > 0) {
System.out.println("Returning Result " + errString);
}
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update inv_pack set status = 'X' "
+ " where tran_id = ? ";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, tranId);
count = pstmtInsert.executeUpdate(); count = pstmtInsert.executeUpdate();
if(count>0) if (count > 0) {
{ System.out.println(">>>>>>>>>>>>>>>>Count from update:"
System.out.println(">>>>>>>>>>>>>>>>Count from update:"+count); + count);
updateFlag=true; updateFlag = true;
} }
pstmtInsert.close(); pstmtInsert.close();
pstmtInsert =null; pstmtInsert = null;
} } else {
else
{
System.out.println("NOt COnfirm"); System.out.println("NOt COnfirm");
errString = "VTTRANCNF"; errString = "VTTRANCNF";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn); errString = itmDBAccessEJB.getErrorString("", errString, "",
"", conn);
return errString; return errString;
} }
} } catch (SQLException ex) {
catch(SQLException ex) ex.printStackTrace();
{
ex.printStackTrace();
System.out.println("Exception in Process1 :: " + ex.getMessage()); System.out.println("Exception in Process1 :: " + ex.getMessage());
errString = itmDBAccessEJB.getErrorString("","VTSQLEXC",userId); errString = itmDBAccessEJB.getErrorString("", "VTSQLEXC", userId);
return errString; return errString;
} } catch (Exception e) {
catch(Exception e) e.printStackTrace();
{
e.printStackTrace();
System.out.println("Exception in Process2 :: " + e.getMessage()); System.out.println("Exception in Process2 :: " + e.getMessage());
errString = itmDBAccessEJB.getErrorString("","VTPRCERR",userId); errString = itmDBAccessEJB.getErrorString("", "VTPRCERR", userId);
return errString; return errString;
} } finally {
finally try {
{ if (errString == null || errString.trim().length() == 0) {
try
{
if( errString == null || errString.trim().length() == 0)
{
conn.commit(); conn.commit();
System.out.println("Transaction Commit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); System.out
errString = itmDBAccessEJB.getErrorString( "", "VTCOMPL", userId ); .println("Transaction Commit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
} errString = itmDBAccessEJB.getErrorString("", "VTCOMPL",
else if(errString!=null && errString.trim().length()>0 && result==true && updateFlag==true) userId);
{ } else if (errString != null && errString.trim().length() > 0
System.out.println(">>>>>>>>>>>>>>>>>>>>If result is true ,commit"); && result == true && updateFlag == true) {
System.out
.println(">>>>>>>>>>>>>>>>>>>>If result is true ,commit");
conn.commit(); conn.commit();
} } else {
else
{
conn.rollback(); conn.rollback();
System.out.println("Transaction RollBack!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); System.out
} .println("Transaction RollBack!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
if(conn != null)
{ if (conn != null) {
conn.close(); conn.close();
conn = null; conn = null;
} }
} } catch (Exception e) {
catch(Exception e) System.out.println("Error In closing connection::==> " + e);
{
System.out.println("Error In closing connection::==> "+e);
e.printStackTrace(); e.printStackTrace();
} }
} }
return errString;
return errString;
} }
} }
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