| | |
| | | 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");
|
| | | // x.http().post(params, new BaseCommonCallBack() {
|
| | | // public void success() {
|
| | | // List<SurveillanceQueryItem> list = getList(SurveillanceQueryItem.class);
|
| | | // if (isVisit) {
|
| | | // int i = 0;
|
| | | // for (SurveillanceQueryItem item : list) {
|
| | | // if (i % 5 == 0) {
|
| | | // item.setRegisterOrCheckIn(CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE);
|
| | | // } else {
|
| | | // item.setRegisterOrCheckIn(CommonVariables.Surveillance.VISIT_CHECK_IN_ITEM_TYPE);
|
| | | // }
|
| | | // i++;
|
| | | // }
|
| | | //
|
| | | // List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>();
|
| | | // fillBlank(list, doubleList);
|
| | | //
|
| | | // SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(doubleList, true);
|
| | | // } else {
|
| | | // SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().show(list, true);
|
| | | // }
|
| | | // }
|
| | | // });
|
| | | }
|
| | |
|
| | | public void addBitmap(final List<Bitmap> bitmapList, byte[] byteArray, int len, String cameraInOrOut) {
|
| | | public void addBitmap(final List<SurveillanceQueryItem> bitmapList, byte[] byteArray, int len, String cameraInOrOut) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | //final int cameraInOrOut = Integer.parseInt(CommonVariables.Camera.IN);
|
| | | 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().getDeviceCompanyId());
|
| | |
| | | ) {
|
| | | newList.add(0, item);
|
| | | if (i < bitmapList.size()) {
|
| | | item.setBitmap(bitmapList.get(i));
|
| | | SurveillanceQueryItem surveillanceQueryItem = bitmapList.get(i);
|
| | | item.setBitmap(surveillanceQueryItem.getBitmap());
|
| | | item.setBase64Image(surveillanceQueryItem.getBase64Image());
|
| | | item.setWidth(surveillanceQueryItem.getWidth());
|
| | | item.setHeight(surveillanceQueryItem.getHeight());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>();
|
| | | List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>();
|
| | | removeDuplicate(list);
|
| | | int maxRegister = 20;
|
| | | int i1 = 0, j = 0;
|
| | | int maxCheckIn = 20;
|
| | | for (SurveillanceQueryItem item : list) {
|
| | | if (item.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
|
| | | registerList.add(item);
|
| | | if (i1 < maxRegister) {
|
| | | registerList.add(item);
|
| | | i1++;
|
| | | }
|
| | | }
|
| | | if (item.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_CHECK_IN_ITEM_TYPE) {
|
| | | checkInList.add(item);
|
| | | if (j < maxCheckIn) {
|
| | | checkInList.add(item);
|
| | | j++;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|