diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/VisitorService.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/VisitorService.java index bc6317acc..78f6e8218 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/VisitorService.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/VisitorService.java @@ -339,9 +339,19 @@ public class VisitorService extends BaseHikvisionService { RegisterAppointmentResponse response = JSON.parseObject(json, new TypeReference() {}); - if (!"0".equals(response.getCode())) { - throw new HikvisionException(response.getCode(), response.getMsg()); + // 处理不同的错误码,提供友好的错误提示 + String code = response.getCode(); + if ("0".equals(code)) { + // 成功情况 + log.info("海康预约登记成功"); + } else if ("0x05320009".equals(code)) { + throw new ServiceException("订单无效或已登记,请检查订单状态"); + } else { + // 其他错误码 + log.error("海康预约登记失败,错误码: {}, 错误信息: {}", code, response.getMsg()); + throw new ServiceException("预约登记失败: " + response.getMsg()); } + return response; }