1、 = !- - !- - = = !- - =ControllerRequestMapping(/view)public class ViewController Resourceprivate ShowService showService;Resourceprivate TRoottypeService tRoottypeService;/类型业务类Resourceprivate TPeriodsService tPeriodsService;/期数业务类public void Type(Model model)/获得重要类型集合List btRoottypeList=tRoottypeS
2、ervice.getbTRoottype();/获得子类型集合List stRoottypesList=tRoottypeService.getsTRoottype();model.addAttribute(btRoottypeList,btRoottypeList);model.addAttribute(stRoottypeList,stRoottypesList);/晒单分享RequestMapping(currentPageNo/shareShow)public String shareShow(PathVariable Integer currentPageNo,Model model
3、)int pageSize = 20;PageSupport page = showService.getShowluckPage(currentPageNo, pageSize);page.setCurrentPageNo(currentPageNo);page.setPageSize(pageSize);List list = page.getList();for (Object object : list) TShowluck ts = (TShowluck)object;String uimg = ts.gettUser().getUimg();System.out.println(b
4、efore+uimg);if(null=uimg|=uimg)ts.gettUser().setUimg(defaultUserFace.png);page.setList(list);ts.gettPeriod().getGid();this.Type(model);model.addAttribute(page, page);return view/new20;/晒单分享详细页面RequestMapping(/showid/shareDetail)public String shareDetail(PathVariable Integer showid,Model model)TShowl
5、uck showluck = showService.findShowluckBy(showid);List showlucks = showService.getShowluckList();if(null=showluck.gettUser().getUimg()|=showluck.gettUser().getUimg()showluck.gettUser().setUimg(defaultUserFace.png);TPeriods nowTperiods=tPeriodsService.findNowPeriods(showluck.gettPeriod().getGid();mod
6、el.addAttribute(nowTperiods, nowTperiods);model.addAttribute(showlucks, showlucks);model.addAttribute(showluck, showluck);this.Type(model);model.addAttribute(url, Url.url);return view/shareShow;/顾客个人主页面RequestMapping(/sphone/userInfo)public String userInfo(PathVariable String sphone,Model model,Http
7、ServletRequest request)List ods = showService.getOrderdetailListBy(sphone);String message = TA还没有购置任何商品;TUser user = showService.getUserBy(sphone);if(null=user.getUimg()|=user.getUimg()user.setUimg(defaultUserFace.png);String userPhone = user.getSphone();String trueName = user.getTrueName();String u
8、img = user.getUimg();model.addAttribute(userPhone, userPhone);model.addAttribute(trueName, trueName);model.addAttribute(uimg, uimg);if(ods.size()0)model.addAttribute(ods, ods);elsemodel.addAttribute(message, message);this.Type(model);model.addAttribute(url, Url.url);return user/user;/顾客购置记录页面Request
9、Mapping(/sphone/userBuy)public String userBuy(PathVariable String sphone,Model model,HttpServletRequest request)List ods = showService.getOrderdetailListBy(sphone);for (TOrderdetails tOrder : ods) System.out.println(tOrder.gettPeriods().getUid();TUser winner = showService.findUserBy(tOrder.gettPerio
10、ds().getUid();tOrder.gettPeriods().settUser(winner);String message = TA还没有购置任何商品;TUser user = showService.getUserBy(sphone);if(null=user.getUimg()|=user.getUimg()user.setUimg(defaultUserFace.png);String userPhone = user.getSphone();String trueName = user.getTrueName();String uimg = user.getUimg();mo
11、del.addAttribute(userPhone, userPhone);model.addAttribute(trueName, trueName);model.addAttribute(uimg, uimg);if(ods.size()0)model.addAttribute(ods, ods);elsemodel.addAttribute(message, message);this.Type(model);model.addAttribute(url, Url.url);return user/userBuy;/顾客获奖记录userRaffle页面RequestMapping(/s
12、phone/userRaffle)public String userRaffle(PathVariable String sphone,Model model,HttpServletRequest request)TUser winner = showService.getUserBy(sphone);System.out.println(+winner.getTrueName()+ +winner.getUid();List periods = showService.getUserPrizeBy(winner.getUid();for (TPeriods tp : periods) Sy
13、stem.out.println(+tp.gettGood().getPics().get(0).getPicUrl()+ +tp.getPic()+ +tp.getPeriods();String message = TA还没有获得任何商品;TUser user = showService.getUserBy(sphone);if(null=user.getUimg()|=user.getUimg()user.setUimg(defaultUserFace.png);String userPhone = user.getSphone();String trueName = user.getT
14、rueName();String uimg = user.getUimg();model.addAttribute(userPhone, userPhone);model.addAttribute(trueName, trueName);model.addAttribute(uimg, uimg);if(periods.size()0)model.addAttribute(periods, periods);elsemodel.addAttribute(message, message);this.Type(model);model.addAttribute(url, Url.url);return user/userRaffle;/顾客晒单页面RequestMapping(/sphone/userPost)public String userPost(PathVariable String sphone,Model model,HttpServletRequest request)List tShows