From a4a904acc5f4de80d30eafe19dd97f3cc8f56a0b Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 29 九月 2025 17:17:34 +0800
Subject: [PATCH] 新问题 25-9-28
---
ycl-server/src/main/java/com/ycl/api/HK/HKApi.java | 44 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/api/HK/HKApi.java b/ycl-server/src/main/java/com/ycl/api/HK/HKApi.java
index a9711cd..0f15d17 100644
--- a/ycl-server/src/main/java/com/ycl/api/HK/HKApi.java
+++ b/ycl-server/src/main/java/com/ycl/api/HK/HKApi.java
@@ -33,12 +33,50 @@
@Slf4j
public class HKApi {
- public static OSDResult getOsdByIP(String ip, String userName, String password) {
+ public static OSDResult getOsdByIP(String serialNumber, String ip, String userName, String password) {
OSDResult osdResult = new OSDResult();
String hostUrl = "http://" + ip;
try {
//鑾峰彇OSD
- String OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH, userName, password);
+ /**
+ * 閫氳繃鍥芥爣鍊掓暟绗竷浣嶅垽鏂�氶亾 0/鍏ㄦ櫙 1/缁嗚妭
+ * 瀵逛簬娴峰悍鏉ヨ锛� 鍥芥爣鍊�7 0/鍏ㄦ櫙/閫氶亾2 1/缁嗚妭/閫氶亾1
+ * 瀵逛簬澶у崕鏉ヨ锛� 鍥芥爣鍊�7 0/鍏ㄦ櫙/閫氶亾1 1/缁嗚妭/閫氶亾2
+ * 瀹囪鍗曢�氶亾涓嶈�冭檻
+ */
+ String OSDString = null;
+ if(StringUtils.isEmpty(serialNumber)) return null;
+ if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == ApiConstants.SerialNumber_All ) {
+ OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_2, userName, password);
+ }else if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == ApiConstants.SerialNumber_Detail){
+ OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_1, userName, password);
+ }
+ //閫氳繃璁惧绫诲瀷鍒ゆ柇锛堝純鐢級
+// if(serialNumber.charAt(ApiConstants.SerialNumber_Category) == 1 ){
+// //鏋満
+// if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 1){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_1, userName, password);
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 0){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_2, userName, password);
+// }
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Category) == 2){
+// //鐞冩満
+// if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 0){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_1, userName, password);
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 1){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_2, userName, password);
+// }
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Category) == 3){
+// //鍗″彛 鍗曢�氶亾
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_1, userName, password);
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Category) == 4){
+// //楂樼┖
+// if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 0){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_1, userName, password);
+// }else if(serialNumber.charAt(ApiConstants.SerialNumber_Channel) == 1){
+// OSDString = getHttpResponse(hostUrl + ApiConstants.HK_OSD_PATH_2, userName, password);
+// }
+// }
if (OSDString == null) return null;
//瑙f瀽xml
@@ -70,7 +108,7 @@
if (node.getNodeType() == Node.ELEMENT_NODE && "TextOverlay".equals(tagName1)) {
Element element = (Element) node;
String textContent = element.getElementsByTagName(tagName2).item(0).getTextContent();
- // log.info("TEXT : " + textContent);
+ log.info("HKTEXT : " + textContent);
if (i == 0) {
osdResult.setOSD1(textContent);
} else if (i == 1) {
--
Gitblit v1.8.0