Commit 1d9c4c77 authored by manohar's avatar manohar

tran_is generation support for site and period prefix added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91753 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c412fb86
......@@ -29,6 +29,7 @@ import org.w3c.dom.*;
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 = "";
......@@ -93,7 +94,7 @@ public class InvHoldGen
chgTerm = "SYSTEM";
}
//End changes by gulzar - 26/11/11
tranId = generateTranId( "w_inv_hold", conn );
tranId = generateTranId( "w_inv_hold", siteCode, conn );
pstmtHold.setString( 1, tranId );
pstmtHold.setTimestamp( 2, java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0"));
......@@ -234,7 +235,7 @@ public class InvHoldGen
return retString;
}
private String generateTranId( String windowName, Connection conn )throws ITMException
private String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -246,11 +247,17 @@ public class InvHoldGen
String xmlValues = "";
String paySiteCode = "";
String effectiveDate = "";
java.sql.Timestamp currDate = null;
java.sql.Date effDate = null;
try
{
SimpleDateFormat sdfAppl = new SimpleDateFormat(genericUtility.getApplDateFormat());
currDate = new java.sql.Timestamp(System.currentTimeMillis());
String currDateStr = sdfAppl.format(currDate);
selSql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
//System.out.println("selSql :"+selSql);
pstmt = conn.prepareStatement(selSql);
......@@ -271,7 +278,10 @@ public class InvHoldGen
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<tran_date>" + currDateStr + "</tran_date>";
xmlValues = xmlValues + "</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", CommonConstants.DB_NAME);
......
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