From 3ca99f2b70ec9301c682e4271410b866eb4f4549 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期日, 23 七月 2017 15:31:37 +0800
Subject: [PATCH]
---
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java | 70 +++++++++++++++++++++++++++++++++--
1 files changed, 66 insertions(+), 4 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 b195e77..b9d9b6c 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
@@ -8,6 +8,7 @@
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.discern.common.SqliteSqlBean;
import cn.com.basic.face.discern.entity.Register;
+import cn.com.basic.face.discern.query.item.CheckInQueryItem;
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;
@@ -39,7 +40,7 @@
return instance;
}
- public void add(RequestParams params, String idCardHeadPhoto, OfflineVisitorRegisterItem offlineVisitorRegisterItem) {
+ public void add(RequestParams params, String idCardHeadPhoto, Register offlineVisitorRegisterItem) {
if (!BaseApplication.deviceAvailable) {
return;
}
@@ -76,6 +77,7 @@
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()) {
@@ -90,7 +92,11 @@
Toast.makeText(BaseApplication.getInstance(),"娣诲姞鎴愬姛", Toast.LENGTH_SHORT).show();
VisitorRegisterFragment.getInstance().resetForm();
MainActivity.selectPage(2);
- //CheckInFragment.getInstance().checkInFromHomePage();
+ List<CheckInQueryItem> checkInLeftVisitorList = getList(CheckInQueryItem.class);
+ CheckInFragment.getInstance().get_fragment_check_in_left_visitor().show(checkInLeftVisitorList);
+ if (checkInLeftVisitorList.size() > 0) {
+ CheckInFragment.getInstance().checkInFromHomePage(checkInLeftVisitorList.get(0));
+ }
}
});
}catch(Exception e) {
@@ -132,6 +138,7 @@
params.addBodyParameter("f0", f0);
params.addBodyParameter("surveillancePhoto", surveillancePhotoFile);
params.addBodyParameter("idCardPhoto", idCardHeadPhotoFile);
+ params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getAndroidDevice().getCompanyId());
x.http().post(params, new BaseCommonCallBack() {
@Override
public void success() {
@@ -203,6 +210,7 @@
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()) {
@@ -247,10 +255,11 @@
item.loadFiles();
- params.addBodyParameter("rawSurveillancePhoto", item.getRawSurveillancePhoto());
+ 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");
@@ -281,8 +290,61 @@
}
public void sendOfflineAttenderRegisterToServer() {
- OfflineAttenderRegisterItem item = RegisterDao.getInstance().readOfflineAttenderRegister();
+ 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() {
--
Gitblit v1.8.0