店铺列表 普通店铺使用
用户优惠券列表
This commit is contained in:
@@ -134,24 +134,23 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
||||
|
||||
|
||||
@Override
|
||||
public Page<MkShopCouponRecordDTO> getRecordByUser(MkShopCouponRecordDTO mkShopCouponRecordDTO, String startTime, String endTime) {
|
||||
AssertUtil.isNull(mkShopCouponRecordDTO.getShopId(), "店铺ID不能为空");
|
||||
AssertUtil.isNull(mkShopCouponRecordDTO.getUserId(), "用户ID不能为空");
|
||||
public Page<MkShopCouponRecordDTO> getRecordByShopUser(MkShopCouponRecordDTO mkShopCouponRecordDTO, String startTime, String endTime) {
|
||||
AssertUtil.isNull(mkShopCouponRecordDTO.getShopUserId(), "店铺用户ID不能为空");
|
||||
QueryWrapper recordQueryWrapper = new QueryWrapper();
|
||||
recordQueryWrapper.eq(MkShopCouponRecord::getShopId, mkShopCouponRecordDTO.getShopId())
|
||||
.eq(MkShopCouponRecord::getIsDel, 0)
|
||||
.eq(MkShopCouponRecord::getStatus, mkShopCouponRecordDTO.getStatus())
|
||||
.eq(MkShopCouponRecord::getUserId, mkShopCouponRecordDTO.getUserId())
|
||||
.eq(MkShopCouponRecord::getShopUserId, mkShopCouponRecordDTO.getShopUserId())
|
||||
.orderBy(MkShopCouponRecord::getCreateTime).desc();
|
||||
if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
|
||||
recordQueryWrapper.between(MkShopCouponRecord::getCreateTime, startTime, endTime);
|
||||
}
|
||||
Page<MkShopCouponRecordDTO> recordPage = pageAs(PageUtil.buildPage(), recordQueryWrapper, MkShopCouponRecordDTO.class);
|
||||
if (mkShopCouponRecordDTO.getUserId() != null) {
|
||||
UserInfo userInfo = userInfoService.getById(mkShopCouponRecordDTO.getUserId());
|
||||
ShopUser shopUser = shopUserService.getById(mkShopCouponRecordDTO.getShopUserId());
|
||||
for (MkShopCouponRecordDTO record : recordPage.getRecords()) {
|
||||
record.setHeadImg(userInfo.getHeadImg());
|
||||
record.setNickName(userInfo.getNickName());
|
||||
record.setHeadImg(shopUser.getHeadImg());
|
||||
record.setNickName(shopUser.getNickName());
|
||||
}
|
||||
}
|
||||
return recordPage;
|
||||
|
||||
Reference in New Issue
Block a user