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{ ...@@ -43,10 +43,10 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
return retString; 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() ::-------------"); System.out.println("-------------:: Inside BusinessLogicChkOverride Override() ::-------------");
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ITMDBAccessEJB itmDBAccess = null; ITMDBAccessEJB itmDBAccess = null;
...@@ -73,7 +73,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -73,7 +73,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
conn.setAutoCommit(false); conn.setAutoCommit(false);
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
itmDBAccess = new ITMDBAccessEJB(); itmDBAccess = new ITMDBAccessEJB();
today = new java.sql.Timestamp(System.currentTimeMillis()) ; today = new java.sql.Timestamp(System.currentTimeMillis()) ;
String empCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginEmpCode" ); String empCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginEmpCode" );
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" ); userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
...@@ -97,8 +97,8 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -97,8 +97,8 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
System.out.println("Pavan>>>:: aprvStat["+aprvStat+"]sorder["+sorder+"]crPolicy["+crPolicy+"]amdNo["+amdNo+"]"); System.out.println("Pavan>>>:: aprvStat["+aprvStat+"]sorder["+sorder+"]crPolicy["+crPolicy+"]amdNo["+amdNo+"]");
if ("O".equals(aprvStat)) if ("O".equals(aprvStat))
{ {
errString = itmDBAccess.getErrorString("", "VTCRCHKOVR", "","",conn); errString = itmDBAccess.getErrorString("", "VTCRCHKOVR", "","",conn);
return errString; return errString;
} }
else else
{ {
...@@ -115,7 +115,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -115,7 +115,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
*/ */
sql = "update BUSINESS_LOGIC_CHECK set APRV_STAT = 'O', EMP_CODE__APRV = ?, APRV_DATE = ? where TRAN_ID = ?"; sql = "update BUSINESS_LOGIC_CHECK set APRV_STAT = 'O', EMP_CODE__APRV = ?, APRV_DATE = ? where TRAN_ID = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId); pstmt.setString(1, userId);
...@@ -125,7 +125,12 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -125,7 +125,12 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("BUSINESS_LOGIC_CHECK 1st updCnt[ "+updCnt+" ]"); 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) if(amdNo!= null && amdNo.trim().length() > 0)
{ {
...@@ -141,7 +146,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -141,7 +146,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if("N".equals(confirmed)) if("N".equals(confirmed))
{ {
sql = "select count(*) as cnt from business_logic_check where aprv_stat <> 'O' and amd_no = ? "; 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{ ...@@ -156,10 +161,10 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(cnt == 0 ) //Update Aprv_stat as M for confirm so amd. 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 = ?"; sql = "update business_logic_check set aprv_stat = 'M', emp_code__aprv = ?, aprv_date = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId); pstmt.setString(1, userId);
pstmt.setTimestamp(2, today); pstmt.setTimestamp(2, today);
...@@ -179,14 +184,14 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -179,14 +184,14 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
{ {
return errString; return errString;
} }
} }
} }
} }
else else
{ {
if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19 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 = ?"; 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{ ...@@ -201,7 +206,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "select count(*) as cnt from business_logic_check where sale_order = ? and aprv_stat = 'F'"; sql = "select count(*) as cnt from business_logic_check where sale_order = ? and aprv_stat = 'F'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sorder); pstmt.setString(1, sorder);
...@@ -216,7 +221,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -216,7 +221,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt = null; pstmt = null;
if( overrideCnt == 0 ) if( overrideCnt == 0 )
{ {
sql = "update sorder set cr_check_stat = 'O' where sale_order = ?"; sql = "update sorder set cr_check_stat = 'O' where sale_order = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sorder); pstmt.setString(1, sorder);
...@@ -242,7 +247,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -242,7 +247,7 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if("N".equals(confirmed)) if("N".equals(confirmed))
{ {
sql = "select count(*) as cnt from business_logic_check where aprv_stat <> 'O' and sale_order = ?"; 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{ ...@@ -258,25 +263,25 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("unconfirmed cnt "+cnt); System.out.println("unconfirmed cnt "+cnt);
if( cnt == 0 ) if( cnt == 0 )
{ {
if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19 if(!"C".equalsIgnoreCase(tranType))//condition added by nandkumar gadkari on 01/10/19
{ {
sordConf = new SorderConf(); sordConf = new SorderConf();
errString = sordConf.confirmSorder(sorder, "", xtraParams, conn); errString = sordConf.confirmSorder(sorder, "", xtraParams, conn);
sordConf = null; sordConf = null;
} }
System.out.println("Sorder Confirm returning... ["+errString+"]"); System.out.println("Sorder Confirm returning... ["+errString+"]");
if (errString.indexOf("VTCNFSUCC") > 0 || errString.trim().length() == 0) if (errString.indexOf("VTCNFSUCC") > 0 || errString.trim().length() == 0)
{ {
errString = itmDBAccess.getErrorString("", "OVRRIDSUCC", "","",conn); errString = itmDBAccess.getErrorString("", "OVRRIDSUCC", "","",conn);
}else }else
{ {
return errString; return errString;
} }
} }
} }
} }
} }
catch (Exception e) catch (Exception e)
...@@ -338,11 +343,11 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{ ...@@ -338,11 +343,11 @@ public class BusinessLogicChkOverride extends ActionHandlerEJB{
throw new ITMException(e); throw new ITMException(e);
} }
} }
return errString; return errString;
} }
private String checkNull(String str) private String checkNull(String str)
{ {
if(str == null) 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