feat:修改校验出库单状态

This commit is contained in:
zhouz
2026-07-27 14:56:20 +08:00
parent b54fbb614a
commit 2269022205
3 changed files with 14 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ public interface ErrorCodeConstants {
ErrorCode IOSTOR_INV_NO_MATCHING_INVENTORY = new ErrorCode(6_000_6, "没有符合当前出库明细的可用库存");
ErrorCode IOSTOR_INV_MANUAL_STATUS_INVALID = new ErrorCode(6_000_7, "只有生成或分配中的明细允许手工分配");
ErrorCode IOSTOR_INV_UPDATE_STATUS_INVALID = new ErrorCode(6_000_8, "只有生成状态的出库单允许修改");
ErrorCode IOSTORINV_DTL_NOT_EXISTS = new ErrorCode(5, "出入库单明细不存在");

View File

@@ -223,7 +223,13 @@ public class IostorInvServiceImpl implements IostorInvService {
@Override
@Transactional(rollbackFor = Exception.class)
public void updateOutbound(IostorInvUpdateReqVO reqVO) {
validateIostorInvExists(String.valueOf(reqVO.getIostorinvId()));
IostorInvDO current = iostorInvMapper.selectById(reqVO.getIostorinvId());
if (current == null) {
throw exception(IOSTOR_INV_NOT_EXISTS);
}
if (!"10".equals(current.getBillStatus())) {
throw exception(IOSTOR_INV_UPDATE_STATUS_INVALID);
}
Map<Long, AvailableInventoryRespVO> inventorySnapshot = validateAndLockInventory(reqVO);
BigDecimal totalWeight = reqVO.getDetails().stream()
.map(IostorInvCreateReqVO.Detail::getPlanQty)