From ab460df1d3a8bebec1ad4a34f2f3b6deac22269b Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期一, 10 四月 2017 17:20:21 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DictionaryMng.java | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DictionaryMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DictionaryMng.java index 1b3da89..50cf378 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DictionaryMng.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DictionaryMng.java @@ -2,6 +2,7 @@ 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; @@ -40,8 +41,8 @@ } 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); @@ -67,8 +68,8 @@ } 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))); @@ -77,8 +78,8 @@ } 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))); @@ -87,8 +88,8 @@ } 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))); @@ -106,15 +107,11 @@ } 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))); } }); } -- Gitblit v1.8.0