/** * 保存开户基本信息 (姓名手机号码) 把member放入request中 并对customer状态进行保存 * * @return * @throws Exception */ public String saveAccountBase() throws Exception { // 用于判断重复提交 if (UserSession.getInstance(this.getRequest()).getTokinId() == null) { return "index"; } Customer newCustomer = new Customer(); newCustomer.setSubmitChannel(DataConfig.OPEN_ACCOUNT_TYPE_SHIPAN); newCustomer.setFromPage(DataConfig.OPEN_ACCOUNT_FROMPAGE_WEIZHAN); Member member = (Member) getRequest().getSession().getAttribute("session_member"); String memberName = this.getRequest().getParameter("memberName"); String memberMobile = this.getRequest().getParameter("mobile"); if (checkMobileScript(memberMobile)) { // 为true验证不通过 return "index"; } if (member == null) { if (this.getRequest().getParameter("kaihu") == null) { return "onlineOne"; } member = new Member(); } member.setMemberName(memberName); member.setMobile(memberMobile); member.setMemberStatus(Member.MEMBERSTATUS_2); member.setIsDelete(Member.ISDELETE_1); getRequest().setAttribute("memberName", member.getMemberName()); newCustomer.setMobile(memberMobile); newCustomer.setCustomerName(member.getMemberName()); // 放入session session过期从第一步提交 getRequest().getSession().setAttribute("session_member", member); this.setAdvId(newCustomer); newCustomer.setIp(DataConfig.getIpAddr(this.getRequest())); Integer id = customerService.setCustomerFromWeiZhan(newCustomer, null, member); getRequest().setAttribute("id", id); return "onlineTwo"; }
/** * 获取手机验证码 * * @throws Exception */ public void getMessageCode() throws Exception { String mobile = getRequest().getParameter("mobile"); randCode = DataConfig.getRandomCode(); Map<String, String> map = new HashMap<String, String>(); map.put("mobile", mobile); map.put("code", randCode); Cookie cookieuser = new Cookie(mobile, randCode); cookieuser.setPath("/"); cookieuser.setMaxAge(600); this.getResponse().addCookie(cookieuser); System.out.println("手机号码:" + mobile + "\n验证码:" + randCode); String result = ClientWebService.sendSms("您的验证码是:" + randCode + ",工作人员不会向您索取,请勿向任何人泄露。", mobile); System.out.println("result......................:" + result); if (result.equals("32")) { this.printText("同一号码相同内容发送次数太多"); } }
/** * 在线开户 -- 实盘开户 银行卡号 身份证号 开户银行 * * @return * @throws Exception */ public String saveOpenAccount() throws Exception { // 用于判断重复提交 if (UserSession.getInstance(this.getRequest()).getTokinId() == null) { return "index"; } // 获取session内member的值 Member member = (Member) getRequest().getSession().getAttribute("session_member"); customer.setSubmitChannel(DataConfig.OPEN_ACCOUNT_TYPE_SHIPAN); customer.setFromPage(DataConfig.OPEN_ACCOUNT_FROMPAGE_WEIZHAN_2); customer.setSourceChannel(Customer.CHANNEL_1); // 来源通道--在线开户 customer.setSourceChannelName("在线开户"); customer.setMobile(member.getMobile()); member.setMemberStatus(Member.MEMBERSTATUS_1); customer.setIp(DataConfig.getIpAddr(this.getRequest())); Map<String, Object> resultMap = customerService.openAccount(customer, member); String result = resultMap.get("result").toString(); if (!Boolean.valueOf(result)) { getRequest().setAttribute("result", "fail"); getRequest().setAttribute("name", customer.getCustomerName()); getRequest().setAttribute("msg", resultMap.get("msg")); getRequest().setAttribute("errorMsg", resultMap.get("errorResult")); } else { getRequest().setAttribute("result", "success"); Member memberModel = (Member) resultMap.get("member"); // 保存member memberService.insert(memberModel); getRequest().setAttribute("member", memberModel); } // 取消重复提交标志 UserSession.getInstance(this.getRequest()).setTokinId(null); return "onlineFinish"; }
/** * 设置广告件 * * @param c */ private void setAdvId(Customer c) { String advId = this.getIpAdvId( this.getRequest(), this.getResponse(), DataConfig.getIpAddr(this.getRequest())); if (advId != null) c.setAdvInfoId(Integer.valueOf(advId)); }