REM:
1.增加错误码
2.无处置设备时,下发任务直接报错
This commit is contained in:
chenlinghy 2021-02-03 11:23:20 +08:00
parent 76696205b0
commit 1aef6bf19e
2 changed files with 12 additions and 0 deletions

View File

@ -277,7 +277,15 @@ public enum ErrorCode {
*/
ERR_ADDBUSINESS(302, "添加客户业务失败"),
/**
* Err delbusiness error code.
*/
ERR_DELBUSINESS(303, "删除客户业务失败"),
/**
* Err not found device error code.
*/
ERR_NOTFOUNDDEVICE(304, "找不到设备先添加设备"),
;
/**

View File

@ -190,6 +190,10 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
*/
@Override
public ErrorCode verifyDisposeCapacity(Long deviceId, String disposeIp, DisposeCapacityType capacityType) {
//处置平台无处置设备直接报错
if(getAllAbilityDevices().size() == 0 ) {
return ErrorCode.ERR_NOTFOUNDDEVICE;
}
if (getAllAbilityDevices().stream()
.noneMatch(f -> deviceId == -1 || f.getDev().getId().equals(deviceId))) {