|
@@ -63,53 +63,12 @@ public class SearchFragment extends Fragment {
|
|
|
searchDeptLayout = (LinearLayout) view.findViewById(R.id.searchDeptLayout);
|
|
|
searchDeptSpinner = (Spinner) view.findViewById(R.id.searchDeptSpinner);
|
|
|
|
|
|
- getHospitalList("1");
|
|
|
+ getHospitalList(BuildConfig.INST_CD);
|
|
|
|
|
|
return view;
|
|
|
}
|
|
|
|
|
|
- private void getHospitalList(final String categoryId) {
|
|
|
- CallBack callBack = new CallBack() {
|
|
|
- @Override
|
|
|
- public void result(SoapObject result) {
|
|
|
- Log.e(TAG, "getHospitalList --> " + result);
|
|
|
- if (result == null || result.toString().indexOf("null") > 0) {
|
|
|
- stop();
|
|
|
- } else {
|
|
|
- ArrayList<CategoryVO> arrayList = SoapParser.getHospitalList(result);
|
|
|
- if (arrayList.size() == 0) {
|
|
|
- stop();
|
|
|
- } else {
|
|
|
- setSpinnerAdapter(arrayList, categoryId);
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < arrayList.size(); i++) {
|
|
|
- CategoryVO categoryVO = arrayList.get(i);
|
|
|
- String categoryId = categoryVO.getCategoryId();
|
|
|
- if (categoryId.equals("EMA_" + BuildConfig.INST_CD)) {
|
|
|
- getHospitalRowList(categoryId);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- @Override
|
|
|
- public void stop() {
|
|
|
-// ArrayList<CategoryVO> arrayList = new ArrayList<CategoryVO>();
|
|
|
-// arrayList.add(new CategoryVO("", "", "전체"));
|
|
|
-// setSpinnerAdapter(arrayList);
|
|
|
- }
|
|
|
- @Override
|
|
|
- public void error() {
|
|
|
-
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- HashMap<String, String> mData = new HashMap<String, String>();
|
|
|
- mData.put("categoryId", categoryId);
|
|
|
- Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_CATEGORYY, mData, callBack);
|
|
|
- }
|
|
|
-
|
|
|
- private void getHospitalRowList(final String categoryId) {
|
|
|
+ private void getHospitalList(final String instCd) {
|
|
|
CallBack callBack = new CallBack() {
|
|
|
@Override
|
|
|
public void result(SoapObject result) {
|
|
@@ -118,7 +77,7 @@ public class SearchFragment extends Fragment {
|
|
|
stop();
|
|
|
} else {
|
|
|
ArrayList<CategoryVO> arrayList = SoapParser.getHospitalList(result);
|
|
|
- setSpinnerAdapter(arrayList, categoryId);
|
|
|
+ setSpinnerAdapter(arrayList);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -134,24 +93,18 @@ public class SearchFragment extends Fragment {
|
|
|
};
|
|
|
|
|
|
HashMap<String, String> mData = new HashMap<String, String>();
|
|
|
- mData.put("categoryId", categoryId);
|
|
|
+ mData.put("categoryId", instCd);
|
|
|
Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_CATEGORYY, mData, callBack);
|
|
|
}
|
|
|
|
|
|
- private void setSpinnerAdapter(final ArrayList arrayList, final String categoryId) {
|
|
|
+ private void setSpinnerAdapter(final ArrayList arrayList) {
|
|
|
mActivity.runOnUiThread(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
categoryAdapter = new CategoryAdapter(mActivity, arrayList);
|
|
|
-
|
|
|
- if (categoryId.equals("EMA_" + BuildConfig.INST_CD)) {
|
|
|
- searchDeptSpinner.setAdapter(categoryAdapter);
|
|
|
- }
|
|
|
+ searchDeptSpinner.setAdapter(categoryAdapter);
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|