| | |
| | | }
|
| | |
|
| | | public void findSurveillanceBottomList(final boolean isVisit) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.SURVEILLANCE_QUERY);
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_NUM, "1");
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, "10");
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | public List getRegisterList() {
|
| | | return new ArrayList();
|
| | | }
|
| | |
|
| | | public List getCheckInList() {
|
| | | return new ArrayList();
|
| | | }
|
| | |
|
| | | public void getList() {
|
| | | List registerList = new ArrayList();
|
| | | List checkInList = new ArrayList();
|
| | | List blendInList = blendIn(registerList, checkInList);
|
| | | SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(null, true);
|
| | | }
|
| | |
|
| | | public List blendIn(List registerList, List checkInList) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | public void addBitmap(final List<Bitmap> bitmapList, byte[] byteArray, int len) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.SURVEILLANCE_UPLOAD);
|
| | | params.addBodyParameter("base64Photo", Base64.encodeToString(byteArray, 0, len, Base64.DEFAULT));
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | | params.addBodyParameter("deviceId", BaseApplication.getInstance().getDevice().getDeviceId());
|
| | | params.addBodyParameter("enterOrExit", CommonVariables.EnterOrExit.ENTER+"");
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | |
| | | if (item.getType() == CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || item.getType() == CommonVariables.Surveillance.VISIT_CHECK_IN_ITEM_TYPE
|
| | | ) {
|
| | | if (bitmapList != null && bitmapList.size() > 0) {
|
| | | item.setBitmap(bitmapList.get(0));
|
| | | }
|
| | |
|
| | | List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>();
|
| | |
|
| | | List list = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().getPrevList();
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | if (bitmapList != null && bitmapList.size() > 0) {
|
| | | //RegisterFragment.getInstance().get_fragment_register_choose_photo().setImageBitmap(bitmapList.get(0));
|
| | | }
|
| | | }
|
| | |
|
| | | 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() {
|