feat: 强化出库上链一致性(确认中即已上链/出库时间必填/上链须先出库)

This commit is contained in:
Nixevol
2026-07-10 17:53:57 +08:00
parent f364d2d194
commit e1e1cf7308
6 changed files with 24 additions and 5 deletions
@@ -38,6 +38,10 @@ export class OutboundService {
if (isOutbound(code)) {
throw new BusinessException(ErrorCode.BAD_REQUEST, '该追溯码已登记出库,不可重复出库');
}
// 出库时间必填:出库登记必须有出库时间
if (!dto.outTime) {
throw new BusinessException(ErrorCode.BAD_REQUEST, '出库时间不能为空');
}
const imageKeys = dto.outImageKeys ?? (dto.outImageKey ? [dto.outImageKey] : []);
const data: Prisma.TraceCodeUpdateInput = {};
if ('outTime' in dto) data.outTime = dto.outTime ? new Date(dto.outTime) : null;