コード例 #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 = "getPackageTProducts")
 @ResponseBody
 public PageResult getPackageTProducts(String keyName) {
   PageResult result = new PageResult();
   List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
   Map<String, Object> param = new HashMap<String, Object>();
   if (ToolUtil.isNoEmpty(keyName)) {
     param.put("keyName", keyName);
   } else {
     result.setState(false);
     return result;
   }
   resultList = tProductsService.queryProductByName(keyName);
   if (null == resultList || resultList.size() == 0) {
     result.setState(false);
     return result;
   }
   result.setObj(resultList.get(0));
   return result;
 }
コード例 #3
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;
 }
コード例 #4
0
  @RequestMapping(value = "queryPackagePage")
  @ResponseBody
  public PageResult queryPackagePage(
      String tType,
      String priceType,
      String packageType,
      String priceStatus,
      String page,
      String perNumber) {
    PageResult result = new PageResult();
    List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
    if (!ToolUtil.isNoEmpty(tType)
        || !ToolUtil.isNoEmpty(priceType)
        || !ToolUtil.isNoEmpty(packageType)
        || !ToolUtil.isNoEmpty(priceStatus)
        || !ToolUtil.isNoEmpty(page)
        || !ToolUtil.isNoEmpty(perNumber)) {
      result.setState(false);
      return result;
    }
    result.setPageSize(Integer.parseInt(perNumber));
    result.setPageIndex(Integer.parseInt(page));
    result.setTotalCount(
        tPackageService.queryTPackageCount(
            Integer.parseInt(tType),
            Integer.parseInt(priceType),
            Integer.parseInt(packageType),
            Integer.parseInt(priceStatus)));
    result.setPageCount(PageResult.calcTotalPage(result.getPageSize(), result.getTotalCount()));

    Integer startRecordNum = (result.getPageIndex() - 1) * result.getPageSize();
    list =
        tPackageService.queryTPackagePage(
            Integer.parseInt(tType),
            Integer.parseInt(priceType),
            Integer.parseInt(packageType),
            Integer.parseInt(priceStatus),
            OrderType.getName("S_COUNT"),
            startRecordNum,
            Integer.parseInt(perNumber));

    result.setResultList(list);
    return result;
  }