Commit 06b91b35 authored by nkhan's avatar nkhan

Added by nasruddin


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101647 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 43976c26
...@@ -853,25 +853,26 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R ...@@ -853,25 +853,26 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
finEntity = checkNull(genericUtility.getColumnValue("fin_entity",dom)); finEntity = checkNull(genericUtility.getColumnValue("fin_entity",dom));
cantactCode = checkNull(genericUtility.getColumnValue("contact_code",dom)); cantactCode = checkNull(genericUtility.getColumnValue("contact_code",dom));
tranID = checkNull(genericUtility.getColumnValue("tran_id",dom)) ; tranID = checkNull(genericUtility.getColumnValue("tran_id",dom)) ;
if(tranID ==null || tranID.trim().length()==0) if(tranID ==null || tranID.trim().length()==0)
{ {
tranID ="@@"; tranID ="@@";
} }
sql ="select min(prd_code__fr) as prd_code__fr, max(prd_code__to) as prd_code__to from rela_party_hdr where fin_entity = ? and acct_prd= ? and contact_code = ? ";
sql =" select count(1) as count from rela_party_hdr where ? between prd_code__fr and prd_code__to " +
" and fin_entity = ? and acct_prd = ? and contact_code = ? and tran_id <> ? ";
System.out.println("sql ===========>>>>[" + sql + "]"); System.out.println("sql ===========>>>>[" + sql + "]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity); pstmt.setString(1, periodCodeFrom);
pstmt.setString(2, acctountPeriod); pstmt.setString(2, finEntity);
pstmt.setString(3, cantactCode); pstmt.setString(3, acctountPeriod);
//pstmt.setString(4, tranID); pstmt.setString(4, cantactCode);
pstmt.setString(5, tranID);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
prdCodeFrm = rs.getString("prd_code__fr"); countRecord = rs.getInt("count");
prdCodeTo = rs.getString("prd_code__to");
} }
rs.close(); rs.close();
...@@ -881,21 +882,7 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R ...@@ -881,21 +882,7 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
sql = "select count(*) as count from rela_party_hdr where tran_id <> ? and ( ? between ? and ? )"; if( countRecord > 0 )
System.out.println("sql ["+ sql +"]");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranID);
pstmt.setString(2, periodCodeFrom);
pstmt.setString(3, prdCodeFrm);
pstmt.setString(4, prdCodeTo);
rs = pstmt.executeQuery();
if(rs.next()){
countRecord = rs.getInt("count");
}
System.out.println("count Record ["+ countRecord + "]");
//if( countRecord > 0 || Integer.parseInt(checkNllOrBlank( periodCodeTo)) <= Integer.parseInt(checkNllOrBlank( prdCodeTo )))
if( countRecord > 0)
{ {
System.out.println("errorrrrrrrrrrrrr"); System.out.println("errorrrrrrrrrrrrr");
errCode = "VTTRANSACT"; errCode = "VTTRANSACT";
...@@ -903,10 +890,7 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R ...@@ -903,10 +890,7 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
...@@ -964,69 +948,54 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R ...@@ -964,69 +948,54 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else{
/*
finEntity = checkNull(genericUtility.getColumnValue("fin_entity",dom));
cantactCode = checkNull(genericUtility.getColumnValue("contact_code",dom));
tranID = checkNull(genericUtility.getColumnValue("tran_id",dom)) ;
if(tranID ==null || tranID.trim().length()==0)
{
tranID ="@@";
}
sql ="select min(prd_code__fr) as prd_code__fr, max(prd_code__to) as prd_code__to from rela_party_hdr where fin_entity = ? and acct_prd= ? and contact_code = ? ";
System.out.println("sql ===========>>>>[" + sql + "]");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
pstmt.setString(2, acctountPeriod);
pstmt.setString(3, cantactCode);
//pstmt.setString(4, tranID);
rs = pstmt.executeQuery(); finEntity = checkNull(genericUtility.getColumnValue("fin_entity",dom));
if(rs.next()){ cantactCode = checkNull(genericUtility.getColumnValue("contact_code",dom));
prdCodeFrm = rs.getString("prd_code__fr");
prdCodeTo = rs.getString("prd_code__to");
} tranID = checkNull(genericUtility.getColumnValue("tran_id",dom)) ;
if(tranID ==null || tranID.trim().length()==0)
rs.close(); {
rs = null; tranID ="@@";
pstmt.close(); }
pstmt = null;
sql =" select count(1) as count from rela_party_hdr where ? between prd_code__fr and prd_code__to " +
" and fin_entity = ? and acct_prd = ? and contact_code = ? and tran_id <> ? ";
System.out.println("sql ===========>>>>[" + sql + "]");
sql = "select count(*) as count from rela_party_hdr where tran_id <> ? and ? between ? and ? "; pstmt = conn.prepareStatement(sql);
System.out.println("sql ["+ sql +"]"); pstmt.setString(1, periodCodeTo);
pstmt = conn.prepareStatement(sql); pstmt.setString(2, finEntity);
pstmt.setString(1, tranID); pstmt.setString(3, acctountPeriod);
pstmt.setString(2, periodCodeFrom); pstmt.setString(4, cantactCode);
pstmt.setString(3, prdCodeFrm); pstmt.setString(5, tranID);
pstmt.setString(4, prdCodeTo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
countRecord = rs.getInt("count");
}
System.out.println("count Record ["+ countRecord + "]");
if( countRecord > 0 || Integer.parseInt(checkNllOrBlank( periodCodeTo)) <= Integer.parseInt(checkNllOrBlank( prdCodeTo ))){
System.out.println("errorrrrrrrrrrrrr");
errCode = "VTACCALR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
countRecord = rs.getInt("count");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null;*/ pstmt = null;
//}
if( countRecord > 0 )
{
System.out.println("errorrrrrrrrrrrrr");
errCode = "VTTRANSACT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
} }
} }
......
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