自动退款兼容

This commit is contained in:
2025-12-19 15:24:44 +08:00
parent 496884d2c2
commit f0f719b7c9

View File

@@ -262,11 +262,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
record.setVerifyCode(CzgRandomUtils.randomNumber(12, true));
wareService.upGbWareGroupedNum(record.getWareId(), record.getNum());
GbWare ware = wareService.getById(record.getWareId());
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
detailService.updateById(record);
refundByGbOrderDetail(record, "商品已下架 自动退款。");
return;
}
if (StrUtil.isBlank(record.getGroupOrderNo())) {
GbOrder order = new GbOrder();
order.setShopId(record.getShopId());
@@ -302,7 +298,10 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
GbOrder order = getOne(query().eq(GbOrder::getGroupOrderNo, record.getGroupOrderNo())
.eq(GbOrder::getShopId, record.getShopId()));
order.setCurrentPeopleNum(order.getCurrentPeopleNum() + 1);
if (order.getCurrentPeopleNum().equals(order.getGroupPeopleNum())) {
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
order.setStatus("fail");
order.setGroupEndTime(LocalDateTime.now());
} else if (order.getCurrentPeopleNum().equals(order.getGroupPeopleNum())) {
order.setStatus("success");
order.setGroupEndTime(LocalDateTime.now());
record.setStatus("待核销");
@@ -320,6 +319,9 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
updateById(order);
}
detailService.updateById(record);
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
refundByGbOrderDetail(record, "商品已下架 自动退款。");
}
}
@Override