| | |
| | | //检查是否达标,不达标继续标红 |
| | | VipSetting vipSetting = vipSettingClient.getVipSetting(appUser.getVipId()).getData(); |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) <= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) <= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) <= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | |
| | | List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, i).eq(AppUser::getStatus, 1).eq(AppUser::getDelFlag, 0).eq(AppUser::getIsDanger, 0)); |
| | | for (AppUser appUser : list) { |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) <= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | |
| | | continue; |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) <= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | |
| | | continue; |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) <= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | |
| | | AND tup.create_time BETWEEN #{userPoint.startTime} AND #{userPoint.endTime} |
| | | </if> |
| | | </where> |
| | | order tup.create_time desc |
| | | order by tup.create_time desc |
| | | </sql> |
| | | |
| | | <select id="queryUserPointPage" resultType="com.ruoyi.account.api.model.UserPoint"> |
| | |
| | | * 秒杀活动列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页","后台管理-活动管理-秒杀活动"}) |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页"}) |
| | | public R<TableDataInfo> list(Goods goods) |
| | | { |
| | | return R.ok(seckillActivityInfoService.listSeckillActivity(goods)); |
| | |
| | | return R.ok(goodsSeckill); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // 创建 LocalDateTime 对象 |
| | | LocalDateTime localDateTime = LocalDateTime.of(2025, 1, 16, 9, 34, 55); |
| | | |
| | | // 转换为 UTC 时间戳(毫秒) |
| | | long l = localDateTime.toEpochSecond(ZoneOffset.UTC) * 1000; |
| | | System.out.println("UTC 时间戳: " + l); |
| | | |
| | | // 转换为 UTC+8 时间戳(毫秒) |
| | | long l2 = localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli(); |
| | | System.out.println("UTC+8 时间戳: " + l2); |
| | | |
| | | // 将时间戳转换为 yyyy-MM-dd HH:mm:ss 格式的字符串 |
| | | String utcTime = formatTimestamp(l, ZoneOffset.UTC); |
| | | String utcPlus8Time = formatTimestamp(l2, ZoneOffset.of("+8")); |
| | | |
| | | System.out.println("UTC 时间: " + utcTime); |
| | | System.out.println("UTC+8 时间: " + utcPlus8Time); |
| | | } |
| | | |
| | | /** |
| | | * 将时间戳转换为指定时区的 yyyy-MM-dd HH:mm:ss 格式字符串 |
| | | * |
| | | * @param timestamp 时间戳(毫秒) |
| | | * @param zoneOffset 时区偏移量 |
| | | * @return 格式化后的时间字符串 |
| | | */ |
| | | private static String formatTimestamp(long timestamp, ZoneOffset zoneOffset) { |
| | | return LocalDateTime.ofEpochSecond(timestamp / 1000, 0, zoneOffset) |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | * 秒杀活动列表 |
| | | */ |
| | | @GetMapping("/manageList") |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页","后台管理-活动管理-秒杀活动"}) |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"后台管理-活动管理-秒杀活动"}) |
| | | public R<IPage<SeckillActivityVO>> manageList(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | Goods goods) |
| | |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vipId} |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 and tsai.end_time lt; now() |
| | | <if test="name != null and name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{name},'%') |
| | | </if> |