| | |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.api.feignClient.PointSettingClient; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | String phone, |
| | | Integer id) { |
| | | |
| | | Long appUserId = null; |
| | | List<Long> appUserIds = null; |
| | | if (!StringUtils.isEmpty(phone)){ |
| | | AppUser appUser1 = appUserService.getOne(new LambdaQueryWrapper<AppUser>() |
| | | List<AppUser> appUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .like(AppUser::getPhone, phone)); |
| | | if (appUser1 != null){ |
| | | appUserId = appUser1.getId(); |
| | | if (!CollectionUtils.isEmpty(appUserList)){ |
| | | appUserIds = appUserList.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | }else { |
| | | return R.ok(Page.of(pageNum, pageSize)); |
| | | } |
| | | } |
| | | |
| | |
| | | .isNull(status!=null&&(status==1||status==3),UserCoupon::getUseTime) |
| | | .isNotNull(status!=null&&status==2,UserCoupon::getUseTime) |
| | | .eq(UserCoupon::getCouponId, id) |
| | | .eq(appUserId != null,UserCoupon::getAppUserId, appUserId) |
| | | .in(appUserIds != null,UserCoupon::getAppUserId, appUserIds) |
| | | .lt(status!=null&&status==3,UserCoupon::getEndTime, LocalDateTime.now()).page(Page.of(pageNum-1, pageSize)); |
| | | for (UserCoupon record : page.getRecords()) { |
| | | record.setIdStr(record.getId().toString()); |