Commit a13efc25 authored by ssalve's avatar ssalve

Sarita : Done changes in FullFinalPos to perform validation for emp_code and...

Sarita : Done changes in FullFinalPos to perform validation for emp_code and confirmed <>  'X' on 29/08/2019

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206370 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f01f1abb
......@@ -55,14 +55,48 @@ public class FullFinalPos extends ValidatorEJB implements FullFinalPosLocal, Ful
Document headerDom = null;
//modified by sarita on 28/AUG/2019 [START]
int cnt = 0;
String empCode = "";
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
//modified by sarita on 28/AUG/2019 [END]
try
{
System.out.println("XML String :"+xmlString);
headerDom = genericUtility.parseString(xmlString);
tranId = checkNullAndTrim(genericUtility.getColumnValue("tran_id",headerDom));
//modified by sarita on 28/AUG/2019 [START]
empCode = checkNullAndTrim(genericUtility.getColumnValue("emp_code",headerDom));
System.out.println("Transaction ID :: ["+tranId+"] \t Employee Code is :: ["+empCode+"]");
sql = "select count(*) as cnt from fullfinal_hdr where emp_code = ? and tran_id <> ? and confirmed <> 'X'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setString(2,tranId);
rs = pstmt.executeQuery();
cnt = 0;
if(rs.next())
{
cnt = rs.getInt("cnt");
}
System.out.println("Count is ===" + cnt);
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0)
{
errString = itmDBAccessEJB.getErrorString("","VTEMP1","","",conn);
return errString;
}
//modified by sarita on 28/AUG/2019 [END]
sql = "SELECT SUM(CASE WHEN NET_AMT IS NULL THEN 0 ELSE NET_AMT END) AS NET_AMT , SUM(CASE WHEN AMOUNT IS NULL THEN 0 ELSE AMOUNT END) AS AMOUNT FROM FULLFINAL_DET WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1 , tranId);
......@@ -89,11 +123,13 @@ public class FullFinalPos extends ValidatorEJB implements FullFinalPosLocal, Ful
pstmt.setDouble(2 , totAmtDet);
pstmt.setString(3 , tranId);
updCnt = pstmt.executeUpdate();
if (rs != null)
//modified by sarita on 28/AUG/2019 [START]
/*if (rs != null)
{
rs.close();
rs = null;
}
}*/
//modified by sarita on 28/AUG/2019 [END]
if (pstmt != null)
{
pstmt.close();
......
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