Commit 250fb50f authored by arane's avatar arane

Fail Business logic not giving any message that its successfully done

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217554 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b92cbeed
......@@ -43,10 +43,10 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
return retString;
}
public String override(String tranId, String xtraParams, String forcedFlag, Connection conn)throws RemoteException, ITMException
public String override(String tranId, String xtraParams, String forcedFlag, Connection conn)throws RemoteException, ITMException
{
System.out.println("-------------:: Inside BusinessLogicChkOverride Override() ::-------------");
E12GenericUtility genericUtility = null;
System.out.println("-------------:: Inside BusinessLogicChkOverride Override() ::-------------");
E12GenericUtility genericUtility = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ITMDBAccessEJB itmDBAccess = null;
......@@ -73,7 +73,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
conn.setAutoCommit(false);
genericUtility = new E12GenericUtility();
itmDBAccess = new ITMDBAccessEJB();
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
String empCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginEmpCode" );
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
......@@ -97,8 +97,8 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
System.out.println("Pavan>>>:: aprvStat["+aprvStat+"]sorder["+sorder+"]crPolicy["+crPolicy+"]amdNo["+amdNo+"]");
if ("O".equals(aprvStat))
{
errString = itmDBAccess.getErrorString("", "VTCRCHKOVR", "","",conn);
return errString;
errString = itmDBAccess.getErrorString("", "VTCRCHKOVR", "","",conn);
return errString;
}
else
{
......@@ -115,7 +115,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null;
pstmt.close();
pstmt = null;
*/
*/
sql = "update BUSINESS_LOGIC_CHECK set APRV_STAT = 'O', EMP_CODE__APRV = ?, APRV_DATE = ? where TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId);
......@@ -125,7 +125,12 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close();
pstmt = null;
System.out.println("BUSINESS_LOGIC_CHECK 1st updCnt[ "+updCnt+" ]");
//Added by Anagha Rane 05/02/2020 START
//for Fail Bussiness logic not giving any message that its successfully done
errString = itmDBAccess.getErrorString("", "OVRRIDSUCC", "","",conn);
//Added by Anagha Rane 05/02/2020 END
}
if(amdNo!= null && amdNo.trim().length() > 0)
{
......@@ -141,7 +146,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null;
pstmt.close();
pstmt = null;
if("N".equals(confirmed))
{
sql = "select count(*) as cnt from business_logic_check where aprv_stat <> 'O' and amd_no = ? ";
......@@ -156,10 +161,10 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null;
pstmt.close();
pstmt = null;
if(cnt == 0 ) //Update Aprv_stat as M for confirm so amd.
{
sql = "update business_logic_check set aprv_stat = 'M', emp_code__aprv = ?, aprv_date = ? where tran_id = ?";
if(cnt == 0 ) //Update Aprv_stat as M for confirm so amd.
{
sql = "update business_logic_check set aprv_stat = 'M', emp_code__aprv = ?, aprv_date = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId);
pstmt.setTimestamp(2, today);
......@@ -179,14 +184,14 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
{
return errString;
}
}
}
}
}
else
{
if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19
{
sql = "select (case when confirmed is null then 'N' else confirmed end) as CONFIRMED from sorder where sale_order = ?";
......@@ -201,7 +206,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null;
pstmt.close();
pstmt = null;
sql = "select count(*) as cnt from business_logic_check where sale_order = ? and aprv_stat = 'F'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sorder);
......@@ -216,7 +221,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt = null;
if( overrideCnt == 0 )
{
sql = "update sorder set cr_check_stat = 'O' where sale_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sorder);
......@@ -242,7 +247,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close();
pstmt = null;
}
if("N".equals(confirmed))
{
sql = "select count(*) as cnt from business_logic_check where aprv_stat <> 'O' and sale_order = ?";
......@@ -258,25 +263,25 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close();
pstmt = null;
System.out.println("unconfirmed cnt "+cnt);
if( cnt == 0 )
{
if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19
if( cnt == 0 )
{
if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19
{
sordConf = new SorderConf();
errString = sordConf.confirmSorder(sorder, "", xtraParams, conn);
sordConf = null;
sordConf = new SorderConf();
errString = sordConf.confirmSorder(sorder, "", xtraParams, conn);
sordConf = null;
}
System.out.println("Sorder Confirm returning... ["+errString+"]");
if (errString.indexOf("VTCNFSUCC") > 0 || errString.trim().length() == 0)
System.out.println("Sorder Confirm returning... ["+errString+"]");
if (errString.indexOf("VTCNFSUCC") > 0 || errString.trim().length() == 0)
{
errString = itmDBAccess.getErrorString("", "OVRRIDSUCC", "","",conn);
errString = itmDBAccess.getErrorString("", "OVRRIDSUCC", "","",conn);
}else
{
return errString;
}
}
}
}
}
}
catch (Exception e)
......@@ -338,11 +343,11 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
throw new ITMException(e);
}
}
return errString;
}
private String checkNull(String str)
private String checkNull(String str)
{
if(str == 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