6c
2025-05-07 eb8a211f814360b6aa2da9cefd924d355bbb5972
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
    }
}