pull/1121/head
liujiang 2025-10-02 22:19:34 +08:00
commit 55bf6218a1
1 changed files with 24 additions and 0 deletions

View File

@ -805,6 +805,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
throw new ServiceException(CharSequenceUtil.format("订单[{}]当前状态无法发货",
order.getOrderNo()));
}
checkNoCompleteRefundDetail(storeOrderDetailIds, "售后完成状态的商品无法发货");
List<StoreOrderDetail> containDetails = storeOrderDetailMapper.selectList(
Wrappers.lambdaQuery(StoreOrderDetail.class)
.eq(StoreOrderDetail::getStoreOrderId, order.getId())
@ -898,6 +899,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
throw new ServiceException(CharSequenceUtil.format("订单[{}]当前状态无法发货",
order.getOrderNo()));
}
checkNoCompleteRefundDetail(storeOrderDetailIds, "售后完成状态的商品无法发货");
List<StoreOrderDetail> containDetails = storeOrderDetailMapper.selectList(
Wrappers.lambdaQuery(StoreOrderDetail.class)
.eq(StoreOrderDetail::getStoreOrderId, order.getId())
@ -974,6 +976,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
public ExpressShippingLabelDTO printOrder(Long storeOrderId, List<Long> storeOrderDetailIds, Long expressId,
Boolean needShip, Long operatorId) {
Assert.notEmpty(storeOrderDetailIds);
checkNoCompleteRefundDetail(storeOrderDetailIds, "售后完成状态的商品无法打印快递单");
ExpressManager expressManager = expressService.getExpressManager(expressId);
Express express = expressService.getById(expressId);
if (!BeanValidators.exists(express) || !express.getSystemDeliverAccess()) {
@ -1775,6 +1778,27 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
new Date());
}
/**
*
*
* @param orderDetailIds
* @param errorMsg
*/
private void checkNoCompleteRefundDetail(Collection<Long> orderDetailIds, String errorMsg) {
if (CollUtil.isEmpty(orderDetailIds)) {
return;
}
List<StoreOrderDetail> refundDetails = storeOrderDetailMapper.selectList(Wrappers
.lambdaQuery(StoreOrderDetail.class)
.in(StoreOrderDetail::getOriginOrderDetailId, orderDetailIds)
.eq(SimpleEntity::getDelFlag, Constants.UNDELETED));
for (StoreOrderDetail refundDetail : refundDetails) {
if (EOrderStatus.AFTER_SALE_COMPLETED.getValue().equals(refundDetail.getDetailStatus())) {
throw new ServiceException(errorMsg);
}
}
}
/**
*
*