diff --git a/pom.xml b/pom.xml index 7d4df5e6..b7814aa0 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ com.dispose dispose_platform - 2.0.8.5 + 2.0.8.6 dispose_platform Dispose Platform diff --git a/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java b/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java index a3682eb3..4e98b45b 100644 --- a/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java @@ -151,6 +151,7 @@ public class PengXinAbilityImpl implements DisposeAbility { String url = urlRootPath + "dispose_device/task/start"; if (token == null || token.length() == 0) { + upgradeToken(); return new MulReturnType<>(ErrorCode.ERR_LOGOUT, ""); } @@ -200,7 +201,7 @@ public class PengXinAbilityImpl implements DisposeAbility { return new MulReturnType<>(ErrorCode.ERR_PENGXIN_ERROR, null); } - log.debug("----Finish PengXin Start Cleanup Task: {}", disposeObject); + log.info("----Finish PengXin Start Cleanup Task: {}", disposeObject); return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskId()); } } catch (Exception ex) { @@ -227,6 +228,7 @@ public class PengXinAbilityImpl implements DisposeAbility { String url = urlRootPath + "dispose_device/task/stop"; if (token == null || token.length() == 0) { + upgradeToken(); return new MulReturnType<>(ErrorCode.ERR_LOGOUT, null); } @@ -266,7 +268,7 @@ public class PengXinAbilityImpl implements DisposeAbility { return new MulReturnType<>(ErrorCode.ERR_PENGXIN_ERROR, null); } - log.debug("----Finish PengXin Stop Cleanup Task: {}", taskId); + log.info("----Finish PengXin Stop Cleanup Task: {}", taskId); return new MulReturnType<>(ErrorCode.ERR_OK, null); } } catch (Exception ex) { @@ -456,6 +458,7 @@ public class PengXinAbilityImpl implements DisposeAbility { @Override public MulReturnType taskStatus(String taskId) { if (token == null || token.length() == 0) { + upgradeToken(); return new MulReturnType<>(ErrorCode.ERR_LOGOUT, -1L); } @@ -470,15 +473,14 @@ public class PengXinAbilityImpl implements DisposeAbility { rspInfo = restfulInterface.getDeviceTaskStatus(url, token, new String[]{taskId}); } - if (rspInfo != null && rspInfo.getCode() == ErrorCode.ERR_OK.getHttpCode()) { - - int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus(); - if (rspInfo.getMsgContent().getItems().size() == 0 || errCode != ErrorCode.ERR_OK.getCode()) { - return new MulReturnType<>(ErrorCode.ERR_NOSUCHTASK, -1L); + if (rspInfo != null) { + if (rspInfo.getCode() == ErrorCode.ERR_OK.getHttpCode()) { + int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus(); + if (rspInfo.getMsgContent().getItems().size() == 0 || errCode != ErrorCode.ERR_OK.getCode()) { + return new MulReturnType<>(ErrorCode.ERR_NOSUCHTASK, -1L); + } } - - return new MulReturnType<>(ErrorCode.ERR_OK, - rspInfo.getMsgContent().getItems().get(0).getTaskStatus()); + return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskStatus()); } else { return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, -1L); }