xuxiuxi
2017-04-05 00d6d1822a08c0bc43467c0e13701a219e4624c8
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurvalanceMng.java
@@ -7,7 +7,7 @@
import java.util.List;
import cn.com.basic.face.discern.common.BaseCommonCallBack;
import cn.com.basic.face.discern.query.item.SupervisoryQueryItem;
import cn.com.basic.face.discern.query.item.SurveillanceQueryItem;
import cn.com.basic.face.fragment.SurveillanceFragment;
import cn.com.basic.face.util.AppApi;
import cn.com.basic.face.util.Constant;
@@ -26,10 +26,10 @@
//        params.addBodyParameter(VisitorQueryCondition.FieldNames.notCompanyId, BaseApplication.getInstance().getPlace().getCompanyId());
        x.http().post(params, new BaseCommonCallBack() {
            public void success() {
                List<SupervisoryQueryItem> list = getList(SupervisoryQueryItem.class);
                List<SurveillanceQueryItem> list = getList(SurveillanceQueryItem.class);
                if (isVisit) {
                    int i = 0;
                    for (SupervisoryQueryItem item : list) {
                    for (SurveillanceQueryItem item : list) {
                        if (i % 5 == 0) {
                            item.setType(Constant.Supervisory.VISIT_REGISTER_ITEM_TYPE);
                        } else {
@@ -38,7 +38,7 @@
                        i++;
                    }
                    List<SupervisoryQueryItem> doubleList = new ArrayList<SupervisoryQueryItem>();
                    List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>();
                    fillBlank(list, doubleList);
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(doubleList, true);
@@ -50,11 +50,11 @@
    }
    private void fillBlank(List<SupervisoryQueryItem> list, List<SupervisoryQueryItem> doubleList) {
        List<SupervisoryQueryItem> registerList = new ArrayList<SupervisoryQueryItem>();
        List<SupervisoryQueryItem> checkInList = new ArrayList<SupervisoryQueryItem>();
    private void fillBlank(List<SurveillanceQueryItem> list, List<SurveillanceQueryItem> doubleList) {
        List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>();
        List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>();
        for (SupervisoryQueryItem item : list) {
        for (SurveillanceQueryItem item : list) {
            if (item.getType() == Constant.Supervisory.VISIT_REGISTER_ITEM_TYPE) {
                registerList.add(item);
            }
@@ -63,11 +63,11 @@
            }
        }
        List<SupervisoryQueryItem> blenderList = new ArrayList<SupervisoryQueryItem>();
        List<SurveillanceQueryItem> blenderList = new ArrayList<SurveillanceQueryItem>();
        int i = 0, m = 0, n = 0;
        for (i = 0; i < registerList.size() + checkInList.size(); i++) {
            SupervisoryQueryItem item;
            SurveillanceQueryItem item;
            if (i % 2 == 0 && m < registerList.size()) {
                item = registerList.get(m);
                m++;
@@ -78,7 +78,7 @@
            blenderList.add(item);
        }
        for (SupervisoryQueryItem item : blenderList) {
        for (SurveillanceQueryItem item : blenderList) {
            if (doubleList.size() % 2 == 0 && item.getType() != Constant.Supervisory.VISIT_REGISTER_ITEM_TYPE) {
                doubleList.add(getBlankItem());
            }
@@ -89,8 +89,8 @@
        }
    }
    private SupervisoryQueryItem getBlankItem() {
        SupervisoryQueryItem blankItem = new SupervisoryQueryItem();
    private SurveillanceQueryItem getBlankItem() {
        SurveillanceQueryItem blankItem = new SurveillanceQueryItem();
        blankItem.setType(Constant.Supervisory.VISIT_BLANK_ITEM_TYPE);
        return blankItem;
    }