Commit 95e1a307 authored by dpawar's avatar dpawar

migration work order route alt.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94186 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5b44298e
......@@ -414,10 +414,8 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
workorder = checkNull(genericUtility.getColumnValue("work_order",dom));
System.out.println("work order ------>>"+workorder);
valueXmlString.append("<work_order>").append("<![CDATA[" + workorder + "]]>").append("</work_order>");
valueXmlString.append("<confirmed>").append("<![CDATA[" + confirm + "]]>").append("</confirmed>");
String error=testDate(conn);
System.out.println("Error from testDate---->>["+error+"]");
valueXmlString.append("<confirmed>").append("<![CDATA[" + confirm + "]]>").append("</confirmed>");
}
......@@ -705,72 +703,7 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
return input.trim();
}
private String testDate(Connection conn)
{
ResultSet rs=null;
PreparedStatement pstmt=null;
String error="",sql="";
java.sql.Timestamp loadDate=null;
try{
sql="select amd_date from worder_route_alt where amd_no = ? ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "WOE0001");
rs=pstmt.executeQuery();
if(rs.next()){
loadDate=rs.getTimestamp(1);
}
System.out.println("Load date----->>["+loadDate+"]");
rs.close();
rs = null;
pstmt.close();
pstmt=null;
sql="select count(*) from work_calendar,workshft"
+ " where ( work_calendar.site_code = workshft.site_code ) and"
+ "( work_calendar.day_no = workshft.day_no ) and ( work_calendar.shift = workshft.shift ) and"
+ "( ( work_calendar.working = 'Y' ) and ( work_calendar.confirmed = 'Y' ) and"
+ " ( work_calendar.site_code = ? ) and ( work_calendar.work_date >= ? )) "
+ "order by work_calendar.site_code asc,work_calendar.work_date asc,workshft.in_time asc";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "TA821");
pstmt.setTimestamp(2, loadDate);
rs=pstmt.executeQuery();
int count=0;
if(rs.next()){
count=rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt=null;
System.out.println("count date---->>["+count+"]");
SimpleDateFormat sdf=new SimpleDateFormat(GenericUtility.getInstance().getApplDateFormat());
String loadDateStr=sdf.format((java.util.Date)loadDate);
System.out.println("loadDateStr---->>["+loadDateStr+"]");
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "TA821");
pstmt.setString(2, loadDateStr);
rs=pstmt.executeQuery();
if(rs.next()){
count=rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt=null;
System.out.println("count date---->>["+count+"]");
}
catch(Exception e)
{
e.printStackTrace();
return "Exception";
}
return error;
}
}
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