| | |
| | | import org.xutils.x;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.discern.common.BaseCommonCallBack;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.query.item.SurveillanceQueryItem;
|
| | |
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | public static class SurveillanceListThread extends Thread {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | while (true) {
|
| | | MainActivity.getInstance().runOnUiThread(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | List prevList = SurveillanceMng.getInstance().removeTimeoutItem(null);
|
| | | SurveillanceMng.getInstance().registerTopAndCheckInBottom(prevList);
|
| | | SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().show(prevList);
|
| | | }
|
| | | });
|
| | | Thread.sleep(1000*60*5);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private List<SurveillanceQueryItem> removeTimeoutItem(List<SurveillanceQueryItem> prevList) {
|
| | | if (prevList == null) {
|
| | | prevList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().getPrevList();
|
| | | }
|
| | | List<SurveillanceQueryItem> newPrevList = new ArrayList();
|
| | | for (SurveillanceQueryItem item : prevList) {
|
| | | if (item.getRegisterOrCheckIn() == CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
|
| | | Date now = new Date();
|
| | | Date createTime = item.getCreateTime();
|
| | | long secs = (now.getTime() - createTime.getTime()) / 1000 ;
|
| | | if (secs*1.0 / 60*5 >= 1) {
|
| | | continue;
|
| | | }
|
| | | newPrevList.add(item);
|
| | | }
|
| | | }
|
| | | return newPrevList;
|
| | | }
|
| | |
|
| | | public void addBitmap(final List<SurveillanceQueryItem> bitmapList, byte[] byteArray, int len, String cameraInOrOut) {
|
| | |
| | | if (type == CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE
|
| | | || type == CommonVariables.Surveillance.VISIT_CHECK_IN_ITEM_TYPE
|
| | | ) {
|
| | | item.setCreateTime(new Date());
|
| | | newVisitorList.add(0, item);
|
| | | if (i < bitmapList.size()) {
|
| | | SurveillanceQueryItem surveillanceQueryItem = bitmapList.get(i);
|
| | |
| | | public List getSurveillancePhotoList() {
|
| | | List<SurveillanceQueryItem> prevVisitorList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().getPrevList();
|
| | | List<SurveillanceQueryItem> registerList = new ArrayList();
|
| | | int n = 9;
|
| | | for (SurveillanceQueryItem surveillanceQueryItem : prevVisitorList) {
|
| | | if (surveillanceQueryItem.getRegisterOrCheckIn() == CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE) {
|
| | | if (registerList.size() > 16) {
|
| | | if (registerList.size() > n*2) {
|
| | | break;
|
| | | }
|
| | | surveillanceQueryItem.setSurveillancePhotoSelected(false);
|
| | |
| | | SurveillanceQueryItem item;
|
| | | List items = new ArrayList();
|
| | | int m = 0;
|
| | | int n = 8;
|
| | | for (int i = 0; i < 16; i++) {
|
| | | for (int i = 0; i < n*2; i++) {
|
| | | if (i % 2 == 0) {
|
| | | if (m < registerList.size()) {
|
| | | item = registerList.get(m);
|