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 ...@@ -15,14 +15,18 @@ public class InvAllocTraceBean
FileWriter f = null; FileWriter f = null;
public String updateInvallocTrace(HashMap invallocTraceMap, Connection conn) throws ITMException,Exception public String updateInvallocTrace(HashMap invallocTraceMap, Connection conn) throws ITMException,Exception
{ {
String fileDest = "";
try 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) catch(Exception e)
{ {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
writeException(e); writeException(e, fileDest );
} }
String errString = ""; String errString = "";
String errCode = "" ; String errCode = "" ;
...@@ -47,6 +51,17 @@ public class InvAllocTraceBean ...@@ -47,6 +51,17 @@ public class InvAllocTraceBean
if(lotSl == null) if(lotSl == null)
lotSl = " "; 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 chgDate = new java.sql.Date(System.currentTimeMillis());
java.sql.Date tranDate = new java.sql.Date(System.currentTimeMillis()); java.sql.Date tranDate = new java.sql.Date(System.currentTimeMillis());
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
...@@ -190,7 +205,7 @@ public class InvAllocTraceBean ...@@ -190,7 +205,7 @@ public class InvAllocTraceBean
{ {
f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n"); f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");
try{conn.rollback();}catch(Exception ee2){} try{conn.rollback();}catch(Exception ee2){}
writeException(e); writeException(e, fileDest);
System.out.println("SQLException :updateInvallocTrace : " + sqlUpdate + "\n" +e.getMessage()); System.out.println("SQLException :updateInvallocTrace : " + sqlUpdate + "\n" +e.getMessage());
System.out.println("ALLOC_QTY : " + allocQty); System.out.println("ALLOC_QTY : " + allocQty);
System.out.println("ITEM_CODE : " + itemCode); System.out.println("ITEM_CODE : " + itemCode);
...@@ -206,7 +221,7 @@ public class InvAllocTraceBean ...@@ -206,7 +221,7 @@ public class InvAllocTraceBean
} }
catch(Exception e) catch(Exception e)
{ {
writeException(e); writeException(e, fileDest);
System.out.println("Exception :updateInvallocTrace :" + sqlUpdate + "\n" +e.getMessage()); System.out.println("Exception :updateInvallocTrace :" + sqlUpdate + "\n" +e.getMessage());
errString = e.getMessage(); errString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
...@@ -218,7 +233,7 @@ public class InvAllocTraceBean ...@@ -218,7 +233,7 @@ public class InvAllocTraceBean
} }
catch(Exception e1) catch(Exception e1)
{ {
writeException(e1); writeException(e, fileDest);
errString = e1.getMessage(); errString = e1.getMessage();
e = e1; e = e1;
} }
...@@ -251,19 +266,20 @@ public class InvAllocTraceBean ...@@ -251,19 +266,20 @@ public class InvAllocTraceBean
try{conn.rollback();f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");}catch(Exception ee2){} try{conn.rollback();f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");}catch(Exception ee2){}
errString = e.getMessage(); errString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
writeException(e); writeException(e, fileDest);
return errString; return errString;
} }
//return errString; //return errString;
} }
return errString; return errString;
} }
private void writeException(Exception e) throws Exception private void writeException(Exception e, String fileDest) throws Exception
{ {
try try
{ {
f.write(e.getMessage() + "\r\n"); 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); e.printStackTrace(t);
} }
catch(Exception t){throw t;} catch(Exception t){throw t;}
......
...@@ -208,6 +208,9 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -208,6 +208,9 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
tranIdHold = rsDetail.getString("TRAN_ID__HOLD"); tranIdHold = rsDetail.getString("TRAN_ID__HOLD");
lineNoHold = rsDetail.getInt("LINE_NO__HOLD"); lineNoHold = rsDetail.getInt("LINE_NO__HOLD");
lockCode = rsDetail.getString("LOCK_CODE"); 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.setString( 1,tranIdHold );
pHoldDet.setInt( 2,lineNoHold ); pHoldDet.setInt( 2,lineNoHold );
...@@ -270,7 +273,7 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -270,7 +273,7 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
rsSelTrace = null; rsSelTrace = null;
} }
balQtyHold = holdQtyTrace - ( relQtyTrace + qtyPerArt ); balQtyHold = holdQtyTrace - ( Math.abs(relQtyTrace) + qtyPerArt );
if( balQtyHold == 0 ) if( balQtyHold == 0 )
{ {
...@@ -400,7 +403,8 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -400,7 +403,8 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
holdQtyStock = rsStock.getDouble("HOLD_QTY"); holdQtyStock = rsStock.getDouble("HOLD_QTY");
stockQty = rsStock.getDouble("QUANTITY"); 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 //Selecting sum(hold_qty) and sum(rel_qty) from trace table
pSelTrace.setString( 1, itemCode ); pSelTrace.setString( 1, itemCode );
...@@ -420,7 +424,12 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -420,7 +424,12 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
rsSelTrace = null; rsSelTrace = null;
//qtyToHold = totalHoldTrace - (totalRelTrace + relQtyTrace) ; //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 ) 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