qvyuanxin
2017-07-21 bef8d3da93bc4f16b1ff11da5f41c758f4f7d70d
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DepartmentMng.java
@@ -10,6 +10,7 @@
import cn.com.basic.face.discern.entity.Department;
import cn.com.basic.face.discern.entity.Dictionary;
import cn.com.basic.face.discern.query.condition.DictionaryQueryCondition;
import cn.com.basic.face.service.sqlite.DepartmentDao;
import cn.com.basic.face.util.AppApi;
public class DepartmentMng extends BaseMng {
@@ -24,12 +25,16 @@
        if (!BaseApplication.deviceAvailable) {
            return;
        }
        RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DEPARTMENT_QUERY);
        x.http().get(params, new BaseCommonCallBack() {
            public void success() {
                SelectDialog.setDepartmentDictionaryList(getDictionaryNameList(getList(Dictionary.class)));
            }
        });
        if (BaseApplication.getInstance().networkAvailable()) {
            RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.DEPARTMENT_QUERY);
            x.http().get(params, new BaseCommonCallBack() {
                public void success() {
                    SelectDialog.setDepartmentDictionaryList(getDictionaryNameList(getList(Dictionary.class)));
                }
            });
        } else {
            SelectDialog.setDepartmentDictionaryList(getDictionaryNameList(DepartmentDao.getInstance().loadDepartmentDictionary()));
        }
    }
}