package cn.com.basic.face.service.sqlite; import android.graphics.Bitmap; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.UUID; import cn.com.basic.face.discern.query.item.SurveillancePhotoQueryItem; import cn.com.basic.face.discern.query.item.SurveillanceQueryItem; import cn.com.basic.face.util.FileUtil; public class SurveillanceDao { public static SurveillanceDao instance = new SurveillanceDao(); public static SurveillanceDao getInstance() { return instance; } //offline_ (headPicture, cameraInOrOut, createTime, visitId) public void addBitmap(final List bitmapList, final byte[] byteArray, int len, final String cameraInOrOut, byte[] surveillancePhotoBytes) { for (SurveillanceQueryItem item : bitmapList) { Bitmap bitmap = item.getBitmap(); String fileName = UUID.randomUUID().toString()+".bmp"; FileUtil.writeToFile(fileName, new byte[]{}); } String headPicture = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String createTime = sdf.format(new Date()); String sql = "insert offline_temp(head_picture, camera_in_or_out, create_time, visit_id) values('"+ headPicture+"','"+ cameraInOrOut+"','"+ createTime+"','"+ "null" +"')"; //存入数据库 //把图片存入本地文件 //人员注册可以选择本地图片 //同步临时表 //同步访客登记表 //删除本地文件(循环删除) } }