@RequestMapping(value = "/adminreset", method = RequestMethod.POST) public ModelAndView adminReset(HttpServletRequest request, @RequestParam("id") String adminId) { System.out.println("In auth adminresetForm method"); String autopwd = request.getParameter("autopwd"); System.out.println("autopwd" + autopwd); String newpassword = request.getParameter("newpassword"); System.out.println("newpassword" + newpassword); String adminid = request.getParameter("adminid"); System.out.println("adminid" + adminid); ModelAndView model = new ModelAndView(); Admin admin = new Admin(); System.out.println("adminId" + adminId); merchantService.updateadminreset(adminId, newpassword); List<Admin> merchantdetails = merchantService.admindetails(adminId); System.out.println("merchantdetails==>" + merchantdetails); System.out.println("merchantdetails" + merchantdetails); String adminuname = merchantdetails.get(0).getUsername(); System.out.println("adminuname" + adminuname); String adminautopassword = merchantdetails.get(0).getAutopassword(); System.out.println("adminautopassword" + adminautopassword); String adminnewpassword = merchantdetails.get(0).getPassword(); System.out.println("adminnewpassword" + adminnewpassword); if (autopwd.equals(adminautopassword) && newpassword.equals(adminnewpassword)) { System.out.println("success"); model.setViewName("/acquirer/adminlogin"); } else { String error = "Enter the correct autopassword and newpassword"; System.out.println("error" + error); model = new ModelAndView("/acquirer/adminresetpassword"); model.addObject("error", error); } return model; }
@RequestMapping(value = "/forgetform", method = RequestMethod.POST) public ModelAndView forgetForm( HttpServletRequest request, @RequestParam("id") String hdnmerchantId) { System.out.println("In auth forgetForm method"); String mailid = request.getParameter("email"); System.out.println("mailid" + mailid); ModelAndView model = new ModelAndView(); Merchant merchant = new Merchant(); String randomPwd = generateRandomString(); String encryptedPwd = encrypt(randomPwd); System.out.println("merchantId==>" + encryptedPwd); if (encryptedPwd != null) { merchant.setAutogeneratedPassword(encryptedPwd); } else { merchant.setAutogeneratedPassword(""); } String password = merchant.getAutogeneratedPassword(); System.out.println("password==>" + password); String decryptedPwd = decrypt(password); merchantService.updateautopassword(hdnmerchantId, decryptedPwd); List<Merchant> merchantList = merchantService.getMerchantdetails(hdnmerchantId); System.out.println("Modifylist" + merchantList); String mername = merchantList.get(0).getMerchantName(); System.out.println("mername" + mername); sendEmailPassword(mailid, request, password, mername); String merchantId = merchantList.get(0).getMerchantId(); System.out.println("mername" + mername); model.addObject("mername", mername); model.addObject("merchantId", hdnmerchantId); model.setViewName("acquirer/mailforget"); return model; }
@RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView indexPage(HttpServletRequest request) { List<Securitytable> securlist = merchantService.getSecurityques(); ModelAndView model = new ModelAndView("acquirer/adminlogin"); model.addObject("securlist", securlist); return model; }
@RequestMapping(value = "/refundpopup", method = RequestMethod.GET) public @ResponseBody ModelAndView refundPopup(HttpServletRequest request, ModelMap modelmap) { ModelAndView model = null; try { String tmid = request.getParameter("tid"); System.out.println("tmid==>" + tmid); List<TransationMonitoring> tmlist = paymentService.getTransationMonitoringValue(tmid); if (tmlist != null) { TransationMonitoring tm = tmlist.get(0); System.out.println(tm.getChargebackauthorizestatus()); String merid = tm.getMerchantid(); String txncurr = tm.getTxncurrency(); String setcurr = tm.getSettlecurrency(); List<Merchant> merlist = merchantService.getMerchantdetails(merid); List<CurrencyCode> txnlist = paymentService.getCurrencyName(txncurr); List<CurrencyCode> setlist = paymentService.getCurrencyName(setcurr); modelmap.addAttribute("merlist", merlist); modelmap.addAttribute("txnlist", txnlist); modelmap.addAttribute("setlist", setlist); } modelmap.addAttribute("tmlist", tmlist); model = new ModelAndView("uam/refundpopup"); } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/txnadjustment", method = RequestMethod.GET) public ModelAndView TxnAdjustment(HttpServletRequest request, ModelMap modelmap) { ModelAndView model = new ModelAndView(); try { AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); // --audit function start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date = new Date(); System.out.println("date and time==>" + dateFormat.format(date)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("open the transaction adjuestment"); audit.setLogdate(dateFormat.format(date)); int auditid = merchantService.saveAudit(audit); // --audit function end-- } catch (Exception e) { e.printStackTrace(); } model.setViewName("uam/txnadjustment"); return model; }
@RequestMapping(value = "/acctadjust", method = RequestMethod.GET) public ModelAndView acctAdjust(HttpServletRequest request, ModelMap modelmap) { ModelAndView model = new ModelAndView(); try { List<CurrencyCode> cclist = paymentService.getCurrencyCode(); List<Merchant> merlist = merchantService.getMerchantdetails(); modelmap.addAttribute("cclist", cclist); modelmap.addAttribute("merlist", merlist); } catch (Exception e) { e.printStackTrace(); } model.setViewName("uam/acctadjust"); return model; }
@RequestMapping(value = "/modifymerchant", method = RequestMethod.GET) public @ResponseBody ModelAndView modifyMerchant( HttpServletRequest request, @RequestParam("id") String merchantid) { System.out.println("In auth modifyMerchant method"); System.out.println("id==>" + merchantid); ModelAndView model = new ModelAndView(); model = new ModelAndView("acquirer/Modifymerchant"); /*String id = (String) request.getAttribute("value"); System.out.println("id==>"+id);*/ List<Merchant> merchantList = merchantService.getMerchantdetails(merchantid); System.out.println("Modifylist=>" + merchantList); if (merchantList != null) { String mailid = merchantList.get(0).getEmailId(); String mername = merchantList.get(0).getMerchantName(); long mobile = merchantList.get(0).getMobile(); long tel = merchantList.get(0).getTelephone(); String country = merchantList.get(0).getCountry(); String region = merchantList.get(0).getRegion(); String business = merchantList.get(0).getBusiness(); Date DOB = merchantList.get(0).getDOB(); String address = merchantList.get(0).getAddress(); String member = merchantList.get(0).getMembershiptype(); long txnfee = merchantList.get(0).getTransactionfee(); long id = merchantList.get(0).getId(); model.addObject("merchantList", merchantList); model.addObject("merchantId", merchantid); model.addObject("mername", mername); model.addObject("DOB", DOB); model.addObject("mailid", mailid); model.addObject("mobile", mobile); model.addObject("tel", tel); model.addObject("business", business); model.addObject("region", region); model.addObject("address", address); model.addObject("country", country); model.addObject("member", member); model.addObject("txnfee", txnfee); model.addObject("id", id); } return model; }
@RequestMapping(value = "/loginform", method = RequestMethod.POST) public ModelAndView loginForm(HttpServletRequest request) { System.out.println("In auth updatedetail method"); ModelAndView model = null; try { HttpSession sessionObj = request.getSession(); String username = request.getParameter("username"); String password = request.getParameter("password"); /*String adminid="123"; List<Admin> merchantdetails= merchantService.admindetails(adminid); */ List<Admin> merchantdetails = merchantService.checkAdminDetails(username, password); if (merchantdetails != null) { String adminuname = merchantdetails.get(0).getUsername(); String adminpassword = merchantdetails.get(0).getPassword(); String adminid = merchantdetails.get(0).getAdminid(); String adminname = merchantdetails.get(0).getAdminname(); sessionObj.setAttribute("adminid", adminid); sessionObj.setAttribute("adminname", adminname); if (username.equals(adminuname) && password.equals(adminpassword)) { System.out.println("success"); model = new ModelAndView("acquirer/index"); } else { String error = "Enter the correct username and password"; model = new ModelAndView("acquirer/adminlogin"); model.addObject("error", error); } } else { String error = "Enter the correct username and password"; model = new ModelAndView("acquirer/adminlogin"); model.addObject("error", error); } } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/adminforget", method = RequestMethod.POST) public ModelAndView adminForget(HttpServletRequest request) { ModelAndView model = new ModelAndView(); try { System.out.println("In auth adminforgetForm method"); String mailid = request.getParameter("email"); System.out.println("mailid" + mailid); Admin admin = new Admin(); List<Admin> admindetails = merchantService.getdetailsusingmailid(mailid); System.out.println("admindetails==>" + admindetails); if (admindetails == null) { String note = "Enter the Registered Mail ID"; System.out.println("note" + note); model.addObject("note", note); model.addObject("pagename", "forgot"); model.setViewName("acquirer/adminlogin"); } else { String adminuname = admindetails.get(0).getUsername(); System.out.println("adminuname" + adminuname); String adminid = admindetails.get(0).getAdminid(); System.out.println("adminId" + adminid); String password = admindetails.get(0).getPassword(); System.out.println("password" + password); sendEmaildbPassword(mailid, request, password, adminuname); model.addObject("adminuname", adminuname); model.addObject("adminId", adminid); model.setViewName("acquirer/adminforgetmail"); } } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/insertaccountajustment", method = RequestMethod.GET) public ModelAndView saveAccountAdjustment(HttpServletRequest request, ModelMap modelmap) { ModelAndView model = new ModelAndView(); try { AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); AccountAdjustment aa = new AccountAdjustment(); aa.setDebitaccount(request.getParameter("hiddendebitacct")); aa.setCreditaccount(request.getParameter("hiddencreditacct")); aa.setAdjustamount(Integer.parseInt(request.getParameter("hiddenadjustacct"))); aa.setCurrency(request.getParameter("hiddentcurrency")); aa.setReason(request.getParameter("hiddenreason")); int id = paymentService.saveAccountAdjustment(aa); // --audit function start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date = new Date(); System.out.println("date and time==>" + dateFormat.format(date)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("Insert the account adjustment"); audit.setLogdate(dateFormat.format(date)); int auditid = merchantService.saveAudit(audit); // --audit function end-- model.setViewName("uam/acctadjustsuccess"); } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/adminchange", method = RequestMethod.POST) public ModelAndView adminChange(HttpServletRequest request) { System.out.println("In auth adminChange method"); String newpassword = request.getParameter("newpassword"); System.out.println("newpassword" + newpassword); ModelAndView model = new ModelAndView(); try { Admin admin = new Admin(); HttpSession sessionObj = request.getSession(); String adminid = sessionObj.getAttribute("adminid").toString(); // sessionObj.setAttribute("adminname" , adminname); System.out.println("adminid" + adminid); List<Admin> merchantdetails = merchantService.admindetails(adminid); System.out.println("merchantdetails==>" + merchantdetails); String adminpwd = merchantdetails.get(0).getPassword(); System.out.println("adminpwd" + adminpwd); String adminpwd1 = merchantdetails.get(0).getPasswd1(); System.out.println("adminpwd1" + adminpwd1); if (adminpwd1 == null && !adminpwd.equals(newpassword)) { merchantService.updatepwd1(adminid, newpassword); } else { model.setViewName("acquirer/changepwdpopup"); String adminpwd2 = merchantdetails.get(0).getPasswd2(); System.out.println("adminpwd2" + adminpwd2); if (adminpwd2 == null && !adminpwd.equals(newpassword) && !adminpwd1.equals(newpassword)) { merchantService.updatepwd2(adminid, newpassword); } else { model.setViewName("acquirer/changepwdpopup"); if (!adminpwd2.equals(newpassword) && !adminpwd.equals(newpassword) && !adminpwd1.equals(newpassword)) { merchantService.updateadminreset(adminid, adminpwd1); System.out.println("updateadminreset"); merchantService.updatepwd1(adminid, adminpwd2); System.out.println("updatepwd1"); merchantService.updatepwd2(adminid, newpassword); System.out.println("updatepwd2"); String note = "Reset password Successfully"; System.out.println("note" + note); model.addObject("note", note); model.setViewName("acquirer/changepwdpopup"); model.addObject("pagename", "resetsuccess"); // model.setViewName("/acquirer/adminlogin"); } else { String note1 = "You are not allowed to enter last three Password"; System.out.println("note" + note1); model.addObject("error", note1); model.setViewName("acquirer/changepwdpopup"); // merchantService.updateadminreset(adminid,newpassword); } } } } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/updatedetails", method = RequestMethod.POST) public @ResponseBody ModelAndView updateDetails(HttpServletRequest request) { System.out.println("In auth updatedetail method"); ModelAndView model = null; try { AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); String merchantid = request.getParameter("merchantId").trim(); System.out.println("merchantid" + merchantid); String merchantname = request.getParameter("merchantName"); String merchantemail = request.getParameter("merchantEmailId"); String merchantdob = request.getParameter("merchantDOB"); System.out.println("merchantdob" + merchantdob); String merchantmobile = request.getParameter("merchantMobile"); // long mermobile = Long.to(merchantmobile); String merchantbusiness = request.getParameter("merchantBusiness"); String merchantregion = request.getParameter("merchantregion"); String merchantcountry = request.getParameter("merchantCountry"); String merchanttel = request.getParameter("merchantTel"); // long mertel = Long.parseLong(merchanttel); String merchantaddress = request.getParameter("merchantAddress"); System.out.println("merchantaddress" + merchantaddress); String merchantmember = request.getParameter("merchantmember"); String merchanttxnfee = request.getParameter("transactionfee"); // long mertxn = Long.parseLong(merchanttxnfee); String id = request.getParameter("merchant_id"); long merid = Long.valueOf(id).longValue(); System.out.println("check" + merid); Merchant merchant = new Merchant(); merchant.setId(merid); merchant.setMerchantId(merchantid); merchant.setMerchantName(merchantname); // merchant.setDOB(merchantdob); DateFormat df2 = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss"); Date merchantDOB; try { merchantDOB = (Date) df2.parse(merchantdob); System.out.println("merchantDOB" + merchantDOB); merchant.setDOB(merchantDOB); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } merchant.setMobile(Long.valueOf(merchantmobile).longValue()); merchant.setEmailId(merchantemail); merchant.setTelephone(Long.valueOf(merchanttel).longValue()); merchant.setBusiness(merchantbusiness); merchant.setRegion(merchantregion); merchant.setAddress(merchantaddress); merchant.setCountry(merchantcountry); merchant.setMembershiptype(merchantmember); merchant.setTransactionfee(Long.valueOf(merchanttxnfee).longValue()); merchantService.updatemodifydetails(merchant); // --audit process start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date = new Date(); System.out.println("date and time==>" + dateFormat.format(date)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("Update the merchent '" + merchantname + "'"); audit.setLogdate(dateFormat.format(date)); int auditid = merchantService.saveAudit(audit); // --audit process end-- model = new ModelAndView("treatement/searchmerchant"); } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/savepermission", method = RequestMethod.POST) public ModelAndView savePermission(HttpServletRequest request) { System.out.println("In auth userform method"); ModelAndView model = null; AssignRights ar = null; try { ar = new AssignRights(); model = new ModelAndView(); AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); // String depid = request.getParameter("departmentId"); String depname = request.getParameter("department"); // String desid = request.getParameter("designationId"); String des = request.getParameter("designation"); String eid = request.getParameter("employeeId"); String usname = request.getParameter("userName"); String bcode = request.getParameter("branchcode"); String funname[] = request.getParameterValues("hiddenfun"); String fundes[] = request.getParameterValues("hiddendes"); for (int s = 0; s < funname.length; s++) { String read = request.getParameter("hiddenread" + s); String write = request.getParameter("hiddenwrite" + s); String del = request.getParameter("hiddendel" + s); ar.setDepartmentname(depname); ar.setDesignation(des); ar.setFunctions(funname[s]); ar.setFunctionsdes(fundes[s]); ar.setRead(read); ar.setWrite(write); ar.setDel(del); ar.setEmpid(eid); ar.setUsername(usname); ar.setBranchcode(bcode); int v = uamService.savePermission(ar); } // --insert audit start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date = new Date(); System.out.println("date and time==>" + dateFormat.format(date)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("Insert the 'Designation & Department Registration'"); audit.setLogdate(dateFormat.format(date)); int auditid = merchantService.saveAudit(audit); // --insert audit end -- model.setViewName("acquirer/userdepartmentconfirm"); } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/callReject", method = RequestMethod.GET) public ModelAndView callReject(HttpServletRequest request, ModelMap modelmap) { ModelAndView model = null; try { String tid = request.getParameter("tid"); int id = paymentService.callAccpectandReject(tid, 'A'); // --view the transaction adjustment list -- AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); String[] mount = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; String merid = request.getParameter("merchantid"); String tdate = request.getParameter("tdate"); String trefno = request.getParameter("trefno"); String cnumber = request.getParameter("cardnumber"); modelmap.addAttribute("merid", merid); modelmap.addAttribute("tdate", tdate); modelmap.addAttribute("trefno", trefno); modelmap.addAttribute("cnumber", cnumber); List<TransationMonitoring> tmlist = null; System.out.println("tdate1===>" + tdate); String state = "yes"; if (!tdate.equals("")) { state = "tdate"; String dateval[] = tdate.split("/"); String mounth = dateval[0]; String date = dateval[1]; String year = dateval[2]; tdate = date + "-" + mount[Integer.parseInt(mounth) - 1] + "-" + year; System.out.println("tdate2===>" + tdate); tmlist = paymentService.getTransationMonitoringTDate(merid, tdate); } if (!trefno.equals("")) { state = "trefno"; tmlist = paymentService.getTransationMonitoringRefno(merid, trefno); } if (cnumber != null && !cnumber.equals("")) { state = "cnumber"; tmlist = paymentService.getTransationMonitoringCardno(merid, cnumber); } if (cnumber != null && !trefno.equals("") && !cnumber.equals("")) { state = "all"; tmlist = paymentService.getTransationMonitoringAll(merid, tdate, trefno, cnumber); } if (state.equals("yes")) { if (!merid.equals("")) { tmlist = paymentService.getTransationMonitoring(merid); } } // --audit function start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date = new Date(); System.out.println("date and time==>" + dateFormat.format(date)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("Change the account transaction status for accpect"); audit.setLogdate(dateFormat.format(date)); int auditid = merchantService.saveAudit(audit); // --audit function end-- modelmap.addAttribute("tmlist", tmlist); model = new ModelAndView("uam/searchtranactionadjustment"); } catch (Exception e) { e.printStackTrace(); } return model; }
@RequestMapping(value = "/saveregistration", method = RequestMethod.POST) public ModelAndView saveRegistration(HttpServletRequest request) { ModelAndView model = null; UserRegistration ur = null; try { AuditTrial audit = new AuditTrial(); HttpSession sessionObj = request.getSession(); ur = new UserRegistration(); model = new ModelAndView(); String empid = request.getParameter("employeeId"); String username = request.getParameter("userName"); String branchcode = request.getParameter("branchcode"); String des = request.getParameter("designation"); String depart = request.getParameter("department"); String dob = request.getParameter("dob"); String email = request.getParameter("emailId"); String mobile = request.getParameter("mobile"); String tel = request.getParameter("tel"); String add = request.getParameter("address"); String count = request.getParameter("country"); Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int dateval = cal.get(Calendar.DATE); System.out.println("year=>" + year); System.out.println("month=>" + month); System.out.println("dateval=>" + dateval); Date curdate = new Date(dateval + "/" + month + "/" + year); Date date = new Date(dob); ur.setEmpid(empid); ur.setName(username); ur.setBranchcode(branchcode); ur.setDesignation(des); ur.setDepartment(depart); ur.setDob(date); ur.setEmailid(email); ur.setMobile(Long.parseLong(mobile)); ur.setTel(Long.parseLong(tel)); ur.setAddress(add); ur.setCountry(count); ur.setCurrentdate(curdate); String randomPwd = generateRandomString(); String encryptedPwd = encrypt(randomPwd); System.out.println("merchantId==>" + encryptedPwd); ur.setPassword(encryptedPwd); // ur.setPassword("password"); int v = uamService.saveRegistration(ur); sendEmailConfirmation(username, encryptedPwd, request, empid, email); // --audit start-- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // get current date time with Date() Date date1 = new Date(); System.out.println("date and time==>" + dateFormat.format(date1)); String adminname = (String) sessionObj.getAttribute("adminname"); audit.setUsername(adminname); audit.setDescription("Insert the user '" + username + "'"); audit.setLogdate(dateFormat.format(date1)); int auditid = merchantService.saveAudit(audit); // --audit end-- model.setViewName("acquirer/userregistrationconfirm"); } catch (Exception e) { e.printStackTrace(); } return model; }