| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | log.info("redis_yzm = {},yzmCode = {}", redis_yzm, yzmCode); |
| | | if (!yzmCode.equals(redis_yzm) && !"6666".equals(yzmCode)) { |
| | | return ServerResponse.createByErrorMsg("验证码不正确或已过期!,注册失败",request); |
| | | return ServerResponse.createByErrorMsg("验证码不正确或已过期,注册失败",request); |
| | | } |
| | | |
| | | AgentUser agentUser = this.iAgentUserService.findByCode(agentCode); |
| | |
| | | |
| | | User dbuser = this.userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getPhone,phone).last( " limit 1")); |
| | | if (dbuser != null) { |
| | | return ServerResponse.createByErrorMsg("注册失败,手机号已注册",request); |
| | | return ServerResponse.createByErrorMsg("注册失败,用户名已注册",request); |
| | | } |
| | | |
| | | |
| | |
| | | if(ObjectUtil.isEmpty(userId)){ |
| | | return ServerResponse.createBySuccess(BigDecimal.ZERO); |
| | | } |
| | | // 计算7天前的时间 |
| | | Date sevenDaysAgo = Date.from(LocalDateTime.now().minusDays(7).atZone(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | List<UserPosition> userPositions = userPositionMapper.selectList( |
| | | new QueryWrapper<UserPosition>() |
| | | .eq("user_id", userId) |
| | | .apply("(sell_order_id IS NOT NULL AND sell_order_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)) " + |
| | | "OR (sell_order_id IS NULL AND buy_order_time >= DATE_SUB(NOW(), INTERVAL 7 DAY))") |
| | | .and(wrapper -> wrapper |
| | | .isNotNull("sell_order_id") |
| | | .ge("sell_order_time", sevenDaysAgo) |
| | | .or() |
| | | .isNull("sell_order_id") |
| | | .ge("buy_order_time", sevenDaysAgo) |
| | | ) |
| | | ); |
| | | BigDecimal weeklyProfit = BigDecimal.ZERO; |
| | | if (userPositions.size() > 0) { |