Commit 5f25ed87 authored by kmandhre's avatar kmandhre

add work_ctr, mc_code, wrok_ctr__alt and mc_code__alt


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93968 ce508802-f39f-4f6c-b175-0d175dae99d5
parent caa997cf
...@@ -94,7 +94,7 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo ...@@ -94,7 +94,7 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo
String childNodeName = null; String childNodeName = null;
String userId = null,loginSite = null; String userId = null,loginSite = null;
String templateCode = "",descr = ""; String templateCode = "",descr = "" ,workCenter = "" , mcCode = "";
int cnt = 0; int cnt = 0;
...@@ -387,7 +387,125 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo ...@@ -387,7 +387,125 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
else if ( childNodeName.equals( "work_ctr" ) )// aaded by kunal on 05/DEC/13
{
workCenter = checkNull(genericUtility.getColumnValue( "work_ctr", dom ));
System.out.println("work_ctr="+workCenter);
if( workCenter == null || workCenter.trim().length() == 0 )
{
errCode = "VEWCTR1 ";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
sql = " select count (*) from workcntr where work_ctr = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString( 1, workCenter );
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1 );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if(cnt == 0)
{
errCode = "VTWCTR1 ";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
else if ( childNodeName.equals( "mc_code" ) )// aaded by kunal on 05/DEC/13
{
mcCode = checkNull(genericUtility.getColumnValue( "mc_code", dom ));
System.out.println("mcCode="+mcCode);
if( mcCode == null || mcCode.trim().length() == 0 )
{
errCode = "VMMACH01";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
sql = " select count (*) from machines where mc_code = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString( 1, mcCode );
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1 );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if(cnt == 0)
{
errCode = "VMMACH00 ";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
else if ( childNodeName.equals( "work_ctr__alt" ) )// aaded by kunal on 05/DEC/13
{
workCenter = checkNull(genericUtility.getColumnValue( "work_ctr__alt", dom ));
System.out.println("work_ctr="+workCenter);
if( workCenter != null && workCenter.trim().length() > 0 )
{
sql = " select count (*) from workcntr where work_ctr = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString( 1, workCenter );
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1 );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if(cnt == 0)
{
errCode = "VTWCTR1 ";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
else if ( childNodeName.equals( "mc_code__alt" ) )// aaded by kunal on 05/DEC/13
{
mcCode = checkNull(genericUtility.getColumnValue( "mc_code__alt", dom ));
System.out.println("mcCode="+mcCode);
if( mcCode != null && mcCode.trim().length() > 0 )
{
sql = " select count (*) from machines where mc_code = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString( 1, mcCode );
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1 );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if(cnt == 0)
{
errCode = "VMMACH00 ";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
} }
break; break;
case 2 : case 2 :
...@@ -783,6 +901,7 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo ...@@ -783,6 +901,7 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo
int nextSeqNo = 0; int nextSeqNo = 0;
String oprStr = genericUtility.getColumnValue( "operation", dom ); String oprStr = genericUtility.getColumnValue( "operation", dom );
String routeCd = genericUtility.getColumnValue( "route_code", dom ); String routeCd = genericUtility.getColumnValue( "route_code", dom );
String workCenter = "",mcCode = "" ;
int operationVal = Integer.parseInt( oprStr != null && !"null".equals( oprStr ) && oprStr.trim().length() > 0 ? oprStr.trim() : "0" ); int operationVal = Integer.parseInt( oprStr != null && !"null".equals( oprStr ) && oprStr.trim().length() > 0 ? oprStr.trim() : "0" );
...@@ -802,7 +921,25 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo ...@@ -802,7 +921,25 @@ public class ProcRouteInstrIc extends ValidatorEJB implements ProcRouteInstrIcLo
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
sql = "select work_ctr,mc_code from procroute where route_code = ? and operation = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString( 1, routeCd );
pStmt.setInt( 2, operationVal );
rs = pStmt.executeQuery();
if( rs.next() )
{
workCenter = checkNull(rs.getString( "work_ctr" ));
mcCode = checkNull(rs.getString( "mc_code" ));
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<seq_no>").append("<![CDATA[" + ( nextSeqNo )+ "]]>").append("</seq_no>"); valueXmlString.append("<seq_no>").append("<![CDATA[" + ( nextSeqNo )+ "]]>").append("</seq_no>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workCenter+ "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCode+ "]]>").append("</mc_code>");
} }
if ( currentColumn.trim().equals( "template_code" ) ) //change done by kunal on 23/11/12 if ( currentColumn.trim().equals( "template_code" ) ) //change done by kunal on 23/11/12
{ {
......
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