Commit 028894d8 authored by pdas's avatar pdas

Request ID- D15HSUN010

Project code validation for disparm 'PROJECT_TYPE_OPT'


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99315 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e9ece46a
......@@ -21,6 +21,7 @@ import java.util.Calendar;
import javax.ejb.Stateless;
import org.apache.log4j.spi.ErrorCode;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -143,12 +144,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
String line1 ="";
String startStr ="",endStr = "",descrStr = "",descrStart ="", descrEnd ="" ,exchRateStr ="",value ="";
double discountpoamddet =0,taxpoamddet =0;
boolean ValueType = false;
boolean ValueType = false,ValueProjectType = false;
int cntindamdhdr = 0,itrArr =0,maxLine =0;
int pos;
String totAmtDetpordertempstr ="",quantitypoamd ="",ratepoamd ="",acctCodeCrporder ="";
String acctCodeCrbrow ="", taxpoamd ="";
String discountpoamd ="";
String discountpoamd ="",varValueprojectType ="";
DistCommon distCommon = new DistCommon();
try {
......@@ -1029,6 +1030,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
if (childNodeName.equalsIgnoreCase("proj_code"))
{
String ordType = "";
String projType ="";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
projCodeO = checkNull(genericUtility.getColumnValue("proj_code__o", dom));
indNo = checkNull(genericUtility.getColumnValue("ind_no", dom));
......@@ -1087,7 +1089,6 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
amdNo = checkNull(genericUtility.getColumnValue("amd_no", dom));
purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
indNo = checkNull(genericUtility.getColumnValue("ind_no", dom));
sql = "select pord_type from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
......@@ -1104,7 +1105,6 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
varValue = discommon.getDisparams("999999","TYPE_ALLOW_PROJBUDGET", conn);
System.out.println(">>>>>>>>>In for loop afer schemeKey varValue:"+varValue);
varValue = varValue.trim();
if(varValue != null && varValue.trim().length() > 0)
{
String varValArr[] = varValue.split(",");
......@@ -1117,39 +1117,15 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
{
ValueType = true;
}
}
/*
while (varValue.trim().length()>0)
{
pos = varValue.indexOf(",");
if (pos > -1)
else
{
String strToken = distCommon.getToken(varValue, ",");
System.out.println("VarValue>>>>>"+varValue);
System.out.println("Stringtoken>>>>"+strToken);
System.out.println("pORDTYPE>>>>"+pordType);
if(pordType.trim().equalsIgnoreCase(strToken.trim()))
{
System.out.println("Stringtoken INSIDE IF1111111111111 >>>>"+strToken);
System.out.println("pORDTYPE INSIDE IF333333333333>>>>"+pordType);
System.out.println("ValueType>>>>"+ValueType);
ValueType = true;
break;
}
varValue = varValue.substring(pos + 1);
ValueType = false;
}
}
*/
System.out.println("ValueType11111>>>>"+ValueType);
if (varValue != null && varValue.trim().length() > 0 && varValue != "NULLFOUND" && ValueType == true)
{
System.out.println("ValueType2222222>>>>"+ValueType);
......@@ -1560,8 +1536,51 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
}
}
}
// Ended by Priyanka Das Request ID -D15ESUN002
}
else if(ValueType == false)
{
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
if (projCode != null && projCode.trim().length() > 0)
{
sql1 ="select proj_type from project where proj_code = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, projCode);
System.out.println("Project code is....."+ projCode);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
projType = checkNull(rs1.getString(1));
}
System.out.println("ProjectType>>>"+projType);
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
varValueprojectType = discommon.getDisparams("999999","PROJECT_TYPE_OPT", conn);
System.out.println(">>>>>>>>>In for loop afer schemeKey varValue for project type : "+varValueprojectType);
varValueprojectType = varValueprojectType.trim();
if(varValueprojectType != null && varValueprojectType.trim().length() > 0 && varValueprojectType != "NULLFOUND")
{
String varValprojecttypeArr[] = varValueprojectType.split(",");
ArrayList varValListprojectType = new ArrayList<String>(Arrays.asList(varValprojecttypeArr));
System.out.println("varValList in project Type ::"+varValListprojectType);
System.out.println("varValListIN PROJECT TYPE.contains(projectType) ::"+varValListprojectType.contains(projType));
if((varValListprojectType.contains(projType.trim())))
{
System.out.println("In error for project type");
errCode = "VTINVPROJ2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
}// Ended by Priyanka Das Request ID -D15ESUN002
if (childNodeName.equalsIgnoreCase("req_date"))
{
......
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