liding
昨天 acc94dd2dc309e50882f7b10c20d955ed2f14716
src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
@@ -26,6 +26,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -89,10 +90,14 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean delete(List<Long> ids) {
        List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>()
                .in(ShippingInfo::getId, ids));
        if (CollectionUtils.isEmpty(shippingInfos)) return false;
        // 只有待审核状态才能删除
        boolean allPending = shippingInfos.stream().allMatch(s -> "待审核".equals(s.getStatus()));
        if (!allPending) throw new RuntimeException("只有待审核状态才能删除");
        // 删除附件
        commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue());
        // 删除发货审批