| | |
| | | }
|
| | |
|
| | | private void fillBlank(List<SurveillanceQueryItem> list, List<SurveillanceQueryItem> doubleList) {
|
| | | doubleList.clear();
|
| | | List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>();
|
| | | List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>();
|
| | | for (SurveillanceQueryItem item : list) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | List<SurveillanceQueryItem> blenderList = new ArrayList<SurveillanceQueryItem>();
|
| | | int max = registerList.size() > checkInList.size() ? registerList.size() : checkInList.size();
|
| | |
|
| | | int i = 0, m = 0, n = 0;
|
| | | for (i = 0; i < registerList.size() + checkInList.size(); i++) {
|
| | | int m = 0, n = 0;
|
| | | for (int i = 0; i < max * 2; i++) {
|
| | | SurveillanceQueryItem item;
|
| | | if (i % 2 == 0 && m < registerList.size()) {
|
| | | item = registerList.get(m);
|
| | | if (i % 2 == 0) {
|
| | | if (m < registerList.size()) {
|
| | | item = registerList.get(m);
|
| | | } else {
|
| | | item = getBlankItem();
|
| | | }
|
| | | m++;
|
| | | } else {
|
| | | item = checkInList.get(n);
|
| | | if (n < checkInList.size()) {
|
| | | item = checkInList.get(n);
|
| | | } else {
|
| | | item = getBlankItem();
|
| | | }
|
| | | n++;
|
| | | }
|
| | | blenderList.add(item);
|
| | | }
|
| | |
|
| | | for (SurveillanceQueryItem item : blenderList) {
|
| | | if (doubleList.size() % 2 == 0 && item.getType() != Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
|
| | | doubleList.add(getBlankItem());
|
| | | }
|
| | | if (doubleList.size() % 2 != 0 && item.getType() != Constant.Surveillance.VISIT_CHECK_IN_ITEM_TYPE) {
|
| | | doubleList.add(getBlankItem());
|
| | | }
|
| | | doubleList.add(item);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private SurveillanceQueryItem getBlankItem() {
|