| | |
| | | @Resource |
| | | private ITUserShareService userShareService; |
| | | |
| | | @Autowired |
| | | private ITIntegralRecordService integralRecordService; |
| | | @PostMapping("/getUserById/{id}") |
| | | @ApiOperation(value = "根据用户id 获取用户信息", tags = {"管理后台-用户管理"}) |
| | | public R<TUser> getUserById(@PathVariable("id") Integer id) { |
| | |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | System.err.println("返回参数" + map); |
| | | if (null != map) { |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | // 会员规格id |
| | |
| | | |
| | | // 修改用户会员续期信息 |
| | | userService.updateById(byId1); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if (null != map) { |
| | | |
| | | // 内部订单号 |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | // 微信订单号 |
| | | String transaction_id = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | // 会员规格id |
| | | String s = out_trade_no.split("_")[0]; |
| | | Integer integer = Integer.valueOf(s); |
| | |
| | | vipOrderService.updateById(byId); |
| | | // 修改用户会员续期信息 |
| | | userService.updateById(byId1); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | return R.freeze("登录失败,您的账号已被冻结!"); |
| | | } |
| | | } else { |
| | | tUser1 = new TUser(); |
| | | // 手机验证码校验 |
| | | if (!phoneCode.equals("123456")) { |
| | | Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone); |
| | |
| | | if (!rCode.equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("登录失败,手机验证码无效!"); |
| | | } else { |
| | | tUser1.setHeadImg("https://haitunyingyu.obs.cn-southwest-2.myhuaweicloud.com/admin/1c6ee218aa18434db2e86df903990de8.jpg"); |
| | | tUser1 = getUser(phone); |
| | | tUser1.setHeadImg("https://haitunyingyu.obs.cn-southwest-2.myhuaweicloud.com/admin/1c6ee218aa18434db2e86df903990de8.jpg"); |
| | | String upperCase = UUIDUtil.getRandomCode(6).toUpperCase(); |
| | | tUser1.setAccount("用户"+upperCase); |
| | | tUser1.setName("用户"+upperCase); |
| | |
| | | TUserShare record = new TUserShare(); |
| | | record.setIntegral(integral); |
| | | record.setUserId(userid); |
| | | // 积分明细 |
| | | |
| | | userShareService.save(record); |
| | | TIntegralRecord tIntegralRecord = new TIntegralRecord(); |
| | | tIntegralRecord.setIntegral(data.getIntegralShare()); |
| | | tIntegralRecord.setMethod("每日分享"); |
| | | tIntegralRecord.setUserId(userid); |
| | | integralRecordService.save(tIntegralRecord); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | |
| | | record.setIntegral(integral); |
| | | record.setUserId(userid); |
| | | userShareService.save(record); |
| | | TIntegralRecord tIntegralRecord = new TIntegralRecord(); |
| | | tIntegralRecord.setIntegral(data.getIntegralShare()); |
| | | tIntegralRecord.setMethod("每日分享"); |
| | | tIntegralRecord.setUserId(userid); |
| | | integralRecordService.save(tIntegralRecord); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | |
| | | .eq(TGameRecord::getDisabled, 0).list(); |
| | | int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum(); |
| | | Integer totalStudy = userStudy.getTotalStudy(); |
| | | userStudy.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | userStudy.setTotalStudy(Math.round((float) (totalStudy) / 3600)); |
| | | return R.ok(new UserPersonalCenterVO(user, userStudy)); |
| | | } |
| | | |
| | |
| | | userService.removeById(tUser); |
| | | return R.ok("注销成功"); |
| | | } |
| | | |
| | | @PostMapping("/deleteUserStudy") |
| | | @ApiOperation(value = "注销当前帐号", tags = {"学习端-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header"), |
| | | }) |
| | | public R<String> deleteUserStudy() { |
| | | if (tokenService.getLoginUserStudy() == null) { |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | Integer userid = tokenService.getLoginUserStudy().getUserid(); |
| | | TUser tUser = userService.getById(userid); |
| | | tUser.setState(3); |
| | | userService.updateById(tUser); |
| | | userService.removeById(tUser); |
| | | return R.ok("注销成功"); |
| | | } |
| | | @PostMapping("/logout") |
| | | @ApiOperation(value = "退出登录", tags = {"家长端-个人中心"}) |
| | | @ApiImplicitParams({ |
| | |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.wxRefundCallback(request); |
| | | if (null != map) { |
| | | |
| | | String code = map.get("out_refund_no"); |
| | | String refund_id = map.get("refund_id"); |
| | | String result = map.get("result"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | TVipOrder one = vipOrderService.getOne(new QueryWrapper<TVipOrder>() |
| | | .eq("outTradeNo", code) |
| | | .eq("payState", 3)); |
| | |
| | | userService.updateById(byId1); |
| | | } |
| | | |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |