Commit 1bfd633a authored by gahmad's avatar gahmad

changes made at sun


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91563 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4b32df34
......@@ -15,14 +15,18 @@ public class InvAllocTraceBean
FileWriter f = null;
public String updateInvallocTrace(HashMap invallocTraceMap, Connection conn) throws ITMException,Exception
{
String fileDest = "";
try
{
f = new FileWriter("invalloc.log", true);
//changes by gulzar on 12/12/2011 to write the log file in jboss log location
//f = new FileWriter("invalloc.log", true);
fileDest = CommonConstants.JBOSSHOME + File.separator + "server" + File.separator + "default" + File.separator + "log" + File.separator + "invalloc.log";
f = new FileWriter( fileDest, true);
}
catch(Exception e)
{
System.out.println(e.getMessage());
writeException(e);
writeException(e, fileDest );
}
String errString = "";
String errCode = "" ;
......@@ -47,6 +51,17 @@ public class InvAllocTraceBean
if(lotSl == null)
lotSl = " ";
//Changed by gulzar on 12/12/2011
if ( chgUser == null || chgUser.trim().length() == 0 )
{
chgUser = "SYSTEM";
}
if ( chgTerm == null || chgTerm.trim().length() == 0 )
{
chgTerm = "SYSTEM";
}
//End changes by gulzar on 12/12/2011
java.sql.Date chgDate = new java.sql.Date(System.currentTimeMillis());
java.sql.Date tranDate = new java.sql.Date(System.currentTimeMillis());
PreparedStatement pstmt = null ;
......@@ -190,7 +205,7 @@ public class InvAllocTraceBean
{
f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");
try{conn.rollback();}catch(Exception ee2){}
writeException(e);
writeException(e, fileDest);
System.out.println("SQLException :updateInvallocTrace : " + sqlUpdate + "\n" +e.getMessage());
System.out.println("ALLOC_QTY : " + allocQty);
System.out.println("ITEM_CODE : " + itemCode);
......@@ -206,7 +221,7 @@ public class InvAllocTraceBean
}
catch(Exception e)
{
writeException(e);
writeException(e, fileDest);
System.out.println("Exception :updateInvallocTrace :" + sqlUpdate + "\n" +e.getMessage());
errString = e.getMessage();
e.printStackTrace();
......@@ -218,7 +233,7 @@ public class InvAllocTraceBean
}
catch(Exception e1)
{
writeException(e1);
writeException(e, fileDest);
errString = e1.getMessage();
e = e1;
}
......@@ -251,19 +266,20 @@ public class InvAllocTraceBean
try{conn.rollback();f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");}catch(Exception ee2){}
errString = e.getMessage();
e.printStackTrace();
writeException(e);
writeException(e, fileDest);
return errString;
}
//return errString;
}
return errString;
}
private void writeException(Exception e) throws Exception
private void writeException(Exception e, String fileDest) throws Exception
{
try
{
f.write(e.getMessage() + "\r\n");
PrintStream t = new PrintStream(new FileOutputStream(new File("C:\\invalloc.log"),true));
//PrintStream t = new PrintStream(new FileOutputStream(new File("C:\\invalloc.log"),true));
PrintStream t = new PrintStream(new FileOutputStream(new File(fileDest),true));
e.printStackTrace(t);
}
catch(Exception t){throw t;}
......
......@@ -208,6 +208,9 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
tranIdHold = rsDetail.getString("TRAN_ID__HOLD");
lineNoHold = rsDetail.getInt("LINE_NO__HOLD");
lockCode = rsDetail.getString("LOCK_CODE");
System.out.println("tranIdHold =[" + tranIdHold + "]");
System.out.println("lineNoHold =[" + lineNoHold + "]");
System.out.println("lockCode =[" + lockCode + "]");
pHoldDet.setString( 1,tranIdHold );
pHoldDet.setInt( 2,lineNoHold );
......@@ -270,7 +273,7 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
rsSelTrace = null;
}
balQtyHold = holdQtyTrace - ( relQtyTrace + qtyPerArt );
balQtyHold = holdQtyTrace - ( Math.abs(relQtyTrace) + qtyPerArt );
if( balQtyHold == 0 )
{
......@@ -400,7 +403,8 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
holdQtyStock = rsStock.getDouble("HOLD_QTY");
stockQty = rsStock.getDouble("QUANTITY");
System.out.println("Quantity :" + stockQty);
System.out.println("Quantity =[" + stockQty + "]");
System.out.println("holdQtyStock =[" + holdQtyStock + "]");
//Selecting sum(hold_qty) and sum(rel_qty) from trace table
pSelTrace.setString( 1, itemCode );
......@@ -420,7 +424,12 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
rsSelTrace = null;
//qtyToHold = totalHoldTrace - (totalRelTrace + relQtyTrace) ;
balQtyHold = holdQtyTrace - ( relQtyTrace + holdQtyStock ) ;
System.out.println("holdQtyTrace =[" + holdQtyTrace + "]");
System.out.println("relQtyTrace =[" + relQtyTrace + "]");
balQtyHold = holdQtyTrace - ( Math.abs(relQtyTrace) + holdQtyStock ) ;
System.out.println("balQtyHold =[" + balQtyHold + "]");
if( balQtyHold == 0 )
{
......
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