|
@@ -1,6 +1,7 @@
|
|
package com.sunwin.visitorapp.activity;
|
|
package com.sunwin.visitorapp.activity;
|
|
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
+import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
import android.widget.AdapterView;
|
|
import android.widget.AdapterView;
|
|
@@ -161,6 +162,9 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
showHead(currentFacePath, mImageVisitorPhoto);
|
|
showHead(currentFacePath, mImageVisitorPhoto);
|
|
mTextVisitorIdCode.setText(userInfo.getIdNum());
|
|
mTextVisitorIdCode.setText(userInfo.getIdNum());
|
|
mTextVisitorName.setText(userInfo.getPerson_name());
|
|
mTextVisitorName.setText(userInfo.getPerson_name());
|
|
|
|
+
|
|
|
|
+ mEditVisitTimeBegin.setText(TimeUtils.stampToDate(System.currentTimeMillis()));
|
|
|
|
+ mEditVisitTimeEnd.setText(TimeUtils.stampToDate(System.currentTimeMillis()));
|
|
}
|
|
}
|
|
|
|
|
|
private void showHead(String path, ImageView iv_head) {
|
|
private void showHead(String path, ImageView iv_head) {
|
|
@@ -188,7 +192,6 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
|
|
|
|
private void submit() {
|
|
private void submit() {
|
|
UserInfoModel oldUserinfo = null;
|
|
UserInfoModel oldUserinfo = null;
|
|
- loadingDialog.showLoadingDialog("");
|
|
|
|
|
|
|
|
String phone = mEditPhone.getText().toString().trim();
|
|
String phone = mEditPhone.getText().toString().trim();
|
|
String idNum = mTextVisitorIdCode.getText().toString().trim();
|
|
String idNum = mTextVisitorIdCode.getText().toString().trim();
|
|
@@ -205,6 +208,13 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
String comeReason = mComeReason.getText().toString().trim();
|
|
String comeReason = mComeReason.getText().toString().trim();
|
|
String company = mEditCompany.getText().toString().trim();
|
|
String company = mEditCompany.getText().toString().trim();
|
|
|
|
|
|
|
|
+ if (TextUtils.isEmpty(phone)) {
|
|
|
|
+ ToastUtils.showToast("请输入手机号码");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ loadingDialog.showLoadingDialog("");
|
|
UserInfoModel infoModel = new UserInfoModel();
|
|
UserInfoModel infoModel = new UserInfoModel();
|
|
infoModel.setPhone(phone);
|
|
infoModel.setPhone(phone);
|
|
infoModel.setVisitorLpCode(carPlate);
|
|
infoModel.setVisitorLpCode(carPlate);
|
|
@@ -222,7 +232,7 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
infoModel.setDeptId(deptNo + "");
|
|
infoModel.setDeptId(deptNo + "");
|
|
infoModel.setCategoryId(categoryId);
|
|
infoModel.setCategoryId(categoryId);
|
|
|
|
|
|
- LogUtil.e(TAG,"categoryName ="+categoryName);
|
|
|
|
|
|
+ LogUtil.e(TAG, "categoryName =" + categoryName);
|
|
List<UserInfoModel> userInfoModels = DatabaseManager.getInstance().query(UserInfoModel.class, "idNum", idNum);
|
|
List<UserInfoModel> userInfoModels = DatabaseManager.getInstance().query(UserInfoModel.class, "idNum", idNum);
|
|
if (userInfoModels.size() != 0) {
|
|
if (userInfoModels.size() != 0) {
|
|
oldUserinfo = userInfoModels.get(0);
|
|
oldUserinfo = userInfoModels.get(0);
|
|
@@ -264,6 +274,8 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
ToastUtils.showToast("保存成功");
|
|
ToastUtils.showToast("保存成功");
|
|
finish();
|
|
finish();
|
|
AppManager.getAppManager().finishActivity(VisitorRegActivity.class);
|
|
AppManager.getAppManager().finishActivity(VisitorRegActivity.class);
|
|
|
|
+ AppManager.getAppManager().finishActivity(NoCardRegActivity.class);
|
|
|
|
+ AppManager.getAppManager().finishActivity(VisitInputActivity.class);
|
|
} else {
|
|
} else {
|
|
loadingDialog.dismissLoadingDialog();
|
|
loadingDialog.dismissLoadingDialog();
|
|
ToastUtils.showToast("保存失败");
|
|
ToastUtils.showToast("保存失败");
|
|
@@ -338,7 +350,7 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
|
|
.setDayText("日")
|
|
.setDayText("日")
|
|
.setCyclic(false)
|
|
.setCyclic(false)
|
|
.setMinMillseconds(System.currentTimeMillis() - tenYears)
|
|
.setMinMillseconds(System.currentTimeMillis() - tenYears)
|
|
- .setMaxMillseconds(System.currentTimeMillis()+tenYears)
|
|
|
|
|
|
+ .setMaxMillseconds(System.currentTimeMillis() + tenYears)
|
|
.setCurrentMillseconds(System.currentTimeMillis())
|
|
.setCurrentMillseconds(System.currentTimeMillis())
|
|
.setThemeColor(getResources().getColor(R.color.timepicker_dialog_bg))
|
|
.setThemeColor(getResources().getColor(R.color.timepicker_dialog_bg))
|
|
.setType(Type.YEAR_MONTH_DAY)
|
|
.setType(Type.YEAR_MONTH_DAY)
|