活动 置空问题
This commit is contained in:
parent
65c9667d9f
commit
08351e6260
|
|
@ -45,8 +45,22 @@ public class TbActivateServiceImpl extends ServiceImpl<TbActivateMapper, TbActiv
|
||||||
@Override
|
@Override
|
||||||
public void modifyActivate(TbActivate activate) {
|
public void modifyActivate(TbActivate activate) {
|
||||||
if (Objects.nonNull(activate.getId()) && activate.getId() > 0) {
|
if (Objects.nonNull(activate.getId()) && activate.getId() > 0) {
|
||||||
|
if(activate.getIsUseCoupon()==0){
|
||||||
|
activate.setCouponId(null);
|
||||||
|
} else if (activate.getIsUseCoupon()==1) {
|
||||||
|
if (activate.getCouponId() == null) {
|
||||||
|
throw new RuntimeException("优惠券不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
activateMapper.updateById(activate);
|
activateMapper.updateById(activate);
|
||||||
} else {
|
} else {
|
||||||
|
if(activate.getIsUseCoupon()==0){
|
||||||
|
activate.setCouponId(null);
|
||||||
|
} else if (activate.getIsUseCoupon()==1) {
|
||||||
|
if (activate.getCouponId() == null) {
|
||||||
|
throw new RuntimeException("优惠券不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
activateMapper.insert(activate);
|
activateMapper.insert(activate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue