| | |
| | | import java.io.FileReader;
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Iterator;
|
| | |
| | | if (goods == null)
|
| | | out.println("商品已下架");
|
| | | else
|
| | | out.println("<html><head><meta charset=utf-8></head><body>"
|
| | | + String.format("cat_name:%s <br> cat_leaf_name:%s", goods.getRootCategoryName(), goods.getLeafName())
|
| | | + "</body></html>");
|
| | | out.println(
|
| | | "<html><head><meta charset=utf-8></head><body>" + String.format("cat_name:%s <br> cat_leaf_name:%s",
|
| | | goods.getRootCategoryName(), goods.getLeafName()) + "</body></html>");
|
| | | }
|
| | |
|
| | | @RequestMapping("getJedisInfo")
|
| | | public void getJedisInfo(PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("active", jedisPool.getNumActive());
|
| | | data.put("idle", jedisPool.getNumIdle());
|
| | | data.put("waiters", jedisPool.getNumWaiters());
|
| | | out.print(data.toString());
|
| | | }
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | |
| | | /**
|
| | | * 订单列表
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "getOrderList", method = RequestMethod.POST)
|
| | | public void getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, String type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime, |
| | | Integer dateType, Integer goodsType, String source, PrintWriter out) {
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime, Integer dateType,
|
| | | Integer goodsType, String source, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | listSource.add(Constant.SOURCE_TYPE_PDD);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | try {
|
| | | // 筛选结果顶部统计
|
| | | String validMoney = "0.00";
|
| | |
| | | }
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType, orderState,
|
| | | orderNo, startTime, endTime, dateType, listSource);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType,
|
| | | orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | | // 统计总数
|
| | | long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, startTime,
|
| | | endTime, dateType, listSource);
|
| | | long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo,
|
| | | startTime, endTime, dateType, listSource);
|
| | |
|
| | | // 判断是否需要显示订单找回提示 8秒内请求3次触发
|
| | | String orderFindUrl = null;
|
| | |
| | | } catch (CommonOrderException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | if (Constant.IS_TEST) {
|
| | | e.printStackTrace(out);
|
| | | } else
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 搜索订单
|
| | | * |
| | | * @param key
|
| | | * @param out
|
| | | */
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 用户订单统计
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * 用户id
|
| | | * type 类型:0全部、1淘宝 2京东、拼多多
|
| | | * 用户id type 类型:0全部、1淘宝 2京东、拼多多
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getOrderCount", method = RequestMethod.POST)
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | |
| | | /**
|
| | | * 通过邀请码获取用户信息
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | String sessionKey = null;
|
| | | WXMPSessionInfo sessionInfo = (WXMPSessionInfo) session.getAttribute(UserController.WXMP_SESSION_INFO_KEY);
|
| | | WXMPSessionInfo sessionInfo = WXXCXUtil.getSessionInfo(Constant.WXMP_APP_INFO, code);
|
| | | if (sessionInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult(90000, "请重新登录"));
|
| | | return;
|
| | | } else {
|
| | | session.setAttribute(UserController.WXMP_SESSION_INFO_KEY, sessionInfo);
|
| | | }
|
| | |
|
| | | sessionKey = sessionInfo.getSessionKey();
|
| | |
| | |
|
| | | UserInfo lastUserInfo = null;
|
| | | if (!StringUtil.isNullOrEmpty(userData)) {
|
| | | String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.wxmpUserLogin, StringUtil.Md5(acceptData.getAppId() + "-" + acceptData.getOpenId()));
|
| | | String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.wxmpUserLogin,
|
| | | StringUtil.Md5(acceptData.getAppId() + "-" + acceptData.getOpenId()));
|
| | | String data = redisManager.getCommonString(redisKey);
|
| | | if (!StringUtil.isNullOrEmpty(data)) {
|
| | | lastUserInfo = new Gson().fromJson(data, UserInfo.class);
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping("wxLogin")
|
| | | public void wxLogin(WXMPAcceptData acceptData, String wxEncryptedData, String wxIv, String inviteCode,
|
| | | public void wxLogin(WXMPAcceptData acceptData, String wxEncryptedData, String wxIv, String inviteCode, String code,
|
| | | HttpServletRequest request, HttpSession session, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(acceptData.getOpenId())) {
|
| | | out.print(JsonUtil.loadFalseResult("openId为空"));
|
| | |
| | | out.print(JsonUtil.loadFalseResult("微信用户加密数据为空"));
|
| | | return;
|
| | | }
|
| | | WXMPSessionInfo sessionInfo = (WXMPSessionInfo) session.getAttribute(UserController.WXMP_SESSION_INFO_KEY);
|
| | | if (sessionInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult(90000, "请重新登录"));
|
| | | return;
|
| | | }
|
| | | WXMPSessionInfo sessionInfo = WXXCXUtil.getSessionInfo(Constant.WXMP_APP_INFO, code);
|
| | |
|
| | | String sessionKey = sessionInfo.getSessionKey();
|
| | | if (StringUtil.isNullOrEmpty(sessionKey)) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.wxmpUserLogin, StringUtil.Md5(acceptData.getAppId() + "-" + acceptData.getOpenId()));
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.wxmpUserLogin,
|
| | | StringUtil.Md5(acceptData.getAppId() + "-" + acceptData.getOpenId()));
|
| | |
|
| | | UserInfo user = new Gson().fromJson(redisManager.getCommonString(key), UserInfo.class);
|
| | | if (user == null) {
|
| | |
| | | userAccountService.updateUserSelective(update);
|
| | | }
|
| | | });
|
| | | break;
|
| | | return;
|
| | | case WXMPLoginResult.CODE_BIND_PHONE:
|
| | | // 需要绑定电话号码
|
| | | redisManager.saveObj(result.getUser(), key, 60 * 5);// 只缓存5分钟
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 绑定电话号码 V1.5.3
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 获取vip信息
|
| | |
| | | }
|
| | | vo.setFinishMoney(hongBaoV2CountService.getRewardMoneyBySelf(uid));
|
| | |
|
| | | |
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(BanLiShopOrder.STATE_SUCCESS);
|
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | |
|
| | | vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney));
|
| | | vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney));
|
| | | vo.setFinishHongBao(banLiShopOrderService.countByUidAndState(uid, list));
|
| | |
|
| | |
|
| | | // 区分老用户和新用户
|
| | | String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
|
| | |
| | | list.add(BanLiShopOrder.STATE_SUCCESS);
|
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | |
|
| | | long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | long finishHongBao = banLiShopOrderService.countByUidAndState(uid, list);
|
| | | BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid);
|
| | |
|
| | |
| | | out.print(JsonUtil.loadTrueResult("已申请"));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("logout")
|
| | | public void logout(WXMPAcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("uid为空"));
|
| | | return;
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | }
|
| | |
| | | redis.addr=172.16.16.3
|
| | | redis.port=6379 |
| | | redis.auth=weikou2014
|
| | | redis.max_total=1024 |
| | | #控制一个pool可分配多少个jedis实例,
|
| | | redis.max_total=-1 |
| | | redis.max_idle=200
|
| | | redis.max_wait=10000
|
| | | redis.timeout=5000
|