|
@ -71,9 +71,17 @@ public class ExchangeGoodsService extends BaseJpaService<ExchangeGoodsDO,Exchang
|
|
|
}
|
|
|
}
|
|
|
if (exchangeGoodsDO.getCoupon() == null){
|
|
|
accountDO.setTotal(accountDO.getTotal()-exchangeGoodsDO.getIntegrate());
|
|
|
if (accountDO.getTotal() == null ){
|
|
|
throw new Exception("积分余额不足!");
|
|
|
}else {
|
|
|
accountDO.setTotal(accountDO.getTotal()-exchangeGoodsDO.getIntegrate());
|
|
|
}
|
|
|
}else if (exchangeGoodsDO.getIntegrate() == null){
|
|
|
accountDO.setCouponTotal(accountDO.getCouponTotal()-exchangeGoodsDO.getCoupon());
|
|
|
if (accountDO.getTotal() == null){
|
|
|
throw new Exception("活动劵余额不足!");
|
|
|
}else {
|
|
|
accountDO.setCouponTotal(accountDO.getCouponTotal()-exchangeGoodsDO.getCoupon());
|
|
|
}
|
|
|
}
|
|
|
exchangeGoodsDO.setCreateTime(new Date());
|
|
|
exchangeGoodsDO.setUpdateTime(new Date());
|