Commit 4f3a6451 authored by caluka's avatar caluka

update query fails then show error message in porcpdet table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96361 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9ad7b96c
......@@ -745,6 +745,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setTimestamp(3, today);
pstmtUpd.setString(4, tranId);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -756,6 +760,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(2, termId);
pstmtUpd.setString(3, tranId);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -1387,6 +1395,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmt1.setString(2, tranId);
pstmt1.setString(3, lineNo);
updCnt = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
......@@ -1809,6 +1818,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(3, purcOrder);
pstmtUpd.setString(4, pordLine);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -1835,6 +1848,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, purcOrder);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -1909,6 +1926,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(3, formNo);
pstmtUpd.setInt(4, formLineNo);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -1988,6 +2009,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setDouble(2, bondTaxAmount);
pstmtUpd.setString(3, bondNo);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -2807,6 +2832,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
int updCnt = 0;
SimpleDateFormat dtFormat = null;
String xmlValues = "";
java.util.Date date = null;
try
{
......@@ -2816,6 +2842,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
GenericUtility genericUtility = GenericUtility.getInstance();
dtFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
dbName = CommonConstants.DB_NAME;
today = new java.sql.Timestamp(System.currentTimeMillis());
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(genericUtility.getDBDateFormat());
date = sdf.parse(today.toString());
today = java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0");
nullPo = distCommon.getDisparams("999999", "RCP_WO_PO", conn);
......@@ -3640,6 +3671,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setTimestamp(8, today);
pstmtUpd.setTimestamp(9, mfgDate);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -3647,7 +3682,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
{
if ( genLotSubctr.equalsIgnoreCase("Y") )
{
sql = "UPDATE PORCPDET SET LOT_NO = ?, LOT_SL = ? WHERE TRAN_ID = ? AND ITEM_CODE = ? AND LOC_CODE = ? AND (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ? AND (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END) = ? AND (CASE WHEN MFG_DATE IS NULL THEN ? ELSE MFG_DATE END) = ? ";
sql = "UPDATE PORCPDET SET LOT_NO = ?, LOT_SL = ? WHERE TRAN_ID = ? AND ITEM_CODE = ? AND LOC_CODE = ? AND (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ? AND (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END) = ? AND (CASE WHEN MFG_DATE IS NULL THEN ? ELSE MFG_DATE END) = ?";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, lotNoRcp);
pstmtUpd.setString(2, lotSl);
......@@ -3659,6 +3694,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setTimestamp(8, today);
pstmtUpd.setTimestamp(9, mfgDate);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -3971,6 +4010,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(4, batchNo);
pstmtUpd.setString(5, locCode);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
if ( pstmtUpd != null)
{
pstmtUpd.close();
......@@ -5604,7 +5647,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if ( ("Y").equalsIgnoreCase(allocated) )
{
sql = "UPDATE SORDALLOC SET STATUS = 'D' WHERE SALE_ORDER = ? AND LINE_NO = ? AND EXP_LEV = ? AND ITEM_CODE__ORD = ? AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ?";
sql = "UPDATE SORDALLOC SET STATUS = 'D' WHERE SALE_ORDER = ? AND LINE_NO = ? AND EXP_LEV = ? AND ITEM_CODE__ORD = ? AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, saleOrder);
pstmtUpd.setString(2, lineNoSord);
......@@ -5616,7 +5659,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(7, rs.getString("LOT_SL"));
pstmtUpd.setString(8, locHdr );
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
......@@ -5645,7 +5691,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(5, expLev);
pstmtUpd.setString(6, "0");
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -5716,10 +5765,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setDouble(1, totalAdditionalCost );
pstmtUpd.setString(2, tranId );
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
retString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
pstmtDspHdr.executeBatch();
pstmtDspHdr.clearBatch();
pstmtDspDtl.executeBatch();
......@@ -5993,7 +6045,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if(pstmtSql != null)
{
pstmtSql.close();
pstmtSql = null;
pstmtSql = null;
}
if ( rs != 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