| | |
| | | import org.xutils.http.RequestParams;
|
| | | import org.xutils.x;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.dialog.SelectDialog;
|
| | | import cn.com.basic.face.discern.common.BaseCommonCallBack;
|
| | |
| | | }
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DEPARTMENT_QUERY);
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getAndroidDevice().getCompanyId());
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | SelectDialog.setDepartmentDictionaryList(getDictionaryNameList(getList(Dictionary.class)));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private Map<String, String> departmentIdMap = new HashMap();
|
| | |
|
| | | public List<String> getDictionaryNameList(List<Dictionary> dictionaryList) {
|
| | | List nameList = new ArrayList();
|
| | | for (Dictionary dictionary : dictionaryList) {
|
| | | departmentIdMap.put(dictionary.getName(), dictionary.getDictId()+"");
|
| | | nameList.add(dictionary.getName());
|
| | | }
|
| | | return nameList;
|
| | | }
|
| | |
|
| | | public String getId(String name) {
|
| | | return departmentIdMap.get(name);
|
| | | }
|
| | |
|
| | | }
|