private void setSessionObj( Map<String, Object> dataMap, Map<String, Object> cstVO, Map<String, Object> sessionCst) { dataMap.put("cstVO", sessionCst); // 设置icopSessionId String icopSessionID = (String) user.get("ICOPSessionID"); dataMap.put("ICOPSessionID", icopSessionID); this.getRequest() .getSession() .setAttribute( "tmpObj_icopSessionId", icopSessionID); // 将icopSessionId放在request里(在session超时监听器里取值) // 取得客户登录sessionId、ip和mac dataMap.put("httpSessionId", this.getSessionId()); dataMap.put("userRemoteIP", BrosWebUtil.getClientIP(this.getRequest())); dataMap.put("userRemoteMac", this.user.get("macAddress")); dataMap.put("logonChannel", BaseConstants.EBANK_CHANNEL); /** * 设置icop报文头需要的机构编号 String residence = (String) cstVO.get("residence"); * if(residence.equals(BaseConstants.ICOP_RESIDENCE_XIB_PB)){ //XIB * dataMap.put("ICOPRequestBranchCode", BaseConstants.ICOP_BRANCHCODE_XIB); }else * if(residence.equals(BaseConstants.ICOP_RESIDENCE_LIB_PB)){ //LIB * dataMap.put("ICOPRequestBranchCode", BaseConstants.ICOP_BRANCHCODE_LIB); } */ }
@SuppressWarnings("unchecked") public String execute() throws Exception { try { // 1、检查同一浏览器下当前是否已经有客户登录;如果已经登录,提示其签退后其他用户才能登录。 if (ActionContext.getContext().getSession().containsKey(this.getSessionId())) { throw new ServiceException(AppErrorCodeConstants.EBNT10007); } // 2、客户登录 Context context = getContext(); context.put("channel", BaseConstants.EBANK_CHANNEL); context.put("sessionId", this.getSessionId()); context.put("ip", BrosWebUtil.getClientIP(this.getRequest())); context.put("password", user.get("password")); context.put("macAddress", user.get("macAddress")); context.put("customerId", user.get("customerId")); context.put("userId", user.get("userId")); context.put("residence", user.get("residence")); context.put("customerId", customerId); context.put("operatorNum", operatorNum); context.put("logonPassword", logonPassword); context.put("verificationCode", verificationCode); context.put("macAddress", macAddress); // IcopClientManager.callChannelService(context, "CSVRPB000181"); CallVirtualSerService.callVirtualServer(context, "CSVRPB000181"); // IPersonLogonTransService personLogonTransService = // (IPersonLogonTransService)Context.getBean("personLogonTransServiceImpl"); // user = personLogonTransService.tranLogon(getChannelHead(BaseConstants.EBANK_CHANNEL, // BrosWebUtil.getClientIP(this.getRequest()), user.get("macAddress")), user); /** 3、取得登录返回数据 */ Context sessionContext = (Context) Context.getBean("sessionContext"); Map<String, Object> dataMap = sessionContext.getDataMap(); // Map<String, Object> cstVO = (Map<String, Object>) user.get("cstInf"); Map<String, Object> cstVO = new HashMap<String, Object>(); Map<String, Object> sessionCst = new HashMap<String, Object>(); BeanUtils.copyProperties(cstVO, sessionCst); setSessionObj(dataMap, cstVO, sessionCst); /** 4、返回登录结果 */ String logonResult = (String) user.get("logonResult"); /** 保存sessionObj */ ActionContext.getContext().getSession().put(this.getSessionId(), sessionContext); // 网银暂停 if (PersonConstants.LOGON_RESULT_PAUSE.equals(logonResult)) { return PAUSE; } // 重置密码 if (PersonConstants.LOGON_RESULT_PASSWORD.equals(logonResult)) { return RESETPASSWORD; } // 他行账户协议应答action标记 String actionFlag = URLMap.get("actionFlag"); // action名称 if (null != actionFlag && !"".equals(actionFlag)) { if ("1".equals(actionFlag)) { return "queryAgree"; // 查询协议 } else if ("3".equals(actionFlag)) { return "payAgree"; // 支付协议 } else if ("4".equals(actionFlag)) { return "payCancle"; // 撤销支付协议 } } } catch (Exception ex) { // 清空会话信息 this.clearSession(); this.handleError(ex); return LOGON_EXCEPTION; } finally { // 清空客户登录信息 if (null != user) { this.user.put("password", null); this.user.put("localLanguage", null); } this.clearCiphertext(); // 清空加密因子 } return SUCCESS; }