package com.product.mobile.app.service;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import com.product.core.dao.BaseDao;
|
import com.product.core.entity.DataTableEntity;
|
import com.product.core.entity.FieldSetEntity;
|
import com.product.core.exception.BaseException;
|
import com.product.core.service.support.AbstractBaseService;
|
import com.product.mobile.core.config.MobileCoreConst;
|
import com.product.util.BaseUtil;
|
|
/**
|
* 手机端,获取用户所有应用
|
* @author Administrator
|
*
|
*/
|
@Component
|
public class AppAdminService extends AbstractBaseService{
|
@Autowired
|
public BaseDao baseDao;
|
/**
|
* 是否有新的版本号,返回两个版本号:最近一次版本,最新版本
|
* 让用户选择
|
* 版本:大中小,三个版本号,只能在相同大版号内容更新
|
* 大版本号随后端的大版本号同时升级,即后端有大版本升级,同时移动端也要大版本升级,中版本、小版号可以不一致
|
* @return
|
* @throws BaseException
|
*/
|
public FieldSetEntity checkVersion(String version) throws BaseException{
|
String filter="version>?";
|
DataTableEntity dt =baseDao.listTable(MobileCoreConst.TABLE_APP_MANAGER, filter, new String[] {version},"version");
|
|
FieldSetEntity fs=new FieldSetEntity();
|
fs.setTableName(MobileCoreConst.TABLE_APP_MANAGER);
|
if(DataTableEntity.isEmpty(dt)) {
|
fs.setValue("upgrade",0);
|
}else {
|
|
fs.setValue("min_version", dt.getString(0,"version"));
|
fs.setValue("min_version_file", dt.getString(0,"file"));
|
fs.setValue("version_code", dt.getString(0,"version_code"));
|
fs.setValue("app_detail", dt.getString(0,"app_detail"));
|
// if(dt.getRows()>1) {
|
// fs.setValue("max_version", dt.getString(dt.getRows()-1,"version"));
|
// fs.setValue("max_version_file", dt.getString(dt.getRows()-1,"file"));
|
// }else {
|
// fs.setValue("max_version", dt.getString(0,"version"));
|
// fs.setValue("max_version_file", dt.getString(0,"file"));
|
// }
|
fs.setValue("upgrade",1);
|
}
|
return fs;
|
}
|
}
|