/** * 查询会员详情,用户ID就是会员ID * * @param Id * @param form * @param request * @param response * @return */ @RequestMapping(value = "/memberCenter/memberInfo/{Id}", method = RequestMethod.GET) public ModelAndView queryMemberDetail( @PathVariable String Id, MemberForm form, HttpServletRequest request, HttpServletResponse response) { // // 测试,会员资料 // Id = 1000; // Members selectByPrimaryKey = membersService.selectByPrimaryKey(Id); // form.setMember(selectByPrimaryKey); String memberId = CookieUtils.getMember(request, response); form.setMemberId(memberId); WebServiceResponseModel webModel = MemberCardService.getMemberInfo(Id); if (webModel.getError_code().equals("")) { PersonInfoModel person = (PersonInfoModel) JSONObject.toBean(webModel.getResponse(), PersonInfoModel.class); // form.setMember(members); if (person.getVipPhoto() == null || person.getVipPhoto().trim().equals("")) { person.setVipPhoto(Constants.vipCommonPhoto); } form.setPerson(person); return new ModelAndView("memberCenter/memberDetail-m", Constants.DEFAULT_COMMAND, form); } else { return toErrorPage(form, webModel); } }
/** * 微网站会员中心首页 * * @param Id * @param form * @param request * @param response * @return */ @RequestMapping(value = "/memberCenter", method = RequestMethod.GET) public ModelAndView memberCenter( MemberForm form, HttpServletRequest request, HttpServletResponse response) { String memberId = CookieUtils.getMember(request, response); form.setMemberId(memberId); WebServiceResponseModel webModel = MemberCardService.getMemberInfoIndex(form.getMemberId()); if (webModel.getError_code().equals("")) { VCardModel members = (VCardModel) JSONObject.toBean(webModel.getResponse(), VCardModel.class); if (members.getVipPhoto() == null || members.getVipPhoto().trim().equals("")) { members.setVipPhoto(Constants.vipCommonPhoto); } if (members.getBalance() == null || members.getBalance().trim().equals("")) { members.setBalance("0"); } if (members.getPoints() == null || members.getPoints().trim().equals("")) { members.setPoints("0"); } if (members.getConsumeCount() == null || members.getConsumeCount().trim().equals("")) { members.setConsumeCount("0"); } // int infoFinish = MemberCardService.getInfoFinish(form.getMemberId()); // members.setInfoFinish(Integer.toString(infoFinish)); form.setMember(members); // form.setIsShowMenu(1);// 根据微信来判断 return new ModelAndView("memberCenter/member-m", Constants.DEFAULT_COMMAND, form); } else { PersonInfoForm personForm = new PersonInfoForm(); personForm.setShowShortCut(1); return new ModelAndView("/account/login-m", Constants.DEFAULT_COMMAND, personForm); } }