예제 #1
0
 @RequestMapping(value = "getTaohaoCode")
 @ResponseBody
 public PageResult getTaohaoCode(
     String packageId, HttpServletRequest request, HttpSession session) {
   PageResult result = new PageResult();
   if (!ToolUtil.isNoEmpty(packageId)) {
     result.setState(false);
     result.setCode(100010);
     result.setMsg("未知异常,请联系网站人员解决!");
     return result;
   }
   Object uId = session.getAttribute("userId");
   if (null != uId) { // 是否登录
     Map<String, Object> packageCodeTH = tPackageService.queryTPackageCodeTH(packageId, 1);
     if (null == packageCodeTH) { // 没有淘到号
       result.setState(false);
       result.setCode(100004);
       result.setMsg("未知异常,请联系网站人员解决!");
       return result;
     }
     result.setObj(packageCodeTH);
   } else {
     result.setState(false);
     result.setCode(100001);
   }
   return result;
 }
예제 #2
0
 @RequestMapping(value = "getPackageCode")
 @ResponseBody
 public PageResult getPackageCode(
     String packageId, HttpServletRequest request, HttpSession session) {
   PageResult result = new PageResult();
   if (!ToolUtil.isNoEmpty(packageId)) {
     result.setState(false);
     result.setCode(100010);
     result.setMsg("未知异常,请联系网站人员解决!");
     return result;
   }
   Object uId = session.getAttribute("userId");
   if (null != uId) { // 是否登录
     String userId = uId.toString();
     List<Map<String, Object>> list =
         tPackageService.queryTPackageCodeByParam(userId, packageId, null);
     if (null == list || list.size() == 0) { // 该用户是否已经领取过该礼包
       Map<String, Object> packageCode = tPackageService.queryTPackageCode(userId, packageId, 1);
       if (null == packageCode) { // 礼包是否已经发完了,搜不到有效数据
         result.setState(false);
         result.setCode(100003);
         result.setMsg("亲,礼包可能已经发完了,试试淘号系统吧!");
       } else {
         result.setObj(packageCode);
       }
     } else {
       result.setState(false);
       result.setCode(100002);
       result.setMsg("亲,您已经领取过该礼包了,不要贪心(⊙o⊙)哦!您可以在我的礼包里面查看您的礼包码");
     }
   } else {
     result.setState(false);
     result.setCode(100001);
   }
   return result;
 }