From b257a7dfde8f0a3e5c44d0a4177fb3f1eb0895b8 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Thu, 18 Jan 2018 16:25:53 +0800 Subject: [PATCH] update --- .../appclient/core/impls/RetailAppServiceImp.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 35cc8f890..8bc77c27c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -958,10 +958,15 @@ public class RetailAppServiceImp implements RetailAppService { Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); int update_type = 0;// 0:不更新 1:更新 2:强制更新 - if (newAppVersion.compareToIgnoreCase(version) > 0) { - update_type = 1; - if (isUpdate) { - update_type = 2; + String [] versionArr = version.split("\\."); + String [] newVersionArr = newAppVersion.split("\\."); + for (int i = 0; i < newVersionArr.length; i++) { + if(Integer.valueOf(newVersionArr[i])>Integer.valueOf(versionArr[i])){ + update_type = 1; + if (isUpdate) { + update_type = 2; + } + i=newVersionArr.length+1; } } JSONObject res = new JSONObject();