Commit 34ef21ad authored by spawar's avatar spawar

Added Changes for hold sale order when adsi fail.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100259 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a4e26d86
...@@ -16280,6 +16280,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16280,6 +16280,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by samadhan on 04/12/2015 for handling special characters //Changed by samadhan on 04/12/2015 for handling special characters
//errString = getError(saleOrder + "[" + objReturn2.getMessage() +"]", "ADSISRVERR", conn); //errString = getError(saleOrder + "[" + objReturn2.getMessage() +"]", "ADSISRVERR", conn);
errString = getErrorNew("["+ saleOrder + "] " + objReturn2.getMessage() +" ", "ADSISRVERR", conn); errString = getErrorNew("["+ saleOrder + "] " + objReturn2.getMessage() +" ", "ADSISRVERR", conn);
//Changed by Samadhan on 23/02/2016 for hold sale order start
if("DDUK".equalsIgnoreCase(projectName))
{
holdSaleOrder(saleOrder,objReturn2.getMessage());
}
//Changed by Samadhan on 23/02/2016 for hold sale order end
return errString; return errString;
} }
else else
...@@ -26305,4 +26311,59 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -26305,4 +26311,59 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
return mainStr; return mainStr;
} }
//Changed by samadhan on 04/12/2015 for handling special characters End //Changed by samadhan on 04/12/2015 for handling special characters End
//Changed by samadhan on 23/02/2016 for hold sale order start
private String holdSaleOrder(String saleOrder,String reason) throws ITMException, Exception
{
String sorderHoldSql = "";
PreparedStatement pstmt = null;
Connection conn = null;
int updatedRows = 0;
String retString = "error";
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
sorderHoldSql = "UPDATE SORDER SET STATUS = ? ,SPEC_REASON = ? WHERE SALE_ORDER = ?";
pstmt = conn.prepareStatement(sorderHoldSql);
pstmt.setString(1, "H");
pstmt.setString(2, reason);
pstmt.setString(3, saleOrder);
updatedRows = pstmt.executeUpdate();
System.out.println(updatedRows+" Rows Updated for Sale Order: "+saleOrder);
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
conn.commit();
conn.close();
retString = "success";
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
conn.close();
}
catch (Exception e1)
{
throw new ITMException(e1);
}
}
return retString;
}
//Changed by samadhan on 23/02/2016 for hold sale order End
} }
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