| | |
| | | import java.util.stream.Collectors; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param dto 管理后台-优惠券数据传输对象 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateCoupon(MgtCouponDTO dto) { |
| | | Coupon coupon = this.getById(dto.getId()); |
| | | if (StringUtils.isNull(coupon)) { |
| | |
| | | coupon.setCouponName(dto.getCouponName()); |
| | | coupon.setDescription(dto.getDescription()); |
| | | this.updateById(coupon); |
| | | couponMemberService.lambdaUpdate().set(CouponMember::getDescription, dto.getDescription()) |
| | | .eq(CouponMember::getCouponId, dto.getId()).update(); |
| | | } |
| | | |
| | | /** |
| | |
| | | public PageDTO<CouponReceiveDetailVO> getReceiveDetail(MgtCouponReceiveQuery query) { |
| | | MemberDTO memberDTO = getMemberQueryParam(query); |
| | | Set<Long> memberIdSet = getMemberIdSet(memberDTO); |
| | | if ((StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) && CollUtils.isEmpty(memberIdSet)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<CouponMember> page = couponMemberService.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getCouponStatus()), |
| | | CouponMember::getCouponStatus, query.getCouponStatus()) |