xuxiuxi
2017-07-22 df06d97f9b81f9f442ae8a47f66708ff4eeb0766


git-svn-id: http://192.168.1.226/svn/proxy@818 454eff88-639b-444f-9e54-f578c98de674
1个文件已修改
55 ■■■■■ 已修改文件
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java
@@ -290,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() {