fix: 退款修改

This commit is contained in:
张松 2024-11-21 14:37:21 +08:00
parent dd7a3a9d46
commit caac76dbd8
1 changed files with 13 additions and 11 deletions

View File

@ -2831,7 +2831,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
orderDetail.setStatus("refund"); orderDetail.setStatus("refund");
} }
if (hasNormalReturn && returnAmount.compareTo(BigDecimal.ZERO) <= 0) { if (hasNormalReturn && returnAmount.compareTo(new BigDecimal("0.01")) <= 0) {
throw new BadRequestException("退款金额必须大于0"); throw new BadRequestException("退款金额必须大于0");
} }
@ -2977,6 +2977,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
String couponInfoList = orderInfo.getCouponInfoList(); String couponInfoList = orderInfo.getCouponInfoList();
if (StrUtil.isNotBlank(couponInfoList)) { if (StrUtil.isNotBlank(couponInfoList)) {
OrderInfoCouponInfoDTO orderInfoCouponInfoDTO = JSONObject.parseObject(couponInfoList, OrderInfoCouponInfoDTO.class); OrderInfoCouponInfoDTO orderInfoCouponInfoDTO = JSONObject.parseObject(couponInfoList, OrderInfoCouponInfoDTO.class);
if (orderInfoCouponInfoDTO.getProductCoupon() != null && !orderInfoCouponInfoDTO.getProductCoupon().isEmpty()) {
int remainNum = 0; int remainNum = 0;
for (OrderInfoUserCouponVo item : orderInfoCouponInfoDTO.getProductCoupon()) { for (OrderInfoUserCouponVo item : orderInfoCouponInfoDTO.getProductCoupon()) {
if (item.getFinalUseNum() > item.getReturnNum()) { if (item.getFinalUseNum() > item.getReturnNum()) {
@ -2993,6 +2994,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
} }
} }
} }
}
orderInfoMapper.updateById(orderInfo); orderInfoMapper.updateById(orderInfo);
// 打印退款小票 // 打印退款小票
// producer.printMechine(newOrderInfo.getId().toString()); // producer.printMechine(newOrderInfo.getId().toString());