From 260206f45cce3d1238568af29d6410bf19facd7e Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期一, 24 七月 2017 18:03:37 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java | 114 --------------------------------------------------------- 1 files changed, 0 insertions(+), 114 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java index 168983d..d052609 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java @@ -261,118 +261,4 @@ } - public void sendOfflineVisitorRegisterToServer() { - final OfflineVisitorRegisterItem item = RegisterDao.getInstance().readOfflineVisitorRegister(); - RequestParams params = new RequestParams(); - - params.addBodyParameter(Register.FieldNames.username, item.getUsername()); - params.addBodyParameter(Register.FieldNames.mobilePhone, item.getMobilePhone()); - params.addBodyParameter(Register.FieldNames.genderId, item.getGenderId()); - params.addBodyParameter(Register.FieldNames.identityTypeId, item.getIdentityTypeId()); - params.addBodyParameter(Register.FieldNames.countryId, item.getCountryId()); - params.addBodyParameter(Register.FieldNames.visitorTypeId, item.getVisitorTypeId()); - params.addBodyParameter(Register.FieldNames.identifyNum, item.getIdentifyNum()); - params.addBodyParameter(Register.FieldNames.companyId, item.getCompanyId()); - params.addBodyParameter(Register.FieldNames.birthday, item.getBirthday()); - params.addBodyParameter(Register.FieldNames.remark, item.getRemark()); - params.addBodyParameter("width", item.getRawSurveillancePhotoWidth()); - params.addBodyParameter("height", item.getRawSurveillancePhotoHeight()); - - item.loadFiles(); - - params.addBodyParameter("rawSurveillancePhoto", item.getRawSurveillancePhotoPath()); - params.addBodyParameter("surveillancePhoto", item.getSurveillancePhoto()); - params.addBodyParameter("uploadCustomPhoto", item.getUploadCustomPhoto()); - params.addBodyParameter("idCardPhoto", item.getIdCardPhoto()); - params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getAndroidDevice().getCompanyId()); - try { - File path = BaseApplication.getInstance().getFilesDir(); - File f0 = new File(path, "f0"); - if (!f0.exists()) { - f0.createNewFile(); - } - FileWriter fw0 = new FileWriter(f0); - fw0.write("test1"); - fw0.close(); - params.setUri(AppApi.BASE_URL +AppApi.REGISTER_ADD); - params.addBodyParameter("f0", f0); - x.http().post(params, new BaseCommonCallBack() { - @Override - public void success() { - SqliteSqlUtil.insert(getExtraList(SqliteSqlBean.class)); - Toast.makeText(BaseApplication.getInstance(),"娣诲姞鎴愬姛", Toast.LENGTH_SHORT).show(); - VisitorRegisterFragment.getInstance().resetForm(); - RegisterDao.getInstance().removeOfflineVisitorRegister(item); - } - }); - }catch(Exception e) { - e.printStackTrace(); - } - } - - public boolean hasOfflineVisitorRegisterData() { - return RegisterDao.getInstance().hasOfflineVisitorRegisterData(); - } - - public void sendOfflineAttenderRegisterToServer() { - if (!BaseApplication.deviceAvailable) { - return; - } - try { - RequestParams params = new RequestParams(); - File path = BaseApplication.getInstance().getFilesDir(); - File rawSurveillancePhotoFile = new File(path, "rawSurveillancePhoto_attender"); - if (!rawSurveillancePhotoFile.exists()) { - rawSurveillancePhotoFile.createNewFile(); - } - File f0 = new File(path, "f0"); - if (!f0.exists()) { - f0.createNewFile(); - } - File surveillancePhotoFile = new File(path, "surveillancePhoto_attender"); - if (!surveillancePhotoFile.exists()) { - surveillancePhotoFile.createNewFile(); - } - File uploadCustomPhotoFile = new File(path, "uploadCustomPhoto_attender"); - if (!uploadCustomPhotoFile.exists()) { - uploadCustomPhotoFile.createNewFile(); - } - File idCardPhotoFile = new File(path, "idCardPhoto_attender"); - if (!idCardPhotoFile.exists()) { - idCardPhotoFile.createNewFile(); - } - - FileWriter fw0 = new FileWriter(f0); - fw0.write("test1"); - fw0.close(); - params.setUri(AppApi.BASE_URL +AppApi.ATTENDER_REGISTER_ADD); - params.addBodyParameter("f0", f0); - params.addBodyParameter("rawSurveillancePhoto", rawSurveillancePhotoFile); - params.addBodyParameter("surveillancePhoto", surveillancePhotoFile); - params.addBodyParameter("uploadCustomPhoto", uploadCustomPhotoFile); - params.addBodyParameter("idCardPhoto", idCardPhotoFile); - params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getAndroidDevice().getCompanyId()); -// if (idCardHeadPhoto != null && !"".equals(idCardHeadPhoto)) { -// File f5 = new File(idCardHeadPhoto); -// if (!f5.exists()) { -// f5.createNewFile(); -// } -// params.addBodyParameter("idCardHeadPhoto_attender", f5); -// } - x.http().post(params, new BaseCommonCallBack() { - @Override - public void success() { - SqliteSqlUtil.insert(getExtraList(SqliteSqlBean.class)); - Toast.makeText(BaseApplication.getInstance(),"娣诲姞鎴愬姛", Toast.LENGTH_SHORT).show(); - AttenderRegisterFragment.getInstance().resetForm(); - } - }); - }catch(Exception e) { - e.printStackTrace(); - } - } - - public boolean hasOfflineAttenderRegisterData() { - return RegisterDao.getInstance().hasOfflineAttenderRegisterData(); - } } -- Gitblit v1.8.0