| | |
| | | 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;
|
| | |
|
| | | /**
|
| | | * Created by xiuxi on 2017/3/31.
|
| | | */
|
| | |
|
| | | public class SurvalanceMng {
|
| | |
|
| | |
| | | // 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 {
|
| | |
| | | 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);
|
| | |
| | |
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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++;
|
| | |
| | | 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());
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private SupervisoryQueryItem getBlankItem() {
|
| | | SupervisoryQueryItem blankItem = new SupervisoryQueryItem();
|
| | | private SurveillanceQueryItem getBlankItem() {
|
| | | SurveillanceQueryItem blankItem = new SurveillanceQueryItem();
|
| | | blankItem.setType(Constant.Supervisory.VISIT_BLANK_ITEM_TYPE);
|
| | | return blankItem;
|
| | | }
|