Commit 6b0f2ece authored by kdabholkar's avatar kdabholkar

commited to add new field in metadata(process type).

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@139920 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6d117e67
...@@ -231,7 +231,8 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI ...@@ -231,7 +231,8 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI
String sql = "",currDateStr = ""; String sql = "",currDateStr = "";
Timestamp monthDate = null; Timestamp monthDate = null;
Calendar calendar = new GregorianCalendar(); Calendar calendar = new GregorianCalendar();
String prdCode = ""; String prdCode = "", fromDateStr = "", toDateStr = "";
Date fromDate = null, toDate = null;
try try
{ {
...@@ -255,12 +256,13 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI ...@@ -255,12 +256,13 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI
{ {
case 1 : case 1 :
{ {
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
valueXmlString.append("<Detail1>\r\n"); valueXmlString.append("<Detail1>\r\n");
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if("itm_default".equalsIgnoreCase(currentColumn))
{ {
calendar.setTime(new Date()); calendar.setTime(new Date());
calendar.add(Calendar.MONTH, -1); calendar.add(Calendar.MONTH, -1);
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
currDateStr = sdf.format(calendar.getTime()); currDateStr = sdf.format(calendar.getTime());
monthDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); monthDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
...@@ -282,11 +284,112 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI ...@@ -282,11 +284,112 @@ public class GstDataIC extends ValidatorEJB implements GstDataICRemote, GstDataI
{ {
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
}*/ }*/
sql = "SELECT CODE FROM PERIOD WHERE ? BETWEEN FR_DATE AND TO_DATE";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, java.sql.Timestamp.valueOf(genericUtility.getValidDateString(new Date(), genericUtility.getDBDateTimeFormat())));
rs = pstmt.executeQuery();
if(rs.next())
{
prdCode = rs.getString("CODE") == null ? "" : rs.getString("CODE");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(prdCode != null && prdCode.trim().length() > 0)
{
sql = "SELECT FR_DATE, TO_DATE FROM PERIOD WHERE CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prdCode);
rs = pstmt.executeQuery();
if(rs.next())
{
fromDate = rs.getDate("FR_DATE");
toDate = rs.getDate("TO_DATE");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
fromDateStr = sdf.format(fromDate);
toDateStr = sdf.format(toDate);
System.out.println("fromDateStr ["+fromDateStr+"] toDateStr ["+toDateStr+"]");
valueXmlString.append("<prd_code>").append("<![CDATA["+prdCode+"]]>").append("</prd_code>"); valueXmlString.append("<prd_code>").append("<![CDATA["+prdCode+"]]>").append("</prd_code>");
valueXmlString.append("<from_date>").append("<![CDATA["+fromDateStr+"]]>").append("</from_date>");
valueXmlString.append("<to_date>").append("<![CDATA["+toDateStr+"]]>").append("</to_date>");
valueXmlString.append("<gst_type>").append("").append("</gst_type>"); valueXmlString.append("<gst_type>").append("").append("</gst_type>");
valueXmlString.append("<prc_type>").append("").append("</prc_type>");
} }
valueXmlString.append("</Detail1>"); else if ("prd_code".equalsIgnoreCase(currentColumn))
{
prdCode = genericUtility.getColumnValue("prd_code", dom1);
prdCode = prdCode == null ? "" : prdCode;
if(prdCode != null && prdCode.trim().length() > 0)
{
sql = "SELECT FR_DATE, TO_DATE FROM PERIOD WHERE CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prdCode);
rs = pstmt.executeQuery();
if(rs.next())
{
fromDate = rs.getDate("FR_DATE");
toDate = rs.getDate("TO_DATE");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
if(fromDate != null)
{
fromDateStr = sdf.format(fromDate);
}
if(toDate != null)
{
toDateStr = sdf.format(toDate);
}
System.out.println("fromDateStr ["+fromDateStr+"] toDateStr ["+toDateStr+"]");
valueXmlString.append("<prd_code>").append("<![CDATA["+prdCode+"]]>").append("</prd_code>");
valueXmlString.append("<from_date>").append("<![CDATA["+fromDateStr+"]]>").append("</from_date>");
valueXmlString.append("<to_date>").append("<![CDATA["+toDateStr+"]]>").append("</to_date>");
}
valueXmlString.append("</Detail1>");
} }
break; break;
} }
......
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