| | |
| | |
|
| | | import java.nio.ByteBuffer;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.discern.common.BaseCommonCallBack;
|
| | |
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<SurveillanceQueryItem> items = getList(SurveillanceQueryItem.class);
|
| | | List list = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().getPrevList();
|
| | | List prevList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().getPrevList();
|
| | |
|
| | | List newList = new ArrayList();
|
| | |
|
| | |
| | |
|
| | | List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>();
|
| | |
|
| | | list.addAll(0, newList);
|
| | | prevList.addAll(0, newList);
|
| | |
|
| | | fillBlank(list, doubleList);
|
| | | fillBlank(prevList, doubleList);
|
| | |
|
| | | SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(doubleList, true);
|
| | | }
|
| | |
| | | doubleList.clear();
|
| | | List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>();
|
| | | List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>();
|
| | | removeDuplicate(list);
|
| | | for (SurveillanceQueryItem item : list) {
|
| | | if (item.getType() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
|
| | | registerList.add(item);
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private void removeDuplicate(List<SurveillanceQueryItem> list) {
|
| | | List itemsToRemove = new ArrayList();
|
| | | Set<String> registerIds = new HashSet<>();
|
| | | for (SurveillanceQueryItem item : list) {
|
| | | if (item.getType() == Constant.Surveillance.VISIT_CHECK_IN_ITEM_TYPE) {
|
| | | if (registerIds.contains(item.getRegisterId())) {
|
| | | itemsToRemove.add(item);
|
| | | } else {
|
| | | registerIds.add(item.getRegisterId());
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | list.removeAll(itemsToRemove);
|
| | | }
|
| | |
|
| | | private SurveillanceQueryItem getBlankItem() {
|
| | | SurveillanceQueryItem blankItem = new SurveillanceQueryItem();
|
| | | blankItem.setType(Constant.Surveillance.VISIT_BLANK_ITEM_TYPE);
|