|
|
@@ -92,6 +92,28 @@ public class ExamRoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ 添加设备
|
|
|
+ */
|
|
|
+ public void addDevice1(String deviceSerial, String validateCode) {
|
|
|
+ String accessToken = ezvizTokenService.getToken();
|
|
|
+ String uri = "https://open.ys7.com/api/lapp/device/add";
|
|
|
+ String send = "accessToken=" + accessToken + "&deviceSerial=" + deviceSerial + "&validateCode=" + validateCode;
|
|
|
+ log.info("萤石添加设备--->" + send);
|
|
|
+
|
|
|
+ String body = HttpRequest.post(uri).send(send).body();
|
|
|
+ log.info("萤石添加设备返回--->" + body);
|
|
|
+
|
|
|
+ JSONObject json = JSONObject.parseObject(body);
|
|
|
+ if (!"200".equals(json.getString("code")) && !"20017".equals(json.getString("code"))) {
|
|
|
+ throw new BusinessException(json.getString("msg"));
|
|
|
+ }
|
|
|
+ // 解密设备
|
|
|
+ this.encryptOff1(deviceSerial, validateCode, accessToken);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
删除设备
|
|
|
*/
|
|
|
@@ -171,6 +193,20 @@ public class ExamRoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void encryptOff1(String deviceSerial, String validateCode, String accessToken) {
|
|
|
+ String uri = "https://open.ys7.com/api/lapp/device/encrypt/off";
|
|
|
+ String send = "accessToken=" + accessToken + "&deviceSerial=" + deviceSerial + "&validateCode=" + validateCode;
|
|
|
+ log.info("萤石关闭设备加密--->" + send);
|
|
|
+
|
|
|
+ String body = HttpRequest.post(uri).send(send).body();
|
|
|
+ log.info("萤石关闭设备加密返回--->" + body);
|
|
|
+
|
|
|
+ JSONObject json = JSONObject.parseObject(body);
|
|
|
+ if (!"200".equals(json.getString("code")) && !"60016".equals(json.getString("code"))) {
|
|
|
+ throw new BusinessException(json.getString("msg"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
展示今天备案中的所有考场信息
|
|
|
*/
|