Commit 95192032 authored by cpatil's avatar cpatil

modify for display due_date


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95385 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 55ae3f96
...@@ -13,6 +13,7 @@ import ibase.webitm.ejb.ValidatorEJB; ...@@ -13,6 +13,7 @@ import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -286,6 +287,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -286,6 +287,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
String custCode="",custName="",quantity="",unit="",loginSiteCode=""; String custCode="",custName="",quantity="",unit="",loginSiteCode="";
String orderType=""; String orderType="";
java.sql.Date orderDueDate=null;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -393,7 +396,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -393,7 +396,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//sDateTo = genericUtility.getValidDateString(genericUtility.getColumnValue("date_from",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); //sDateTo = genericUtility.getValidDateString(genericUtility.getColumnValue("date_from",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
dateFr = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("date_from",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00"); dateFr = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("date_from",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00");
dateTo = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("date_to",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00"); dateTo = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("date_to",dom1), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00");
/*
/*
sql = " SELECT sorditem.sale_order,sorditem.line_no, sorditem.site_code, item.item_code__plan as item_code,sorditem.due_date as due_date, " sql = " SELECT sorditem.sale_order,sorditem.line_no, sorditem.site_code, item.item_code__plan as item_code,sorditem.due_date as due_date, "
+" ((case when sorditem.quantity is null then 0 else sorditem.quantity end - case when sorditem.qty_alloc is null then 0 else sorditem.qty_alloc end - case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) * case when sorditem.conv__qty_stdqty is null then 1 else sorditem.conv__qty_stdqty end ) as demand," +" ((case when sorditem.quantity is null then 0 else sorditem.quantity end - case when sorditem.qty_alloc is null then 0 else sorditem.qty_alloc end - case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) * case when sorditem.conv__qty_stdqty is null then 1 else sorditem.conv__qty_stdqty end ) as demand,"
+" 0 as supply, 0 as stock_qty, 0 as oth_supply , sorder.cust_code, customer.cust_name ,sorditem.quantity,sorditem.unit " +" 0 as supply, 0 as stock_qty, 0 as oth_supply , sorder.cust_code, customer.cust_name ,sorditem.quantity,sorditem.unit "
...@@ -407,37 +411,37 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -407,37 +411,37 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//+" and item.mfg_type = 'O' " //+" and item.mfg_type = 'O' "
+" and (sorder.cust_code = customer.cust_code ) " +" and (sorder.cust_code = customer.cust_code ) "
+" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' "; +" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' ";
*/ */
sql=" SELECT sorditem.sale_order as sale_order,sorditem.line_no as line_no," + sql=" SELECT sorditem.sale_order as sale_order,sorditem.line_no as line_no," +
"sorditem.site_code as site_code," + " sorditem.site_code as site_code," +
" item.item_code__plan as item_code,sorditem.due_date as due_date," + " item.item_code__plan as item_code,sorditem.due_date as due_date," +
" sorder.cust_code as cust_code, customer.cust_name as cust_name ," + " sorder.cust_code as cust_code, customer.cust_name as cust_name ," +
" sorditem.quantity quantity,sorditem.unit unit,'SORD' as type " + " sorditem.quantity quantity,sorditem.unit unit,'SORD' as type " +
" ,sorder.due_date as order_due_date " +
" FROM sorder,sorditem, item ,customer" + " FROM sorder,sorditem, item ,customer" +
" WHERE ( sorditem.item_code = item.item_code ) and" + " WHERE ( sorditem.item_code = item.item_code ) and" +
"(sorder.sale_order = sorditem.sale_order )" + " (sorder.sale_order = sorditem.sale_order )" +
" and (case when sorder.confirmed is null then 'N' else sorder.confirmed" + " and (case when sorder.confirmed is null then 'N' else sorder.confirmed" +
" end = 'Y' )" + " end = 'Y' )" +
" and (case when sorditem.consume_fc is null then 'Y' else" + " and (case when sorditem.consume_fc is null then 'Y' else" +
" sorditem.consume_fc end = 'N' )" + " sorditem.consume_fc end = 'N' )" +
" and sorditem.site_code >= ? AND sorditem.site_code <= ?" + " and sorditem.site_code >= ? AND sorditem.site_code <= ?" +
" and (sorditem.due_date >= ? ) and (sorditem.due_date <= ? )" + " and (sorditem.due_date >= ? ) and (sorditem.due_date <= ? )" +
" and ( case when sorder.status is null then 'P' else sorder.status end = 'P')" + " and ( case when sorder.status is null then 'P' else sorder.status end = 'P')" +
" and (sorder.cust_code = customer.cust_code )" + " and (sorder.cust_code = customer.cust_code )" +
" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " + " and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " +
" UNION ALL" + " UNION ALL" +
" select mps_order.tran_id as sale_order,'1' as" + " select mps_order.tran_id as sale_order,'1' as" +
" line_no,mps_order.site_code as site_code," + " line_no,mps_order.site_code as site_code," +
" item.item_code__plan as item_code,mps_order.due_date due_date,'' as " + " item.item_code__plan as item_code,mps_order.due_date due_date,'' as " +
" cust_code,'' as cust_name, " + " cust_code,'' as cust_name, " +
" mps_order.quantity as quantity,item.unit,'MPS' as type from mps_order,item where" + " mps_order.quantity as quantity,item.unit,'MPS' as type " +
" mps_order.item_code=item.item_code " + " ,mps_order.due_date as order_due_date " +
" from mps_order,item where mps_order.item_code=item.item_code " +
" and ( case when mps_order.status is null then 'P' else " + " and ( case when mps_order.status is null then 'P' else " +
" mps_order.status end in ('P','T','M','N')) " + // added N in condition on 26/06/14 " mps_order.status end in ('P','T','M','N')) " + // added N in condition on 26/06/14
" and mps_order.site_code >= ? AND mps_order.site_code <= ? " + " and mps_order.site_code >= ? AND mps_order.site_code <= ? " +
" and (mps_order.due_date >= ? ) and (mps_order.due_date " + " and (mps_order.due_date >= ? ) and (mps_order.due_date <= ? )" ;
" <= ? )" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeFr); pstmt.setString(1,siteCodeFr);
...@@ -460,6 +464,12 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -460,6 +464,12 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
quantity = checkNull(rs.getString("quantity")); quantity = checkNull(rs.getString("quantity"));
unit = checkNull(rs.getString("unit")); unit = checkNull(rs.getString("unit"));
orderType = checkNull(rs.getString("type")); orderType = checkNull(rs.getString("type"));
orderDueDate = rs.getDate("order_due_date"); // added on 02-07-14
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDate = sdf.format(orderDueDate);
System.out.println("Now the order due date is ["+sysDate+"]");
System.out.println(saleOrder+"@"+lineNo+"@"+itemCode); System.out.println(saleOrder+"@"+lineNo+"@"+itemCode);
domID ++; domID ++;
valueXmlString.append( "<Detail2 domID='"+ domID +"' selected = 'N'>\r\n" ); valueXmlString.append( "<Detail2 domID='"+ domID +"' selected = 'N'>\r\n" );
...@@ -472,7 +482,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -472,7 +482,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
valueXmlString.append( "<cust_name><![CDATA[" ).append(custName).append("]]></cust_name>\r\n" ); valueXmlString.append( "<cust_name><![CDATA[" ).append(custName).append("]]></cust_name>\r\n" );
valueXmlString.append( "<quantity><![CDATA[" ).append(quantity).append("]]></quantity>\r\n" ); valueXmlString.append( "<quantity><![CDATA[" ).append(quantity).append("]]></quantity>\r\n" );
valueXmlString.append( "<unit><![CDATA[" ).append(unit).append("]]></unit>\r\n" ); valueXmlString.append( "<unit><![CDATA[" ).append(unit).append("]]></unit>\r\n" );
valueXmlString.append( "<orderType><![CDATA[" ).append(orderType).append("]]></orderType>\r\n" ); valueXmlString.append( "<order_type><![CDATA[" ).append(orderType).append("]]></order_type>\r\n" );
valueXmlString.append( "<due_date><![CDATA[" ).append(sysDate).append("]]></due_date>\r\n" );
valueXmlString.append( "</Detail2>\r\n" ); valueXmlString.append( "</Detail2>\r\n" );
} }
...@@ -499,8 +510,6 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -499,8 +510,6 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
{ {
siteCodeTo = genericUtility.getColumnValue("site_code__to",dom1); siteCodeTo = genericUtility.getColumnValue("site_code__to",dom1);
siteCodeFr = genericUtility.getColumnValue("site_code__from",dom1); siteCodeFr = genericUtility.getColumnValue("site_code__from",dom1);
System.out.println("siteCodeTo="+siteCodeTo+ " siteCodeFr ="+siteCodeFr); System.out.println("siteCodeTo="+siteCodeTo+ " siteCodeFr ="+siteCodeFr);
...@@ -518,6 +527,10 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -518,6 +527,10 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
else else
itemCodeList = "'"+saleOrder+itemCode+"'" ; itemCodeList = "'"+saleOrder+itemCode+"'" ;
System.out.println("itemCodeList=="+itemCodeList); System.out.println("itemCodeList=="+itemCodeList);
orderType= checkNull(genericUtility.getColumnValueFromNode( "order_type", detail2List.item(ctr1) ));
System.out.println("inside for orderType["+orderType+"]");
} }
/* /*
for ( int ctr1 = 0; ctr1 < detail2List.getLength(); ctr1++ ) //Loop for each node of current detail for ( int ctr1 = 0; ctr1 < detail2List.getLength(); ctr1++ ) //Loop for each node of current detail
...@@ -568,6 +581,10 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -568,6 +581,10 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
argData.append("<isBomReplace>").append("N").append("</isBomReplace>\r\n"); // added by cpatil on 17/05/14 for BomReplace argData.append("<isBomReplace>").append("N").append("</isBomReplace>\r\n"); // added by cpatil on 17/05/14 for BomReplace
// orderType= genericUtility.getColumnValue("order_type",dom)==null?"":genericUtility.getColumnValue("order_type",dom);
argData.append("<order_type>").append(orderType).append("</order_type>\r\n"); // added by cpatil on 17/05/14 for BomReplace
System.out.println("@@@@@@@@:: order_type["+orderType+"]");
argData.append("</Detail>"); argData.append("</Detail>");
argData.append("</Root>"); argData.append("</Root>");
...@@ -1110,4 +1127,4 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -1110,4 +1127,4 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//} //}
//} //}
//} //}
} }
\ 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