Commit 321f518d authored by abibave's avatar abibave

Request Id: D16EBAS004

Added code for updating  wf_status column in EJB file for sales return workflow.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103347 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6b833886
......@@ -42,6 +42,10 @@ public class SaleReturnConfWF implements SaleReturnConfWFRemote, SaleReturnConfW
ConnDriver connDriver = new ConnDriver();
E12GenericUtility genericUtility = null;
if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag)){
retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag);
}
else{
try {
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
......@@ -135,7 +139,7 @@ public class SaleReturnConfWF implements SaleReturnConfWFRemote, SaleReturnConfW
retString = "Y";
} else {
retString = "N";
System.out.println("Exception while calling WSR component");
System.out.println("Exception in SaleReturnConfWF while calling WSR component");
}
} catch (Exception e) {
e.printStackTrace();
......@@ -151,10 +155,90 @@ public class SaleReturnConfWF implements SaleReturnConfWFRemote, SaleReturnConfW
}
}
}
System.out.println("Return string from confirm method is: "+retString);
}
System.out.println("Return string from SaleReturnConfWF confirm method is: "+retString);
return retString;
}
public String updateWfStatus(String tran_id,String empCodeAprv, String loginSiteCode, String wfStatus) {
String retString = "";
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = "";
try
{
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
if ("C".equalsIgnoreCase(wfStatus)) {
sql = "UPDATE SRETURN SET WF_STATUS = 'C' WHERE TRAN_ID = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, tran_id);
int cnt = pStmt.executeUpdate();
if (cnt > 0) {
conn.commit();
retString = "Y";
}
else{
retString = "N";
}
} else if("R".equalsIgnoreCase(wfStatus)){
sql = "UPDATE SRETURN SET WF_STATUS = 'R' WHERE TRAN_ID = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, tran_id);
int cnt = pStmt.executeUpdate();
if (cnt > 0) {
conn.commit();
retString = "Y";
}
else{
retString = "N";
}
}
else{
System.out.println("Workflow In Progress");
}
}
catch (Exception e)
{
try {
conn.rollback();
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
System.out.println("Exception : SaleReturnConfWF : updateWfStatus() : ==>\n" + e.getMessage());
e.printStackTrace();
}
finally
{
try
{
if(rs !=null)
{
rs.close();rs=null;
}
if(pStmt != null)
{
pStmt.close();pStmt = null;
}
if(conn!=null)
{
conn.close();
conn=null;
}
}
catch(SQLException sqlEx)
{
System.out.println("Exception in updateWfStatus() Finally "+sqlEx.getMessage());
sqlEx.printStackTrace();
}
}
return retString;
}
}
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