| | |
| | |
|
| | | import cn.com.basic.face.dialog.CountryDialog;
|
| | | import cn.com.basic.face.dialog.SelectDialog;
|
| | | import cn.com.basic.face.discern.query.condition.DictionaryQueryCondition;
|
| | | import cn.com.basic.face.discern.query.item.VistorTypeQueryItem;
|
| | | import cn.com.basic.face.util.AppApi;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public void loadCountries() {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.DICTIONARY_TYPE_LIST);
|
| | | params.addParameter(Dictionary.FieldNames.type, CommonVariables.DictionaryType.COUNTRY);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DICTIONARY_QUERY);
|
| | | params.addParameter(DictionaryQueryCondition.FieldNames.type, CommonVariables.DictionaryType.COUNTRY);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<Dictionary> items = getList(Dictionary.class);
|
| | |
| | | List<String> uniqueFirstLetterList = new ArrayList<String>();
|
| | | HashMap<String,List<String>> countriesGroupByFirstLetter = new HashMap<String,List<String>>();
|
| | | for (Dictionary item : items) {
|
| | | idMap.put(item.getName(), item.getId()+"");
|
| | | idMap.put(item.getName(), item.getDictId()+"");
|
| | | String firstLetter = item.getRemark();
|
| | | List list = countriesGroupByFirstLetter.get(firstLetter);
|
| | | if (list == null) {
|
| | |
| | | }
|
| | |
|
| | | public void loadIdTypeList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.DICTIONARY_TYPE_LIST);
|
| | | params.addParameter(Dictionary.FieldNames.type, CommonVariables.DictionaryType.ID_TYPE);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DICTIONARY_QUERY);
|
| | | params.addParameter(DictionaryQueryCondition.FieldNames.type, CommonVariables.DictionaryType.ID_TYPE);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | SelectDialog.setIdTypeList(getDictionaryNameList(getList(Dictionary.class)));
|
| | |
| | | }
|
| | |
|
| | | private void loadGenderList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.DICTIONARY_TYPE_LIST);
|
| | | params.addParameter(Dictionary.FieldNames.type, CommonVariables.DictionaryType.GENDER);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DICTIONARY_QUERY);
|
| | | params.addParameter(DictionaryQueryCondition.FieldNames.type, CommonVariables.DictionaryType.GENDER);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | SelectDialog.setGenderList(getDictionaryNameList(getList(Dictionary.class)));
|
| | |
| | | }
|
| | |
|
| | | private void loadVisitReasonList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.DICTIONARY_TYPE_LIST);
|
| | | params.addParameter(Dictionary.FieldNames.type, CommonVariables.DictionaryType.VISIT_REASON);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DICTIONARY_QUERY);
|
| | | params.addParameter(DictionaryQueryCondition.FieldNames.type, CommonVariables.DictionaryType.VISIT_REASON);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | SelectDialog.setVisitReasonList(getDictionaryNameList(getList(Dictionary.class)));
|
| | |
| | | public List<String> getDictionaryNameList(List<Dictionary> dictionaryList) {
|
| | | List nameList = new ArrayList();
|
| | | for (Dictionary dictionary : dictionaryList) {
|
| | | idMap.put(dictionary.getName(), dictionary.getId()+"");
|
| | | idMap.put(dictionary.getName(), dictionary.getDictId()+"");
|
| | | nameList.add(dictionary.getName());
|
| | | }
|
| | | return nameList;
|
| | | }
|
| | |
|
| | | private void loadVisitorTypeList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.VISITOR_TYPE_LIST);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DICTIONARY_QUERY);
|
| | | params.addParameter(DictionaryQueryCondition.FieldNames.type, CommonVariables.DictionaryType.VISIT_TYPE);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<String> mVisitorTypeList = new ArrayList<String>();
|
| | | for (VistorTypeQueryItem item : getList(VistorTypeQueryItem.class)) {
|
| | | mVisitorTypeList.add(item.getLabel());
|
| | | idMap.put(item.getLabel(), item.getId()+"");
|
| | | }
|
| | | SelectDialog.setVisitorTypeList(mVisitorTypeList);
|
| | | SelectDialog.setVisitorTypeList(getDictionaryNameList(getList(Dictionary.class)));
|
| | | }
|
| | | });
|
| | | }
|