From ea7c2a623a82848575707dbc0952351a8f59d89e Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Tue, 22 Jul 2025 15:44:46 +0800 Subject: [PATCH] =?UTF-8?q?/*ivs=E6=8E=A7=E5=88=B6=E9=A2=84=E7=BD=AE?= =?UTF-8?q?=E4=BD=8D=E6=8E=A5=E5=8F=A3bug=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=E5=B0=86=E9=80=82=E9=85=8D=E7=81=B5=E5=B7=9E=E7=AB=99=E7=BA=A2?= =?UTF-8?q?=E5=A4=96=E6=A8=A1=E5=9D=97=E7=9A=84host=3D'null',port=3D'null'?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E5=88=B0=E4=BA=86ivs3800=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E8=AF=B7=E6=B1=82=E4=B8=AD=E9=80=A0=E6=88=90?= =?UTF-8?q?=E5=BC=82=E5=B8=B8*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ivs/controller/IvsControlController.java | 5 ++- .../service/IvsResourceRetryableDelegate.java | 14 +++--- .../java/com/inspect/ivs/vo/IvsPresetVo.java | 44 +------------------ 3 files changed, 13 insertions(+), 50 deletions(-) diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java index 036a98e..bcb1588 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java @@ -106,10 +106,11 @@ public class IvsControlController { @GetMapping({"presetList"}) public IvsPresetListView presetList(IvsVo ivsVo) { - log.info("GET_PRESET_LIST PARAM: {}", ivsVo); + final String apiAddr = ivsResourceRetryableDelegate.getApiAddress(ivsVo); + log.info("GET_PRESET_LIST PARAM: {}, apiAddr: {}", ivsVo, apiAddr); IvsPresetListView ivsPresetListView = ivsCommonService.get(ivsResourceRetryableDelegate.getLabel(), - ivsVo.getAddress(), + apiAddr, UriUtils.parseForReplace(IvsConst.URI_PRESET_LIST, ivsVo), IvsPresetListView.class); log.debug("[IVS] END"); diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java b/inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java index bdadbfe..c805560 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java @@ -77,7 +77,8 @@ public class IvsResourceRetryableDelegate { } paramJson.put("controlPara1", ivsPresetVo.getPreset()); paramJson.put("controlPara2", ""); - if(StringUtils.isNotEmpty(ivsPresetVo.getHost())) { + if (StringUtils.isNotEmpty(ivsPresetVo.getHost()) + && !"null".equals(ivsPresetVo.getHost())) { paramJson.put("host", ivsPresetVo.getHost()); paramJson.put("port", ivsPresetVo.getPort()); paramJson.put("address", ivsPresetVo.getAddress()); @@ -120,7 +121,8 @@ public class IvsResourceRetryableDelegate { ignoredKeys.add("uUID"); ignoredKeys.add("name"); ignoredKeys.add("id"); - if(StringUtils.isEmpty(ivsDevChanSnapVo.getHost())) { + if (StringUtils.isEmpty(ivsDevChanSnapVo.getHost()) + && !"null".equals(ivsDevChanSnapVo.getHost())) { ignoredKeys.add("host"); ignoredKeys.add("port"); ignoredKeys.add("address"); @@ -168,7 +170,8 @@ public class IvsResourceRetryableDelegate { ivsChanSnapVo.setUUID(null); ivsChanSnapVo.setName(null); ivsChanSnapVo.setId(null); - if(StringUtils.isEmpty(ivsChanSnapVo.getHost())) { + if (StringUtils.isEmpty(ivsChanSnapVo.getHost()) + && !"null".equals(ivsChanSnapVo.getHost())) { ivsChanSnapVo.setHost(null); ivsChanSnapVo.setPort(null); ivsChanSnapVo.setAddress(null); @@ -281,9 +284,10 @@ public class IvsResourceRetryableDelegate { return UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); } - private String getApiAddress(IvsVo ivsVo) { + public String getApiAddress(IvsVo ivsVo) { String realAddr = null; - if(StringUtils.isNotEmpty(ivsVo.getHost()) && StringUtils.isNotEmpty(ivsVo.getPort())) { // nvr ip + if (StringUtils.isNotEmpty(ivsVo.getHost()) + && !"null".equals(ivsVo.getHost())) { // nvr ip //realAddr = ivsVo.getHost().concat(StringUtils.COLON).concat(ivsVo.getPort()); realAddr = "http://" + ivsVo.getHost() + StringUtils.COLON + ivsVo.getPort(); } diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java b/inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java index 4a310c3..939beff 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java @@ -7,10 +7,8 @@ import java.util.Objects; public class IvsPresetVo extends IvsVo { private String serial; private String channel; - private String code; private String command; private String preset; - private String name; private int focusSwitch = 0; public String getSerial() { @@ -21,9 +19,6 @@ public class IvsPresetVo extends IvsVo { return this.channel; } - public String getCode() { - return this.code; - } public String getCommand() { return this.command; @@ -33,9 +28,7 @@ public class IvsPresetVo extends IvsVo { return this.preset; } - public String getName() { - return this.name; - } + public int getFocusSwitch() { return this.focusSwitch; @@ -61,40 +54,5 @@ public class IvsPresetVo extends IvsVo { this.focusSwitch = focusSwitch; } - @Override - public boolean equals(Object object) { - if (this == object) return true; - if (object == null || getClass() != object.getClass()) return false; - if (!super.equals(object)) return false; - IvsPresetVo that = (IvsPresetVo) object; - return focusSwitch == that.focusSwitch && Objects.equals(serial, that.serial) && Objects.equals(channel, that.channel) && Objects.equals(code, that.code) && Objects.equals(command, that.command) && Objects.equals(preset, that.preset) && Objects.equals(name, that.name); - } - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), serial, channel, code, command, preset, name, focusSwitch); - } - - @Override - public String toString() { - return "IvsPresetVo{" + - "serial='" + serial + '\'' + - ", channel='" + channel + '\'' + - ", code='" + code + '\'' + - ", command='" + command + '\'' + - ", preset='" + preset + '\'' + - ", name='" + name + '\'' + - ", focusSwitch=" + focusSwitch + - "code='" + getCode() + '\'' + - "cameraCode='" + getCameraCode() + '\'' + - "domainCode='" + getCameraCode() + '\'' + - "host='" + getHost() + '\'' + - "port='" + getPort() + '\'' + - "address='" + getAddress() + '\'' + - "username='" + getUsername() + '\'' + - "password='" + getPassword() + '\'' + - "name='" + getName() + '\'' + - "id='" + getId() + '\'' + - '}'; - } }