| | |
| | | public boolean delete(List<Long> ids) { |
| | | List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>() |
| | | .in(ShippingInfo::getId, ids)); |
| | | if(CollectionUtils.isEmpty(shippingInfos)) return false; |
| | | // 删除附件 |
| | | commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue()); |
| | | // 扣库存 |
| | | for (Long id : ids) { |
| | | stockUtils.deleteStockRecord(id, StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode()); |
| | | // 扣已发货库存 |
| | | for (ShippingInfo shippingInfo : shippingInfos) { |
| | | if("已发货".equals(shippingInfo.getStatus())) { |
| | | stockUtils.deleteStockRecord(shippingInfo.getId(), StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode()); |
| | | } |
| | | } |
| | | // 删除发货审批 |
| | | if(CollectionUtils.isNotEmpty(shippingInfos)){ |