| | |
| | | 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(); |
| | | } |
| | | |
| | | /** |