parent
16bdcdb66a
commit
76696205b0
|
@ -56,6 +56,12 @@ public interface DisposeDeviceManager {
|
|||
*/
|
||||
List<DisposeDevice> getAllNormalDisposeDevices();
|
||||
|
||||
/**
|
||||
* Gets all dispose devices.
|
||||
*
|
||||
* @return the all dispose devices
|
||||
*/
|
||||
List<DisposeDevice> getAllDisposeDevices();
|
||||
/**
|
||||
* Gets dispose device by id.
|
||||
*
|
||||
|
|
|
@ -290,6 +290,16 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all dispose devices.
|
||||
*
|
||||
* @return the all dispose devices
|
||||
*/
|
||||
@Override
|
||||
public List<DisposeDevice> getAllDisposeDevices(){
|
||||
return disposeDeviceMapper.selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets dispose device by id.
|
||||
*
|
||||
|
|
|
@ -57,7 +57,8 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
|||
*/
|
||||
@PostConstruct
|
||||
private void initDisposeAbility() {
|
||||
List<DisposeDevice> devList = disposeDeviceManager.getAllNormalDisposeDevices();
|
||||
//List<DisposeDevice> devList = disposeDeviceManager.getAllNormalDisposeDevices();
|
||||
List<DisposeDevice> devList = disposeDeviceManager.getAllDisposeDevices();
|
||||
devList.forEach(this::addDisposeAbilityDevice);
|
||||
}
|
||||
|
||||
|
@ -223,8 +224,10 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
|||
DisposeDevice dev = disposeDeviceManager.getDisposeDeviceById(v.getDev().getId());
|
||||
|
||||
if (dev == null || !dev.getStatus().equals(ObjectStatus.NORMAL)) {
|
||||
// 如果数据库中设备不存在,那么删除该设备
|
||||
v.getDev().setStatus(ObjectStatus.DELETED);
|
||||
if(!v.getDev().getStatus().equals(ObjectStatus.DELETED)){
|
||||
// 如果数据库中设备不存在,那么删除该设备
|
||||
v.getDev().setStatus(ObjectStatus.DELETED);
|
||||
}
|
||||
} else {
|
||||
v.getDev().setStatus(ObjectStatus.NORMAL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue