Browse Source

优化诊断

develop
wangsixiang 3 weeks ago
parent
commit
897d4c1230
  1. 6
      zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

6
zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

@ -194,7 +194,7 @@ public class DcSwitchServiceImpl extends ServiceImpl<DcSwitchMapper, DcSwitch> i
List<DcDevice> dcDeviceId = dcSwitchMapper.getDcDeviceId(deviceIp);//查询设备id List<DcDevice> dcDeviceId = dcSwitchMapper.getDcDeviceId(deviceIp);//查询设备id
DcDevice dcDevice = new DcDevice();//存放设备id DcDevice dcDevice = new DcDevice();//存放设备id
if (dcDeviceId.size()>1){ if (dcDeviceId.size()>1){
return AjaxResult.success("设备IP存在冲突,请联系技术人员"); return AjaxResult.success("设备IP存在冲突");
}else { }else {
for (DcDevice dcDeviceValue:dcDeviceId){ for (DcDevice dcDeviceValue:dcDeviceId){
dcDevice.setId(dcDeviceValue.getId());//存入设备id dcDevice.setId(dcDeviceValue.getId());//存入设备id
@ -207,11 +207,11 @@ public class DcSwitchServiceImpl extends ServiceImpl<DcSwitchMapper, DcSwitch> i
.filter(dcSwitch -> dcSwitch.getDeviceList().contains(deviceIdString)) .filter(dcSwitch -> dcSwitch.getDeviceList().contains(deviceIdString))
.findFirst().map(DcSwitch::getSwitchIp).orElse(null); .findFirst().map(DcSwitch::getSwitchIp).orElse(null);
if (StringUtils.isBlank(switchIp)){ //switchIp为空不存在交换机ip if (StringUtils.isBlank(switchIp)){ //switchIp为空不存在交换机ip
return AjaxResult.success("未查询到相关的二层交换机,请联系技术人员配置"); return AjaxResult.success("未查询到相关的二层交换机");
} }
List<DcSwitch> switchList = dcSwitchMapper.getSwitchName(switchIp); List<DcSwitch> switchList = dcSwitchMapper.getSwitchName(switchIp);
if (switchList.size()!=1){ if (switchList.size()!=1){
return AjaxResult.success("二层交换机IP存在冲突,请联系技术人员"); return AjaxResult.success("二层交换机IP存在冲突");
}else { }else {
for (DcSwitch switchListValue:switchList) { for (DcSwitch switchListValue:switchList) {
InetAddress newSwitchIp = InetAddress.getByName(switchIp); InetAddress newSwitchIp = InetAddress.getByName(switchIp);

Loading…
Cancel
Save