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