| | |
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.fragment.CheckInFragment;
|
| | | import cn.com.basic.face.fragment.SupervisoryFragment;
|
| | | import cn.com.basic.face.util.AppApi;
|
| | |
|
| | | import org.xutils.http.RequestParams;
|
| | | import org.xutils.x;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.List;
|
| | |
| | | import cn.com.basic.face.discern.common.BaseCommonCallBack;
|
| | | import cn.com.basic.face.discern.query.condition.VisitorQueryCondition;
|
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | | import cn.com.basic.face.util.CharacterParser;
|
| | |
|
| | | public class CheckInMng {
|
| | |
|
| | |
| | | return instance;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询来访人员列表
|
| | | */
|
| | | public void findSupervisoryBottomList(String pageNum, String name, final boolean isClear) {
|
| | | //id,名称,头像路径,联系电话,公司名称,证件编号
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.CheckInQuery);
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.notCompanyId, BaseApplication.getInstance().getPlace().getCompanyId());
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.name, name);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | //CheckInFragment.getInstance().listChanged(getList(CheckInQueryItem.class), isClear);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询来访人员列表
|
| | | */
|
| | | public void findSupervisoryBottomList() {
|
| | | //id,名称,头像路径,联系电话,公司名称,证件编号
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.CheckInQuery);
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.notCompanyId, BaseApplication.getInstance().getPlace().getCompanyId());
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | //SupervisoryFragment.getInstance().visitorListChanged(getList(CheckInQueryItem.class));
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询被访问人员列表
|
| | | */
|
| | | public void findIntervieweeList(String pageNum, String name, final boolean isClear) {
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.CheckInQuery);
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.companyId, BaseApplication.getInstance().getPlace().getCompanyId());
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.name, name);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | //CheckInFragment.getInstance().listChanged(getList(CheckInQueryItem.class), isClear);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 添加访客记录
|
| | | * @param params
|
| | | */
|
| | | public void add(RequestParams params) {
|
| | |
|
| | | params.setUri(AppApi.BASEURL+AppApi.CHECK_IN_ADD);
|
| | | params.setUri(AppApi.BASE_URL +AppApi.VISIT_ADD);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | @Override
|
| | | public void success() {
|
| | | Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
|
| | | CheckInFragment.getInstance().resetForm();
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | public void findCheckInLeftList(final boolean isVisitorList, final boolean isSortByDept, String searchText) {
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.CheckInQuery);
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.REGISTER_QUERY);
|
| | | if (isVisitorList) {
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.notCompanyId, BaseApplication.getInstance().getPlace().getCompanyId());
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.notCompanyId, BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | } else {
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.companyId, BaseApplication.getInstance().getPlace().getCompanyId());
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.companyId, BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | }
|
| | | params.addBodyParameter(VisitorQueryCondition.FieldNames.name, searchText);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<CheckInQueryItem> list = getList(CheckInQueryItem.class);
|
| | | sort(list, isSortByDept);
|
| | | CheckInFragment.getInstance().get_fragment_check_in_left_list_view().show(list, isVisitorList);
|
| | | List allItems = new ArrayList();
|
| | | String name = "";
|
| | | String prev = "";
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | CheckInQueryItem item = list.get(i);
|
| | | if (isSortByDept) {
|
| | | name = CharacterParser.getInstance().getSelling(item.getDeptName()).substring(0, 1);
|
| | | } else {
|
| | | name = CharacterParser.getInstance().getSelling(item.getUsername()).substring(0, 1);
|
| | | }
|
| | | if (!name.equals(prev)) {
|
| | | allItems.add(name);
|
| | | }
|
| | | allItems.add(item);
|
| | | prev = name;
|
| | | }
|
| | | if (isVisitorList) {
|
| | | CheckInFragment.getInstance().get_fragment_check_in_left_visitor().show(allItems);
|
| | | } else {
|
| | | CheckInFragment.getInstance().get_fragment_check_in_left_interviewee().show(allItems);
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | String dept1Name = t1.getDeptName()==null?"":t1.getDeptName();
|
| | | String dept2Name = t2.getDeptName()==null?"":t2.getDeptName();
|
| | | if(!dept1Name.equals(dept2Name)) {
|
| | | return dept1Name.compareTo(dept2Name);
|
| | | String dept1Name_a = CharacterParser.getInstance().getSelling(dept1Name).toLowerCase();
|
| | | String dept1Name_b = CharacterParser.getInstance().getSelling(dept2Name).toLowerCase();
|
| | | return dept1Name_a.compareTo(dept1Name_b);
|
| | | }
|
| | | }
|
| | | String name1 = t1.getName()==null?"":t1.getName();
|
| | | String name2 = t2.getName()==null?"":t2.getName();
|
| | | return name1.compareTo(name2);
|
| | | String name1 = t1.getUsername()==null?"":t1.getUsername();
|
| | | String name2 = t2.getUsername()==null?"":t2.getUsername();
|
| | | String dept1Name_a = CharacterParser.getInstance().getSelling(name1).toLowerCase();
|
| | | String dept1Name_b = CharacterParser.getInstance().getSelling(name2).toLowerCase();
|
| | | return dept1Name_a.compareTo(dept1Name_b);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询拜访事由列表
|
| | | */
|
| | |
|
| | | }
|