| | |
| | | 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);
|
| | | }
|
| | | /*
|
| | | public <T> List<T> getSyncList(String url, Map<String, String> condition, Class<T> requiredType){
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+url);
|
| | | addParameters(params, condition);
|
| | | try {
|
| | | ResultBean resultBean = x.http().getSync(params, ResultBean.class);
|
| | | return resultBean.getListBeanOfType(requiredType);
|
| | | } catch (Throwable throwable) {
|
| | | throwable.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | private void addParameters(RequestParams params, Map<String, String> condition) {
|
| | | try {
|
| | | for (Map.Entry<String, String> entry : condition.entrySet()) {
|
| | | params.addParameter(entry.getKey(), entry.getValue());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }*/
|
| | |
|
| | | }
|