自动退款兼容
This commit is contained in:
@@ -262,11 +262,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
|||||||
record.setVerifyCode(CzgRandomUtils.randomNumber(12, true));
|
record.setVerifyCode(CzgRandomUtils.randomNumber(12, true));
|
||||||
wareService.upGbWareGroupedNum(record.getWareId(), record.getNum());
|
wareService.upGbWareGroupedNum(record.getWareId(), record.getNum());
|
||||||
GbWare ware = wareService.getById(record.getWareId());
|
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())) {
|
if (StrUtil.isBlank(record.getGroupOrderNo())) {
|
||||||
GbOrder order = new GbOrder();
|
GbOrder order = new GbOrder();
|
||||||
order.setShopId(record.getShopId());
|
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())
|
GbOrder order = getOne(query().eq(GbOrder::getGroupOrderNo, record.getGroupOrderNo())
|
||||||
.eq(GbOrder::getShopId, record.getShopId()));
|
.eq(GbOrder::getShopId, record.getShopId()));
|
||||||
order.setCurrentPeopleNum(order.getCurrentPeopleNum() + 1);
|
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.setStatus("success");
|
||||||
order.setGroupEndTime(LocalDateTime.now());
|
order.setGroupEndTime(LocalDateTime.now());
|
||||||
record.setStatus("待核销");
|
record.setStatus("待核销");
|
||||||
@@ -320,6 +319,9 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
|||||||
updateById(order);
|
updateById(order);
|
||||||
}
|
}
|
||||||
detailService.updateById(record);
|
detailService.updateById(record);
|
||||||
|
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
|
||||||
|
refundByGbOrderDetail(record, "商品已下架 自动退款。");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user