Commit f98fdde5 authored by dpawar's avatar dpawar

item change of mc code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94407 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 44ad5319
...@@ -104,15 +104,44 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -104,15 +104,44 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
System.out.println("Child name --->> "+childNodeName); System.out.println("Child name --->> "+childNodeName);
if (childNodeName.equalsIgnoreCase("mc_code")){ if (childNodeName.equalsIgnoreCase("mc_code")){
String mcCode="",mcCodeO="",workctrO="",workctr="",workorder="",operation=""; String mcCode="",mcCodeO="",workctrO="",workctr="",workorder="",operation="",mcCodeOld="";
int count=0; int count=0;
mcCode = checkNull(genericUtility.getColumnValue("mc_code",dom)); mcCode = checkNull(genericUtility.getColumnValue("mc_code",dom));
mcCodeO = checkNull(genericUtility.getColumnValue("mc_code__o",dom)); mcCodeOld = checkNull(genericUtility.getColumnValue("mc_code__o",dom));
workctr = checkNull(genericUtility.getColumnValue("work_ctr",dom)); workctr = checkNull(genericUtility.getColumnValue("work_ctr",dom));
workctrO = checkNull(genericUtility.getColumnValue("work_ctr__o",dom)); workctrO = checkNull(genericUtility.getColumnValue("work_ctr__o",dom));
workorder = checkNull(genericUtility.getColumnValue("work_order",dom)); workorder = checkNull(genericUtility.getColumnValue("work_order",dom));
operation = checkNull(genericUtility.getColumnValue("operation",dom)); operation = checkNull(genericUtility.getColumnValue("operation",dom));
//--------------------
System.out.println("mc_code wfval----->>["+mcCode+"]");
System.out.println("mcCodeOld wfval----->>["+mcCodeOld+"]");
if(mcCode.length() == 0 && mcCodeOld.length() ==0){
errCode = "VTMCNN";
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()){
count=rs.getInt(1);
}
if(count == 0){
errCode = "VTMCCNE";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
//--------------------
System.out.println("work_ctr---->>["+workctr+"] mc_code---->>["+mcCode+"]"); System.out.println("work_ctr---->>["+workctr+"] mc_code---->>["+mcCode+"]");
//check machine is in work center or not //check machine is in work center or not
...@@ -223,36 +252,127 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -223,36 +252,127 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
} //end cnt } //end cnt
} }
else if (childNodeName.equalsIgnoreCase("operation")){ else if (childNodeName.equalsIgnoreCase("item_code")){
System.out.println("in operation--------------------"); System.out.println("in item_code--------------------");
String mcCode="",routeCode="",procCode="",workorder="",operation=""; String itemCode="";
int count=0; int count=0;
workorder = checkNull(genericUtility.getColumnValue("work_order",dom)); itemCode = checkNull(genericUtility.getColumnValue("item_code",dom));
operation = checkNull(genericUtility.getColumnValue("operation",dom)); System.out.println("item code wfval----->>["+itemCode+"]");
mcCode = checkNull(genericUtility.getColumnValue("mc_code",dom)); if(itemCode.length()==0){
routeCode = checkNull(genericUtility.getColumnValue("route_code",dom)); errCode = "VTITMCNN";
procCode = checkNull(genericUtility.getColumnValue("proc_code",dom)); errList.add( errCode );
System.out.println("operation---->>["+operation.length()+"]"); errFields.add( childNodeName.toLowerCase() );
if(operation.length() == 0){
errCode = "VTOPRNN"; // if operation is null then show error.
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}else{ }else{
//Validation to check duplicate operation sql="select count(*) from item where item_code = ?";
condParam.clear(); pstmt=conn.prepareStatement(sql);
condParam.add("operation"); pstmt.setString(1, itemCode);
condParam.add("work_order"); rs=pstmt.executeQuery();
condParam.add(operation); if(rs.next()){
condParam.add(workorder); count=rs.getInt(1);
count=getDBRowCount(conn, "worder_route", condParam); }
System.out.println("count---->>["+count+"] editflag---->>["+editFlag+"]"); if(count == 0){
if(count > 0 && editFlag.trim().equalsIgnoreCase("A")){ errCode = "VTITMCNM";
errCode = "VTOPRTN"; errList.add( errCode );
errList.add( errCode ); errFields.add( childNodeName.toLowerCase() );
errFields.add( childNodeName.toLowerCase() ); }
rs.close();
rs=null;
pstmt.close();
pstmt=null;
} }
}
}
else if (childNodeName.equalsIgnoreCase("proc_code")){
System.out.println("in proc_code--------------------");
String procCode="";
int count=0;
procCode = checkNull(genericUtility.getColumnValue("proc_code",dom));
System.out.println("proc_code wfval----->>["+procCode+"]");
if(procCode.length()==0){
errCode = "VTPRCCNN";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}else{
sql="select count(*) from process where proc_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, procCode);
rs=pstmt.executeQuery();
if(rs.next()){
count=rs.getInt(1);
}
if(count == 0){
errCode = "VTPRCCNM";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
}
else if (childNodeName.equalsIgnoreCase("work_ctr")){
String workCtr="",workCtrOld="";
int count=0;
workCtr = checkNull(genericUtility.getColumnValue("work_ctr",dom));
workCtrOld = checkNull(genericUtility.getColumnValue("work_ctr",dom));
System.out.println("workCtr wfval----->>["+workCtr+"]");
System.out.println("workCtrOld wfval----->>["+workCtrOld+"]");
//when user enter new operation against work order that time below condition check.
if(workCtr.length() == 0 && workCtrOld.length() == 0){
errCode = "VTWRKCNN";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}else{
sql="select count(*) from workcntr where work_ctr = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, workCtr);
rs=pstmt.executeQuery();
if(rs.next()){
count=rs.getInt(1);
}
if(count == 0){
errCode = "VTWRKCNTN";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
}
else if (childNodeName.equalsIgnoreCase("mc_code")){
String mcCode="",mcCodeOld="";
int count=0;
mcCode = checkNull(genericUtility.getColumnValue("mc_code",dom));
mcCodeOld = checkNull(genericUtility.getColumnValue("mc_code__o",dom));
System.out.println("mc_code wfval----->>["+mcCode+"]");
System.out.println("mcCodeOld wfval----->>["+mcCodeOld+"]");
if(mcCode.length() == 0 && mcCodeOld.length() ==0){
errCode = "VTMCNN";
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()){
count=rs.getInt(1);
}
if(count == 0){
errCode = "VTMCCNE";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
} }
else if (childNodeName.equalsIgnoreCase("work_order")){ else if (childNodeName.equalsIgnoreCase("work_order")){
String workorder="",status=""; String workorder="",status="";
...@@ -464,11 +584,13 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -464,11 +584,13 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
System.out.println("editFlag122 =>" +editFlag); System.out.println("editFlag122 =>" +editFlag);
/*if( currentColumn.trim().equalsIgnoreCase( "itm_defaultedit" ) )
{ if( currentColumn.trim().equalsIgnoreCase( "itm_defaultedit" ) )
valueXmlString.append("<amd_no protect = \"1\">").append("<![CDATA[]]>").append("</amd_no>"); {
String parentOpr="",itemCodeL="",procCodeL="",procCodeLDescL="";
System.out.println("------------in itm_default Edit--------->");
} }
*/
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) ) if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{ {
System.out.println("------------in itm_default--------->"); System.out.println("------------in itm_default--------->");
...@@ -490,16 +612,19 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -490,16 +612,19 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
} }
if (currentColumn.trim().equalsIgnoreCase("operation")) if (currentColumn.trim().equalsIgnoreCase("operation"))
{ {
String workOrder="",operation="",oprtn="",procCode="", routecode=""; String workOrder="",operation="",oprtn="",procCode="", routecode="";
String itemCode = "",workctr = "",mcCode= "",oprParent=""; String itemCode = "",oprParent="",procCodeLDesc="",workctr = "",mcCode= "",mcCodeDescL;
int seqno = 0; int seqno = 0;
double wtime=0,stime = 0,retime= 0,rutime=0; double wtime=0,stime = 0,retime= 0,rutime=0;
operation = checkNull(genericUtility.getColumnValue("operation",dom)); operation = checkNull(genericUtility.getColumnValue("operation",dom));
workOrder = checkNull(genericUtility.getColumnValue("work_order",dom)); workOrder = checkNull(genericUtility.getColumnValue("work_order",dom));
oprParent = checkNull(genericUtility.getColumnValue("operation_parent",dom)); oprParent = checkNull(genericUtility.getColumnValue("operation_parent",dom));
sql="select operation, proc_code, seq_no,route_code,item_code, work_ctr," /*sql="select operation, proc_code, seq_no,item_code,"
+ "wait_time, set_time, reset_time,run_time from worder_route "
+ "where work_order = ? and operation = ?";*/
sql="select operation, proc_code, seq_no,item_code, work_ctr,"
+ "mc_code,wait_time, set_time, reset_time,run_time from worder_route " + "mc_code,wait_time, set_time, reset_time,run_time from worder_route "
+ "where work_order = ? and operation = ?"; + "where work_order = ? and operation = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
...@@ -509,66 +634,73 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -509,66 +634,73 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
if(rs.next()){ if(rs.next()){
oprtn=checkNull(rs.getString(1)); oprtn=checkNull(rs.getString(1));
procCode=checkNull(rs.getString(2)); procCode=checkNull(rs.getString(2));
seqno=rs.getInt(3); seqno=rs.getInt(3);
//routecode=checkNull(rs.getString(4)); itemCode=checkNull(rs.getString(4));
itemCode=checkNull(rs.getString(5)); workctr=checkNull(rs.getString(5));
workctr=checkNull(rs.getString(6)); mcCode=checkNull(rs.getString(6));
wtime=rs.getDouble(7);
mcCode=checkNull(rs.getString(7)); stime=rs.getDouble(8);
wtime=rs.getDouble(8); retime=rs.getDouble(9);
stime=rs.getDouble(9); rutime=rs.getDouble(10);
retime=rs.getDouble(10);
rutime=rs.getDouble(11);
} }
rs.close(); rs.close();
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
valueXmlString.append("<seq_no>").append("<![CDATA[" +seqno+ "]]>").append("</seq_no>");
if(oprParent.length() == 0){
valueXmlString.append("<proc_code>").append("<![CDATA[" + procCode + "]]>").append("</proc_code>");
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr__o>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code__o>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code__o>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code>");
mcCodeDesc=getColumnDescr(conn,"descr","machines","mc_code",mcCode);
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDesc+ "]]>").append("</machines_descr>");
procCodeDesc=getColumnDescr(conn,"descr","process","proc_code",procCode);
valueXmlString.append("<process_descr>").append("<![CDATA[" +procCodeDesc+ "]]>").append("</process_descr>");
}
itemCodeDesc=getColumnDescr(conn,"descr","item","item_code",itemCode);
valueXmlString.append("<item_descr>").append("<![CDATA[" +itemCodeDesc+ "]]>").append("</item_descr>");
// valueXmlString.append("<operation>").append("<![CDATA[" + oprtn + "]]>").append("</operation>");
valueXmlString.append("<seq_no>").append("<![CDATA[" + (seqno == 0 ? "" :seqno) + "]]>").append("</seq_no>");
//valueXmlString.append("<route_code>").append("<![CDATA[" + routecode + "]]>").append("</route_code>");
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr__o>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code__o>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code__o>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code>");
valueXmlString.append("<wait_time>").append("<![CDATA[" +wtime+ "]]>").append("</wait_time>"); valueXmlString.append("<wait_time>").append("<![CDATA[" +wtime+ "]]>").append("</wait_time>");
valueXmlString.append("<set_time>").append("<![CDATA[" +stime+ "]]>").append("</set_time>"); valueXmlString.append("<set_time>").append("<![CDATA[" +stime+ "]]>").append("</set_time>");
valueXmlString.append("<reset_time>").append("<![CDATA[" +retime+ "]]>").append("</reset_time>"); valueXmlString.append("<reset_time>").append("<![CDATA[" +retime+ "]]>").append("</reset_time>");
valueXmlString.append("<run_time>").append("<![CDATA[" +rutime+ "]]>").append("</run_time>"); valueXmlString.append("<run_time>").append("<![CDATA[" +rutime+ "]]>").append("</run_time>");
System.out.println("oprParent1---->>["+oprParent+"]");
if(oprParent.length()==0){
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
itemCodeDesc=getColumnDescr(conn,"descr","item","item_code",itemCode);
valueXmlString.append("<item_descr>").append("<![CDATA[" +itemCodeDesc+ "]]>").append("</item_descr>");
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr__o>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workctr + "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code__o>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code__o>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCode + "]]>").append("</mc_code>");
mcCodeDescL=getColumnDescr(conn,"descr","machines","mc_code",mcCode);
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDescL+ "]]>").append("</machines_descr>");
valueXmlString.append("<proc_code protect = \"0\">").append("<![CDATA[" + procCode + "]]>").append("</proc_code>");
procCodeLDesc=getColumnDescr(conn,"descr","process","proc_code",procCode);
valueXmlString.append("<process_descr>").append("<![CDATA[" +procCodeLDesc+ "]]>").append("</process_descr>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("work_order"))
{
String routecodeDF="",workOrderL="";
workOrderL = checkNull(genericUtility.getColumnValue("work_order",dom));
routecodeDF=getColumnDescr(conn,"route_code","workorder","work_order",workOrderL);
valueXmlString.append("<route_code>").append("<![CDATA[" + routecodeDF + "]]>").append("</route_code>");
} }
else if (currentColumn.trim().equalsIgnoreCase("mc_code")) else if (currentColumn.trim().equalsIgnoreCase("mc_code"))
{ {
String mcCode="",mcCodeDescL=""; String mcCode="",mcCodeDescL="",operationL="",workOrderL="";
operationL = checkNull(genericUtility.getColumnValue("operation",dom));
workOrderL = checkNull(genericUtility.getColumnValue("work_order",dom));
mcCode=checkNull(genericUtility.getColumnValue("mc_code",dom)); mcCode=checkNull(genericUtility.getColumnValue("mc_code",dom));
mcCodeDescL=getColumnDescr(conn,"descr","machines","mc_code",mcCode); mcCodeDescL=getColumnDescr(conn,"descr","machines","mc_code",mcCode);
if(mcCodeDesc.length() > 0) if(mcCodeDesc.length() > 0)
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDescL+ "]]>").append("</machines_descr>"); valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDescL+ "]]>").append("</machines_descr>");
else else
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDescL+ "]]>").append("</machines_descr>"); valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDescL+ "]]>").append("</machines_descr>");
if(isOperationNew(conn,workOrderL,operationL)){
valueXmlString.append("<mc_code__o>").append("<![CDATA[" +mcCode+ "]]>").append("</mc_code__o>");
}
} }
...@@ -587,13 +719,29 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -587,13 +719,29 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
procCodeL = checkNull(genericUtility.getColumnValue("proc_code",dom)); procCodeL = checkNull(genericUtility.getColumnValue("proc_code",dom));
System.out.println("Process code dom---->>["+procCodeL+"]"); System.out.println("Process code dom---->>["+procCodeL+"]");
procCodeLDesc=getColumnDescr(conn,"descr","process","proc_code",procCodeL); procCodeLDesc=getColumnDescr(conn,"descr","process","proc_code",procCodeL);
valueXmlString.append("<process_descr>").append("<![CDATA[" +procCodeLDesc+ "]]>").append("</process_descr>"); valueXmlString.append("<process_descr>").append("<![CDATA[" +procCodeLDesc+ "]]>").append("</process_descr>");
} }
else if(currentColumn.trim().equalsIgnoreCase("operation_parent")) else if(currentColumn.trim().equalsIgnoreCase("work_ctr"))
{
String workCtr="",workCtrOld="",operationL="",workOrderL="";
operationL = checkNull(genericUtility.getColumnValue("operation",dom));
workOrderL = checkNull(genericUtility.getColumnValue("work_order",dom));
workCtr= checkNull(genericUtility.getColumnValue("work_ctr",dom));
workCtrOld= checkNull(genericUtility.getColumnValue("work_ctr__o",dom));
System.out.println("work_ctr dom---->>["+workCtr+"]");
System.out.println("workOrderL dom---->>["+workOrderL+"] operation-->"+operationL);
System.out.println("work_ctrold dom---->>["+workCtrOld+"]");
if(isOperationNew(conn,workOrderL,operationL)){
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" +workCtr+ "]]>").append("</work_ctr__o>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("operation_parent"))
{ {
boolean isRecordFound=false; boolean isRecordFound=false;
String operationParent="",procCode="",procCodeLDesc="",workOrd="",workCtrF="",mcCodeF=""; String operationParent="",procCode="",procCodeLDesc="",workOrd="",workCtrF="",mcCodeF="",
itemCode="",itemCodeDescL="";
operationParent = checkNull(genericUtility.getColumnValue("operation_parent",dom)); operationParent = checkNull(genericUtility.getColumnValue("operation_parent",dom));
workOrd= checkNull(genericUtility.getColumnValue("work_order",dom)); workOrd= checkNull(genericUtility.getColumnValue("work_order",dom));
System.out.println("operationParent dom---->>["+operationParent+"]"); System.out.println("operationParent dom---->>["+operationParent+"]");
...@@ -617,28 +765,28 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -617,28 +765,28 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
sql="select work_ctr,mc_code from workorder_feedback where work_order = ? and operation = ?"; sql="select work_ctr,mc_code,item_code from workorder_feedback where work_order = ? and operation = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, workOrd); pstmt.setString(1, workOrd);
pstmt.setInt(2, Integer.parseInt(operationParent)); pstmt.setInt(2, Integer.parseInt(operationParent));
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
workCtrF=checkNull(rs.getString(1)); workCtrF=checkNull(rs.getString(1));
mcCodeF=checkNull(rs.getString(2)); mcCodeF=checkNull(rs.getString(2));
itemCode=checkNull(rs.getString(3));
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" + workCtrF + "]]>").append("</work_ctr__o>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workCtrF + "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code__o>").append("<![CDATA[" + mcCodeF + "]]>").append("</mc_code__o>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCodeF + "]]>").append("</mc_code>");
mcCodeDesc=getColumnDescr(conn,"descr","machines","mc_code",mcCodeF);
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDesc+ "]]>").append("</machines_descr>");
procCodeDesc=getColumnDescr(conn,"descr","process","proc_code",procCode);
valueXmlString.append("<process_descr>").append("<![CDATA[" +procCodeDesc+ "]]>").append("</process_descr>");
} }
} }
valueXmlString.append("<work_ctr__o>").append("<![CDATA[" + workCtrF + "]]>").append("</work_ctr__o>");
valueXmlString.append("<work_ctr>").append("<![CDATA[" + workCtrF + "]]>").append("</work_ctr>");
valueXmlString.append("<mc_code__o>").append("<![CDATA[" + mcCodeF + "]]>").append("</mc_code__o>");
valueXmlString.append("<mc_code>").append("<![CDATA[" + mcCodeF + "]]>").append("</mc_code>");
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
itemCodeDescL=getColumnDescr(conn,"descr","item","item_code",itemCode);
valueXmlString.append("<item_descr>").append("<![CDATA[" +itemCodeDescL+ "]]>").append("</item_descr>");
mcCodeDesc=getColumnDescr(conn,"descr","machines","mc_code",mcCodeF);
valueXmlString.append("<machines_descr>").append("<![CDATA[" +mcCodeDesc+ "]]>").append("</machines_descr>");
if(!isRecordFound){ if(!isRecordFound){
valueXmlString.append("<proc_code protect = \"0\">").append("<![CDATA[" + procCode + "]]>").append("</proc_code>"); valueXmlString.append("<proc_code protect = \"0\">").append("<![CDATA[" + procCode + "]]>").append("</proc_code>");
procCodeLDesc=getColumnDescr(conn,"descr","process","proc_code",procCode); procCodeLDesc=getColumnDescr(conn,"descr","process","proc_code",procCode);
...@@ -717,7 +865,7 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -717,7 +865,7 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
StringBuffer sql1=new StringBuffer(); StringBuffer sql1=new StringBuffer();
try{ try{
if(condParamL.size() > 0){ if(condParamL.size() > 0){
System.out.println("---------arrayList Size---->>["+condParamL.size()+"]"); System.out.println("---------arrayList Size---->>["+condParamL+"]");
System.out.println("---------arrayList values 1---->>["+condParamL.get(0)+"]");//"operation" System.out.println("---------arrayList values 1---->>["+condParamL.get(0)+"]");//"operation"
System.out.println("---------arrayList values 2---->>["+condParamL.get(1)+"]");//"work_order" System.out.println("---------arrayList values 2---->>["+condParamL.get(1)+"]");//"work_order"
System.out.println("---------arrayList values 3---->>["+condParamL.get(2)+"]");//operation System.out.println("---------arrayList values 3---->>["+condParamL.get(2)+"]");//operation
...@@ -755,6 +903,42 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt ...@@ -755,6 +903,42 @@ public class WorkOrderRouteAlt extends ValidatorEJB implements WorkOrderRouteAlt
} }
return cnt; return cnt;
} }
private boolean isOperationNew(Connection conn,String workOrder,String operation)
{
PreparedStatement pstmt = null ;
ResultSet rs = null ;
String sql = "";
int count=0;
try{
sql="select count(*) from worder_route where work_order = ? and operation = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, workOrder);
pstmt.setInt(2, Integer.parseInt(operation));
rs=pstmt.executeQuery();
if(rs.next()){
count=rs.getInt(1);
}
System.out.println("count in isOperationNew123--->>["+count+"]");
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
if(count == 0){
System.out.println("Returning true...........");
return true;
}
}
catch(Exception e){
e.printStackTrace();
}
return false;
}
private String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value) private String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value)
{ {
......
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