xuxiuxi
2017-08-01 e09e9f8a34cbc99a33dfa9ef1792b0025575c3a8
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
package cn.com.basic.face.service;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.discern.entity.Dictionary;
 
public class BaseMng {
 
    public void addPageFooter(boolean hasMorePages, int pageNum, List list) {
        if (hasMorePages) {
            list.add(CommonVariables.Page.hasMorePages);
        } else {
            if (pageNum > 1) {
                list.add(CommonVariables.Page.reachBottom);
            } else {
                if (list.size() > 0) {
                    list.add(CommonVariables.Page.reachBottom);
                } else {
                    //itemList.add(CommonVariables.Page.noMorePage);
                }
            }
        }
    }
 
    public List<String> getDictionaryNameList(List<Dictionary> dictionaryList) {
        List nameList = new ArrayList();
        for (Dictionary dictionary : dictionaryList) {
            idMap.put(dictionary.getName(), dictionary.getDictId()+"");
            nameList.add(dictionary.getName());
        }
        return nameList;
    }
 
    public Map<String, String> idMap = new HashMap<String, String>();
 
    public String getId(String name) {
        return idMap.get(name);
    }
 
}