Browse Source

/*ivs控制预置位接口bug修改:将适配灵州站红外模块的host='null',port='null'传递到了ivs3800服务器的请求中造成异常*/

master
htjcAdmin 5 months ago
parent
commit
ea7c2a623a
3 changed files with 13 additions and 50 deletions
  1. +3
    -2
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java
  2. +9
    -5
      inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java
  3. +1
    -43
      inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java

+ 3
- 2
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java View File

@ -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");


+ 9
- 5
inspect-ivs/src/main/java/com/inspect/ivs/service/IvsResourceRetryableDelegate.java View File

@ -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();
}


+ 1
- 43
inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetVo.java View File

@ -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() + '\'' +
'}';
}
}

Loading…
Cancel
Save