|
@@ -24,12 +24,27 @@ public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper, HyAppVe
|
|
|
*/
|
|
|
@Override
|
|
|
public HyAppVersion selectInfo(String appid, String version, String imei, String type) {
|
|
|
+ HyAppVersion hyAppVersion1 = new HyAppVersion();
|
|
|
if("hz".equals(type)){
|
|
|
HyAppVersion hyAppVersion =this.selectById("1");
|
|
|
- return hyAppVersion;
|
|
|
+ //将传入版本号转成int类型
|
|
|
+ String str = version.replace(".","");
|
|
|
+ int value1 = Integer.parseInt(str);
|
|
|
+ //数据库版本号与传入版本号比较,如果大于,更新
|
|
|
+ if (Integer.parseInt(hyAppVersion.getVersionCode()) > value1){
|
|
|
+ return hyAppVersion;
|
|
|
+ }
|
|
|
+ return hyAppVersion1;
|
|
|
}else {
|
|
|
HyAppVersion hyAppVersion =this.selectById("2");
|
|
|
- return hyAppVersion;
|
|
|
+ //将传入版本号转成int类型
|
|
|
+ String str = version.replace(".","");
|
|
|
+ int value1 = Integer.parseInt(str);
|
|
|
+ //数据库版本号与传入版本号比较,如果大于,更新
|
|
|
+ if (Integer.parseInt(hyAppVersion.getVersionCode()) > value1){
|
|
|
+ return hyAppVersion;
|
|
|
+ }
|
|
|
+ return hyAppVersion1;
|
|
|
}
|
|
|
}
|
|
|
}
|