优惠券 修改发放数量的校验
This commit is contained in:
parent
09df694d36
commit
24bc7ba3a8
|
|
@ -122,6 +122,14 @@ public class TbShopCouponServiceImpl extends ServiceImpl<TbShopCouponMapper, TbS
|
||||||
param.setLeftNumber(param.getNumber());
|
param.setLeftNumber(param.getNumber());
|
||||||
tbShopCouponmapper.insert(param);
|
tbShopCouponmapper.insert(param);
|
||||||
} else {
|
} else {
|
||||||
|
if (param.getNumber() != null) {
|
||||||
|
TbShopCoupon tbShopCoupon = tbShopCouponmapper.selectById(param.getId());
|
||||||
|
if (param.getNumber() < tbShopCoupon.getNumber()) {
|
||||||
|
throw new BadRequestException("修改失败 发放数量不可减少");
|
||||||
|
} else {
|
||||||
|
param.setLeftNumber(param.getLeftNumber() + param.getNumber() - tbShopCoupon.getNumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
tbShopCouponmapper.updateById(param);
|
tbShopCouponmapper.updateById(param);
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(param.getProducts())) {
|
if (CollectionUtil.isNotEmpty(param.getProducts())) {
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ public class QueryReceiveVo {
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private String name;
|
private String name;
|
||||||
private String phone;
|
private String phone;
|
||||||
private Date receiveTime;
|
private String receiveTime;
|
||||||
private Date useTime;
|
private String useTime;
|
||||||
private String num;
|
private String num;
|
||||||
private String overNum;
|
private String overNum;
|
||||||
private String source;
|
private String source;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue