You've already forked FrameTour-BE
优惠券软删除
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.ycwl.basic.service.mobile.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ycwl.basic.mapper.CouponMapper;
|
||||
import com.ycwl.basic.mapper.CouponRecordMapper;
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
@@ -50,11 +49,7 @@ public class AppCouponRecordServiceImpl implements AppCouponRecordService {
|
||||
}
|
||||
// 查找可用的优惠券
|
||||
Long scenicId = face.getScenicId();
|
||||
QueryWrapper<CouponEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("scenic_id", scenicId)
|
||||
.eq("type", type)
|
||||
.eq("status", 1); // 开启状态
|
||||
CouponEntity coupon = couponMapper.selectOne(queryWrapper);
|
||||
CouponEntity coupon = couponMapper.selectByScenicIdAndTypeAndStatus(scenicId, type, 1);
|
||||
|
||||
if (coupon == null) {
|
||||
throw new RuntimeException("未找到可领取的优惠券");
|
||||
|
@@ -1,5 +1,4 @@
|
||||
package com.ycwl.basic.service.pc.impl;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ycwl.basic.mapper.CouponMapper;
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
||||
@@ -11,7 +10,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CouponServiceImpl extends ServiceImpl<CouponMapper, CouponEntity> implements CouponService {
|
||||
public class CouponServiceImpl implements CouponService {
|
||||
|
||||
@Autowired
|
||||
private CouponMapper couponMapper;
|
||||
@@ -28,7 +27,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, CouponEntity> i
|
||||
|
||||
@Override
|
||||
public Boolean delete(Integer id) {
|
||||
return removeById(id);
|
||||
return couponMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user