xuxiuxi
2017-07-07 2058665f07c3feeeab94f53544dafbebd406faa7


git-svn-id: http://192.168.1.226/svn/proxy@690 454eff88-639b-444f-9e54-f578c98de674
1个文件已修改
70 ■■■■ 已修改文件
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java
@@ -190,77 +190,29 @@
            fragment_register_phone.requestFocus();
            return;
        }
        String gender = fragment_register_gender.getValue();
        if (gender.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "性别不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_gender.callOnClick();
            return;
        }
        String id_class = fragment_register_id_class.getValue();
        if (id_class.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "证件类型不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_id_class.callOnClick();
            return;
        }
        String country = fragment_register_country.getValue();
        if (country.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "国籍不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_country.callOnClick();
            return;
        }
        String id_num = fragment_register_id_num.getValue();
        if (id_num.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "证件编号不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_id_num.requestFocus();
            return;
        }
        String birthday = fragment_register_birthday.getValue();
        if (birthday.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "出生日期不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_birthday.callOnClick();
            return;
        }
        String company = fragment_register_company.getValue();
        if (company.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "公司名称不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_company.requestFocus();
            return;
        }
        String remark = fragment_register_remark.getValue();
        if (remark.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "备注不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_remark.requestFocus();
            return;
        }
        String visitor_class = fragment_register_visitor_class.getValue();
        if (visitor_class.trim().length() <= 0) {
        String visitor_type = fragment_register_visitor_class.getValue();
        if (visitor_type.trim().length() <= 0) {
            Toast.makeText(MainActivity.getInstance(), "访客类型不能为空", Toast.LENGTH_SHORT).show();
            fragment_register_visitor_class.callOnClick();
            return;
        }
        final PostData pd = new PostData();
        pd.addValue(Register.FieldNames.username, name);
        pd.addValue(Register.FieldNames.mobilePhone, phone);
        pd.addValue(Register.FieldNames.genderId, DictionaryMng.getInstance().getId(gender));
        pd.addValue(Register.FieldNames.identityTypeId, DictionaryMng.getInstance().getId(id_class));
        pd.addValue(Register.FieldNames.countryId, DictionaryMng.getInstance().getId(country));
        pd.addValue(Register.FieldNames.visitorTypeId, DictionaryMng.getInstance().getId(visitor_class));
        pd.addValue(Register.FieldNames.identifyNum, id_num);
        pd.addValue(Register.FieldNames.companyId, company);
        pd.addValue(Register.FieldNames.birthday, birthday);
        params.addBodyParameter(Register.FieldNames.username, name);
        params.addBodyParameter(Register.FieldNames.mobilePhone, phone);
        params.addBodyParameter(Register.FieldNames.genderId, DictionaryMng.getInstance().getId(gender));
        params.addBodyParameter(Register.FieldNames.identityTypeId, DictionaryMng.getInstance().getId(id_class));
        params.addBodyParameter(Register.FieldNames.countryId, DictionaryMng.getInstance().getId(country));
        params.addBodyParameter(Register.FieldNames.visitorTypeId, DictionaryMng.getInstance().getId(visitor_class));
        params.addBodyParameter(Register.FieldNames.identifyNum, id_num);
        params.addBodyParameter(Register.FieldNames.genderId, DictionaryMng.getInstance().getId(fragment_register_gender.getValue()));
        params.addBodyParameter(Register.FieldNames.identityTypeId, DictionaryMng.getInstance().getId(fragment_register_id_class.getValue()));
        params.addBodyParameter(Register.FieldNames.countryId, DictionaryMng.getInstance().getId(fragment_register_country.getValue()));
        params.addBodyParameter(Register.FieldNames.visitorTypeId, DictionaryMng.getInstance().getId(visitor_type));
        params.addBodyParameter(Register.FieldNames.identifyNum, fragment_register_id_num.getValue());
        params.addBodyParameter(Register.FieldNames.companyId, company);
        params.addBodyParameter(Register.FieldNames.birthday, birthday);
        params.addBodyParameter(Register.FieldNames.birthday, fragment_register_birthday.getValue());
        params.addBodyParameter(Register.FieldNames.remark, fragment_register_remark.getValue());
        if (surveillanceQueryItem_selectPhoto != null) {
            params.addBodyParameter("width", surveillanceQueryItem_selectPhoto.getWidth());
@@ -272,7 +224,6 @@
            for (int i = 0; i < nativeImg.size; i++) {
                imageBytes[i] = nativeImg.image[i];
            }
            pd.addData("rawSurveillancePhoto", "application/octet-stream", imageBytes);
            params.addBodyParameter("rawSurveillancePhoto", writeToFile("rawSurveillancePhoto", imageBytes));
        } else {
@@ -283,7 +234,6 @@
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            fragment_register_surveillance_photo_img.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
            byte[] imageBytes = byteArrayOutputStream.toByteArray();
            pd.addData(Register.FieldNames.surveillancePhoto, "application/octet-stream", imageBytes);
            params.addBodyParameter("surveillancePhoto", writeToFile("surveillancePhoto", imageBytes));
        } else {
@@ -294,7 +244,6 @@
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            fragment_register_upload_custom_photo_img.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
            byte[] imageBytes = byteArrayOutputStream.toByteArray();
            pd.addData(Register.FieldNames.uploadCustomPhoto, "application/octet-stream", imageBytes);
            params.addBodyParameter("uploadCustomPhoto", writeToFile("uploadCustomPhoto", imageBytes));
        } else {
@@ -305,7 +254,6 @@
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            fragment_register_id_card_photo_img.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
            byte[] imageBytes = byteArrayOutputStream.toByteArray();
            pd.addData(Register.FieldNames.idCardPhoto, "application/octet-stream", imageBytes);
            params.addBodyParameter("idCardPhoto", writeToFile("idCardPhoto", imageBytes));
        } else {