Commit 62ef89b6 authored by ysawant's avatar ysawant

Changes done to display Successful message on completion of process.

w_leave_open_balance.sql
LeaveOpenBalancePrc.java



git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205618 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d1129e15
......@@ -84,7 +84,7 @@ Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,E
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VTSEQ ','Invalid auto gen. logic','The logic for the autogeneration of transaction numbers for this option is not defined','E','Y',null,null,null,to_date('1999-10-22','RRRR-MM-DD'),'SUN','RITESH',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VTTRANID ','Invalid Tranid !','Unable to generate tran id','E',null,null,null,null,to_date('2000-07-06','RRRR-MM-DD'),'BASE ','SUN_ITM ',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('DS000 ','Database Exception','Database Error','E','Y',0,null,null,to_date('2006-03-23','RRRR-MM-DD'),'SEJAL ','SEJAL ',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VTPRCSUCC ','Process complete','process complete successfully ','P','Y',null,null,null,to_date('05-08-15','DD-MM-RR'),'BASE ','BASE111 ',null,null);
......@@ -38,12 +38,14 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
String retStr = "";
Connection conn = null;
Connection logConn = null;
String userId = "";
try
{
conn = getConnection();
logConn = getConnection();
System.out.println("Conn ["+conn+"]");
System.out.println("logConn ["+logConn+"]");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (xmlString != null && xmlString.trim().length() > 0)
{
headerDom = genericUtility.parseString(xmlString);
......@@ -56,6 +58,11 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
}
retStr = process(headerDom, detailDom, windowName, xtraParams, conn,logConn);
System.out.println("Process for LeaveOpenBalancePrc :::: " + retStr);
if(retStr == null || retStr.trim().length() == 0)
{
retStr = itmDBAccessEJB.getErrorString("","VTPRCSUCC ", userId, "", conn);
}
}
catch (Exception e)
{
......@@ -92,7 +99,6 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams, Connection conn, Connection logConn) throws RemoteException, ITMException
{
//LogWriterDatabase logWriter = new LogWriterDatabase();
HRLogWriter logWriter = new HRLogWriter();
ResultSet rs = null, rs1 = null, rs2 = null, rs3 = null ,rs4 = null;
......@@ -116,6 +122,7 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
String tranId = "";
String userId = "";
String termId = "";
String frDateStr = "";
Timestamp ldRelieveDate=null;
Timestamp frDate = null;
......@@ -333,8 +340,8 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
System.out.println("Data inside rowMap = "+rowMap);
lcPrevBal = ((Double) rowMap.get("csum_bal")).doubleValue();
lsEmpCode = (String) rowMap.get("emp_code");
lsLveCode = (String) rowMap.get("lve_code");
lsEmpCode = (String) rowMap.get("EMP_CODE");
lsLveCode = (String) rowMap.get("LVE_CODE");
ldProc = utilMethod.date(ldProcess);
System.out.println("lcPrevBal = "+lcPrevBal+"\nlsEmpCode = "+lsEmpCode+"\nlsLveCode = "+lsLveCode+"\nldProc = "+ldProc);
......@@ -400,6 +407,10 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
pstmt2.clearParameters();
//
frDate = utilMethod.dateTime(utilMethod.today());
System.out.println("frDate::::::::::::"+frDate);
frDateStr = genericUtility.getValidDateTimeString(frDate, genericUtility.getApplDateFormat());
System.out.println("frDateStr::::::::::::"+frDateStr);
Timestamp ldProcTs = new Timestamp(ldProc.getTime());
System.out.println("ldProcTs = "+ldProcTs);
......@@ -439,8 +450,8 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<eff_date>" + frDate + "</eff_date>";
xmlValues = xmlValues + "<tran_date>" + frDate + "</tran_date>";
xmlValues = xmlValues + "<eff_date>" + frDateStr + "</eff_date>";
xmlValues = xmlValues + "<tran_date>" + frDateStr + "</tran_date>";
xmlValues = xmlValues + "<site_code>" + lsEmpSite + "</site_code>";
xmlValues = xmlValues + "<work_site>" + lsWorkSite + "</work_site>";
xmlValues = xmlValues + "</Detail1></Root>";
......@@ -464,7 +475,6 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
pstmt5.setString(2,lsLveCode);
pstmt5.setTimestamp(3,ldEffDate);
pstmt5.setTimestamp(4,ldUptoDate);
pstmt5 = conn.prepareStatement(sql5);
cnt = pstmt5.executeUpdate();
pstmt5.clearParameters();
if(cnt < 0)
......@@ -488,7 +498,6 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
pstmt6.setTimestamp(9,frDate);
pstmt6.setString(10,userId);
pstmt6.setString(11,termId);
pstmt6 = conn.prepareStatement(sql6);
cnt = pstmt6.executeUpdate();
pstmt6.clearParameters();
if(cnt < 0)
......@@ -504,14 +513,13 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
pstmt7.setDouble(1,lcPrevBal);
pstmt7.setString(2,lsEmpCode);
pstmt7.setString(3,lsLveCode);
pstmt7.setTimestamp(3,ldProcTs);
pstmt7 = conn.prepareStatement(sql7);
pstmt7.setTimestamp(4,ldProcTs);
cnt = pstmt7.executeUpdate();
if(cnt == 1)
if(cnt > 0)
{
conn.commit();
}
if(cnt != 1)
else
{
errCode = "DS000NR";
errString = itmDBAccessEJB.getErrorString("", errCode, userId, "", conn);
......@@ -688,7 +696,7 @@ public class LeaveOpenBalancePrc extends ProcessEJB implements LeaveOpenBalanceP
{
input = "";
}
return input;
return input.trim();
}
......
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