REM:
1. 修改鹏信设备下发处置、停止处置命令错误处理逻辑
This commit is contained in:
HuangXin 2020-11-25 15:19:24 +08:00
parent 57979598b6
commit 1d157e2d54
1 changed files with 28 additions and 17 deletions

View File

@ -7,8 +7,6 @@ import com.dispose.common.ErrorCode;
import com.dispose.common.Helper;
import com.dispose.common.IpAddrType;
import com.dispose.common.NetflowDirection;
import com.dispose.manager.DisposeTaskManager;
import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.po.MulReturnType;
import com.dispose.pojo.vo.DeviceFirewareInfo;
@ -26,7 +24,6 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@ -54,16 +51,6 @@ public class PengXinAbilityImpl implements DisposeAbility {
* The Peng xin dispose type.
*/
private final Integer[] pengXinDisposeType = new Integer[]{0, 4, 1, 3};
/**
* The Dispose task manager.
*/
@Resource
private DisposeTaskManager disposeTaskManager;
/**
* The Dispose device mapper.
*/
@Resource
private DisposeDeviceMapper disposeDeviceMapper;
/**
* The Task req id.
*/
@ -195,8 +182,20 @@ public class PengXinAbilityImpl implements DisposeAbility {
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
}
log.debug("----Finish PengXin Start Cleanup Task: {}", disposeObject);
return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskId());
if (rspInfo.getMsgContent().getItems().size() == 0) {
log.error("----Error PengXin start clean {} server return nothing", disposeObject);
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
} else {
int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus();
if (errCode != ErrorCode.ERR_OK.getCode()) {
log.error("----Error PengXin start clean {} server return error: {}", disposeObject, errCode);
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
}
log.debug("----Finish PengXin Start Cleanup Task: {}", disposeObject);
return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskId());
}
} catch (Exception ex) {
log.error("----Exception PengXin Start Cleanup Task: {}, {}, {}", disposeObject, nfDirection, duration);
return new MulReturnType<>(ErrorCode.ERR_SYSTEMEXCEPTION, null);
@ -251,8 +250,20 @@ public class PengXinAbilityImpl implements DisposeAbility {
return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, null);
}
log.debug("----Finish PengXin Stop Cleanup Task: {}", taskId);
return new MulReturnType<>(ErrorCode.ERR_OK, null);
if (rspInfo.getMsgContent().getItems().size() == 0) {
log.error("----Error PengXin stop clean {} server return nothing", disposeObject);
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
} else {
int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus();
if (errCode != ErrorCode.ERR_OK.getCode()) {
log.error("----Error PengXin stop clean {} server return error: {}", disposeObject, errCode);
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
}
log.debug("----Finish PengXin Stop Cleanup Task: {}", taskId);
return new MulReturnType<>(ErrorCode.ERR_OK, null);
}
} catch (Exception ex) {
log.error("----Exception PengXin Stop Cleanup Task: {}, {}, {}", disposeObject, nfDirection, taskId);
return new MulReturnType<>(ErrorCode.ERR_SYSTEMEXCEPTION, null);