海康接口
This commit is contained in:
1 parent
1f6d49381d
commit
6d15f93642
19 files changed
+727
-8
No files matched your search
+76
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, pjcloud All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: pjcloud
|
||||
*
|
||||
*/
|
||||
|
||||
package com.bsd.pjcloud.thirdparty.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.VisitorObjectResponse;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.request.make.CheckOutRequest;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.request.make.RegisterAppointmentRequest;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.request.make.VisitorAppointmentRequest;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.response.make.AppointmentData;
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.response.make.RegisterAppointmentResponse;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(contextId = "remoterVisitorService", value = ServiceNameConstants.THIRDPARTY_SERVICE)
|
||||
public interface RemoterVisitorService {
|
||||
|
||||
|
||||
/**
|
||||
* 访客预约预约
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/visitors/appointment")
|
||||
R<VisitorObjectResponse<AppointmentData>> createVisitorAppointment(@Valid @RequestBody VisitorAppointmentRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 取消预约
|
||||
* @param recordIds
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/cancel")
|
||||
public R cancelAppointments(@RequestBody List<String> recordIds);
|
||||
|
||||
/**
|
||||
* 预约登记
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/register")
|
||||
public R<RegisterAppointmentResponse> registerAppointment(@Valid @RequestBody RegisterAppointmentRequest request);
|
||||
|
||||
/**
|
||||
* 访客签离
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/checkout")
|
||||
public R checkOut(@Valid @RequestBody CheckOutRequest request);
|
||||
}
|
||||
+9
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.make;
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
@@ -25,4 +25,12 @@ public class AppointmentInfo {
|
||||
*/
|
||||
private String QRCode;
|
||||
|
||||
|
||||
|
||||
private String receptionistName;
|
||||
private String verificationCode;
|
||||
private String orderId;
|
||||
private String picUri;
|
||||
private String svrIndexCode;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.response.person.PersonDetailResponse;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ListDetailData {
|
||||
private Integer total;
|
||||
private List<PersonDetailResponse.PersonDetail> list;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.request.person;
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor;
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.apache.poi.ss.formula.functions.T;
|
||||
* 访客预约响应主类
|
||||
*/
|
||||
@Data
|
||||
public class VisitorObjectResponse {
|
||||
public class VisitorObjectResponse<T> {
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.request.make;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "取消预约请求参数")
|
||||
public class CancelAppointmentRequest {
|
||||
/**
|
||||
* 预约记录ID列表(必填)
|
||||
* 最多支持批量取消100条记录
|
||||
*/
|
||||
@NotEmpty(message = "预约记录ID不能为空")
|
||||
@Size(max = 100, message = "单次最多取消100条预约")
|
||||
private List<@NotBlank String> appointRecordIds;
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.request.make;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "访客签离请求参数")
|
||||
public class CheckOutRequest {
|
||||
/**
|
||||
* 访客记录ID(必填)
|
||||
* 从查询接口获取的orderId
|
||||
*/
|
||||
@NotBlank(message = "访客记录ID不能为空")
|
||||
private String orderId;
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.request.make;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "预约登记请求参数")
|
||||
public class RegisterAppointmentRequest {
|
||||
/**
|
||||
* 访客记录ID(必填)
|
||||
* 从查询预约记录接口获取
|
||||
*/
|
||||
@NotBlank(message = "访客记录ID不能为空")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 预计离开时间(必填)
|
||||
* ISO8601格式,需晚于当前时间
|
||||
*/
|
||||
@NotNull
|
||||
@Future(message = "离开时间必须是将来的时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
|
||||
private LocalDateTime visitEndTime;
|
||||
|
||||
/**
|
||||
* 门禁卡号(可选)
|
||||
*/
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 权限配置(可选)
|
||||
*/
|
||||
private VisitorPermissionSet visitorPermissionSet;
|
||||
|
||||
/**
|
||||
* 是否使用预约权限(默认0)
|
||||
* 0-使用登记权限,1-权限合并
|
||||
*/
|
||||
@Pattern(regexp = "[01]", message = "权限模式参数错误")
|
||||
private String isUseOrderAuth = "0";
|
||||
|
||||
@Data
|
||||
@Schema(description = "访客权限配置")
|
||||
public static class VisitorPermissionSet {
|
||||
/**
|
||||
* 权限组ID列表
|
||||
*/
|
||||
@Size(max = 10, message = "最多选择10个权限组")
|
||||
private List<String> privilegeGroupIds;
|
||||
|
||||
/**
|
||||
* 是否使用默认权限组
|
||||
* 1-使用,其他-不使用
|
||||
*/
|
||||
@Pattern(regexp = "1|.*", message = "默认权限组标识错误")
|
||||
private String defaultPrivilegeGroupFlag;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.request.person;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PersonDetailRequest {
|
||||
/**
|
||||
* 查询参数类型(必填)
|
||||
* certificateNo-证件号码 | personId-人员ID | phoneNo-手机号 | jobNo-工号
|
||||
*/
|
||||
@NotNull(message = "查询类型不能为空")
|
||||
private ParamName paramName;
|
||||
|
||||
/**
|
||||
* 查询值列表(必填)
|
||||
* 最大支持1000个查询值
|
||||
*/
|
||||
@NotEmpty(message = "查询值不能为空")
|
||||
@Size(max = 1000, message = "最多支持1000个查询值")
|
||||
private List<String> paramValue;
|
||||
|
||||
public enum ParamName {
|
||||
certificateNo, personId, phoneNo, jobNo
|
||||
}
|
||||
}
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.make;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.dto.visitor.AppointmentInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.make;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "取消预约响应结果")
|
||||
public class CancelAppointmentResponse {
|
||||
/**
|
||||
* ("返回码 0-成功")
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* "操作结果描述
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* ("保留字段(始终为null)")
|
||||
*/
|
||||
private Object data; // 根据接口文档返回null
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.make;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "访客签离响应结果")
|
||||
public class CheckOutResponse {
|
||||
@Schema(description = "返回码 0-成功")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "操作结果描述")
|
||||
private String msg;
|
||||
|
||||
@Schema(description = "保留字段(始终为null)")
|
||||
private Object data; // 根据接口文档返回null
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.make;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "预约登记响应结果")
|
||||
public class RegisterAppointmentResponse {
|
||||
@Schema(description = "返回码 0-成功")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "操作结果描述")
|
||||
private String msg;
|
||||
|
||||
@Schema(description = "登记凭证信息")
|
||||
private RegisterData data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "登记凭证数据")
|
||||
public static class RegisterData {
|
||||
@Schema(description = "动态二维码内容")
|
||||
private String QRCode;
|
||||
|
||||
@Schema(description = "访客记录唯一标识")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "图片服务索引码")
|
||||
private String svrIndexCode;
|
||||
|
||||
@Schema(description = "头像访问路径")
|
||||
private String picUri;
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.visitor.response.person;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class PersonDetailResponse {
|
||||
private String code;
|
||||
private String msg;
|
||||
private PersonDetailData data;
|
||||
|
||||
@Data
|
||||
public static class PersonDetailData {
|
||||
private Integer total;
|
||||
private List<PersonDetail> list;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class PersonDetail {
|
||||
// 基础字段
|
||||
private String personId;
|
||||
private String personName;
|
||||
private Integer gender;
|
||||
private String orgPath;
|
||||
private String orgPathName;
|
||||
private String orgIndexCode;
|
||||
private Integer certificateType;
|
||||
private String certificateNo;
|
||||
private String jobNo;
|
||||
private String birthday;
|
||||
private String phoneNo;
|
||||
private String address;
|
||||
|
||||
// 教育信息
|
||||
private Integer education;
|
||||
private String academy;
|
||||
private String profession;
|
||||
private String studentId;
|
||||
private String stuGrade;
|
||||
private String stuClass;
|
||||
|
||||
// 工作信息
|
||||
private String company;
|
||||
private String employeePost;
|
||||
private String postType;
|
||||
private String staffProperty;
|
||||
|
||||
// 个人信息
|
||||
private Integer age;
|
||||
private String lastName;
|
||||
private String givenName;
|
||||
private Integer nation;
|
||||
private String birthplace;
|
||||
private String nationality;
|
||||
private Integer marriaged;
|
||||
private String politicalStatus;
|
||||
private String censusRegister;
|
||||
|
||||
// 证件信息
|
||||
private String certIssuer;
|
||||
private String certAddr;
|
||||
private String certExpireTime;
|
||||
|
||||
// 系统信息
|
||||
private Integer status;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// 照片信息
|
||||
private List<PersonPhoto> personPhoto;
|
||||
|
||||
// 扩展字段(兼容新增属性)
|
||||
private Map<String, Object> extendedProperties;
|
||||
|
||||
@Data
|
||||
public static class PersonPhoto {
|
||||
private String personPhotoIndexCode;
|
||||
private String picUri;
|
||||
private String serverIndexCode;
|
||||
private String personId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user