fix(stock): 修复销售出货记录删除逻辑错误
- 修改判断条件,区分销售发货出库记录类型
- 修正断言逻辑,确保存在销售出货记录时禁止删除
- 优化代码结构,避免逻辑混淆
- 保障数据一致性,防止误删相关记录
| | |
| | | stockUninventoryDto.setQualitity(stockOutRecord.getStockOutNum()); |
| | | stockUninventoryMapper.updateAddStockUnInventory(stockUninventoryDto); |
| | | } |
| | | }else if ("3".equals(stockOutRecord.getType())){ |
| | | } |
| | | if ("13".equals(stockOutRecord.getRecordType())){ |
| | | // 此为 销售-发货出库 没有关联记录才能成功删除 |
| | | // 查询对应是否含有销售出货记录 |
| | | ShippingInfo byId = shippingInfoService.getById(stockOutRecord.getRecordId()); |
| | | Assert.notNull(byId, StrUtil.format("{}存在销售出货记录,无法删除!!!",stockOutRecord.getOutboundBatches())); |
| | | Assert.isNull(byId, StrUtil.format("{}存在销售出货记录,无法删除!!!",stockOutRecord.getOutboundBatches())); |
| | | |
| | | } |
| | | } |