Replace DealerMasterMakerSearchAction.java

parent c6e029ef
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* */ import javax.servlet.http.HttpSession; /* */ import javax.servlet.http.HttpSession;
/* */ import org.apache.commons.beanutils.BeanUtils; /* */ import org.apache.commons.beanutils.BeanUtils;
/* */ import org.apache.log4j.Logger; /* */ import org.apache.log4j.Logger;
import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionErrors;
/* */ import org.apache.struts.action.ActionForm; /* */ import org.apache.struts.action.ActionForm;
/* */ import org.apache.struts.action.ActionForward; /* */ import org.apache.struts.action.ActionForward;
/* */ import org.apache.struts.action.ActionMapping; /* */ import org.apache.struts.action.ActionMapping;
...@@ -122,13 +122,12 @@ import org.apache.struts.action.ActionErrors; ...@@ -122,13 +122,12 @@ import org.apache.struts.action.ActionErrors;
/* 125 */ String branch = CommonFunction.checkNull(request.getParameter("branchDesc")); /* 125 */ String branch = CommonFunction.checkNull(request.getParameter("branchDesc"));
/* 126 */ logger.info("branch : " + branch); /* 126 */ logger.info("branch : " + branch);
/* */ // PAN validation logic addded bvy Amol s -strt /* */ // PAN validation logic addded by Amol S -strt
String panNumber = CommonFunction.checkNull(request.getParameter("pan")).trim(); String panNumber = CommonFunction.checkNull(request.getParameter("pan")).trim();
logger.info("PAN NO:: " + panNumber); logger.info("PAN NO:: " + panNumber);
if (!panNumber.isEmpty()) if (!panNumber.isEmpty())
{ {
logger.info("Inside the if when pan is not empty Test--> " ); logger.info("Inside the if when pan is not empty Test ::--> " );
String panStatus = checkPANStatus(panNumber); String panStatus = checkPANStatus(panNumber);
if ("A".equalsIgnoreCase(panStatus)) { if ("A".equalsIgnoreCase(panStatus)) {
...@@ -139,8 +138,7 @@ import org.apache.struts.action.ActionErrors; ...@@ -139,8 +138,7 @@ import org.apache.struts.action.ActionErrors;
return mapping.findForward("openAdd"); return mapping.findForward("openAdd");
} }
} }
/* */ // PAN validation logic addded bvy Amol s -end /* */ // PAN validation logic addded by Amol s -end
/* 135 */ procval = bp.insertDealerMaster(vo, user, branch); /* 135 */ procval = bp.insertDealerMaster(vo, user, branch);
/* */ /* */
/* 137 */ if (!procval.equalsIgnoreCase("NONE")) { /* 137 */ if (!procval.equalsIgnoreCase("NONE")) {
...@@ -165,13 +163,12 @@ import org.apache.struts.action.ActionErrors; ...@@ -165,13 +163,12 @@ import org.apache.struts.action.ActionErrors;
/* 156 */ request.setAttribute("save", "save"); /* 156 */ request.setAttribute("save", "save");
/* 157 */ request.setAttribute("procval", procval); /* 157 */ request.setAttribute("procval", procval);
/* */ } /* */ }
//development is incopmlte pls procval value , how to set is not ? //development is incomplete procval value , how to set is not ?
else if (procval.equalsIgnoreCase("dataNotSaved")) { else if (procval.equalsIgnoreCase("Data is not saved successfully")) {
logger.info("Inside the block to test::" ); logger.info("Inside the block to test::" );
sms = "A"; // Setting the sms value to "A" sms = "A"; // Setting the sms value to "A"
request.setAttribute("save", "save"); request.setAttribute("save", "save");
request.setAttribute("procval", procval); request.setAttribute("procval", procval);
// Log the info for debugging purposes
logger.info("Setting SMS to: " + sms); logger.info("Setting SMS to: " + sms);
} }
//Ask to gagan to add the else if block for SMS =A //Ask to gagan to add the else if block for SMS =A
...@@ -189,19 +186,15 @@ import org.apache.struts.action.ActionErrors; ...@@ -189,19 +186,15 @@ import org.apache.struts.action.ActionErrors;
//method added by amol s , to check the recStatus on 22nov--strt //method added by amol s , to check the recStatus on 22nov--strt
public String checkPANStatus(String panNumber) throws SQLException, RemoteException { public String checkPANStatus(String panNumber) throws SQLException, RemoteException {
logger.info(" inside the checkPANStatus mehtod():: "); logger.info(" Inside the checkPANStatus mehtod():: ");
// SQL query to get the REC_STATUS for the given PAN number
String query= "SELECT REC_STATUS FROM cr_dsa_dealer_m_temp WHERE PAN = '" + panNumber + "'"; String query= "SELECT REC_STATUS FROM cr_dsa_dealer_m_temp WHERE PAN = '" + panNumber + "'";
//String query = "SELECT t.REC_STATUS, m.REC_STATUS FROM cr_dsa_dealer_m_temp t LEFT JOIN cr_dsa_dealer_m m ON t.PAN = m.PAN WHERE t.PAN = :panNumber OR m.PAN = :panNumber";
PrepStmtObject prepStmtObject = new PrepStmtObject(); PrepStmtObject prepStmtObject = new PrepStmtObject();
prepStmtObject.setSql(query); prepStmtObject.setSql(query);
// Execute the query and get the REC_STATUS value
String recStatus = CommonFunction.checkNull(ConnectionDAOforEJB.singleReturnPrepStmt(prepStmtObject)); String recStatus = CommonFunction.checkNull(ConnectionDAOforEJB.singleReturnPrepStmt(prepStmtObject));
logger.info(" recStatus value :: "+ recStatus); logger.info(" recStatus value :: "+ recStatus);
return recStatus; return recStatus;
} }
// end //method added by amol s , to check the recStatus on 22nov--end
/* to check the values in both the table --strt /* to check the values in both the table --strt
* public String checkPANStatus(String panNumber) throws SQLException, RemoteException { * public String checkPANStatus(String panNumber) throws SQLException, RemoteException {
...@@ -240,6 +233,8 @@ import org.apache.struts.action.ActionErrors; ...@@ -240,6 +233,8 @@ import org.apache.struts.action.ActionErrors;
} }
//end //end
/* */ /* */
/* */ public ActionForward openEditDealer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { /* */ public ActionForward openEditDealer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
/* 186 */ DealerMasterVo dealerMasterVo = new DealerMasterVo(); /* 186 */ DealerMasterVo dealerMasterVo = new DealerMasterVo();
/* 187 */ ServletContext context = getServlet().getServletContext(); /* 187 */ ServletContext context = getServlet().getServletContext();
...@@ -366,132 +361,7 @@ import org.apache.struts.action.ActionErrors; ...@@ -366,132 +361,7 @@ import org.apache.struts.action.ActionErrors;
/* */ /* */
/* 309 */ return mapping.findForward("editDealer"); /* 309 */ return mapping.findForward("editDealer");
/* */ } /* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ /* */
/* */ public ActionForward forwardDealerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { /* */ public ActionForward forwardDealerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
/* 439 */ ServletContext context = getServlet().getServletContext(); /* 439 */ ServletContext context = getServlet().getServletContext();
......
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