From 6ac14e937107b5d97cb674bbbab209e02b77bcd4 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Tue, 26 Oct 2021 09:24:51 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=BA2.0.8.6=202.=20=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E8=B0=83=E7=94=A8=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../ability/impl/PengXinAbilityImpl.java | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) 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); }