fix(customs): keep declaration pending while exceptions remain
This commit is contained in:
+5
-2
@@ -428,8 +428,11 @@ public class ContainerCustomsService {
|
||||
if (mapper.insertClearanceResult(resultId, batch.id(), batch.customsContainerId(), type, resultStatus,
|
||||
batch.customsEntryNo(), request.occurredAt(), trim(request.resolution()), request.evidenceFileId(),
|
||||
operatorId, operatorName, null) != 1) throw conflict("海关结果保存失败");
|
||||
if ("OPEN".equals(resultStatus)) mapper.markDeclarationResultPending(batch.id());
|
||||
else mapper.closeDeclarationBatch(batch.id());
|
||||
if ("OPEN".equals(resultStatus) || mapper.openClearanceResultCount(batch.id()) > 0) {
|
||||
mapper.markDeclarationResultPending(batch.id());
|
||||
} else {
|
||||
mapper.closeDeclarationBatch(batch.id());
|
||||
}
|
||||
ContainerRow container = mapper.lockContainerById(batch.customsContainerId());
|
||||
if (container != null) history(container, "RECORD_CUSTOMS_CLEARANCE_RESULT", container.status(), container.status(), type, operatorId, operatorName);
|
||||
completeCommand(operatorId, action, key, resultId);
|
||||
|
||||
Reference in New Issue
Block a user