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
......@@ -859,19 +859,20 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
{
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 + "]");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
pstmt.setString(2, acctountPeriod);
pstmt.setString(3, cantactCode);
//pstmt.setString(4, tranID);
pstmt.setString(1, periodCodeFrom);
pstmt.setString(2, finEntity);
pstmt.setString(3, acctountPeriod);
pstmt.setString(4, cantactCode);
pstmt.setString(5, tranID);
rs = pstmt.executeQuery();
if(rs.next()){
prdCodeFrm = rs.getString("prd_code__fr");
prdCodeTo = rs.getString("prd_code__to");
countRecord = rs.getInt("count");
}
rs.close();
......@@ -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 ? )";
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)
if( countRecord > 0 )
{
System.out.println("errorrrrrrrrrrrrr");
errCode = "VTTRANSACT";
......@@ -903,10 +890,7 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
......@@ -964,34 +948,32 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
errList.add(errCode);
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 = ? ";
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 + "]");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
pstmt.setString(2, acctountPeriod);
pstmt.setString(3, cantactCode);
//pstmt.setString(4, tranID);
pstmt.setString(1, periodCodeTo);
pstmt.setString(2, finEntity);
pstmt.setString(3, acctountPeriod);
pstmt.setString(4, cantactCode);
pstmt.setString(5, tranID);
rs = pstmt.executeQuery();
if(rs.next()){
prdCodeFrm = rs.getString("prd_code__fr");
prdCodeTo = rs.getString("prd_code__to");
countRecord = rs.getInt("count");
}
rs.close();
......@@ -1001,31 +983,18 @@ public class RelPartyDefIC extends ValidatorEJB implements RelPartyDefICLocal, R
sql = "select count(*) as count from rela_party_hdr where tran_id <> ? and ? between ? and ? ";
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");
errCode = "VTACCALR";
errCode = "VTTRANSACT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = 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