Commit 1ce13e81 authored by prahate's avatar prahate

Changes done for Charge back replacement.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194133 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 47f6b927
...@@ -335,7 +335,8 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -335,7 +335,8 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
// errString = itmDBAccessEJB.getErrorString("emp_code", "VMECODENULL", userId); // errString = itmDBAccessEJB.getErrorString("emp_code", "VMECODENULL", userId);
// break; // break;
// return errString; // return errString;
errList.add("VMECODENULL"); //errList.add("VMECODENULL");
errList.add("VMEMPCD");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} else } else
{ {
...@@ -781,6 +782,78 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -781,6 +782,78 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
} }
} }
}// END FOR OF CASE2 }// END FOR OF CASE2
//Added by Saiprasad G. [When the settle_mth change in edit case] START
settlemth=genericUtility.getColumnValue("settle_mth", dom2,"1");
System.out.println("settlemth in case2 p : "+settlemth);
parentNodeList1 = null;
parentNodeList1 = dom2.getElementsByTagName("Detail2");
parentNode = null;
childNodeList = null;
childNodeListLength = 0;
childNode = null;
childNodeName = "";
System.out.println("All the object are done null case2 : "+childNodeList);
//boolean isUpdated = false;
parentNodeListPOCLen = 0;
parentNodeListPOCLen = parentNodeList1.getLength();
System.out.println("parentNodeListPOCLen case2: "+ parentNodeListPOCLen);
for ( int rowCnt=0; rowCnt < parentNodeListPOCLen; rowCnt++ )
{
parentNode = parentNodeList1.item(rowCnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName : "+childNodeName);
if(childNodeName.equalsIgnoreCase("attribute"))
{
String updateNodeValue = childNode.getAttributes().getNamedItem("updateFlag").getFirstChild().getNodeValue();
System.out.println("updateNodeValue case2: "+updateNodeValue);
if((settlemth.equalsIgnoreCase("V") || settlemth.equalsIgnoreCase("Q"))&&(! "D".equalsIgnoreCase(updateNodeValue)))
{
errList.add("VMNVSECOND");
errFields.add(childNodeName.toLowerCase());
}
}
}
}
parentNodeList2 = null;
parentNodeList2 = dom2.getElementsByTagName("Detail3");
parentNode = null;
childNodeList = null;
childNodeListLength = 0;
childNode = null;
childNodeName = "";
System.out.println("All the object are done null Detail3: "+childNodeList);
parentNodeListPOCLen1 = 0;
parentNodeListPOCLen1 = parentNodeList2.getLength();
System.out.println("parentNodeListPOCLen1 : "+ parentNodeListPOCLen1);
for ( int rowCnt=0; rowCnt < parentNodeListPOCLen1; rowCnt++ )
{
parentNode = parentNodeList2.item(rowCnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName : "+childNodeName);
if(childNodeName.equalsIgnoreCase("attribute"))
{
String updateNodeValue2 = childNode.getAttributes().getNamedItem("updateFlag").getFirstChild().getNodeValue();
System.out.println("updateNodeValue Detail3 : "+updateNodeValue2);
if((settlemth.equalsIgnoreCase("C")) && (! "D".equalsIgnoreCase(updateNodeValue2)))
{
errList.add("VMINVTHIRD");
errFields.add(childNodeName.toLowerCase());
}
}
}
}
//Added by Saiprasad G. [When the settle_mth change in edit case] END
break; break;
//Added by saiprasad on 22-Nov-18 for replacement form. //Added by saiprasad on 22-Nov-18 for replacement form.
case 3: case 3:
......
...@@ -773,28 +773,38 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -773,28 +773,38 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
// & "quantity replacement" in charge back then data inserted into scheme // & "quantity replacement" in charge back then data inserted into scheme
// balance table] // balance table]
// For the charge_back // For the charge_back
int updatedCount = 0;
System.out.println("tranId::[" + tranID + "]"); System.out.println("tranId::[" + tranID + "]");
chargeBakSql = "SELECT CUST_CODE, SETTLE_MTH FROM CHARGE_BACK WHERE TRAN_ID=?"; chargeBakSql = "SELECT CUST_CODE, SETTLE_MTH FROM CHARGE_BACK WHERE TRAN_ID=?";
System.out.println(chargeBakSql); System.out.println(chargeBakSql);
pstmt = conn.prepareStatement(chargeBakSql); PreparedStatement preparedStatement = null, preparedStatement1 = null;
pstmt.setString(1, tranID); ResultSet resultSet = null;
rs = pstmt.executeQuery(); preparedStatement = conn.prepareStatement(chargeBakSql);
if (rs.next()) { preparedStatement.setString(1, tranID);
custCode1 = rs.getString("CUST_CODE"); resultSet = preparedStatement.executeQuery();
if (resultSet.next()) {
custCode1 = resultSet.getString("CUST_CODE");
System.out.println("customer code1::[" + custCode1 + "]"); System.out.println("customer code1::[" + custCode1 + "]");
settleMethod = rs.getString("SETTLE_MTH"); settleMethod = resultSet.getString("SETTLE_MTH");
System.out.println("Settle method1::[" + settleMethod + "]"); System.out.println("Settle method1::[" + settleMethod + "]");
} }
rs.close(); if(resultSet != null)
rs = null; {
pstmt.close(); resultSet.close();
pstmt = null; resultSet = null;
}
if(preparedStatement != null)
{
preparedStatement.close();
preparedStatement = null;
}
// For the charge_back_repl // For the charge_back_repl
secondarySchSql = "SELECT ITEM_CODE__REPL,FREE_QTY,FREE_VALUE,OFFER FROM CHARGE_BACK_REPL WHERE TRAN_ID=?"; secondarySchSql = "SELECT ITEM_CODE__REPL,FREE_QTY,FREE_VALUE,OFFER FROM CHARGE_BACK_REPL WHERE TRAN_ID=?";
System.out.println(secondarySchSql); System.out.println(secondarySchSql);
pstmt = conn.prepareStatement(secondarySchSql); preparedStatement1 = conn.prepareStatement(secondarySchSql);
pstmt.setString(1, tranID); preparedStatement1.setString(1, tranID);
rs = pstmt.executeQuery(); rs = preparedStatement1.executeQuery();
while (rs.next()) while (rs.next())
{ {
itemCodeRepl = E12GenericUtility.checkNull(rs.getString("ITEM_CODE__REPL")); itemCodeRepl = E12GenericUtility.checkNull(rs.getString("ITEM_CODE__REPL"));
...@@ -874,32 +884,37 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -874,32 +884,37 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmt.setTimestamp(12, effFrom1); pstmt.setTimestamp(12, effFrom1);
pstmt.setString(13, termId); pstmt.setString(13, termId);
pstmt.setString(14, "A"); pstmt.setString(14, "A");
int i = pstmt.executeUpdate(); updatedCount = pstmt.executeUpdate();
System.out.println("Data inserted:" + i); System.out.println("Data inserted:..." + updatedCount);
if (i > 0) if (updatedCount > 0)
{ {
conn.commit(); conn.commit();
} }
else else
{ {
conn.rollback(); conn.rollback();
} }
pstmt.close(); if(pstmt != null)
pstmt = null; {
} pstmt.close();
else if(settleMethod.equalsIgnoreCase("C")) pstmt = null;
{ }
} }
} }
rs.close(); if(rs != null)
rs = null; {
pstmt.close(); rs.close();
pstmt = null; rs = null;
}
if(preparedStatement1 != null)
{
preparedStatement1.close();
preparedStatement1 = null;
}
//Added by Saiprasad G. END //Added by Saiprasad G. END
returnString = itmDBAccessEJB.getErrorString("","TRANCONFSC",userId);
returnString = itmDBAccessEJB.getErrorString("","TRANCONFSC",userId,"",conn);
} }
else else
...@@ -918,7 +933,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -918,7 +933,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("ChrgBckLocConfEJB..."+e.getMessage()); System.out.println("ChrgBckLocConfEJB..."+e);
e.printStackTrace(); e.printStackTrace();
try try
{ {
...@@ -926,7 +941,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -926,7 +941,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
} }
catch(Exception e1) catch(Exception e1)
{ {
System.out.println("ChrgBckLocConfEJB..."+e1.getMessage()); System.out.println("ChrgBckLocConfEJB..."+e1);
e1.printStackTrace(); e1.printStackTrace();
} }
} }
......
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