Commit 80da8d63 authored by pdas's avatar pdas

Request ID-D15ESUN002

CHANGES MADE FOR PORJECT CODE VALIDATION


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99186 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 68e9bc59
...@@ -138,6 +138,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -138,6 +138,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String linearr []; String linearr [];
String temparr =""; String temparr ="";
int a =0;
ArrayList line =new ArrayList();
double quantitypoamddet = 0, ratepoamddet = 0, totAmtDetPoamdDetbrowtemp = 0;
String line1 ="";
String startStr ="",endStr = "",descrStr = "",descrStart ="", descrEnd ="" ,exchRateStr ="",value ="";
double exchRatePoAmd =0;
try { try {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -881,7 +887,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -881,7 +887,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
+ acctCodeCr); + acctCodeCr);
System.out.println("noOfParent@@@@@@@@@@@" System.out.println("noOfParent@@@@@@@@@@@"
+ noOfParent); + noOfParent);
int a = 0; a = 0;
for (a = noOfParent - 1; a >= 0; a--) { for (a = noOfParent - 1; a >= 0; a--) {
...@@ -1045,79 +1051,66 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1045,79 +1051,66 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} }
// Added by Priyanka Das Request ID -D15ESUN002 // Added by Priyanka Das Request ID -D15ESUN002
pordNo = checkNull(genericUtility.getColumnValue( pordNo = checkNull(genericUtility.getColumnValue("purc_order", dom));
"purc_order", dom)); lineNoOrd = genericUtility.getColumnValue("line_no__ord", dom);
lineNoOrd = genericUtility.getColumnValue( lineNoOrd = lineNoOrd == null || lineNoOrd.trim().length() == 0 ? " ": lineNoOrd;
"line_no__ord", dom);
lineNoOrd = lineNoOrd == null
|| lineNoOrd.trim().length() == 0 ? " "
: lineNoOrd;
amdNo = checkNull(genericUtility.getColumnValue( amdNo = checkNull(genericUtility.getColumnValue("amd_no", dom));
"amd_no", dom)); purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
purcOrder = checkNull(genericUtility.getColumnValue( indNo = checkNull(genericUtility.getColumnValue("ind_no", dom));
"purc_order", dom)); varValue = discommon.getDisparams("999999","TYPE_ALLOW_PROJBUDGET", conn);
indNo = checkNull(genericUtility.getColumnValue(
"ind_no", dom));
varValue = discommon.getDisparams("999999",
"TYPE_ALLOW_PROJBUDGET", conn);
sql = "select pord_type from porder where purc_order = ?"; sql = "select pord_type from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next())
{
pordType = rs.getString(1); pordType = rs.getString(1);
} }
System.out.println("Amdtype.........." + pordType); System.out.println("Amdtype.........." + pordType);
if (varValue != null && varValue.trim().length() > 0 if (varValue != null && varValue.trim().length() > 0 && varValue != "NULLFOUND"
&& varValue != "NULLFOUND" && pordType.equalsIgnoreCase(varValue))
&& pordType.equalsIgnoreCase(varValue)) { {
System.out.println("Project Code>>>> [" + projCode); System.out.println("Project Code>>>> [" + projCode);
if (projCode == null if (projCode == null || projCode.trim().length() == 0)
|| projCode.trim().length() == 0) { {
errCode = "VEPRJ1"; errCode = "VEPRJ1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
} }
if (projCode != null if (projCode != null && projCode.trim().length() > 0)
&& projCode.trim().length() > 0) { {
errCode = isExist("project", "proj_code", errCode = isExist("project", "proj_code",
projCode, conn); projCode, conn);
if ("FALSE".equalsIgnoreCase(errCode)) { if ("FALSE".equalsIgnoreCase(errCode))
{
errCode = "VTPROJ1"; errCode = "VTPROJ1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break;
} }
ordDateStr = checkNull(genericUtility ordDateStr = checkNull(genericUtility
.getColumnValue("ord_date", dom1)); .getColumnValue("ord_date", dom1));
System.out System.out.println("orderdate>>>>" + ordDateStr);
.println("orderdate>>>>" + ordDateStr); pordDate = Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr,
// sd = new genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())
// SimpleDateFormat(genericUtility.getDBDateFormat());
pordDate = Timestamp.valueOf(genericUtility
.getValidDateString(ordDateStr,
genericUtility
.getApplDateFormat(),
genericUtility
.getDBDateFormat())
+ " 00:00:00.0"); + " 00:00:00.0");
// pordDate =
// Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr,genericUtility.getDBDateFormat()));
// pordDate = (Timestamp) sd.parse(ordDateStr);
System.out.println("pordDate>>>>" + pordDate); System.out.println("pordDate>>>>" + pordDate);
sql = "select count(*) from project where proj_code = ? and ? between start_date and end_date OR ? between start_date and ext_end_date"; sql = "select count(*) from project where proj_code = ? and ? between start_date" +
" and end_date OR ? between start_date and ext_end_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
pstmt.setTimestamp(2, pordDate); pstmt.setTimestamp(2, pordDate);
pstmt.setTimestamp(3, pordDate); pstmt.setTimestamp(3, pordDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next())
{
cntproj = rs.getInt(1); cntproj = rs.getInt(1);
} }
...@@ -1126,10 +1119,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1126,10 +1119,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out System.out.println("Count for project not between order date>>>> + "+ cntproj);
.println("Count for project not between order date>>>> + " if (cntproj == 0)
+ cntproj); {
if (cntproj == 0) {
errCode = "VTINVORDT"; errCode = "VTINVORDT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1138,20 +1130,22 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1138,20 +1130,22 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
sql1 = "select approx_cost from project where proj_code = ?"; sql1 = "select approx_cost from project where proj_code = ?";
projCode = checkNull(genericUtility projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
.getColumnValue("proj_code", dom));
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, projCode); pstmt1.setString(1, projCode);
System.out.println("Project code is....." System.out.println("Project code is....."+ projCode);
+ projCode);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
while (rs1.next()) { while (rs1.next())
{
approxCost = rs1.getDouble(1); approxCost = rs1.getDouble(1);
System.out System.out.println("approxCost for Project Code>>>>>>>> "+ approxCost);
.println("approxCost for Project Code>>>>>>>> "
+ approxCost);
} }
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql = "select count(*) from porder,porddet" sql = "select count(*) from porder,porddet"
+ " where (porddet.purc_order = porder.purc_order)" + " where (porddet.purc_order = porder.purc_order)"
...@@ -1160,7 +1154,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1160,7 +1154,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
cntporder = rs.getInt(1); cntporder = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -1168,9 +1163,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1168,9 +1163,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Count for porder>>>> + " System.out.println("Count for porder>>>> + "+ cntporder);
+ cntporder); if (cntporder >= 1)
if (cntporder >= 1) { {
errCode = "VTDUPROJ1"; errCode = "VTDUPROJ1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1178,7 +1173,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1178,7 +1173,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} }
System.out.println("AmdNo>>>>>" + amdNo); System.out.println("AmdNo>>>>>" + amdNo);
if (amdNo == null || amdNo.trim().length() == 0) { if (amdNo == null || amdNo.trim().length() == 0)
{
amdNo = "@@@@@"; amdNo = "@@@@@";
} }
sql = "select count(*) from poamd_hdr,poamd_det" sql = "select count(*) from poamd_hdr,poamd_det"
...@@ -1189,7 +1185,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1189,7 +1185,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
pstmt.setString(2, amdNo); pstmt.setString(2, amdNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
cntamd = rs.getInt(1); cntamd = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -1197,14 +1194,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1197,14 +1194,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Count for poamd>>>> + " System.out.println("Count for poamd>>>> + "+ cntamd);
+ cntamd);
if (cntamd >= 1) { if (cntamd >= 1)
{
errCode = "VTDUPRO3"; errCode = "VTDUPRO3";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break;
} }
...@@ -1217,7 +1214,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1217,7 +1214,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
cntind = rs.getInt(1); cntind = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -1225,20 +1223,20 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1225,20 +1223,20 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Count for indent>>>> + " System.out.println("Count for indent>>>> + "+ cntind);
+ cntind); if (cntind >= 1)
if (cntind >= 1) { {
errCode = "VTDUPROJ2"; errCode = "VTDUPROJ2";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break;
} }
sql = "select count(*) from indent_hdr where confirmed = 'N' and proj_code = ? "; sql = "select count(*) from indent_hdr where confirmed = 'N' and proj_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
cntindhdr = rs.getInt(1); cntindhdr = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -1246,21 +1244,19 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1246,21 +1244,19 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out System.out.println("Count for indent where unconfirmed indent>>>> + "+ cntindhdr);
.println("Count for indent where unconfirmed indent>>>> + " if (cntindhdr >= 1)
+ cntindhdr); {
if (cntindhdr >= 1) {
errCode = "VTDUPROJ"; errCode = "VTDUPROJ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break;
} }
sql1 = "select count(*) from indent_amd where confirmed = 'N' and proj_code = ? "; sql1 = "select count(*) from indent_amd where confirmed = 'N' and proj_code = ? ";
pstmt = conn.prepareStatement(sql1); pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
cntindamdhdr = rs.getInt(1); cntindamdhdr = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -1268,15 +1264,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1268,15 +1264,12 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out System.out.println("Count for indent where unconfirmed indent>>>> + "+ cntindhdr);
.println("Count for indent where unconfirmed indent>>>> + " if (cntindamdhdr >= 1)
+ cntindhdr); {
if (cntindamdhdr >= 1) {
errCode = "VTDUPROJ3"; errCode = "VTDUPROJ3";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break;
} }
/* /*
...@@ -1326,21 +1319,15 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1326,21 +1319,15 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" + " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'"; + " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'";
projCode = checkNull(genericUtility projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
pstmt.setString(2, pordNo); pstmt.setString(2, pordNo);
// pstmt.setString(3, lineNoOrd);
System.out
.println("Project code is in porder....."
+ projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
totAmtDetpordertot = rs.getDouble(1); totAmtDetpordertot = rs.getDouble(1);
System.out System.out.println("totAmtDet for Porder without in loop>>>>>>>> "+ totAmtDetpordertot);
.println("totAmtDet for Porder without in loop>>>>>>>> "
+ totAmtDetpordertot);
} }
rs.close(); rs.close();
...@@ -1348,9 +1335,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1348,9 +1335,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot);
.println("totAmtDet for Porder outside loop>>>>>>>> "
+ totAmtDetpordertot);
/* /*
* sql1 = * sql1 =
...@@ -1383,108 +1368,58 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1383,108 +1368,58 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
* "totAmtDet for Porder outside loop>>>>>>>> " * "totAmtDet for Porder outside loop>>>>>>>> "
* + totAmtDetporder); * + totAmtDetporder);
*/ */
System.out.println("dom@@@@" System.out.println("dom@@@@"+ genericUtility.serializeDom(dom));
+ genericUtility.serializeDom(dom)); System.out.println("dom1111@@@@"+ genericUtility.serializeDom(dom1));
System.out.println("dom1111@@@@" System.out.println("dom2222222222@@@@"+ genericUtility.serializeDom(dom2));
+ genericUtility.serializeDom(dom1)); NodeList detail2List = dom2.getElementsByTagName("Detail2");
System.out.println("dom2222222222@@@@"
+ genericUtility.serializeDom(dom2));
NodeList detail2List = dom2
.getElementsByTagName("Detail2");
System.out.println("ChildNOde" + childNodeName); System.out.println("ChildNOde" + childNodeName);
System.out.println("detail2List" + detail2List); System.out.println("detail2List" + detail2List);
noOfParent = detail2List.getLength(); noOfParent = detail2List.getLength();
System.out.println("NO OF PARENT@@@@"+ noOfParent); System.out.println("NO OF PARENT@@@@"+ noOfParent);
int a = 0; a = 0;
projCode = checkNull(genericUtility projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
.getColumnValue("proj_code", dom));
System.out.println("projCode>>>>" + projCode); System.out.println("projCode>>>>" + projCode);
ArrayList line =new ArrayList();
for (a = 0; a < noOfParent; a++) for (a = 0; a < noOfParent; a++)
{ {
System.out.println("in loop");
System.out.println(" detail2List.item(a)" System.out.println(" detail2List.item(a)"+ detail2List.item(a));
+ detail2List.item(a)); System.out.println(genericUtility.getColumnValueFromNode("proj_code",detail2List.item(a))+ "in genericutility");
System.out.println(genericUtility String projcodeBrow = checkNull(genericUtility.getColumnValueFromNode("proj_code",detail2List.item(a)));
.getColumnValueFromNode( System.out.println("projcodebrow>>>"+ projcodeBrow);
"proj_code",
detail2List.item(a))
+ "in genericutility");
String projcodeBrow = checkNull(genericUtility
.getColumnValueFromNode(
"proj_code",
detail2List.item(a)));
System.out.println("projcodebrow>>>"
+ projcodeBrow);
System.out.println("projcode>>" + projCode); System.out.println("projcode>>" + projCode);
if (projcodeBrow.equals(projCode)) {
if (projcodeBrow.equals(projCode))
{
System.out.println("in condition!!!"); System.out.println("in condition!!!");
String quantitypoamd = checkNull(genericUtility String quantitypoamd = checkNull(genericUtility.getColumnValueFromNode("quantity",detail2List.item(a)));
.getColumnValueFromNode( quantitypoamddet = quantitypoamd == null ? 0: Double.parseDouble(quantitypoamd);
"quantity", System.out.println("<quantitypoamd >@@@@@@ "+ quantitypoamd);
detail2List.item(a))); String ratepoamd = checkNull(genericUtility.getColumnValueFromNode("rate",detail2List.item(a)));
double quantitypoamddet = 0, ratepoamddet = 0, totAmtDetPoamdDetbrowtemp = 0; ratepoamd = ratepoamd != null&& ratepoamd.trim().length() > 0 ? ratepoamd.trim() : "0";
quantitypoamddet = quantitypoamd == null ? 0 System.out.println("<ratepoamd > @@@@@@@@@@@@@@@@@"+ ratepoamd);
: Double.parseDouble(quantitypoamd); ratepoamddet = ratepoamd == null ? 0: Double.parseDouble(ratepoamd);
System.out totAmtDetPoamdDetbrowtemp = quantitypoamddet* ratepoamddet;
.println("<quantitypoamd >@@@@@@ " pordNo = checkNull(genericUtility.getColumnValueFromNode("purc_order",detail2List.item(a)));
+ quantitypoamd); linenoOrdBrow = checkNull(genericUtility.getColumnValueFromNode("line_no__ord",detail2List.item(a)));
String ratepoamd = checkNull(genericUtility
.getColumnValueFromNode("rate",
detail2List.item(a)));
ratepoamd = ratepoamd != null
&& ratepoamd.trim().length() > 0 ? ratepoamd
.trim() : "0";
System.out
.println("<ratepoamd > @@@@@@@@@@@@@@@@@"
+ ratepoamd);
ratepoamddet = ratepoamd == null ? 0
: Double.parseDouble(ratepoamd);
totAmtDetPoamdDetbrowtemp = quantitypoamddet
* ratepoamddet;
pordNo = checkNull(genericUtility
.getColumnValueFromNode(
"purc_order",
detail2List.item(a)));
linenoOrdBrow = checkNull(genericUtility
.getColumnValueFromNode(
"line_no__ord",
detail2List.item(a)));
System.out.println("linenoOrdBrow>>>" +linenoOrdBrow ); System.out.println("linenoOrdBrow>>>" +linenoOrdBrow );
if(linenoOrdBrow == null || linenoOrdBrow.trim().length() == 0) if(linenoOrdBrow == null || linenoOrdBrow.trim().length() == 0)
{ {
linenoOrdBrow ="@"; linenoOrdBrow ="@";
} }
System.out.println("totAmtDetPoamdDetbrowtemp @@@ "+ totAmtDetPoamdDetbrowtemp);
System.out.println("totamtdetpoamd"); totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrowtemp + totAmtDetPoamdDetbrow;
System.out
.println("totAmtDetPoamdDetbrowtemp @@@ "
+ totAmtDetPoamdDetbrowtemp);
totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrowtemp
+ totAmtDetPoamdDetbrow;
temparr = temparr + linenoOrdBrow +","; temparr = temparr + linenoOrdBrow +",";
//line.add(lineNoOrd);
} }
} }
if(temparr.length() >0) if(temparr.length() >0)
{ {
String tempArray[]=temparr.split(","); String tempArray[]=temparr.split(",");
System.out.println("tempArray[].length :-["+tempArray.length+"]"); System.out.println("tempArray[].length :-["+tempArray.length+"]");
System.out.println("line!!!!"+line); System.out.println("line!!!!"+line);
String line1 ="";
for(int itrArr=0; itrArr < tempArray.length;itrArr++) for(int itrArr=0; itrArr < tempArray.length;itrArr++)
{ {
line1=line1+"'"+tempArray[itrArr]+"',"; line1=line1+"'"+tempArray[itrArr]+"',";
...@@ -1492,156 +1427,73 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1492,156 +1427,73 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} }
System.out.println("line1 before sql:- ["+line1+"]"); System.out.println("line1 before sql:- ["+line1+"]");
line1=line1.substring(0, line1.length()-1); line1=line1.substring(0, line1.length()-1);
sql1 = "select sum((a.quantity * a.rate) * b.exch_rate) " +
sql1 = "select sum((a.quantity * a.rate) * exch_rate) " +
"from porddet a, porder b" "from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" + " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order = ? and line_no NOT IN ( "+ line1 +")"; + " and a.proj_code = ? and a.purc_order = ? and line_no NOT IN ( "+ line1 +")";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
projCode = checkNull(genericUtility
.getColumnValue("proj_code",
dom));
pstmt = conn.prepareStatement(sql1); pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode); pstmt.setString(1, projCode);
pstmt.setString(2, pordNo); pstmt.setString(2, pordNo);
System.out.println("pordNo is....."+ pordNo);
System.out.println("pordNo is....." System.out.println("Project code is....."+ projCode);
+ pordNo);
System.out
.println("Project code is....."
+ projCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) { if (rs.next())
{
String totAmtDetpordertempstr = rs
.getString(1);
totAmtDetpordertempstr = totAmtDetpordertempstr != null
&& totAmtDetpordertempstr
.trim().length() > 0 ? totAmtDetpordertempstr
.trim() : "0.0";
totAmtDetpordertemp = Double
.parseDouble(totAmtDetpordertempstr);
totAmtDetporder = totAmtDetporder
+ totAmtDetpordertemp;
System.out
.println("totAmtDet for Porder in loop>>>>>>>> "
+ totAmtDetporder);
String totAmtDetpordertempstr = rs.getString(1);
totAmtDetpordertempstr = totAmtDetpordertempstr != null && totAmtDetpordertempstr.trim().length() > 0 ? totAmtDetpordertempstr.trim() : "0.0";
totAmtDetpordertemp = Double.parseDouble(totAmtDetpordertempstr);
totAmtDetporder = totAmtDetporder + totAmtDetpordertemp;
System.out.println("totAmtDet for Porder in loop>>>>>>>> "+ totAmtDetporder);
} }
} }
System.out System.out.println("totAmtDetPoamdDetbrow>>"+ totAmtDetPoamdDetbrow);
.println("totAmtDetPoamdDetbrow>>" System.out.println("totAmtDet for poamd>>>>>>>> "+ totAmtDetPoamdDetbrow);
+ totAmtDetPoamdDetbrow); System.out.println("totAmtDet for porder>>>>>>>> "+ totAmtDetporder);
exchRateStr = checkNull(genericUtility.getColumnValue("exch_rate", dom1));
// System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ exchRatePoAmd =Double.parseDouble(exchRateStr);
// totAmtDetIndent);
System.out
.println("totAmtDet for poamd>>>>>>>> "
+ totAmtDetPoamdDetbrow);
System.out
.println("totAmtDet for porder>>>>>>>> "
+ totAmtDetporder);
String exchRateStr = checkNull(genericUtility.getColumnValue(
"exch_rate", dom1));
double exchRatePoAmd =Double.parseDouble(exchRateStr);
System.out.println("Exchrate>>"+exchRatePoAmd); System.out.println("Exchrate>>"+exchRatePoAmd);
totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrow *exchRatePoAmd; totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrow *exchRatePoAmd;
totAmtProj = totAmtDetPoamdDetbrow + totAmtDetporder+ totAmtDetpordertot;
totAmtProj = totAmtDetPoamdDetbrow+ totAmtDetporder+ totAmtDetpordertot;
System.out.println("totAmtProj>>>>> "+ totAmtProj); System.out.println("totAmtProj>>>>> "+ totAmtProj);
if (totAmtProj > approxCost) { if (totAmtProj > approxCost)
{
errCode = "VTPROJCOST"; errCode = "VTPROJCOST";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
// errCode = "VTPROJCOST";
// TODO
errCode = "VTPROJCOST"; errCode = "VTPROJCOST";
errString = getErrorString("proj_code", errString = getErrorString("proj_code",errCode, userId);
errCode, userId); System.out.println("::: errorstring ::: "+ errString);
// errString = startStr = errString.substring(0,errString.indexOf("<description>") + 13);
// itmDBAccessEJB.getErrorString("","VTPROJCOST","","",conn); endStr = errString.substring(errString.indexOf("</description>"),errString.length());
System.out descrStr = errString.substring(errString.indexOf("<description>") + 13,errString.indexOf("</description>"));
.println("::: errorstring ::: " descrStart = descrStr.substring(0, descrStr.indexOf("]"));
+ errString); descrEnd = descrStr.substring(descrStr.indexOf("]"),descrStr.length());
value = "Approx Cost Of budget : "+ BigDecimal.valueOf(approxCost).toPlainString()
String startStr = errString
.substring(0,
errString
.indexOf("<description>") + 13);
String endStr = errString
.substring(
errString
.indexOf("</description>"),
errString.length());
String descrStr = errString
.substring(
errString
.indexOf("<description>") + 13,
errString
.indexOf("</description>"));
String descrStart = descrStr.substring(
0, descrStr.indexOf("]"));
String descrEnd = descrStr.substring(
descrStr.indexOf("]"),
descrStr.length());
/*
* String totAmtProjStr
* =Double.toString(totAmtProj); String
* approxCostStr =
* Double.toString(approxCost); String
* totAmtDetPoamdDetbrowStr
* =Double.toString
* (totAmtDetPoamdDetbrow);
*/
String value = "Approx Cost Of budget : "+ BigDecimal.valueOf(approxCost).toPlainString()
+ ", Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj).toPlainString(); + ", Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj).toPlainString();
System.out.println("Value ::: "+ value);
System.out.println("Tajuddin ::: "+ value); descrStart = descrStart.concat(value).concat(descrEnd);
errString = startStr.concat(descrStart).concat(endStr);
descrStart = descrStart.concat(value)
.concat(descrEnd);
errString = startStr.concat(descrStart)
.concat(endStr);
errorType = errorType(conn, errCode); errorType = errorType(conn, errCode);
if (errString.length() > 0) { if (errString.length() > 0)
String bifurErrString = errString {
.substring(errString.indexOf("<Errors>") + 8, String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8,errString.indexOf("<trace>"));
errString
.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>")); bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString); errStringXml.append(bifurErrString);
errString = ""; errString = "";
System.out.println("In errorString Length"); System.out.println("In errorString Length");
} }
System.out.println("ErrorType>>>>>>" System.out.println("ErrorType>>>>>>"+ errorType);
+ errorType); if (errorType.equalsIgnoreCase("E"))
{
if (errorType.equalsIgnoreCase("E")) { System.out.println("ErrorType in loop>>>>>>"+ errorType);
System.out
.println("ErrorType in loop>>>>>>"
+ errorType);
break; break;
} }
// return errString;
/*
* errList.add(errCode);
* errFields.add(childNodeName
* .toLowerCase()); break;
*/
} }
} }
} }
...@@ -2778,7 +2630,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -2778,7 +2630,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} }
System.out System.out
.println("noOfParent@@@@@@@@@@@" + noOfParent); .println("noOfParent@@@@@@@@@@@" + noOfParent);
int a = 0; a = 0;
for (a = 1; a <= noOfParent; a++) { for (a = 1; a <= noOfParent; a++) {
System.out.println("noOfParent@@@@@@@@@@@" System.out.println("noOfParent@@@@@@@@@@@"
......
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