Commit ab88b72d authored by cpatil's avatar cpatil

modify for date issue exception


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101776 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0ad4c6c3
......@@ -138,6 +138,8 @@ POrderICRemote, POrderICLocal {
Node parentNode4 = null;
Node childNode4 = null;
Timestamp ordDate2=null,ordDated2=null;
StringBuffer errStringXml = new StringBuffer(
"<?xml version=\"1.0\"?>\r\n<Root><Errors>");
try {
......@@ -1417,6 +1419,11 @@ POrderICRemote, POrderICLocal {
discount = checkNull(genericUtility.getColumnValue("discount", dom));
taxAmt = genericUtility.getColumnValue("tax_amt", dom);
if( ordDate != null && ordDate.trim().length() > 0)
{
ordDate2 = Timestamp.valueOf(genericUtility.getValidDateString(ordDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if (purcOrder == null || purcOrder.trim().length() == 0) {
purcOrder = "@@@";
}
......@@ -1707,9 +1714,13 @@ POrderICRemote, POrderICLocal {
}
if (errcode == null
|| errcode.trim().length() == 0) {
sql = "select count(*) from project where proj_code = ? and (ordDate between start_date and end_date or ordDate between start_date and ext_end_date)";
sql = "select count(*) from project where proj_code = ? " +
" and ( ? between start_date and end_date " +
" or ? between start_date and ext_end_date )";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, projCode);
pStmt.setTimestamp(2, ordDate2);
pStmt.setTimestamp(3, ordDate2);
rs = pStmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt(1);
......@@ -3590,15 +3601,22 @@ POrderICRemote, POrderICLocal {
pStmt.close();
pStmt = null;
java.sql.Date ordDated = (java.sql.Date) sdf
.parse(ordDate);
//java.sql.Date ordDated = (java.sql.Date) sdf.parse(ordDate);
if( ordDate != null && ordDate.trim().length() > 0)
{
ordDated2 = Timestamp.valueOf(genericUtility.getValidDateString(ordDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if (lopReqd == "Y") {
sql = "Select count(1) From lop_hdr a, lop_det b Where a.lop_ref_no = b.lop_ref_no And"
+ "a.site_code = :ls_site_code And a.confirmed = 'Y' And b.item_code = :ls_itemCode And b.item_status ='A' And"
+ "? >= a.valid_from And ? <= a.valid_to And b.buy_sell_flag In ('P','B');";
pStmt = conn.prepareStatement(sql);
pStmt.setDate(1, ordDated);
pStmt.setDate(2, ordDated);
pStmt.setTimestamp(1, ordDated2);
pStmt.setTimestamp(2, ordDated2);
//pStmt.setDate(1, ordDated);
//pStmt.setDate(2, ordDated);
rs = pStmt.executeQuery();
if (rs.next()) {
......@@ -3702,10 +3720,18 @@ POrderICRemote, POrderICLocal {
}
}
java.sql.Date ordDated = (java.sql.Date) sdf
.parse(ordDate);
java.sql.Date purcOrderd = (java.sql.Date) sdf
.parse(purcOrder);
//java.sql.Date ordDated = (java.sql.Date) sdf.parse(ordDate);
//java.sql.Date purcOrderd = (java.sql.Date) sdf.parse(purcOrder);
if( ordDate != null && ordDate.trim().length() > 0)
{
ordDated2 = Timestamp.valueOf(genericUtility.getValidDateString(ordDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if( ordDate != null && ordDate.trim().length() > 0)
{
ordDated2 = Timestamp.valueOf(genericUtility.getValidDateString(ordDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
sql = "select a.status, case when b.quantity is null then 0 else b.quantity end,case when b.qty_used is null then 0 else b.qty_used end"
+ "From ct3form_hdr a , ct3form_det b Where a.form_no = b.form_no And a.site_code = ? And b.supp_code = ? And b.item_code = ?"
+ "And ? >= a.eff_from And ? <= a.valid_upto And b.purc_order = ? And b.line_no = ? And a.status = 'O'"
......@@ -3714,9 +3740,12 @@ POrderICRemote, POrderICLocal {
pStmt.setString(1, siteCode);
pStmt.setString(2, suppCode);
pStmt.setString(3, itemCode);
pStmt.setDate(3, ordDated);
pStmt.setDate(4, ordDated);
pStmt.setDate(5, purcOrderd);
pStmt.setTimestamp(3, ordDated2);
pStmt.setTimestamp(4, ordDated2);
//pStmt.setDate(3, ordDated);
//pStmt.setDate(4, ordDated);
//pStmt.setDate(5, purcOrderd);
pStmt.setString(5, purcOrder);
pStmt.setString(6, lineNo);
rs = pStmt.executeQuery();
if (rs.next()) {
......@@ -4553,7 +4582,7 @@ POrderICRemote, POrderICLocal {
return errStringXml.toString();
}
private String checkrate(Document dom, Connection conn) throws SQLException {
private String checkrate(Document dom, Connection conn) throws Exception {
// TODO Auto-generated method stub
System.out.println("Inside checkrate ........");
String errcode = "";
......@@ -4575,6 +4604,8 @@ POrderICRemote, POrderICLocal {
DistCommon DistCommon = new DistCommon();
ArrayList ratestduomArr = new ArrayList();
Timestamp orddate2= null;
try {
lsValue = DistCommon.getDisparams("999999", "UOM_ROUND", conn);
......@@ -4631,18 +4662,24 @@ POrderICRemote, POrderICLocal {
Double.parseDouble(convrtuomstduom), conn);
}
if( orddate!=null && orddate.trim().length() > 0)
{
orddate2 = Timestamp.valueOf(genericUtility.getValidDateString(orddate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
sql = "select porddet.purc_order, porder.ord_date, porddet.rate__stduom from porddet, porder "
+ " where ( porddet.purc_order = porder.purc_order ) and ( ( porddet.site_code = ? ) and "
+ " ( porddet.item_code = ? ) and ( porder.ord_date < ? ) ) order by porder.ord_date desc ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sitecode);
pstmt.setString(2, itemCode);
pstmt.setString(3, orddate);
pstmt.setTimestamp(3, orddate2);
//pstmt.setString(3, orddate);
rs = pstmt.executeQuery();
while (rs.next()) {
lspurcorder = rs.getString(1);
ldtorddate = rs.getDate(1);
lctemprate = rs.getDouble(1);
ldtorddate = rs.getDate(2);
lctemprate = rs.getDouble(3);
}
rs.close();
rs = null;
......@@ -4812,6 +4849,8 @@ POrderICRemote, POrderICLocal {
// cpatil end
Timestamp ordDate2=null;
try
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
......@@ -5811,7 +5850,7 @@ POrderICRemote, POrderICLocal {
}
if(currentColumn.trim().equals( "cr_term" ))
{
mcode = checkNull(genericUtility.getColumnValue("dept_code", dom));
mcode = checkNull(genericUtility.getColumnValue("cr_term", dom));
sql = "select descr from crterm where cr_term = ? ";
pStmt= conn.prepareStatement(sql);
......@@ -5825,6 +5864,7 @@ POrderICRemote, POrderICLocal {
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<crterm_descr>").append("<![CDATA[" + descr + "]]>").append("</crterm_descr>");
}
if(currentColumn.trim().equals( "curr_code__frt" ))
......@@ -8377,10 +8417,17 @@ POrderICRemote, POrderICLocal {
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
//siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
if( ordDate != null && ordDate.trim().length() > 0)
{
ordDate2 = Timestamp.valueOf(genericUtility.getValidDateString(ordDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
sql = "select DDF_GET_LASTPURRATE(?,?,?) from dual";
pStmt= conn.prepareStatement(sql);
pStmt.setString(1, itemCode);
pStmt.setString(2, ordDate);
//pStmt.setString(2, ordDate);
pStmt.setTimestamp(2, ordDate2);
pStmt.setString(3, siteCode);
rs = pStmt.executeQuery();
if(rs.next())
......@@ -8397,7 +8444,8 @@ POrderICRemote, POrderICLocal {
sql = "select DDF_GET_PO(?,?,?) from dual";
pStmt= conn.prepareStatement(sql);
pStmt.setString(1, itemCode);
pStmt.setString(2, ordDate);
//pStmt.setString(2, ordDate);
pStmt.setTimestamp(2, ordDate2);
pStmt.setString(3, siteCode);
rs = pStmt.executeQuery();
if(rs.next())
......
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