xuxiuxi
2017-03-29 8a2304211316d1ea4dde90fb33591d3b95624e6d
VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/service/VisitorCheckInMng.java
@@ -1,5 +1,7 @@
package com.bsk.zhangbo.demoforbsk.service;
import android.widget.Toast;
import com.bsk.zhangbo.demoforbsk.base.BaseApplication;
import com.bsk.zhangbo.demoforbsk.ui.fragment.VisitorRegisterFragment;
import com.bsk.zhangbo.demoforbsk.util.AppApi;
@@ -44,16 +46,40 @@
     * 查询被访问人员列表
     */
    public void findIntervieweeList(String pageNum, String name, final boolean isClear) {
        RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.DICTIONARY_TYPE_LIST);
        params.addBodyParameter(IntervieweeQueryCondition.FieldNames.companyId, "1");
        params.addBodyParameter(IntervieweeQueryCondition.FieldNames.name, name);
//        RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.DICTIONARY_TYPE_LIST);
//        params.addBodyParameter(IntervieweeQueryCondition.FieldNames.companyId, "1");
//        params.addBodyParameter(IntervieweeQueryCondition.FieldNames.name, name);
//        x.http().post(params, new BaseCommonCallBack() {
//            public void success() {
//                VisitorRegisterFragment.getInstance().listChanged(getList(IntervieweeQueryItem.class), isClear);
//            }
//        });
        RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.VISITOR_LIST);
        params.addBodyParameter(VisitorQueryCondition.FieldNames.companyId, BaseApplication.getInstance().getPlace().getCompanyId());
        params.addBodyParameter(VisitorQueryCondition.FieldNames.name, name);
        x.http().post(params, new BaseCommonCallBack() {
            public void success() {
                VisitorRegisterFragment.getInstance().listChanged(getList(IntervieweeQueryItem.class), isClear);
                VisitorRegisterFragment.getInstance().listChanged(getList(VisitorQueryItem.class), isClear);
            }
        });
    }
    /**
     * 添加访客记录
     * @param params
     */
    public void add(RequestParams params) {
        params.setUri(AppApi.BASEURL+AppApi.CHECK_IN_ADD);
        x.http().post(params, new BaseCommonCallBack() {
            @Override
            public void success() {
                Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
            }
        });
    }
    /**
     * 查询拜访事由列表