Commit 3ab5f18c authored by dpawar's avatar dpawar

validation updated for PTCN


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97164 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2cb53d04
......@@ -130,11 +130,7 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
if (objContext != null && objContext.trim().length() > 0) {
currentFormNo = Integer.parseInt(objContext);
}
System.out.println("IN WAFVAL DATA....................................DADASO3");
}
switch ( currentFormNo ) // Switch Case for form number
......@@ -185,6 +181,14 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
int ptcnYCount = 0,rowCnt = 0;
ptcn = checkNull(genericUtility.getColumnValue("ptcn",dom2));
System.out.println("PTCN11------>>["+ptcn+"]");
//rowCnt = getDBRowCount(conn, "MULTI_PICK_ISS_HDR", "PTCN", ptcn);
//System.out.println("rowCnt MULTI_PICK_ISS_HDR------>>["+rowCnt+"]");
if(isExistPtcn(dom2))
{
errCode = "VTPTCNAS";//Entered PTCN already scanned.
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
if(ptcn.length() == 0)
{
errCode = "VTPTCNNN";// PTCN blank validation
......@@ -202,6 +206,7 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
}
}
//validation for check PTCN confirmed or not.
rowCnt = 0;
rowCnt = getDBRowCount(conn, "WAVE_TASK_DET", "PTCN", ptcn);
sql ="SELECT STATUS FROM WAVE_TASK_DET WHERE PTCN = ?";
pstmt = conn.prepareStatement(sql);
......@@ -232,13 +237,7 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rowCnt = getDBRowCount(conn, "MULTI_PICK_ISS_HDR", "PTCN", ptcn);
if(rowCnt > 1)
{
errCode = "VTPTCNAS";//Entered PTCN already scanned.
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
sql = "SELECT T.HOLD_STATUS,T.CANCEL FROM WAVE_TASK_DET D ,WAVE_TASK T "
+ "WHERE D.WAVE_ID = T.WAVE_ID AND D.PTCN = ?";
......@@ -1017,7 +1016,7 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
System.out.println("item change form 3........itm_default_add");
valueXmlString.append("<Detail3 domID='1' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( "").append( "]]></tran_id>\r\n" );
valueXmlString.append( "<line_no><![CDATA[" ).append( "").append( "]]></line_no>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( "").append( "]]></site_code>\r\n" );
......@@ -1150,6 +1149,60 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
System.out.println("return from getLineNo ---->>["+lineNo+"]");
return lineNo;
}
private boolean isExistPtcn(Document dom)
{
System.out.println("--------isExistPtcn --------");
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int childNodeListLength = 0;
String childNodeName = null,ptcn = "",oldPtcn = "";
GenericUtility genericUtility = GenericUtility.getInstance();
int count = 0;
try
{
parentNodeList = dom.getElementsByTagName("Detail2");
childNodeListLength = parentNodeList.getLength();
System.out.println("childNodeListLength----->>"+childNodeListLength);
for (int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = parentNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
if (childNode.getNodeType() == Node.ELEMENT_NODE)
{
Element eElement = (Element) childNode;
ptcn = eElement.getElementsByTagName("ptcn").item(0).getTextContent();
System.out.println("ctr --->> "+ctr);
System.out.println("ptcn --->> "+ptcn);
if(ctr == 0)
{
oldPtcn = ptcn;
}
else
{
System.out.println("else ctr --->> "+ctr+" "+oldPtcn +" "+ptcn);
if(oldPtcn.equals(ptcn))
{
return true;
}
}
}
} //end for
}
catch(Exception e)
{
e.printStackTrace();
}
return false;
}
private int getMaxLineNo(String tranId,Connection conn)
{
ResultSet rs = null;
......
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