From ae5a02a4428be27d69c1fe8791ec83bce3827e80 Mon Sep 17 00:00:00 2001
From: chenke <chenke@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 09 八月 2017 13:07:06 +0800
Subject: [PATCH]
---
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttenderRegisterFragment.java | 46 ++++++++++++++++++++++++++++++++++++----------
1 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttenderRegisterFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttenderRegisterFragment.java
index 0d35b74..cfa3bd3 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttenderRegisterFragment.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttenderRegisterFragment.java
@@ -9,13 +9,13 @@
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
+import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewGroup;
import android.view.WindowManager;
+import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -26,7 +26,6 @@
import cn.com.basic.face.base.BaseFragment;
import cn.com.basic.face.dialog.AttenderRegisterSelectPhotoDialog;
import cn.com.basic.face.dialog.AttenderRegisterUploadPhotoDialog;
-import cn.com.basic.face.dialog.SurveillancePhotoDialog;
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.discern.entity.Register;
import cn.com.basic.face.discern.query.item.CheckInQueryItem;
@@ -41,12 +40,12 @@
import cn.com.basic.face.util.FileUtil;
import cn.com.basic.face.util.IdCard;
-import cn.com.basic.face.util.IdCardReaderThread;
+import cn.com.basic.face.thread.IdCardReaderThread;
+import cn.com.basic.face.util.KeyboardUtil;
import cn.com.basic.face.util.NativeImg;
import cn.com.basic.face.util.OkClickedListener;
import cn.com.basic.face.util.AppApi;
-import cn.com.basic.face.dialog.DateSelectDialog;
import cn.com.basic.face.dialog.CountryDialog;
import cn.com.basic.face.widget.register.RegisterRightFieldLabelView;
import cn.com.basic.face.widget.register.RegisterRightFieldTextView;
@@ -149,10 +148,35 @@
public void fragment_attender_register_save_click(View v) {
RequestParams params = new RequestParams();
+ if (surveillanceQueryItem_selectPhoto == null) {
+ Toast.makeText(MainActivity.getInstance(), "璇烽�夋嫨鐓х墖", Toast.LENGTH_SHORT).show();
+ return;
+ }
+
String name = fragment_attender_register_name.getValue();
if (name.trim().length() <= 0) {
Toast.makeText(MainActivity.getInstance(), "濮撳悕涓嶈兘涓虹┖", Toast.LENGTH_SHORT).show();
fragment_attender_register_name.requestFocus();
+ return;
+ }
+ String gender = fragment_attender_register_gender.getValue();
+ if (gender.trim().length() <= 0) {
+ Toast.makeText(MainActivity.getInstance(), "鎬у埆涓嶈兘涓虹┖", Toast.LENGTH_SHORT).show();
+ fragment_attender_register_gender.callOnClick();
+ return;
+ }
+
+ String post = fragment_attender_register_post.getValue();
+ if (post.trim().length() <= 0) {
+ Toast.makeText(MainActivity.getInstance(), "鑱屽姟绫诲瀷涓嶈兘涓虹┖", Toast.LENGTH_SHORT).show();
+ fragment_attender_register_post.callOnClick();
+ return;
+ }
+
+ String department = fragment_attender_register_department.getValue();
+ if (department.trim().length() <= 0) {
+ Toast.makeText(MainActivity.getInstance(), "閮ㄩ棬鐝骇涓嶈兘涓虹┖", Toast.LENGTH_SHORT).show();
+ fragment_attender_register_department.callOnClick();
return;
}
OfflineAttenderRegisterItem offlineAttenderRegisterItem = new OfflineAttenderRegisterItem();
@@ -227,7 +251,7 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
offlineAttenderRegisterItem.setCreateTime(sdf.format(new Date()));
- String rawSurveillancePhotoPath = UUID.randomUUID().toString()+".bmp";
+ String rawSurveillancePhotoPath = UUID.randomUUID().toString()+"";
byte[] rawSurveillancePhotoBytes = new byte[]{};
if (surveillanceQueryItem_selectPhoto != null) {
@@ -245,7 +269,7 @@
FileUtil.writeToFile(rawSurveillancePhotoPath, rawSurveillancePhotoBytes);
offlineAttenderRegisterItem.setRawSurveillancePhotoPath(rawSurveillancePhotoPath);
- String surveillancePhotoPath = UUID.randomUUID().toString()+".bmp";
+ String surveillancePhotoPath = UUID.randomUUID().toString()+"";
byte[] surveillancePhotoBytes = new byte[]{};
if (fragment_attender_register_surveillance_photo_img != null) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -255,7 +279,7 @@
FileUtil.writeToFile(surveillancePhotoPath, surveillancePhotoBytes);
offlineAttenderRegisterItem.setSurveillancePhoto(surveillancePhotoPath);
- String uploadCustomPhotoPath = UUID.randomUUID().toString()+".bmp";
+ String uploadCustomPhotoPath = UUID.randomUUID().toString()+"";
byte[] uploadCustomPhotoBytes = new byte[]{};
if (fragment_attender_register_upload_custom_photo_img != null) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -265,7 +289,7 @@
FileUtil.writeToFile(uploadCustomPhotoPath, uploadCustomPhotoBytes);
offlineAttenderRegisterItem.setUploadCustomPhoto(uploadCustomPhotoPath);
- String idCardPhotoPath = UUID.randomUUID().toString()+".bmp";
+ String idCardPhotoPath = UUID.randomUUID().toString()+"";
byte[] idCardPhotoBytes = new byte[]{};
if (fragment_attender_register_id_card_photo_img != null) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -514,6 +538,7 @@
idCardReaderThread = new IdCardReaderThread();
idCardReaderThread.start();
}
+ setupUI(getView());
}
public void fillFormWithIdCard(IdCard idCard) {
@@ -568,4 +593,5 @@
}, fragment_attender_register_department.getValue());
}
+
}
--
Gitblit v1.8.0