Commit 145f86f8 authored by liqin's avatar liqin 💬

bug fixed

parent 8f0d0e9b
......@@ -713,15 +713,18 @@ public class ChinaMobileRestApiController extends BaseController {
Map map = new HashMap();
if (StringUtils.isNotBlank(versionNo)) {
final String prefix = StringUtils.substring(versionNo, 0, StringUtils.indexOf(versionNo, "."));
final String suffix = StringUtils.substring(versionNo, StringUtils.indexOf(versionNo, ".")).replaceAll("\\.", "");
String currAppVersion = current.getAppVersion();
final String prefix1 = StringUtils.substring(currAppVersion, 0, StringUtils.indexOf(currAppVersion, "."));
final String suffix1 = StringUtils.substring(currAppVersion, StringUtils.indexOf(currAppVersion, ".")).replaceAll("\\.", "");
if (Double.parseDouble(prefix + "." + suffix) >= Double.parseDouble(prefix1 + "." + suffix1)) {
map.put("isLatest", true);
final String[] versionNoArray = StringUtils.split(versionNo, ".");
final String[] currentVersionNoArray = StringUtils.split(current.getAppVersion(), ".");
if (Integer.parseInt(versionNoArray[0]) >= Integer.parseInt(currentVersionNoArray[0])) {
if (Integer.parseInt(versionNoArray[1]) >= Integer.parseInt(currentVersionNoArray[1])) {
if (Integer.parseInt(versionNoArray[2]) >= Integer.parseInt(currentVersionNoArray[2])) {
map.put("isLatest", true);
} else {
map.put("isLatest", false);
}
} else {
map.put("isLatest", false);
}
} else {
map.put("isLatest", false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment