fix: 订单详情增加优惠券抵扣标识
This commit is contained in:
parent
06d92f7e26
commit
bc073414d2
|
|
@ -129,6 +129,7 @@ public class TbOrderDetail implements Serializable {
|
|||
private String returnNum;
|
||||
|
||||
private BigDecimal memberPrice;
|
||||
private Integer userCouponId;
|
||||
|
||||
public void copy(TbOrderDetail source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
|
|
|
|||
|
|
@ -1476,6 +1476,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
orderDetail.setProductSkuName(productSku.getSpecSnap());
|
||||
}
|
||||
|
||||
orderDetail.setUserCouponId(cashierCart.getUserCouponId());
|
||||
orderDetail.setMemberPrice(cashierCart.getMemberPrice());
|
||||
orderDetail.setNote(cashierCart.getNote());
|
||||
orderDetail.setCreateTime(DateUtil.date().toTimestamp());
|
||||
|
|
@ -2546,6 +2547,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
BigDecimal saleAmount = BigDecimal.ZERO;
|
||||
ArrayList<TbOrderDetail> remainOrderDetailList = new ArrayList<>();
|
||||
for (TbOrderDetail orderDetail : detailList) {
|
||||
if (orderDetail.getUserCouponId() != null) {
|
||||
throw new BadRequestException("选择了优惠券抵扣商品,无法退款");
|
||||
}
|
||||
Integer returnNum = returnNumMap.get(orderDetail.getId().toString());
|
||||
int remainNum = orderDetail.getNum() - returnNum;
|
||||
if (remainNum < 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue