parent
1aef6bf19e
commit
c34b9ecb3d
|
@ -2,6 +2,7 @@ package com.dispose.manager.impl;
|
|||
|
||||
import com.dispose.common.ErrorCode;
|
||||
import com.dispose.common.Helper;
|
||||
import com.dispose.common.HttpType;
|
||||
import com.dispose.common.IpAddrType;
|
||||
import com.dispose.common.ObjectStatus;
|
||||
import com.dispose.manager.DisposeDeviceManager;
|
||||
|
@ -55,6 +56,16 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
|
|||
*/
|
||||
@Override
|
||||
public MulReturnType<ErrorCode, Long> addDisposeDevice(DisposeDevice dev) {
|
||||
List<DisposeDevice> tmpDev = disposeDeviceMapper.getDeviceByIpAndType(dev.getIpAddr(),
|
||||
dev.getDeviceType().getValue());
|
||||
|
||||
for (DisposeDevice v : tmpDev) {
|
||||
if (dev.getIpPort().equals(HttpType.getDefaultPort(v.getUrlType())) || dev.getIpPort()
|
||||
.equals(v.getIpPort())) {
|
||||
return new MulReturnType<>(ErrorCode.ERR_DEVICEEXISTS, v.getId());
|
||||
}
|
||||
}
|
||||
|
||||
// 看看系统中有没有存在相同IP+端口地址的设备,有的话返回失败
|
||||
DisposeDevice tDev = disposeDeviceMapper.getDeviceByAddrAndType(dev.getIpAddr(), dev.getIpPort(),
|
||||
dev.getDeviceType().getValue());
|
||||
|
|
|
@ -797,7 +797,8 @@ public class P2DeviceAdd {
|
|||
Assert.assertNotNull(k.getDevId());
|
||||
});
|
||||
|
||||
DisposeDevice dev = c.getDisposeDeviceMapper().getDeviceByAddrAndType("10.88.77.15", "", DisposeDeviceType.DPTECH_UMC
|
||||
DisposeDevice dev = c.getDisposeDeviceMapper().getDeviceByAddrAndType("10.88.77.15", "80",
|
||||
DisposeDeviceType.DPTECH_UMC
|
||||
.getValue());
|
||||
Assert.assertNotNull(dev);
|
||||
|
||||
|
|
Loading…
Reference in New Issue