| | |
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.base.BaseFragment;
|
| | | import cn.com.basic.face.dialog.SurveillancePhotoDialog;
|
| | | import cn.com.basic.face.dialog.VisitorRegisterSelectPhotoDialog;
|
| | | import cn.com.basic.face.dialog.VisitorRegisterUploadPhotoDialog;
|
| | | 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;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | OfflineVisitorRegisterItem offlineVisitorRegisterItem = new OfflineVisitorRegisterItem();
|
| | | Register offlineVisitorRegisterItem = new Register();
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | params.addBodyParameter(Register.FieldNames.username, name);
|
| | | params.addBodyParameter(Register.FieldNames.mobilePhone, phone);
|
| | |
| | | params.addBodyParameter(Register.FieldNames.countryId, DictionaryMng.getInstance().getId(fragment_visitor_register_country.getValue()));
|
| | | params.addBodyParameter(Register.FieldNames.visitorTypeId, DictionaryMng.getInstance().getId(visitor_type));
|
| | | params.addBodyParameter(Register.FieldNames.identifyNum, fragment_visitor_register_id_num.getValue());
|
| | | params.addBodyParameter(Register.FieldNames.companyId, company);
|
| | | // params.addBodyParameter(Register.FieldNames.companyId, null);
|
| | | params.addBodyParameter(Register.FieldNames.company, company);
|
| | | params.addBodyParameter(Register.FieldNames.birthday, fragment_visitor_register_birthday.getValue());
|
| | | params.addBodyParameter(Register.FieldNames.remark, fragment_visitor_register_remark.getValue());
|
| | |
|
| | |
| | | params.addBodyParameter("idCardPhoto", FileUtil.writeToFile("idCardPhoto", new byte[]{}));
|
| | | }
|
| | | } else {
|
| | | offlineVisitorRegisterItem.setRegisterId(UUID.randomUUID().toString());
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | offlineVisitorRegisterItem.setDeviceCompanyId(BaseApplication.getInstance().getAndroidDevice().getCompanyId());
|
| | | offlineVisitorRegisterItem.setIsSynchron("N");
|
| | | offlineVisitorRegisterItem.setCreateTime(sdf.format(new Date()));
|
| | | offlineVisitorRegisterItem.setUsername(name);
|
| | | offlineVisitorRegisterItem.setMobilePhone(phone);
|
| | | offlineVisitorRegisterItem.setGenderId(DictionaryMng.getInstance().getId(fragment_visitor_register_gender.getValue()));
|
| | |
| | | offlineVisitorRegisterItem.setCountryId(DictionaryMng.getInstance().getId(fragment_visitor_register_country.getValue()));
|
| | | offlineVisitorRegisterItem.setVisitorTypeId(DictionaryMng.getInstance().getId(visitor_type));
|
| | | offlineVisitorRegisterItem.setIdentifyNum(fragment_visitor_register_id_num.getValue());
|
| | | offlineVisitorRegisterItem.setCompanyId(company);
|
| | | offlineVisitorRegisterItem.setCompanyId(null);
|
| | | offlineVisitorRegisterItem.setCompany(company);
|
| | | offlineVisitorRegisterItem.setBirthday(fragment_visitor_register_birthday.getValue());
|
| | | offlineVisitorRegisterItem.setRemark(fragment_visitor_register_remark.getValue());
|
| | |
|
| | |
| | | surveillancePhotoBytes = byteArrayOutputStream.toByteArray();
|
| | | }
|
| | | FileUtil.writeToFile(surveillancePhotoPath, surveillancePhotoBytes);
|
| | | offlineVisitorRegisterItem.setSurveillancePhotoPath(surveillancePhotoPath);
|
| | | offlineVisitorRegisterItem.setSurveillancePhoto(surveillancePhotoPath);
|
| | |
|
| | | String uploadCustomPhotoPath = UUID.randomUUID().toString()+".bmp";
|
| | | byte[] uploadCustomPhotoBytes = new byte[]{};
|
| | |
| | | uploadCustomPhotoBytes = byteArrayOutputStream.toByteArray();
|
| | | }
|
| | | FileUtil.writeToFile(uploadCustomPhotoPath, uploadCustomPhotoBytes);
|
| | | offlineVisitorRegisterItem.setUploadCustomPhotoPath(uploadCustomPhotoPath);
|
| | | offlineVisitorRegisterItem.setUploadCustomPhoto(uploadCustomPhotoPath);
|
| | |
|
| | | String idCardPhotoPath = UUID.randomUUID().toString()+".bmp";
|
| | | byte[] idCardPhotoBytes = new byte[]{};
|
| | |
| | | idCardPhotoBytes = byteArrayOutputStream.toByteArray();
|
| | | }
|
| | | FileUtil.writeToFile(idCardPhotoPath, idCardPhotoBytes);
|
| | | offlineVisitorRegisterItem.setIdCardPhotoPath(idCardPhotoPath);
|
| | | offlineVisitorRegisterItem.setIdCardPhoto(idCardPhotoPath);
|
| | | }
|
| | | RegisterMng.getInstance().add(params, idCardHeadPath, offlineVisitorRegisterItem);
|
| | | }
|
| | |
| | |
|
| | | //@OnClick(R.id.fragment_visitor_register_country)
|
| | | public void fragment_visitor_register_country_click(View view) {
|
| | | new CountryDialog(fragment_visitor_register_linear_layout, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | fragment_visitor_register_country.setValue(value);
|
| | | }
|
| | | },fragment_visitor_register_country.getValue());
|
| | | if (CountryDialog.hasCountries()) {
|
| | | new CountryDialog(fragment_visitor_register_linear_layout, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | fragment_visitor_register_country.setValue(value);
|
| | | }
|
| | | }, fragment_visitor_register_country.getValue());
|
| | | }
|
| | | }
|
| | |
|
| | | //@OnClick(R.id.fragment_visitor_register_gender)
|
| | |
| | |
|
| | | @OnClick(R.id.fragment_visitor_register_surveillance_photo)
|
| | | public void fragment_visitor_register_surveillance_photo_click(View view) {
|
| | | SurveillanceFragment.SurveillancePhotoSelectListViewAdapter.selectPhotoOrUploadPhoto = CommonVariables.SelectPhotoType.SELECT_PHOTO;
|
| | | new SurveillancePhotoDialog(fragment_visitor_register_linear_layout, Constant.DialogSelectType.ID_TYPE, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | }
|
| | | }, selectedSurveillancePhotoId);
|
| | | VisitorRegisterSelectPhotoDialog.getInstance().show();
|
| | | }
|
| | |
|
| | | public FrameLayout get_fragment_visitor_register_linear_layout() {
|
| | | return fragment_visitor_register_linear_layout;
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_visitor_register_upload_custom_photo)
|
| | | public void fragment_visitor_register_upload_custom_photo_click(View view) {
|
| | | SurveillanceFragment.SurveillancePhotoSelectListViewAdapter.selectPhotoOrUploadPhoto = CommonVariables.SelectPhotoType.UPLOAD_PHOTO;
|
| | | new SurveillancePhotoDialog(fragment_visitor_register_linear_layout, Constant.DialogSelectType.ID_TYPE, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | }
|
| | | }, selectedCustomPhotoId);
|
| | | VisitorRegisterUploadPhotoDialog.getInstance().show();
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_visitor_register_id_card_photo)
|