Commit c5c055b4 authored by apal's avatar apal

Client name:Pitambari

We need table structure for following outbound master and transaction as mentioned in the scope document :
1. Item Master
2. Customer Master
3. Scheme Master
4. Price-list Master
5. Invoice
6. Sales return

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@172688 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 43a2176e
...@@ -77,7 +77,9 @@ public class CreateRCPXML ...@@ -77,7 +77,9 @@ public class CreateRCPXML
winSqls[ formIdx ] = sql; winSqls[ formIdx ] = sql;
} }
return prepareXML( winSqls, conn ); //return prepareXML( winSqls, conn );
//Changed by Arun p 31-10-17 for Passing dbID as attribute in deatil tag for edi outbond data
return prepareXML( winSqls, conn, tranId );
} }
private String getFormSQL( String formNo ) throws Exception private String getFormSQL( String formNo ) throws Exception
...@@ -168,5 +170,82 @@ public class CreateRCPXML ...@@ -168,5 +170,82 @@ public class CreateRCPXML
return tranXmlBuff.toString(); return tranXmlBuff.toString();
} }
//Added by Arun p 31-10-17 for Passing dbID as attribute in deatil tag for edi outbond data -Start
} private String prepareXML( String []formSQLs, Connection conn , String tranId) throws Exception
{
System.out.println("tranId in prepareXML:["+tranId+"]");
StringBuffer tranXmlBuff = new StringBuffer( " <DocumentRoot> "
+" <description>Datawindow Root</description> "
+" <group0><description>Group0 description</description> "
+" <Header0><description>Header0 members</description> "
+" <DocumentRoot><description>Datawindow Root</description> "
+" <group0><description>Group0 description</description> "
+" <Header0><description>Header0 members</description> "
);
String colName = null;
String colVal = null;
String colXml = null;
String detTag = null;
String detEndTag = null;
for( int formSqlIdx = 0; formSqlIdx < formSQLs.length ; formSqlIdx++ )
{
pstmt = conn.prepareStatement( formSQLs[ formSqlIdx ] );
pstmt.setString( 1, this.tranId );
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
detTag = "<Detail" + ( formSqlIdx + 1 ) + " dbID =\""+tranId+"\">";
detEndTag = "</Detail" + ( formSqlIdx + 1 ) + ">";
while( rs.next() )
{
tranXmlBuff.append( "\n\t" + detTag );
for( int rsIdx = 1; rsIdx < numberOfColumns ; rsIdx++ )
{
colName = rsmd.getColumnName( rsIdx );
colVal = rs.getString( colName );
String colType = rsmd.getColumnTypeName(rsIdx);
if( "date".equalsIgnoreCase(colType) || "datetime".equalsIgnoreCase(colType) )
{
E12GenericUtility e12GenericUtility = new E12GenericUtility();
colVal = E12GenericUtility.checkNull(colVal);
if(!"".equalsIgnoreCase(colVal))
{
colVal = e12GenericUtility.getValidDateString(colVal, e12GenericUtility.getDBDateFormat(), e12GenericUtility.getApplDateFormat());
}
}
//colXml = "\n\t\t<" + colName.toLowerCase() + ">"
// + ( colVal == null || colVal.trim().length() == 0 || colVal.equalsIgnoreCase( "null" ) ? "" : colVal )
// + "</" + colName.toLowerCase() + ">";
// 04/12/12 manoharan CDATA tag to be added
colXml = "\n\t\t<" + colName.toLowerCase() + "><![CDATA["
+ ( colVal == null || colVal.trim().length() == 0 || colVal.equalsIgnoreCase( "null" ) ? "" : colVal )
+ "]]></" + colName.toLowerCase() + ">";
tranXmlBuff.append( colXml );
}
tranXmlBuff.append( "\t" + detEndTag );
}
rsmd = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
tranXmlBuff.append( " </Header0> "
+" </group0> "
+" </DocumentRoot> "
+" </Header0> "
+" </group0> "
+"</DocumentRoot> " );
return tranXmlBuff.toString();
}
//Added by Arun p 31-10-17 for Passing dbID as attribute in deatil tag for edi outbond data -Ended
}
\ 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