| | |
| | | import cn.com.basic.face.discern.query.item.OfflineAttenderRegisterItem;
|
| | | import cn.com.basic.face.discern.query.item.OfflineVisitorRegisterItem;
|
| | | import cn.com.basic.face.fragment.AttenderRegisterFragment;
|
| | | import cn.com.basic.face.fragment.CheckInFragment;
|
| | | import cn.com.basic.face.fragment.VisitorRegisterFragment;
|
| | | import cn.com.basic.face.service.sqlite.RegisterDao;
|
| | | import cn.com.basic.face.service.sqlite.VisitDao;
|
| | |
| | | return instance;
|
| | | }
|
| | |
|
| | | public void add(RequestParams params, String idCardHeadPhoto) {
|
| | | public void add(RequestParams params, String idCardHeadPhoto, OfflineVisitorRegisterItem offlineVisitorRegisterItem) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | |
| | | public void success() {
|
| | | Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
|
| | | VisitorRegisterFragment.getInstance().resetForm();
|
| | | MainActivity.selectPage(2);
|
| | | //CheckInFragment.getInstance().checkInFromHomePage();
|
| | | }
|
| | | });
|
| | | }catch(Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } else {
|
| | | RegisterDao.getInstance().add(params, idCardHeadPhoto);
|
| | | RegisterDao.getInstance().add(offlineVisitorRegisterItem);
|
| | | VisitDao.getInstance().findLeftVisitorList("", 1);
|
| | | Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
|
| | | VisitorRegisterFragment.getInstance().resetForm();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void compareSurveillancePhotoAndIdCardPhoto(RequestParams params, final IdCard idCard) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | } else {
|
| | | RegisterDao.getInstance().add(params, idCardHeadPhoto);
|
| | | RegisterDao.getInstance().addAttender(params, idCardHeadPhoto);
|
| | | Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
|
| | | }
|
| | |
|
| | |
| | | params.addBodyParameter("width", item.getRawSurveillancePhotoWidth());
|
| | | params.addBodyParameter("height", item.getRawSurveillancePhotoHeight());
|
| | |
|
| | | File rawSurveillancePhoto= FileUtil.getFile(item.getRawSurveillancePhotoPath());
|
| | | File surveillancePhoto= FileUtil.getFile(item.getSurveillancePhotoPath());
|
| | | File uploadCustomPhoto= FileUtil.getFile(item.getUploadCustomPhotoPath());
|
| | | File idCardPhoto= FileUtil.getFile(item.getIdCardPhotoPath());
|
| | | params.addBodyParameter("rawSurveillancePhoto", rawSurveillancePhoto);
|
| | | params.addBodyParameter("surveillancePhoto", surveillancePhoto);
|
| | | params.addBodyParameter("uploadCustomPhoto", uploadCustomPhoto);
|
| | | params.addBodyParameter("idCardPhoto", idCardPhoto);
|
| | | item.loadFiles();
|
| | |
|
| | | params.addBodyParameter("rawSurveillancePhoto", item.getRawSurveillancePhoto());
|
| | | params.addBodyParameter("surveillancePhoto", item.getSurveillancePhoto());
|
| | | params.addBodyParameter("uploadCustomPhoto", item.getUploadCustomPhoto());
|
| | | params.addBodyParameter("idCardPhoto", item.getIdCardPhoto());
|
| | | try {
|
| | | File path = BaseApplication.getInstance().getFilesDir();
|
| | | File rawSurveillancePhotoFile = new File(path, "rawSurveillancePhoto");
|
| | | if (!rawSurveillancePhotoFile.exists()) {
|
| | | rawSurveillancePhotoFile.createNewFile();
|
| | | }
|
| | | File f0 = new File(path, "f0");
|
| | | if (!f0.exists()) {
|
| | | f0.createNewFile();
|
| | | }
|
| | | File surveillancePhotoFile = new File(path, "surveillancePhoto");
|
| | | if (!surveillancePhotoFile.exists()) {
|
| | | surveillancePhotoFile.createNewFile();
|
| | | }
|
| | | File uploadCustomPhotoFile = new File(path, "uploadCustomPhoto");
|
| | | if (!uploadCustomPhotoFile.exists()) {
|
| | | uploadCustomPhotoFile.createNewFile();
|
| | | }
|
| | | File idCardPhotoFile = new File(path, "idCardPhoto");
|
| | | if (!idCardPhotoFile.exists()) {
|
| | | idCardPhotoFile.createNewFile();
|
| | | }
|
| | |
|
| | | FileWriter fw0 = new FileWriter(f0);
|
| | | fw0.write("test1");
|
| | | fw0.close();
|
| | | params.setUri(AppApi.BASE_URL +AppApi.REGISTER_ADD);
|
| | | params.addBodyParameter("f0", f0);
|
| | | params.addBodyParameter("rawSurveillancePhoto", rawSurveillancePhotoFile);
|
| | | params.addBodyParameter("surveillancePhoto", surveillancePhotoFile);
|
| | | params.addBodyParameter("uploadCustomPhoto", uploadCustomPhotoFile);
|
| | | params.addBodyParameter("idCardPhoto", idCardPhotoFile);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | @Override
|
| | | public void success() {
|