xuxiuxi
2017-04-27 c7fe31931a26a941ca2adf002e40b47a049a604c
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java
@@ -1,6 +1,5 @@
package cn.com.basic.face.service;
import android.graphics.Bitmap;
import android.util.Base64;
import org.xutils.http.RequestParams;
@@ -67,27 +66,21 @@
                }
                if (newList.size() > 0) {
                    List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>();
                    prevList.addAll(0, newList);
                    fillBlank(prevList, doubleList);
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(doubleList, true);
                    registerTopAndCheckInBottom(prevList);
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(prevList);
                }
            }
        });
    }
    private void fillBlank(List<SurveillanceQueryItem> list, List<SurveillanceQueryItem> doubleList) {
        doubleList.clear();
    private void registerTopAndCheckInBottom(List<SurveillanceQueryItem> list) {
        List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>();
        List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>();
        removeDuplicate(list);
        int maxRegister = 20;
        removeDuplicateCheckIn(list);
        int i1 = 0, j = 0;
        int maxRegister = 20;
        int maxCheckIn = 20;
        for (SurveillanceQueryItem item : list) {
            if (item.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
@@ -105,6 +98,8 @@
        }
        int max = registerList.size() > checkInList.size() ? registerList.size() : checkInList.size();
        List tempList = new ArrayList();
        int m = 0, n = 0;
        for (int i = 0; i < max * 2; i++) {
@@ -124,12 +119,13 @@
                }
                n++;
            }
            doubleList.add(item);
            tempList.add(item);
        }
        list.clear();
        list.addAll(tempList);
    }
    private void removeDuplicate(List<SurveillanceQueryItem> list) {
    private void removeDuplicateCheckIn(List<SurveillanceQueryItem> list) {
        List itemsToRemove = new ArrayList();
        Set<String> registerIds = new HashSet<>();
        for (SurveillanceQueryItem item : list) {