领取时间 范围校验
This commit is contained in:
parent
dca94cc848
commit
5ef41403e0
|
|
@ -138,17 +138,22 @@ public class ACouponController {
|
|||
|
||||
/**
|
||||
* 优惠券列表/已领取详情
|
||||
* @param search 用户Id/昵称/手机号
|
||||
*
|
||||
* @param search 用户Id/昵称/手机号
|
||||
* @param param 用户的优惠券列表 使用该对象的UserId
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Page<MkShopCouponRecordDTO>> getRecord(@RequestParam(required = false) String search, MkShopCouponRecordDTO param) {
|
||||
Page<MkShopCouponRecordDTO> data = couponRecordService.getRecord(search, param);
|
||||
public CzgResult<Page<MkShopCouponRecordDTO>> getRecord(@RequestParam(required = false) String search,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
MkShopCouponRecordDTO param) {
|
||||
Page<MkShopCouponRecordDTO> data = couponRecordService.getRecord(search, param, startTime, endTime);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户优惠券
|
||||
*
|
||||
* @param id 优惠券记录Id
|
||||
*/
|
||||
@DeleteMapping("/deleteRecord")
|
||||
|
|
|
|||
|
|
@ -27,16 +27,18 @@ public interface MkShopCouponRecordService extends IService<MkShopCouponRecord>
|
|||
|
||||
/**
|
||||
* 优惠券列表/已领取详情
|
||||
*
|
||||
* @param search 用户Id/昵称/手机号
|
||||
*/
|
||||
Page<MkShopCouponRecordDTO> getRecord(String search, MkShopCouponRecordDTO param);
|
||||
Page<MkShopCouponRecordDTO> getRecord(String search, MkShopCouponRecordDTO param, String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 发放券 统一方法
|
||||
*
|
||||
* @param mkShopCouponRecordDTO 赠送信息 除Id外 几乎全填
|
||||
* @param number 发放数量
|
||||
* @param number 发放数量
|
||||
*/
|
||||
void receiveCoupon(MkShopCouponRecordDTO mkShopCouponRecordDTO,Integer number);
|
||||
void receiveCoupon(MkShopCouponRecordDTO mkShopCouponRecordDTO, Integer number);
|
||||
|
||||
/**
|
||||
* 用户优惠券 失效/删除
|
||||
|
|
|
|||
|
|
@ -55,10 +55,8 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Page<MkShopCouponRecordDTO> getRecord(String search, MkShopCouponRecordDTO mkShopCouponRecordDTO) {
|
||||
public Page<MkShopCouponRecordDTO> getRecord(String search, MkShopCouponRecordDTO mkShopCouponRecordDTO, String startTime, String endTime) {
|
||||
Map<Long, UserInfo> userInfoMap = new HashMap<>();
|
||||
if (StrUtil.isNotBlank(search)) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
|
|
@ -81,6 +79,7 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
|||
.eq(MkShopCouponRecord::getCouponId, mkShopCouponRecordDTO.getCouponId())
|
||||
.eq(MkShopCouponRecord::getIsDel, 0)
|
||||
.eq(MkShopCouponRecord::getStatus, mkShopCouponRecordDTO.getStatus())
|
||||
.between(MkShopCouponRecord::getCreateTime, startTime, endTime)
|
||||
.orderBy(MkShopCouponRecord::getCreateTime).desc();
|
||||
if (CollUtil.isNotEmpty(userInfoMap)) {
|
||||
recordQueryWrapper.in(MkShopCouponRecord::getUserId, userInfoMap.keySet());
|
||||
|
|
|
|||
Loading…
Reference in New Issue