Commit a3e2ae03 authored by srajendra's avatar srajendra

CHANGES for tran datr


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91090 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bad86ef3
...@@ -8,6 +8,7 @@ import ibase.webitm.utility.GenericUtility; ...@@ -8,6 +8,7 @@ import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.TransIDGenerator; import ibase.webitm.utility.TransIDGenerator;
import java.util.HashMap; import java.util.HashMap;
import java.io.*; import java.io.*;
import java.text.SimpleDateFormat;
public class InvAllocTraceBean public class InvAllocTraceBean
{ {
...@@ -76,11 +77,13 @@ public class InvAllocTraceBean ...@@ -76,11 +77,13 @@ public class InvAllocTraceBean
System.out.println("keyCol :"+ keyCol); System.out.println("keyCol :"+ keyCol);
System.out.println("tranSer1 :"+ tranSer1); System.out.println("tranSer1 :"+ tranSer1);
String xmlValues = ""; String xmlValues = "";
String tranDateStr = getCurrdateAppFormat(); //added by rajendra on 17/04/09 for tran date
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>"; xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>"; xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>"; xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>"; xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>"; xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<tran_date>" + tranDateStr + "</tran_date>"; //added by rajendra on 17/04/09
xmlValues = xmlValues +"</Detail1></Root>"; xmlValues = xmlValues +"</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]"); System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME); TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME);
...@@ -237,9 +240,9 @@ public class InvAllocTraceBean ...@@ -237,9 +240,9 @@ public class InvAllocTraceBean
writeException(e); writeException(e);
return errString; return errString;
} }
return errString; //return errString;
} }
return errString;
} }
private void writeException(Exception e) throws Exception private void writeException(Exception e) throws Exception
{ {
...@@ -251,4 +254,25 @@ public class InvAllocTraceBean ...@@ -251,4 +254,25 @@ public class InvAllocTraceBean
} }
catch(Exception t){throw t;} catch(Exception t){throw t;}
} }
private String getCurrdateAppFormat()
{
String s = "";
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
java.util.Date date = null;
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
System.out.println(genericUtility.getDBDateFormat());
SimpleDateFormat simpledateformat = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = simpledateformat.parse(timestamp.toString());
timestamp = Timestamp.valueOf(simpledateformat.format(date).toString() + " 00:00:00.0");
s = (new SimpleDateFormat(genericUtility.getApplDateFormat())).format(timestamp).toString();
}
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
}
return s;
}
} }
\ 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