Przeglądaj źródła

折线显示完成

FANGLH 8 lat temu
rodzic
commit
661ac98b3e
100 zmienionych plików z 1655 dodań i 871 usunięć
  1. 1 1
      WeiChat/src/main/AndroidManifest.xml
  2. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java
  3. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/SplashActivity.java
  4. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/UserCheckedActivity.java
  5. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/account/LoginHistoryActivity.java
  6. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendAudioActivity.java
  7. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendShuoshuoActivity.java
  8. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendVideoActivity.java
  9. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/ADActivity.java
  10. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java
  11. 3 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/ClientActivity.java
  12. 150 22
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/datainquiry/activity/PDFDownloadActivity.java
  13. 2 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java
  14. 2 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java
  15. 8 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MucChatActivity.java
  16. 0 324
      WeiChat/src/main/res/layout/act_taskb2b_add.xml
  17. 0 320
      WeiChat/src/main/res/layout/act_taskerp_add.xml
  18. 1 1
      WeiChat/src/main/res/layout/activity_data_inquiry.xml
  19. 25 8
      WeiChat/src/main/res/layout/activity_pdf_download.xml
  20. 9 6
      WeiChat/src/main/res/layout/layout_select_head.xml
  21. 2 0
      WeiChat/src/main/res/values-en/strings.xml
  22. 2 0
      WeiChat/src/main/res/values-zh-rCN/strings.xml
  23. 2 0
      WeiChat/src/main/res/values-zh-rTW/strings.xml
  24. 2 0
      WeiChat/src/main/res/values/strings.xml
  25. 2 0
      app_core/common/build.gradle
  26. 10 0
      app_core/common/src/main/java/com/common/config/VersionUtil.java
  27. 0 7
      app_core/common/src/main/java/com/core/model/OAConfig.java
  28. 120 0
      app_core/common/src/main/java/com/core/net/ProgressDownloader.java
  29. 72 0
      app_core/common/src/main/java/com/core/net/ProgressResponseBody.java
  30. 74 2
      app_core/common/src/main/java/com/core/utils/CommonUtil.java
  31. 0 0
      app_core/common/src/main/res/color/selector_cancel_text_color.xml
  32. 21 0
      app_core/common/src/main/res/drawable/bg_white_hint_btn.xml
  33. 0 0
      app_core/common/src/main/res/drawable/selector_cancel_bg.xml
  34. 0 0
      app_core/common/src/main/res/drawable/shape_blue_corner_white_bg.xml
  35. 0 0
      app_core/common/src/main/res/drawable/shape_corner_deep_blue_bg.xml
  36. 1 2
      app_core/common/src/main/res/layout/activity_business_add.xml
  37. 9 6
      app_core/common/src/main/res/layout/layout_select_head.xml
  38. 4 0
      app_core/common/src/main/res/values/strings.xml
  39. 129 130
      app_core/network/src/main/java/com/me/network/app/http/impl/RetrofitImpl.java
  40. 3 3
      app_modular/applogin/build.gradle
  41. 16 7
      app_modular/applogin/src/main/AndroidManifest.xml
  42. 84 0
      app_modular/applogin/src/main/assets/profession.json
  43. 240 0
      app_modular/applogin/src/main/java/com/modular/login/activity/AdminRegisterActivity.java
  44. 36 0
      app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseCompleteActivity.java
  45. 537 0
      app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseRegisterActivity.java
  46. 3 1
      app_modular/applogin/src/main/java/com/modular/login/activity/LoginActivity.java
  47. 2 1
      app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java
  48. 9 7
      app_modular/applogin/src/main/java/com/modular/login/activity/RegisterSelectActivity.java
  49. 65 0
      app_modular/applogin/src/main/java/com/modular/login/model/ProfessionBean.java
  50. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_admin_password.png
  51. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_business_license.png
  52. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_business_scope.png
  53. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_circle_check.png
  54. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_circle_uncheck.png
  55. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_company_name.png
  56. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_drop_down.png
  57. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_password_invisible.png
  58. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_password_visiable.png
  59. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_address.png
  60. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_camera.png
  61. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_defaultpic.png
  62. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_email.png
  63. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_name.png
  64. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_notice.png
  65. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_phone.png
  66. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_regex_correct.png
  67. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_trade_certify.png
  68. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_b2b.png
  69. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_mall.png
  70. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_uu.png
  71. BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_verification_code.png
  72. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_admin_password.png
  73. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_business_license.png
  74. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_business_scope.png
  75. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_circle_check.png
  76. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_circle_uncheck.png
  77. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_company_name.png
  78. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_drop_down.png
  79. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_password_invisible.png
  80. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_password_visiable.png
  81. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_address.png
  82. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_camera.png
  83. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_defaultpic.png
  84. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_email.png
  85. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_name.png
  86. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_notice.png
  87. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_phone.png
  88. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_regex_correct.png
  89. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_trade_certify.png
  90. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_b2b.png
  91. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_mall.png
  92. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_uu.png
  93. BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_verification_code.png
  94. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_admin_password.png
  95. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_business_license.png
  96. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_business_scope.png
  97. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_circle_check.png
  98. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_circle_uncheck.png
  99. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_company_name.png
  100. BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_drop_down.png

+ 1 - 1
WeiChat/src/main/AndroidManifest.xml

@@ -146,7 +146,7 @@
         </activity>
         <!-- 登录模块 -->
         <activity
-            android:name="com.modular.login.LoginActivity"
+            android:name="com.modular.login.activity.LoginActivity"
             android:launchMode="singleTask"
             android:windowSoftInputMode="adjustPan" />
         <activity android:name=".ui.account.LoginHistoryActivity" />

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java

@@ -75,8 +75,8 @@ import com.core.xmpp.ListenerManager;
 import com.core.xmpp.dao.FriendDao;
 import com.core.xmpp.listener.AuthStateListener;
 import com.core.xmpp.model.SignAutoLogEntity;
+import com.modular.login.activity.LoginActivity;
 import com.modular.appmessages.presenter.MessagePresenter;
-import com.modular.login.LoginActivity;
 import com.uas.appcontact.listener.ImStatusListener;
 import com.uas.appcontact.ui.fragment.ContactsFragment;
 import com.uas.appcontact.ui.fragment.GroupChatFragment;

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/SplashActivity.java

@@ -25,7 +25,7 @@ import com.core.model.User;
 import com.core.dao.UserDao;
 import com.core.utils.helper.LoginHelper;
 import com.core.utils.sp.UserSp;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.core.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.activity.ADActivity;
 import com.xzjmyk.pm.activity.ui.me.TimeStatisticsActivity;

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/UserCheckedActivity.java

@@ -12,7 +12,7 @@ import com.core.base.ActivityStack;
 import com.core.app.MyApplication;
 import com.xzjmyk.pm.activity.R;
 import com.core.utils.sp.UserSp;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.core.app.ActionBackActivity;
 import com.core.utils.helper.LoginHelper;
 

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/account/LoginHistoryActivity.java

@@ -32,7 +32,7 @@ import com.core.utils.ToastUtil;
 import com.core.utils.helper.AvatarHelper;
 import com.core.utils.helper.LoginHelper;
 import com.core.utils.sp.UserSp;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.MainActivity;
 

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendAudioActivity.java

@@ -27,7 +27,7 @@ import com.core.xmpp.model.Area;
 import com.core.model.UploadFileResult;
 import com.core.utils.helper.LoginHelper;
 import com.xzjmyk.pm.activity.util.im.helper.UploadService;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.core.base.BaseActivity;
 import com.core.utils.ToastUtil;
 import com.core.net.volley.ObjectResult;

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendShuoshuoActivity.java

@@ -48,7 +48,7 @@ import com.core.widget.view.MyGridView;
 import com.core.xmpp.model.Area;
 import com.core.app.AppConstant;
 import com.xzjmyk.pm.activity.R;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.xzjmyk.pm.activity.ui.erp.activity.oa.LocationMapActivity;
 import com.core.widget.view.Activity.MultiImagePreviewActivity;
 import com.xzjmyk.pm.activity.util.im.helper.UploadService;

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/SendVideoActivity.java

@@ -38,7 +38,7 @@ import com.core.xmpp.model.Area;
 import com.core.model.UploadFileResult;
 import com.core.utils.helper.LoginHelper;
 import com.xzjmyk.pm.activity.util.im.helper.UploadService;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.core.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.activity.oa.LocationMapActivity;
 import com.xzjmyk.pm.activity.ui.me.LocalVideoActivity;

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/ADActivity.java

@@ -17,7 +17,7 @@ import com.lidroid.xutils.ViewUtils;
 import com.lidroid.xutils.view.annotation.ViewInject;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.MainActivity;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.core.base.BaseActivity;
 
 

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java

@@ -38,7 +38,7 @@ import com.core.net.http.ViewUtil;
 import com.handmark.pulltorefresh.library.PullToRefreshBase;
 import com.handmark.pulltorefresh.library.PullToRefreshWebView;
 import com.modular.appmessages.model.SubMessage;
-import com.modular.login.LoginActivity;
+import com.modular.login.activity.LoginActivity;
 import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 import com.umeng.socialize.media.UMImage;

+ 3 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/ClientActivity.java

@@ -27,12 +27,12 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.common.config.VersionUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.StringUtil;
 import com.common.system.DisplayUtil;
 import com.core.app.Constants;
 import com.core.base.BaseActivity;
-import com.core.model.OAConfig;
 import com.core.net.http.ViewUtil;
 import com.core.utils.time.wheel.DatePicker;
 import com.github.mikephil.charting.charts.BarChart;
@@ -71,8 +71,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import static com.core.model.OAConfig.canShowCrm2_0;
-
 /**
  * @功能:CRM 功能模块
  * @author:Arisono
@@ -1079,11 +1077,10 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                     switch (position) {
 
                         case 0:
-                            if (canShowCrm2_0() && !CommonUtil.isBiteman())
+                            if (VersionUtil.canShowCrm2_0() && !CommonUtil.isBiteman())
                                 startActivity(new Intent(ClientActivity.this, AddBusinessActivity.class));
                             else
                                 startActivity(new Intent(ClientActivity.this, BusinessAddActivity.class));
-
                             break;
                         case 1:
                             startActivity(new Intent(ClientActivity.this, CustomerAddActivity.class));
@@ -1215,7 +1212,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
     }
 
     public  Intent getVisitClass(Context ct) {
-        return new Intent(ct, OAConfig.canShowCrm2_0() ? AddVisitReportActivity.class : VisitReportAddActivity.class);
+        return new Intent(ct, VersionUtil.canShowCrm2_0() ? AddVisitReportActivity.class : VisitReportAddActivity.class);
     }
 }
 

+ 150 - 22
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/datainquiry/activity/PDFDownloadActivity.java

@@ -5,6 +5,7 @@ import android.graphics.Canvas;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.widget.LinearLayout;
@@ -12,7 +13,10 @@ import android.widget.ProgressBar;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.core.net.ProgressDownloader;
+import com.core.net.ProgressResponseBody;
 import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
 import com.github.barteksc.pdfviewer.PDFView;
 import com.github.barteksc.pdfviewer.listener.OnDrawListener;
 import com.github.barteksc.pdfviewer.listener.OnErrorListener;
@@ -23,22 +27,39 @@ import com.github.barteksc.pdfviewer.listener.OnRenderListener;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.Constants;
-import com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.PDFUtils;
+import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
+
+import org.json.JSONException;
+import org.json.JSONObject;
 
 import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import static com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.Constants.CONSTANT.PDF_FILE_NAME;
+import static com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.Constants.CONSTANT.PDF_FILE_PATH;
 
 /**
  * Created by RaoMeng on 2017/8/17.
  * 报表统计PDF文件下载并展示页面
  */
-public class PDFDownloadActivity extends BaseActivity implements View.OnClickListener, OnDrawListener, OnLoadCompleteListener, OnPageChangeListener, OnPageScrollListener, OnErrorListener, OnRenderListener {
+public class PDFDownloadActivity extends BaseActivity implements View.OnClickListener, OnDrawListener, OnLoadCompleteListener, OnPageChangeListener, OnPageScrollListener, OnErrorListener, OnRenderListener, ProgressResponseBody.ProgressListener {
+    private final int OBATIN_PDF_PATH = 100;
+
     private PDFView mPDFView;
-    private TextView mStateTextView, mRemainTextView, mReloadTextView, mExitTextView;
+    private TextView mStateTextView, mRemainTextView, mReloadTextView, mExitTextView, mPauseTextView;
     private ProgressBar mDownloadProgressBar;
     private RelativeLayout mDownloadRelativeLayout;
     private LinearLayout mErrorLinearLayout;
     private String downloadUrl = "", mReportName = "";
     private String mCondition, mTitle;
+    private ProgressDownloader mDownloader;
+    private long breakPoints;
+    private File file;
+    private long contentLength;
+    private long totalBytes;
 
     private Handler mHandler = new Handler() {
         @Override
@@ -47,17 +68,18 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
                 case Constants.CONSTANT.DOWNLOAD_PROGRESS:
                     try {
                         int progress = (int) msg.obj;
-                        Log.d("progress", progress + "");
+                        Log.d("progress", progress + ":" + contentLength);
                         mStateTextView.setText(R.string.str_loading);
                         mDownloadProgressBar.setProgress(progress);
-                        mRemainTextView.setText((100 - progress) + "");
+                        mRemainTextView.setText((100 - (((progress * 1024 * 100) / contentLength))) + "");
                     } catch (Exception e) {
 
                     }
                     break;
                 case Constants.CONSTANT.DOWNLOAD_SUCCESS:
+                    mPauseTextView.setVisibility(View.GONE);
                     mStateTextView.setText("报表文件下载成功!\n正在加载....");
-                    mDownloadProgressBar.setProgress(100);
+//                    mDownloadProgressBar.setProgress(100);
                     mRemainTextView.setText("0");
                     /*mDownloadRelativeLayout.postDelayed(new Runnable() {
                         @Override
@@ -65,15 +87,21 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
                             mDownloadRelativeLayout.setVisibility(View.GONE);
                         }
                     }, 1000);*/
-                    displayFromFile(new File(Constants.CONSTANT.PDF_FILE_PATH, Constants.CONSTANT.PDF_FILE_NAME));
+                    displayFromFile(new File(PDF_FILE_PATH, PDF_FILE_NAME));
                     break;
                 case Constants.CONSTANT.PDF_OVERLOAD:
+                    mPauseTextView.setVisibility(View.GONE);
                     mErrorLinearLayout.setVisibility(View.VISIBLE);
                     mStateTextView.setText("数据量过载,报表文件获取失败!");
                     mDownloadProgressBar.setProgress(0);
                     mRemainTextView.setText(100 + "");
                     break;
+                case OBATIN_PDF_PATH:
+                    String result = msg.getData().getString("result");
+                    analysisPdfPath(result);
+                    break;
                 case Constants.CONSTANT.DOWNLOAD_FAILED:
+                    mPauseTextView.setVisibility(View.GONE);
                     mErrorLinearLayout.setVisibility(View.VISIBLE);
                     String info = "";
                     if (msg.obj != null) {
@@ -83,10 +111,67 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
                     mDownloadProgressBar.setProgress(0);
                     mRemainTextView.setText(100 + "");
                     break;
+                case com.core.app.Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    result = msg.getData().getString("response");
+                    analysisPdfPath(result);
+                    break;
             }
         }
     };
 
+    private void analysisPdfPath(String result) {
+        if (result != null) {
+            try {
+                JSONObject responseObject = new JSONObject(result);
+                if (!responseObject.isNull("success") && !responseObject.optBoolean("success")) {
+                    Message message = Message.obtain();
+                    message.what = Constants.CONSTANT.DOWNLOAD_FAILED;
+                    message.obj = responseObject.optString("message");
+                    mHandler.sendMessage(message);
+                } else {
+                    boolean overload = responseObject.optBoolean("overload");
+                    int pageSize = -1;
+                    if (!responseObject.isNull("pageSize")) {
+                        pageSize = responseObject.optInt("pageSize");
+                    }
+                    if (overload) {
+                        mHandler.sendEmptyMessage(Constants.CONSTANT.PDF_OVERLOAD);
+                    } else if (pageSize == 0) {
+                        Message message = Message.obtain();
+                        message.what = Constants.CONSTANT.DOWNLOAD_FAILED;
+                        message.obj = "报表文件内容为空";
+                        mHandler.sendMessage(message);
+                    } else {
+                        downloadUrl = responseObject.optString("path");
+                        if (!TextUtils.isEmpty(downloadUrl)) {
+                            downloadUrl = "http://print.ubtob.com/report/" + downloadUrl;
+                            mPauseTextView.setVisibility(View.VISIBLE);
+                            breakPoints = 0L;
+                            File directory = new File(PDF_FILE_PATH);
+                            if (!directory.exists() && !directory.isDirectory()) {
+                                boolean mkdirs = directory.mkdirs();
+
+                            } else {
+                                CommonUtil.delAllFile(PDF_FILE_PATH);
+                            }
+                            file = new File(PDF_FILE_PATH, PDF_FILE_NAME);
+                            try {
+                                file.createNewFile();
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                            mDownloader = new ProgressDownloader(downloadUrl, file, PDFDownloadActivity.this);
+                            mDownloader.download(0L);
+                        }
+                    }
+                }
+
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
     private void displayFromFile(File fileName) {
         try {
             mPDFView.fromFile(fileName)
@@ -95,9 +180,9 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
 //                .swipeHorizontal(true)
                     .enableDoubletap(true)
                     .defaultPage(0)
-                            // allows to draw something on the current page, usually visible in the middle of the screen
+                    // allows to draw something on the current page, usually visible in the middle of the screen
                     .onDraw(this)
-                            // allows to draw something on all pages, separately for every page. Called only for visible pages
+                    // allows to draw something on all pages, separately for every page. Called only for visible pages
                     .onDrawAll(this)
                     .onLoad(this) // called after document is loaded and starts to be rendered
                     .onPageChange(this)
@@ -108,10 +193,11 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
                     .password(null)
                     .scrollHandle(null)
                     .enableAntialiasing(true) // improve rendering a little bit on low-res screens
-                            // spacing between pages in dp. To define spacing color, set view background
+                    // spacing between pages in dp. To define spacing color, set view background
                     .spacing(10)
                     .load();
         } catch (Exception e) {
+            mPauseTextView.setVisibility(View.GONE);
             mErrorLinearLayout.setVisibility(View.VISIBLE);
             mStateTextView.setText("报表文件加载失败!");
             mDownloadProgressBar.setProgress(0);
@@ -126,11 +212,20 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
 
         initViews();
         initEvents();
-        downloadPDF();
+        obtainPdfPath();
     }
 
-    private void downloadPDF() {
-        PDFUtils.downloadPDF(downloadUrl, mHandler);
+    private void obtainPdfPath() {
+        String url = "http://print.ubtob.com/report/pdf/path";
+        Map<String, Object> params = new HashMap<>();
+        params.put("u", CommonUtil.getSharedPreferences(ct, "erp_master"));
+        params.put("pf", "phone");
+        params.put("r", mReportName);
+        params.put("w", "where " + mCondition);
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        ViewUtil.httpSendRequest(this, url, params, mHandler, headers, OBATIN_PDF_PATH, null, null, "get");
+//        PDFUtils.downloadPDF(downloadUrl, mHandler);
     }
 
     private void initViews() {
@@ -144,15 +239,8 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
         if (mTitle != null)
             getSupportActionBar().setTitle(mTitle);
 
-//        downloadUrl = com.xzjmyk.pm.activity.ui.erp.util.Constants.getAppBaseUrl(this)
-//                + "report/pdf/data?u=" + CommonUtil.getSharedPreferences(ct, "erp_master")
-//                + "&pf=phone&r=" + mReportName + "&w=" + mCondition;
-//        downloadUrl = "http://192.168.253.60:8090/report/pdf/data?u=" + CommonUtil.getSharedPreferences(ct, "erp_master")
+//        downloadUrl = "http://print.ubtob.com/report/pdf/data?u=" + CommonUtil.getSharedPreferences(ct, "erp_master")
 //                + "&pf=phone&r=" + mReportName + "&w=where " + mCondition;
-        downloadUrl = "http://print.ubtob.com/report/pdf/data?u=" + CommonUtil.getSharedPreferences(ct, "erp_master")
-                + "&pf=phone&r=" + mReportName + "&w=where " + mCondition;
-
-        Log.d("downloadUrl", downloadUrl);
 
         mPDFView = (PDFView) findViewById(R.id.pdf_download_pdfview);
         mPDFView.useBestQuality(true);
@@ -164,12 +252,14 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
         mReloadTextView = (TextView) findViewById(R.id.pdf_download_reload_tv);
         mExitTextView = (TextView) findViewById(R.id.pdf_download_exit_tv);
         mErrorLinearLayout = (LinearLayout) findViewById(R.id.pdf_download_error_menu_ll);
+        mPauseTextView = (TextView) findViewById(R.id.pdf_download_pause_tv);
     }
 
     private void initEvents() {
         mExitTextView.setOnClickListener(this);
         mReloadTextView.setOnClickListener(this);
         mDownloadRelativeLayout.setOnClickListener(this);
+        mPauseTextView.setOnClickListener(this);
     }
 
     @Override
@@ -181,7 +271,21 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
             case R.id.pdf_download_reload_tv:
                 mStateTextView.setText(R.string.str_loading);
                 mErrorLinearLayout.setVisibility(View.GONE);
-                PDFUtils.downloadPDF(downloadUrl, mHandler);
+//                PDFUtils.downloadPDF(downloadUrl, mHandler);
+                obtainPdfPath();
+                break;
+            case R.id.pdf_download_pause_tv:
+                if (getString(R.string.pause_download).equals(mPauseTextView.getText().toString())) {
+                    mPauseTextView.setText(R.string.continue_download);
+                    mDownloader.pause();
+                    ToastUtil.showToast(this, "下载暂停");
+                    // 存储此时的totalBytes,即断点位置。
+                    breakPoints = totalBytes;
+                } else if (getString(R.string.continue_download).equals(mPauseTextView.getText().toString())) {
+                    mPauseTextView.setText(R.string.pause_download);
+                    ToastUtil.showToast(this, "下载继续");
+                    mDownloader.download(breakPoints);
+                }
                 break;
         }
     }
@@ -214,6 +318,7 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
 
     @Override
     public void onError(Throwable t) {
+        mPauseTextView.setVisibility(View.GONE);
         mErrorLinearLayout.setVisibility(View.VISIBLE);
         mStateTextView.setText("报表文件加载失败!");
         mDownloadProgressBar.setProgress(0);
@@ -224,4 +329,27 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
     public void onInitiallyRendered(int nbPages, float pageWidth, float pageHeight) {
         mPDFView.fitToWidth();
     }
+
+    @Override
+    public void onPreExecute(long contentLength) {
+        // 文件总长只需记录一次,要注意断点续传后的contentLength只是剩余部分的长度
+        if (this.contentLength == 0L) {
+            this.contentLength = contentLength;
+            mDownloadProgressBar.setMax((int) (contentLength / 1024));
+        }
+    }
+
+    @Override
+    public void update(long totalBytes, boolean done) {
+        // 注意加上断点的长度
+        this.totalBytes = totalBytes + breakPoints;
+        int progress = (int) (totalBytes + breakPoints) / 1024;
+        Message message = Message.obtain();
+        message.what = Constants.CONSTANT.DOWNLOAD_PROGRESS;
+        message.obj = progress;
+        mHandler.sendMessage(message);
+        if (done) {
+            mHandler.sendEmptyMessage(Constants.CONSTANT.DOWNLOAD_SUCCESS);
+        }
+    }
 }

+ 2 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java

@@ -28,6 +28,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
+import com.common.config.VersionUtil;
 import com.common.data.CalendarUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
@@ -45,7 +46,6 @@ import com.core.app.Constants;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
 import com.core.model.Employees;
-import com.core.model.OAConfig;
 import com.core.net.http.ViewUtil;
 import com.core.net.http.http.OAHttpHelper;
 import com.core.net.http.http.OnHttpResultListener;
@@ -1098,6 +1098,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
     }
 
     public  Intent getVisitClass(Context ct) {
-        return new Intent(ct, OAConfig.canShowCrm2_0() ? AddVisitReportActivity.class : VisitReportAddActivity.class);
+        return new Intent(ct, VersionUtil.canShowCrm2_0() ? AddVisitReportActivity.class : VisitReportAddActivity.class);
     }
 }

+ 2 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java

@@ -68,6 +68,7 @@ public class ViewUtil {
     private static List<LoginEntity> erpEntities;
     private static boolean hasErp = true;//是否有erp
 
+
     private static String oldMsg;
     private static long time;
     private static String oldMsg2;
@@ -807,6 +808,7 @@ public class ViewUtil {
                             if (result.getStatusCode() == 404) {
                                 exception = "404系统错误";
                             }
+                            finalBundle.putString("response", result.getResponseText());
                             finalBundle.putString("result", exception);
                             finalBundle.putInt("what", what);
                             finalBundle.putInt("code", result.getStatusCode());

+ 8 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MucChatActivity.java

@@ -223,7 +223,9 @@ public class MucChatActivity extends ActionBackActivity
             mService = ((CoreService.CoreServiceBinder) service).getService();
             if (mService != null && isGroupChat) {
                 Friend friend = FriendDao.getInstance().getFriend(mLoginUserId, mUseId);
-                mService.joinMucChat(mUseId, mLoginNickName, friend.getTimeSend());
+                if (friend != null) {
+                    mService.joinMucChat(mUseId, mLoginNickName, friend.getTimeSend());
+                }
             }
         }
     };
@@ -247,7 +249,7 @@ public class MucChatActivity extends ActionBackActivity
         mChatBottomView = (ChatBottomView) findViewById(R.id.chat_bottom_view);
         mChatBottomView.setChatBottomListener(this);
         mChatBottomView.isMuc(true);
-        if (mFriend!=null){
+        if (mFriend != null) {
             mChatBottomView.roomId(mFriend.getRoomId());
         }
         tv_none.setOnClickListener(new View.OnClickListener() {
@@ -329,7 +331,7 @@ public class MucChatActivity extends ActionBackActivity
             intent.putExtra(AppConstant.EXTRA_USER_ID, mUseId);
             if (mNickName != null && mNickName.length() > 0)
                 intent.putExtra(RoomInfoActivity.ROOM_NAME, mNickName);
-            startActivityForResult(intent,0x11);
+            startActivityForResult(intent, 0x11);
             return true;
         }
         return super.onOptionsItemSelected(item);
@@ -791,7 +793,7 @@ public class MucChatActivity extends ActionBackActivity
 
     @Override
     public void clickCamera() {
-        mNewPhotoUri = CameraUtil.getOutputMediaFileUri(this, MyApplication.getInstance().mLoginUser.getUserId(),CameraUtil.MEDIA_TYPE_IMAGE);
+        mNewPhotoUri = CameraUtil.getOutputMediaFileUri(this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
         CameraUtil.captureImage(this, mNewPhotoUri, REQUEST_CODE_CAPTURE_PHOTO);
         mChatBottomView.reset();
     }
@@ -919,11 +921,11 @@ public class MucChatActivity extends ActionBackActivity
 
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        if (resultCode==0x9088) {
+        if (resultCode == 0x9088) {
             Intent intent = new Intent();
             setResult(0x11, intent);
             finish();
-        }else if (requestCode == REQUEST_CODE_CAPTURE_PHOTO) {// 拍照返回
+        } else if (requestCode == REQUEST_CODE_CAPTURE_PHOTO) {// 拍照返回
             if (resultCode == RESULT_OK) {
                 if (mNewPhotoUri != null) {
                     sendImage(new File(mNewPhotoUri.getPath()));

+ 0 - 324
WeiChat/src/main/res/layout/act_taskb2b_add.xml

@@ -1,324 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="#EBE9E9">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="#EBE9E9"
-        android:orientation="vertical">
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_marginBottom="10dp"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_title" />
-
-            <EditText
-                android:id="@+id/et_title"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_title"
-                android:background="@null"
-                android:gravity="right|center_vertical"
-                android:hint="@string/common_input" />
-        </RelativeLayout>
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="30dp">
-            <TextView
-                android:id="@+id/detail"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent" 
-               android:gravity="bottom"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_detail"/>
-            <ImageView
-                android:id="@+id/voice_search_iv"
-                android:background="@drawable/btn_yuyin_nor"
-                android:visibility="visible"
-                android:layout_marginRight="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_marginTop="8dp"
-                />
-            </RelativeLayout>
-        <EditText
-            android:id="@+id/et_task_remark"
-            android:background="@color/white"
-            android:textSize="15sp"
-            android:layout_width="match_parent"
-            android:layout_height="100dp"
-            android:paddingLeft="10dp"
-            android:layout_marginBottom="10dp"
-            android:hint="@string/common_input" />
-        
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="90dp">
-
-            <TextView
-                android:id="@+id/tv_task_peoples"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_executor" />
-
-            <ImageView
-                android:id="@+id/iv_find"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="20dp"
-                android:src="@drawable/icon_find_voice" />
-
-        </RelativeLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_startime"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_starttime" />
-
-            <TextView
-                android:id="@+id/et_startime"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_startime"
-                android:background="@null"
-                android:gravity="right"
-                android:hint="@string/common_select" />
-
-            <include
-                android:id="@+id/ic_voice_center"
-                layout="@layout/include_voice_center_size"
-                android:layout_width="200dp"
-                android:layout_height="200dp"
-                android:layout_centerHorizontal="true"
-                android:layout_centerVertical="true"
-                android:visibility="invisible" />
-
-            <ScrollView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_alignParentBottom="true"
-                android:layout_centerHorizontal="true"
-                android:scrollbars="none">
-
-                <com.core.widget.view.TagGroup
-                    android:id="@+id/et_task_people"
-                    style="@style/TagGroup"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:background="@null" />
-            </ScrollView>
-        </RelativeLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />
-        <RelativeLayout
-            android:id="@+id/task_startime_rl"
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_task_startime"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_endtime" />
-
-            <TextView
-                android:id="@+id/et_task_startime"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_task_startime"
-                android:background="@null"
-                android:gravity="right"
-                android:hint="@string/common_select" />
-
-        </RelativeLayout>
-
-       <!-- <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />-->
-        <!-- 语音 -->
-        <LinearLayout
-            android:id="@+id/lay_voice_layout"
-            style="@style/form_relative_customer"
-            android:orientation="horizontal"
-            android:visibility="gone">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:padding="15dp"
-                android:text="语音" />
-
-            <LinearLayout
-                android:id="@+id/voice_display_voice_layout"
-                android:layout_width="150dip"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="5dp"
-                android:layout_marginLeft="15dp"
-                android:layout_marginTop="5dp"
-                android:background="@drawable/globle_player_bg"
-                android:gravity="center_vertical"
-                android:orientation="horizontal"
-                android:visibility="visible">
-
-                <ImageView
-                    android:id="@+id/voice_display_voice_play"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:src="@drawable/globle_player_btn_play" />
-
-                <ProgressBar
-                    android:id="@+id/voice_display_voice_progressbar"
-                    style="?android:attr/progressBarStyleHorizontal"
-                    android:layout_width="0dp"
-                    android:layout_height="6dip"
-                    android:layout_margin="8dip"
-                    android:layout_weight="1"
-                    android:max="100"
-                    android:progress="0"
-                    android:progressDrawable="@drawable/globle_player_progress_bar_bg" />
-
-                <TextView
-                    android:id="@+id/voice_display_voice_time"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text=""
-                    android:textColor="#999999"
-                    android:textSize="12sp" />
-
-            </LinearLayout>
-
-            <ImageView
-                android:id="@+id/iv_delete_voice"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_marginLeft="10dp"
-                android:background="@drawable/iconfont_shanchu" />
-        </LinearLayout>
-        <View
-            android:id="@+id/view_line"
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey"
-            android:visibility="gone" />
-        <RelativeLayout
-            android:id="@+id/chaosonren_rl"
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="90dp">
-
-            <TextView
-                android:id="@+id/tv_task_chaosong"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="   抄送人" />
-
-            <ScrollView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_marginBottom="5dp"
-                android:layout_marginLeft="10dp"
-                android:layout_marginTop="5dp"
-                android:layout_toLeftOf="@+id/iv_find_chaosong"
-                android:layout_toRightOf="@+id/tv_task_chaosong"
-                android:scrollbars="none">
-
-                <com.core.widget.view.TagGroup
-                    android:id="@+id/et_task_chaosong"
-                    style="@style/TagGroup"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:background="@null" />
-            </ScrollView>
-
-            <ImageView
-                android:id="@+id/iv_find_chaosong"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="20dp"
-                android:src="@drawable/icon_find_voice" />
-
-        </RelativeLayout>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />
-
-        <LinearLayout style="@style/form_linear_customer">
-
-            <Button
-                android:id="@+id/bt_task_add"
-                android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:layout_marginBottom="10dp"
-                android:layout_marginLeft="10dp"
-                android:layout_marginRight="10dp"
-                android:layout_marginTop="10dp"
-                android:background="@drawable/btn_index_selector"
-                android:text="保存"
-                android:textColor="@color/white"
-                android:visibility="gone" />
-        </LinearLayout>
-    </LinearLayout>
-
-    <ImageView
-        android:id="@+id/iv_recode"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerInParent="true"
-        android:contentDescription="@string/app_name"
-        android:padding="20dp"
-        android:src="@drawable/icon_voice_black"
-        android:visibility="gone" />
-</RelativeLayout>

+ 0 - 320
WeiChat/src/main/res/layout/act_taskerp_add.xml

@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="#EBE9E9">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="#EBE9E9"
-        android:orientation="vertical">
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_marginBottom="10dp"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_title" />
-
-            <EditText
-                android:id="@+id/et_title"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_title"
-                android:background="@null"
-                android:gravity="right|center_vertical"
-                android:hint="@string/common_input" />
-        </RelativeLayout>
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="30dp">
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:gravity="bottom"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_detail"/>
-
-
-            <ImageView
-                android:id="@+id/voice_search_iv"
-                android:background="@drawable/btn_yuyin_nor"
-                android:visibility="visible"
-                android:layout_marginRight="20dp"
-                android:layout_alignParentRight="true"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_marginTop="8dp"
-                />
-        </RelativeLayout>
-        <EditText
-            android:id="@+id/et_task_detail"
-            android:background="@color/white"
-            android:textSize="15sp"
-            android:layout_width="match_parent"
-            android:layout_height="100dp"
-            android:paddingLeft="10dp"
-            android:layout_marginBottom="10dp"
-            android:hint="@string/common_input" />
-
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="90dp">
-
-            <TextView
-                android:id="@+id/tv_task_peoples"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_executor" />
-
-            <ScrollView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_marginBottom="5dp"
-                android:layout_marginLeft="10dp"
-                android:layout_marginTop="5dp"
-                android:layout_toLeftOf="@+id/iv_find"
-                android:layout_toRightOf="@+id/tv_task_peoples"
-                android:scrollbars="none">
-
-                <com.core.widget.view.TagGroup
-                    android:id="@+id/et_task_people"
-                    style="@style/TagGroup"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:background="@null" />
-            </ScrollView>
-
-            <ImageView
-                android:id="@+id/iv_find"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="20dp"
-                android:src="@drawable/icon_find_voice" />
-
-        </RelativeLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_startime"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_starttime" />
-
-            <TextView
-                android:id="@+id/et_startime"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_startime"
-                android:background="@null"
-                android:gravity="right"
-                android:hint="@string/common_select" />
-        </RelativeLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey" />
-        <RelativeLayout
-            android:id="@+id/task_startime_rl"
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="50dp">
-
-            <TextView
-                android:id="@+id/tv_task_startime"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/task_endtime" />
-
-            <TextView
-                android:id="@+id/et_endtime"
-                style="@style/form_relative_right_text"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@+id/tv_task_startime"
-                android:background="@null"
-                android:gravity="right"
-                android:hint="@string/common_select" />
-
-        </RelativeLayout>
-        <!--
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="0.5dp"
-                    android:layout_marginLeft="5dp"
-                    android:layout_marginRight="5dp"
-                    android:background="@color/light_grey" />-->
-        <!-- 语音 -->
-        <LinearLayout
-            android:id="@+id/lay_voice_layout"
-            style="@style/form_relative_customer"
-            android:orientation="horizontal"
-            android:visibility="gone">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:padding="15dp"
-                android:text="语音" />
-
-            <LinearLayout
-                android:id="@+id/voice_display_voice_layout"
-                android:layout_width="150dip"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="5dp"
-                android:layout_marginLeft="15dp"
-                android:layout_marginTop="5dp"
-                android:background="@drawable/globle_player_bg"
-                android:gravity="center_vertical"
-                android:orientation="horizontal"
-                android:visibility="visible">
-
-                <ImageView
-                    android:id="@+id/voice_display_voice_play"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:src="@drawable/globle_player_btn_play" />
-
-                <ProgressBar
-                    android:id="@+id/voice_display_voice_progressbar"
-                    style="?android:attr/progressBarStyleHorizontal"
-                    android:layout_width="0dp"
-                    android:layout_height="6dip"
-                    android:layout_margin="8dip"
-                    android:layout_weight="1"
-                    android:max="100"
-                    android:progress="0"
-                    android:progressDrawable="@drawable/globle_player_progress_bar_bg" />
-
-                <TextView
-                    android:id="@+id/voice_display_voice_time"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text=""
-                    android:textColor="#999999"
-                    android:textSize="12sp" />
-
-            </LinearLayout>
-
-            <ImageView
-                android:id="@+id/iv_delete_voice"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_marginLeft="10dp"
-                android:background="@drawable/iconfont_shanchu" />
-        </LinearLayout>
-        <View
-            android:id="@+id/view_line"
-            android:layout_width="match_parent"
-            android:layout_height="0.5dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:background="@color/light_grey"
-            android:visibility="gone" />
-        <RelativeLayout
-            style="@style/form_relative_customer"
-            android:background="@color/white"
-            android:layout_height="90dp"
-            android:visibility="gone">
-
-            <TextView
-                android:id="@+id/tv_task_chaosong"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:layout_marginLeft="10dp"
-                android:text="   抄送人" />
-
-            <ScrollView
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_marginBottom="5dp"
-                android:layout_marginLeft="10dp"
-                android:layout_marginTop="5dp"
-                android:layout_toLeftOf="@+id/iv_find_chaosong"
-                android:layout_toRightOf="@+id/tv_task_chaosong"
-                android:scrollbars="none">
-
-                <com.core.widget.view.TagGroup
-                    android:id="@+id/et_task_chaosong"
-                    style="@style/TagGroup"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:background="@null" />
-            </ScrollView>
-
-            <ImageView
-                android:id="@+id/iv_find_chaosong"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="20dp"
-                android:src="@drawable/icon_find_voice" />
-
-        </RelativeLayout>
-
-        <!-- <View
-             android:layout_width="match_parent"
-             android:layout_height="0.5dp"
-             android:layout_marginLeft="5dp"
-             android:layout_marginRight="5dp"
-             android:background="@color/light_grey" />-->
-
-        <LinearLayout style="@style/form_linear_customer">
-
-            <Button
-                android:id="@+id/bt_task_add"
-                android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:layout_marginBottom="10dp"
-                android:layout_marginLeft="10dp"
-                android:layout_marginRight="10dp"
-                android:layout_marginTop="10dp"
-                android:background="@drawable/btn_index_selector"
-                android:text="保存"
-                android:textColor="@color/white"
-                android:visibility="gone" />
-        </LinearLayout>
-    </LinearLayout>
-
-
-    <ImageView
-        android:id="@+id/iv_recode"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerInParent="true"
-        android:contentDescription="@string/app_name"
-        android:padding="20dp"
-        android:src="@drawable/icon_voice_black"
-        android:visibility="gone" />
-</RelativeLayout>

+ 1 - 1
WeiChat/src/main/res/layout/activity_data_inquiry.xml

@@ -16,7 +16,7 @@
         android:drawablePadding="6dp"
         android:gravity="center_vertical"
         android:padding="6dp"
-        android:visibility="gone"
+        android:visibility="invisible"
         android:text="@string/search"/>
 
     <com.handmark.pulltorefresh.library.PullToRefreshListView

+ 25 - 8
WeiChat/src/main/res/layout/activity_pdf_download.xml

@@ -9,7 +9,7 @@
     <com.github.barteksc.pdfviewer.PDFView
         android:id="@+id/pdf_download_pdfview"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
+        android:layout_height="match_parent" />
 
     <RelativeLayout
         android:id="@+id/pdf_download_progress_rl"
@@ -27,9 +27,11 @@
                 android:id="@+id/pdf_download_state_tv"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:ellipsize="end"
                 android:gravity="center"
+                android:maxLines="2"
                 android:text="@string/str_loading"
-                android:textSize="16sp"/>
+                android:textSize="16sp" />
 
             <ProgressBar
                 android:id="@+id/pdf_download_progress_pb"
@@ -40,7 +42,6 @@
                 android:layout_marginLeft="40dp"
                 android:layout_marginRight="40dp"
                 android:layout_marginTop="10dp"
-                android:max="100"
                 android:progress="0"
                 />
 
@@ -54,7 +55,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:text="剩余 "
-                    android:textSize="16sp"/>
+                    android:textSize="16sp" />
 
                 <TextView
                     android:id="@+id/pdf_download_remain_tv"
@@ -62,16 +63,32 @@
                     android:layout_height="wrap_content"
                     android:text="100"
                     android:textColor="@color/titleBlue"
-                    android:textSize="16sp"/>
+                    android:textSize="16sp" />
 
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:text=" %"
-                    android:textSize="16sp"/>
+                    android:textSize="16sp" />
             </LinearLayout>
         </LinearLayout>
 
+
+        <TextView
+            android:id="@+id/pdf_download_pause_tv"
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="20dp"
+            android:layout_marginLeft="30dp"
+            android:layout_marginRight="30dp"
+            android:background="@drawable/selector_confirm_bg"
+            android:gravity="center"
+            android:text="@string/pause_download"
+            android:textColor="@color/white"
+            android:textSize="16sp"
+            android:visibility="gone" />
+
         <LinearLayout
             android:id="@+id/pdf_download_error_menu_ll"
             android:layout_width="match_parent"
@@ -92,7 +109,7 @@
                 android:gravity="center"
                 android:text="@string/re_download"
                 android:textColor="@color/white"
-                android:textSize="16sp"/>
+                android:textSize="16sp" />
 
             <TextView
                 android:id="@+id/pdf_download_exit_tv"
@@ -104,7 +121,7 @@
                 android:gravity="center"
                 android:text="@string/exit"
                 android:textColor="@color/selector_cancel_text_color"
-                android:textSize="16sp"/>
+                android:textSize="16sp" />
 
         </LinearLayout>
 

+ 9 - 6
WeiChat/src/main/res/layout/layout_select_head.xml

@@ -13,29 +13,32 @@
         android:layout_height="50dp"
         android:gravity="center"
         android:textColor="@color/black"
-        android:textSize="20sp"
+        android:textSize="16sp"
         android:text="@string/common_camera"/>
     <View
         style="@style/app_line_gray_1dp"
         />
+
     <TextView
         android:id="@+id/head_select_photos"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:gravity="center"
+        android:text="@string/select_form_phoneablum"
         android:textColor="@color/black"
-        android:textSize="20sp"
-        android:text="@string/select_form_phoneablum"/>
+        android:textSize="16sp" />
+
     <View
         style="@style/app_line_gray_1dp"
-        android:layout_height="5dp"
+        android:layout_height="3dp"
         />
+
     <TextView
         android:id="@+id/head_cancel"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:gravity="center"
+        android:text="@string/common_cancel"
         android:textColor="@color/black"
-        android:textSize="20sp"
-        android:text="@string/common_cancel"/>
+        android:textSize="16sp" />
 </LinearLayout>

+ 2 - 0
WeiChat/src/main/res/values-en/strings.xml

@@ -1434,5 +1434,7 @@
     <string name="re_download">重新下载</string>
     <string name="search_history">搜索历史</string>
     <string name="str_clear">清空</string>
+    <string name="pause_download">暂停下载</string>
+    <string name="continue_download">继续下载</string>
 
 </resources>

+ 2 - 0
WeiChat/src/main/res/values-zh-rCN/strings.xml

@@ -1546,5 +1546,7 @@
     <string name="re_download">重新下载</string>
     <string name="search_history">搜索历史</string>
     <string name="str_clear">清空</string>
+    <string name="pause_download">暂停下载</string>
+    <string name="continue_download">继续下载</string>
 
 </resources>

+ 2 - 0
WeiChat/src/main/res/values-zh-rTW/strings.xml

@@ -1535,5 +1535,7 @@
     <string name="re_download">重新下载</string>
     <string name="search_history">搜索历史</string>
     <string name="str_clear">清空</string>
+    <string name="pause_download">暂停下载</string>
+    <string name="continue_download">继续下载</string>
 
 </resources>

+ 2 - 0
WeiChat/src/main/res/values/strings.xml

@@ -1878,4 +1878,6 @@
     <string name="re_download">重新下载</string>
     <string name="search_history">搜索历史</string>
     <string name="str_clear">清空</string>
+    <string name="pause_download">暂停下载</string>
+    <string name="continue_download">继续下载</string>
 </resources>

+ 2 - 0
app_core/common/build.gradle

@@ -38,6 +38,8 @@ dependencies {
     compile deps.photoView
     compile deps.stickyListHeaders
     compile deps.stickyGridHeaders
+    compile 'com.squareup.okhttp3:okhttp:3.9.0'
+
     compile project(':pullToRefershLibraryMy')
     compile project(':MPAndroidChart')
     compile project(':libedittextformlibrary')

+ 10 - 0
app_core/common/src/main/java/com/common/config/VersionUtil.java

@@ -1,5 +1,8 @@
 package com.common.config;
 
+import com.core.app.MyApplication;
+import com.core.utils.CommonUtil;
+
 /**
  * Created by Bitliker on 2017/9/14.
  */
@@ -9,4 +12,11 @@ public class VersionUtil {
         return true;
     }
 
+    public static boolean canShowCrm2_0() {
+        if (!CommonUtil.getSharedPreferencesBoolean(MyApplication.getInstance(), "erp_login"))
+            return false;
+        if (BaseConfig.isDebug()) return false;
+        //TODO default
+        return false;
+    }
 }

+ 0 - 7
app_core/common/src/main/java/com/core/model/OAConfig.java

@@ -30,15 +30,8 @@ public class OAConfig {
     public static int nonclass = 90;   //矿工时间
 
     /*是否显示Crm2.0功能*/
-    public static boolean canShowCrm2_0 = true;
     public static boolean canShowRed = false;
 
-    public static boolean canShowCrm2_0() {
-        if (!CommonUtil.getSharedPreferencesBoolean(MyApplication.getInstance(), "erp_login"))
-            return false;
-        if (!BaseConfig.isDebug()) return false;
-        return canShowCrm2_0;
-    }
 
 
 }

+ 120 - 0
app_core/common/src/main/java/com/core/net/ProgressDownloader.java

@@ -0,0 +1,120 @@
+package com.core.net;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Interceptor;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+/**
+ * Created by RaoMeng on 2017/9/25.
+ * okhttp实现的下载工具类
+ * 支持下载暂停以及断电续传
+ */
+
+public class ProgressDownloader {
+    private ProgressResponseBody.ProgressListener progressListener;
+    private String url;
+    private OkHttpClient client;
+    private File destination;
+    private Call call;
+
+    public ProgressDownloader(String url, File destination, ProgressResponseBody.ProgressListener progressListener) {
+        this.url = url;
+        this.destination = destination;
+        this.progressListener = progressListener;
+        //在下载、暂停后的继续下载中可复用同一个client对象
+        client = getProgressClient();
+    }
+
+    //每次下载需要新建新的Call对象
+    private Call newCall(long startPoints) {
+        Request request = new Request.Builder()
+                .url(url)
+                .header("RANGE", "bytes=" + startPoints + "-")//断点续传要用到的,指示下载的区间
+                .build();
+        return client.newCall(request);
+    }
+
+    public OkHttpClient getProgressClient() {
+        // 拦截器,用上ProgressResponseBody
+        Interceptor interceptor = new Interceptor() {
+            @Override
+            public Response intercept(Chain chain) throws IOException {
+                Response originalResponse = chain.proceed(chain.request());
+                return originalResponse.newBuilder()
+                        .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+                        .build();
+            }
+        };
+
+        return new OkHttpClient.Builder()
+                .addNetworkInterceptor(interceptor)
+                .build();
+    }
+
+    // startsPoint指定开始下载的点
+    public void download(final long startsPoint) {
+        call = newCall(startsPoint);
+        call.enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                save(response, startsPoint);
+            }
+        });
+    }
+
+    public void pause() {
+        if (call != null) {
+            call.cancel();
+        }
+    }
+
+    private void save(Response response, long startsPoint) {
+        ResponseBody body = response.body();
+        InputStream in = body.byteStream();
+        FileChannel channelOut = null;
+        // 随机访问文件,可以指定断点续传的起始位置
+        RandomAccessFile randomAccessFile = null;
+        try {
+            randomAccessFile = new RandomAccessFile(destination, "rwd");
+            //Chanel NIO中的用法,由于RandomAccessFile没有使用缓存策略,直接使用会使得下载速度变慢,亲测缓存下载3.3秒的文件,用普通的RandomAccessFile需要20多秒。
+            channelOut = randomAccessFile.getChannel();
+            // 内存映射,直接使用RandomAccessFile,是用其seek方法指定下载的起始位置,使用缓存下载,在这里指定下载位置。
+            MappedByteBuffer mappedBuffer = channelOut.map(FileChannel.MapMode.READ_WRITE, startsPoint, body.contentLength());
+            byte[] buffer = new byte[1024];
+            int len;
+            while ((len = in.read(buffer)) != -1) {
+                mappedBuffer.put(buffer, 0, len);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                in.close();
+                if (channelOut != null) {
+                    channelOut.close();
+                }
+                if (randomAccessFile != null) {
+                    randomAccessFile.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 72 - 0
app_core/common/src/main/java/com/core/net/ProgressResponseBody.java

@@ -0,0 +1,72 @@
+package com.core.net;
+
+import java.io.IOException;
+
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+/**
+ * Created by RaoMeng on 2017/9/25.
+ * okhttp下载返回体
+ */
+
+public class ProgressResponseBody extends ResponseBody {
+    public interface ProgressListener {
+        void onPreExecute(long contentLength);
+
+        void update(long totalBytes, boolean done);
+    }
+
+    private final ResponseBody responseBody;
+    private final ProgressListener progressListener;
+    private BufferedSource bufferedSource;
+
+    public ProgressResponseBody(ResponseBody responseBody,
+                                ProgressListener progressListener) {
+        this.responseBody = responseBody;
+        this.progressListener = progressListener;
+        if (progressListener != null) {
+            progressListener.onPreExecute(contentLength());
+        }
+    }
+
+    @Override
+    public MediaType contentType() {
+        return responseBody.contentType();
+    }
+
+    @Override
+    public long contentLength() {
+        return responseBody.contentLength();
+    }
+
+    @Override
+    public BufferedSource source() {
+        if (bufferedSource == null) {
+            bufferedSource = Okio.buffer(source(responseBody.source()));
+        }
+        return bufferedSource;
+    }
+
+    private Source source(Source source) {
+        return new ForwardingSource(source) {
+            long totalBytes = 0L;
+
+            @Override
+            public long read(Buffer sink, long byteCount) throws IOException {
+                long bytesRead = super.read(sink, byteCount);
+                // read() returns the number of bytes read, or -1 if this source is exhausted.
+                totalBytes += bytesRead != -1 ? bytesRead : 0;
+                if (null != progressListener) {
+                    progressListener.update(totalBytes, bytesRead == -1);
+                }
+                return bytesRead;
+            }
+        };
+    }
+}

+ 74 - 2
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
+import android.content.res.AssetManager;
 import android.graphics.Bitmap;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
@@ -37,10 +38,12 @@ import com.core.xmpp.model.SignAutoLogEntity;
 import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.text.DecimalFormat;
@@ -434,11 +437,10 @@ public class CommonUtil {
 
     public static String getUserRole() {
         String userRole = getSharedPreferences(MyApplication.getInstance(), "userRole");
-        return userRole==null?"":userRole;
+        return userRole == null ? "" : userRole;
     }
 
 
-
     public static long getlongNumByString(String chche) {
         if (StringUtil.isEmpty(chche)) return -1;
         Pattern p = Pattern.compile("(\\d+)");
@@ -658,6 +660,7 @@ public class CommonUtil {
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         com.core.net.http.ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, codeWhat, null, null, "post");
     }
+
     /**
      * 去除字符串中的换行符,空格
      *
@@ -674,6 +677,7 @@ public class CommonUtil {
         }
         return result;
     }
+
     /**
      * 返回输入框内去除换行符和空格之后的字符串
      *
@@ -686,6 +690,7 @@ public class CommonUtil {
         temp = removeStringMark(temp);
         return StringUtil.toHttpString(temp);
     }
+
     /**
      * @desc:修改textView样式
      * @author:Arison on 2016/8/3
@@ -710,6 +715,7 @@ public class CommonUtil {
         }
         view.setText(style);
     }
+
     /**
      * 检验是否是正确的网址
      *
@@ -723,6 +729,72 @@ public class CommonUtil {
         return m.matches();
     }
 
+    /**
+     * 从asset路径下读取对应文件转String输出
+     *
+     * @param mContext
+     * @return
+     */
+    public static String getAssetsJson(Context mContext, String fileName) {
+        StringBuilder sb = new StringBuilder();
+        AssetManager am = mContext.getAssets();
+        try {
+            BufferedReader br = new BufferedReader(new InputStreamReader(
+                    am.open(fileName)));
+            String next = "";
+            while (null != (next = br.readLine())) {
+                sb.append(next);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            sb.delete(0, sb.length());
+        }
+        return sb.toString().trim();
+    }
+
+    public static boolean delAllFile(String path) {
+        boolean flag = false;
+        File file = new File(path);
+        if (!file.exists()) {
+            return flag;
+        }
+        if (!file.isDirectory()) {
+            return flag;
+        }
+        String[] tempList = file.list();
+        File temp = null;
+        for (int i = 0; i < tempList.length; i++) {
+            if (path.endsWith(File.separator)) {
+                temp = new File(path + tempList[i]);
+            } else {
+                temp = new File(path + File.separator + tempList[i]);
+            }
+            if (temp.isFile()) {
+                temp.delete();
+            }
+            if (temp.isDirectory()) {
+                delAllFile(path + "/" + tempList[i]);//先删除文件夹里面的文件
+                delFolder(path + "/" + tempList[i]);//再删除空文件夹
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    //删除文件夹
+    //param folderPath 文件夹完整绝对路径
+    public static void delFolder(String folderPath) {
+        try {
+            delAllFile(folderPath); //删除完里面所有内容
+            String filePath = folderPath;
+            filePath = filePath.toString();
+            java.io.File myFilePath = new java.io.File(filePath);
+            myFilePath.delete(); //删除空文件夹
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
     public static String getUTF8String(String str){
         String xmString = "";
         String xmlUTF8="";

+ 0 - 0
WeiChat/src/main/res/color/selector_cancel_text_color.xml → app_core/common/src/main/res/color/selector_cancel_text_color.xml


+ 21 - 0
app_core/common/src/main/res/drawable/bg_white_hint_btn.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true">
+        <shape>
+            <solid android:color="@color/hine_bg" />
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp" />
+        </shape>
+    </item>
+    <item android:state_checked="true">
+        <shape>
+            <solid android:color="@color/hine_bg" />
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp" />
+        </shape>
+    </item>
+    <item>
+        <shape>
+            <solid android:color="@color/white" />
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp" />
+        </shape>
+    </item>
+</selector>

+ 0 - 0
WeiChat/src/main/res/drawable/selector_cancel_bg.xml → app_core/common/src/main/res/drawable/selector_cancel_bg.xml


+ 0 - 0
WeiChat/src/main/res/drawable/shape_blue_corner_white_bg.xml → app_core/common/src/main/res/drawable/shape_blue_corner_white_bg.xml


+ 0 - 0
WeiChat/src/main/res/drawable/shape_corner_deep_blue_bg.xml → app_core/common/src/main/res/drawable/shape_corner_deep_blue_bg.xml


+ 1 - 2
app_core/common/src/main/res/layout/activity_business_add.xml

@@ -3,8 +3,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:whatever="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.crm.BusinessAddActivity">
+    android:layout_height="match_parent">
 
     <RelativeLayout
         android:layout_width="match_parent"

+ 9 - 6
app_core/common/src/main/res/layout/layout_select_head.xml

@@ -13,29 +13,32 @@
         android:layout_height="50dp"
         android:gravity="center"
         android:textColor="@color/black"
-        android:textSize="20sp"
+        android:textSize="16sp"
         android:text="@string/common_camera"/>
     <View
         style="@style/app_line_gray_1dp"
         />
+
     <TextView
         android:id="@+id/head_select_photos"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:gravity="center"
+        android:text="@string/select_form_phoneablum"
         android:textColor="@color/black"
-        android:textSize="20sp"
-        android:text="@string/select_form_phoneablum"/>
+        android:textSize="16sp" />
+
     <View
         style="@style/app_line_gray_1dp"
-        android:layout_height="5dp"
+        android:layout_height="3dp"
         />
+
     <TextView
         android:id="@+id/head_cancel"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:gravity="center"
+        android:text="@string/common_cancel"
         android:textColor="@color/black"
-        android:textSize="20sp"
-        android:text="@string/common_cancel"/>
+        android:textSize="16sp" />
 </LinearLayout>

+ 4 - 0
app_core/common/src/main/res/values/strings.xml

@@ -1871,4 +1871,8 @@
     <string name="common_service_query">常用业务查询</string>
     <string name="more_queries">更多查询</string>
     <string name="select_query_service">选择查询业务</string>
+
+
+    <string name="schedule_title_must_input">日程标题为必填项</string>
+    <string name="schedule_detail_must_input">日程详情为必填项</string>
 </resources>

+ 129 - 130
app_core/network/src/main/java/com/me/network/app/http/impl/RetrofitImpl.java

@@ -35,139 +35,138 @@ import rx.functions.Func1;
 
 /**
  * Retrofit封装Okhttp的方式进行网络操作
- * 
- * @author Arison
  *
+ * @author Arison
  */
 public class RetrofitImpl extends HttpBase {
 
-	public Retrofit retrofit;
-	public ParamService paramService;
-	private static RetrofitImpl instance;
-	
-
-	public static RetrofitImpl getInstance() {
-		if (instance == null) {
-			synchronized (RetrofitImpl.class) {
-				if (instance == null) {
-					instance = new RetrofitImpl();
-				}
-			}
-		}
-
-		return instance;
-	}
-
-	@Override
-	public void initClient() {
-	  
-		Builder okBuilder = new Builder()
-				.connectTimeout(mbuilder.getConnectTimeout(), TimeUnit.SECONDS)
-				.readTimeout(mbuilder.getReadTimeout(), TimeUnit.SECONDS)
-				.writeTimeout(mbuilder.getWriteTimeout(), TimeUnit.SECONDS)
-				.sslSocketFactory(createSSLSocketFactory(), new TrustAllCerts())// 信任所有证书
-				.hostnameVerifier(new TrustAllHostnameVerifier());
-
-		LogInterceptor logInterceptor = new LogInterceptor();
-		logInterceptor.setBuilder(mbuilder);
-		okBuilder.addInterceptor(logInterceptor);
-		if (mbuilder.getCacheFileSize() != 0) {
-			okBuilder.cache(new Cache(mbuilder.getCacheFile(), mbuilder.getCacheFileSize()));
-			okBuilder.addInterceptor(
-					new CacheInterceptor(String.valueOf(mbuilder.getCacheTime()), mbuilder.getCacheType()));
-		}
-
-
-		OkHttpClient client = okBuilder.build();
-		retrofit = new Retrofit.Builder().client(client)
-				.baseUrl(mbuilder.getBaseUrl())
-				.addConverterFactory(StringConverterFactory.create())
-				.addConverterFactory(GsonConverterFactory.create(new Gson()))
-				.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
-				.build();
-
-		paramService = initApi(ParamService.class);
-	}
-
-	public <T> T initApi(Class<T> service) {
-		return retrofit.create(service);
-	}
-
-	@Override
-	public void get(HttpClient builder, Subscriber<Object> s) {
-		Observable<Object> o = paramService.getParam(builder.getBaseUrl(), builder.getParams(), builder.getHeaders());
-		toSubscribe(o, s);
-		
-	}
-
-	@Override
-	public void post(HttpClient builder, Subscriber<Object> s) {
-		Observable<Object> o = paramService.postParam(builder.getBaseUrl(), builder.getParams(), builder.getHeaders());
-		toSubscribe(o, s);
-	}
-	
-	@Override
-	public void uploads(HttpClient mBuilder, Subscriber<Object> s){
-		MultipartBody.Builder builder = new MultipartBody.Builder();
-		builder.setType(MultipartBody.FORM);
-		//追加参数
-		for (String key : mBuilder.getParams().keySet()) {
-			Object object = mBuilder.getParams().get(key);
-			if (!(object instanceof File)) {
-				builder.addFormDataPart(key, object.toString());
-			} else {
-				File file = (File) object;
-				//其中参数“file”和服务器接收的参数 一一对应,保证多文件上传唯一key不变
-				builder.addFormDataPart("file", file.getName(), RequestBody.create(null, file));
-			}
-		}
-		//创建RequestBody
-		RequestBody body = builder.build();
-		Observable<Object> o=paramService.uploads(mBuilder.getBaseUrl(), body);
-		toSubscribe(o, s);
-	}
-
-	private <T> void toSubscribe(Observable<T> o, Subscriber<T> s) {
-		o.retryWhen(new Func1<Observable<? extends Throwable>, Observable<?>>() {
-
-			@Override
-			public Observable<?> call(Observable<? extends Throwable> t) {
-           
-				return t.flatMap(new Func1<Throwable, Observable<?>>() {
-					private int count = 0;
-                     
-					@Override
-					public Observable<?> call(Throwable t) {
-						if (++count <= mbuilder.getMaxRetryCount()) {
+    public Retrofit retrofit;
+    public ParamService paramService;
+    private static RetrofitImpl instance;
+
+
+    public static RetrofitImpl getInstance() {
+        if (instance == null) {
+            synchronized (RetrofitImpl.class) {
+                if (instance == null) {
+                    instance = new RetrofitImpl();
+                }
+            }
+        }
+
+        return instance;
+    }
+
+    @Override
+    public void initClient() {
+
+        Builder okBuilder = new Builder()
+                .connectTimeout(mbuilder.getConnectTimeout(), TimeUnit.SECONDS)
+                .readTimeout(mbuilder.getReadTimeout(), TimeUnit.SECONDS)
+                .writeTimeout(mbuilder.getWriteTimeout(), TimeUnit.SECONDS)
+                .sslSocketFactory(createSSLSocketFactory(), new TrustAllCerts())// 信任所有证书
+                .hostnameVerifier(new TrustAllHostnameVerifier());
+
+        LogInterceptor logInterceptor = new LogInterceptor();
+        logInterceptor.setBuilder(mbuilder);
+        okBuilder.addInterceptor(logInterceptor);
+        if (mbuilder.getCacheFileSize() != 0) {
+            okBuilder.cache(new Cache(mbuilder.getCacheFile(), mbuilder.getCacheFileSize()));
+            okBuilder.addInterceptor(
+                    new CacheInterceptor(String.valueOf(mbuilder.getCacheTime()), mbuilder.getCacheType()));
+        }
+
+
+        OkHttpClient client = okBuilder.build();
+        retrofit = new Retrofit.Builder().client(client)
+                .baseUrl(mbuilder.getBaseUrl())
+                .addConverterFactory(StringConverterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create(new Gson()))
+                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
+                .build();
+
+        paramService = initApi(ParamService.class);
+    }
+
+    public <T> T initApi(Class<T> service) {
+        return retrofit.create(service);
+    }
+
+    @Override
+    public void get(HttpClient builder, Subscriber<Object> s) {
+        Observable<Object> o = paramService.getParam(builder.getBaseUrl(), builder.getParams(), builder.getHeaders());
+        toSubscribe(o, s);
+
+    }
+
+    @Override
+    public void post(HttpClient builder, Subscriber<Object> s) {
+        Observable<Object> o = paramService.postParam(builder.getBaseUrl(), builder.getParams(), builder.getHeaders());
+        toSubscribe(o, s);
+    }
+
+    @Override
+    public void uploads(HttpClient mBuilder, Subscriber<Object> s) {
+        MultipartBody.Builder builder = new MultipartBody.Builder();
+        builder.setType(MultipartBody.FORM);
+        //追加参数
+        for (String key : mBuilder.getParams().keySet()) {
+            Object object = mBuilder.getParams().get(key);
+            if (!(object instanceof File)) {
+                builder.addFormDataPart(key, object.toString());
+            } else {
+                File file = (File) object;
+                //其中参数“file”和服务器接收的参数 一一对应,保证多文件上传唯一key不变
+                builder.addFormDataPart("businessImage", file.getName(), RequestBody.create(null, file));
+            }
+        }
+        //创建RequestBody
+        RequestBody body = builder.build();
+        Observable<Object> o = paramService.uploads(mBuilder.getBaseUrl(), body);
+        toSubscribe(o, s);
+    }
+
+    private <T> void toSubscribe(Observable<T> o, Subscriber<T> s) {
+        o.retryWhen(new Func1<Observable<? extends Throwable>, Observable<?>>() {
+
+            @Override
+            public Observable<?> call(Observable<? extends Throwable> t) {
+
+                return t.flatMap(new Func1<Throwable, Observable<?>>() {
+                    private int count = 0;
+
+                    @Override
+                    public Observable<?> call(Throwable t) {
+                        if (++count <= mbuilder.getMaxRetryCount()) {
 //							Logger.d("请求重试"+count+":"+t.getMessage());
-							Observable<?> ob=	Observable.timer(mbuilder.getRetryTimeout(), TimeUnit.MILLISECONDS);
-							return ob;
-						}
-		
-						return Observable.error(t);
-					}
-				});
-			}
-		}).map(new Func1<T, T>() {
-
-			@Override
-			public T call(T t) {
-				return (T) t;
-			}
-		}).subscribeOn(RxJavaUtils.getScheduler("newThread"))
-				.observeOn(AndroidSchedulers.mainThread())
-				.subscribe(s);
-	}
-
-
-	public SSLSocketFactory createSSLSocketFactory() {
-		SSLSocketFactory ssfFactory = null;
-		try {
-			SSLContext sc = SSLContext.getInstance("TLS");
-			sc.init(null,  new TrustManager[] { new TrustAllCerts() }, new SecureRandom());
-			ssfFactory = sc.getSocketFactory();
-		} catch (Exception e) {
-		}
-		return ssfFactory;
-	}
+                            Observable<?> ob = Observable.timer(mbuilder.getRetryTimeout(), TimeUnit.MILLISECONDS);
+                            return ob;
+                        }
+
+                        return Observable.error(t);
+                    }
+                });
+            }
+        }).map(new Func1<T, T>() {
+
+            @Override
+            public T call(T t) {
+                return (T) t;
+            }
+        }).subscribeOn(RxJavaUtils.getScheduler("newThread"))
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(s);
+    }
+
+
+    public SSLSocketFactory createSSLSocketFactory() {
+        SSLSocketFactory ssfFactory = null;
+        try {
+            SSLContext sc = SSLContext.getInstance("TLS");
+            sc.init(null, new TrustManager[]{new TrustAllCerts()}, new SecureRandom());
+            ssfFactory = sc.getSocketFactory();
+        } catch (Exception e) {
+        }
+        return ssfFactory;
+    }
 }

+ 3 - 3
app_modular/applogin/build.gradle

@@ -18,9 +18,9 @@ android {
 }
 
 dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
+    compile fileTree(include: ['*.jar'], dir: 'libs')
     testCompile deps.junit
     compile deps.appcompatV7
-    
-    compile project(":common")
+    compile project(':common')
+    compile project(':network')
 }

+ 16 - 7
app_modular/applogin/src/main/AndroidManifest.xml

@@ -1,18 +1,27 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.modular.login"
-    android:versionCode="111"
-    android:versionName="5.8.9">
+<manifest package="com.modular.login"
+          xmlns:android="http://schemas.android.com/apk/res/android"
+          android:versionCode="111"
+          android:versionName="5.8.9">
+
     <application>
         <!-- 登录模块 -->
         <activity
-            android:name=".LoginActivity"
+            android:name=".activity.LoginActivity"
             android:launchMode="singleTask"
             android:windowSoftInputMode="adjustPan" />
         <!--注册选择-->
-        <activity android:name=".RegisterSelectActivity"></activity>
+        <activity android:name=".activity.RegisterSelectActivity"></activity>
         <!--个人注册-->
         <activity
-            android:name=".PersonalRegActivity"
+            android:name=".activity.PersonalRegActivity"
             android:label="个人注册"></activity>
+
+        <activity
+            android:name=".activity.EnterpriseRegisterActivity"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
+        <activity
+            android:name=".activity.AdminRegisterActivity"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
+        <activity android:name=".activity.EnterpriseCompleteActivity" />
     </application>
 </manifest>

+ 84 - 0
app_modular/applogin/src/main/assets/profession.json

@@ -0,0 +1,84 @@
+{
+  "IT|通信|电子|互联网": [
+    "互联网/电子商务",
+    "计算机软件",
+    "IT服务(系统/数据/维护)",
+    "电子技术/半导体/集成电路",
+    "计算机硬件",
+    "通信/电信/网络设备",
+    "通信/电信运营、增值服务",
+    "网络游戏"
+  ],
+  "金融业": [
+    "基金/证券/期货/投资",
+    "保险",
+    "银行",
+    "信托/担保/拍卖/典当"
+  ],
+  "房地产|建筑业": {
+    "房地产/建筑/建材/工程": [
+      "房地产金融服务类",
+      "房地产工程施工类",
+      "房地产工程货物类"
+    ],
+    "家居/室内设计/装饰装潢": "家居/室内设计/装饰装潢",
+    "物业管理/商业中心": "物业管理/商业中心"
+  },
+  "商业服务": [
+    "专业服务/咨询(财会/法律/人力资源等)",
+    "广告/会展/公关",
+    "中介服务",
+    "检验/认证",
+    "外包服务"
+  ],
+  "贸易|批发|零售|租赁业": [
+    "快速消费品(食品/饮料/烟酒/日化)",
+    "耐用消费品(服饰/纺织/皮革/家具/家电)",
+    "贸易/进出口",
+    "零售/批发",
+    "租赁服务"
+  ],
+  "文体教育|工艺美术": [
+    "教育/培训/院校",
+    "礼品/玩具/工艺美术/收藏品/奢侈品"
+  ],
+  "生产|加工|制造": [
+    "汽车/摩托车",
+    "大型设备/机电设备/重工业",
+    "加工制造(原料加工/模具)",
+    "仪器仪表及工业自动化",
+    "印刷/包装/造纸",
+    "办公用品及设备",
+    "医药/生物工程",
+    "医疗设备/器械",
+    "航空/航天研究与制造"
+  ],
+  "交通|运输|物流|仓储": [
+    "交通/运输",
+    "物流/仓储"
+  ],
+  "服务业": [
+    "医疗/护理/美容/保健/卫生服务",
+    "酒店/餐饮",
+    "旅游/度假"
+  ],
+  "文化|传媒|娱乐|体育": [
+    "媒体/出版/影视/文化传播",
+    "娱乐/体育/休闲"
+  ],
+  "能源|矿产|环保": [
+    "能源/矿产/采掘/冶炼",
+    "石油/石化/化工",
+    "电气/电力/水利",
+    "环保"
+  ],
+  "政府|非盈利机构": [
+    "政府/公共事业/非盈利机构",
+    "学术/科研"
+  ],
+  "农|林|牧|渔|其他": [
+    "农/林/牧/渔",
+    "跨领域经营",
+    "其他"
+  ]
+}

+ 240 - 0
app_modular/applogin/src/main/java/com/modular/login/activity/AdminRegisterActivity.java

@@ -0,0 +1,240 @@
+package com.modular.login.activity;
+
+import android.content.Intent;
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.text.method.HideReturnsTransformationMethod;
+import android.text.method.PasswordTransformationMethod;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.andreabaccega.widget.FormEditText;
+import com.core.app.Constants;
+import com.core.base.BaseActivity;
+import com.core.net.http.ViewUtil;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.me.network.app.http.HttpClient;
+import com.modular.login.R;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * Created by RaoMeng on 2017/9/21.
+ */
+
+public class AdminRegisterActivity extends BaseActivity implements View.OnClickListener {
+    private final int OBTAIN_VERIFICATION_CODE = 0x01;
+    private final int ADMIN_REGISTER = 0x02;
+    private final int VERIFICATION_TIME_TASK = 0x03;
+
+    private Button mNextStepButton;
+    private FormEditText mAdminNameEt;
+    private FormEditText mAdminPhoneEt;
+    private FormEditText mAdminEmailEt;
+    private FormEditText mAdminVerificationEt;
+    private TextView mAdminObtainCodeTv;
+    private FormEditText mAdminPasswordEt;
+    private ImageView mAdminPasswordVisiableIv;
+    private boolean isPasswordVisiable = false;
+    private String mCheckcodeToken;
+    private HttpClient mHttpClient;
+    private Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            progressDialog.dismiss();
+            String result = null;
+            if (msg.what != VERIFICATION_TIME_TASK) {
+                result = msg.getData().getString("result");
+                Log.d("adminresponse", result);
+            }
+            switch (msg.what) {
+                case OBTAIN_VERIFICATION_CODE:
+                    if (result != null) {
+                        try {
+                            JSONObject resultObject = new JSONObject(result);
+                            if (resultObject.optBoolean("success")) {
+                                JSONObject contentObject = resultObject.optJSONObject("content");
+                                if (contentObject != null) {
+                                    mCheckcodeToken = contentObject.optString("token");
+                                } else {
+                                    progressDialog.dismiss();
+                                    ToastUtil.showToast(AdminRegisterActivity.this
+                                            , "验证码获取失败,请重试");
+                                }
+                            } else {
+                                progressDialog.dismiss();
+                                String errMsg = resultObject.optString("errMsg");
+                                ToastUtil.showToast(AdminRegisterActivity.this
+                                        , TextUtils.isEmpty(errMsg) ? "验证码获取失败,请重试" : errMsg);
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    break;
+                case ADMIN_REGISTER:
+                    progressDialog.dismiss();
+                    if (result != null) {
+                        try {
+                            JSONObject resultObject = new JSONObject(result);
+                            if (resultObject.optBoolean("success")) {
+                                Intent intent = new Intent();
+                                intent.setClass(AdminRegisterActivity.this, EnterpriseCompleteActivity.class);
+                                startActivity(intent);
+                            } else {
+                                String errMsg = resultObject.optString("errMsg");
+                                ToastUtil.showToast(AdminRegisterActivity.this, errMsg);
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    break;
+                case VERIFICATION_TIME_TASK:
+                    if (mFlag > 0) {
+                        mFlag--;
+                        mAdminObtainCodeTv.setEnabled(false);
+                        mAdminObtainCodeTv.setText(mFlag + "秒后重新获取");
+                    } else {
+                        if (mTimer != null)
+                            mTimer.cancel();
+                        mAdminObtainCodeTv.setEnabled(true);
+                        mAdminObtainCodeTv.setText("获取验证码");
+                    }
+                    break;
+                case Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    progressDialog.dismiss();
+                    if (result != null)
+                        ToastMessage(result);
+                    break;
+            }
+        }
+    };
+    private int mFlag;
+    private Timer mTimer;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_admin_register);
+        getSupportActionBar().setTitle("企业注册(2/2)");
+
+        initViews();
+
+        initEvents();
+    }
+
+    private void initViews() {
+        mNextStepButton = (Button) findViewById(R.id.admin_register_next_step_btn);
+        mAdminNameEt = (FormEditText) findViewById(R.id.admin_register_name_et);
+        mAdminPhoneEt = (FormEditText) findViewById(R.id.admin_register_phone_et);
+        mAdminEmailEt = (FormEditText) findViewById(R.id.admin_register_email_et);
+        mAdminVerificationEt = (FormEditText) findViewById(R.id.admin_register_verification_et);
+        mAdminObtainCodeTv = (TextView) findViewById(R.id.admin_register_obtain_code_tv);
+        mAdminPasswordEt = (FormEditText) findViewById(R.id.admin_register_password_et);
+        mAdminPasswordEt.setTypeface(Typeface.DEFAULT);
+        mAdminPasswordEt.setTransformationMethod(new PasswordTransformationMethod());
+        mAdminPasswordVisiableIv = (ImageView) findViewById(R.id.admin_register_password_visiable_iv);
+        mHttpClient = new HttpClient.Builder("https://account.ubtob.com").build();
+    }
+
+    private void initEvents() {
+        mNextStepButton.setOnClickListener(this);
+        mAdminObtainCodeTv.setOnClickListener(this);
+        mAdminPasswordVisiableIv.setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.admin_register_next_step_btn) {
+            FormEditText[] allFields = {mAdminNameEt, mAdminPhoneEt
+                    , mAdminEmailEt, mAdminVerificationEt, mAdminPasswordEt};
+
+            boolean allValid = true;
+            for (FormEditText field : allFields) {
+                allValid = field.testValidity() && allValid;
+            }
+
+            if (allValid) {
+                progressDialog.show();
+
+                String url = "http://192.168.253.66:8082/sso/mobile/userspace/setAdmin";
+
+                Map<String, Object> params = new HashMap<>();
+                params.put("adminName", mAdminNameEt.getText().toString());
+                params.put("adminTel", mAdminPhoneEt.getText().toString());
+                params.put("adminEmail", mAdminEmailEt.getText().toString());
+                params.put("checkcode", mAdminVerificationEt.getText().toString());
+                params.put("checkcodeToken", mCheckcodeToken);
+                params.put("password", mAdminPasswordEt.getText().toString());
+                params.put("pageToken", CommonUtil.getSharedPreferences(ct, "pageToken"));
+                LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+                headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+                ViewUtil.httpSendRequest(this, url, params, mHandler, headers, ADMIN_REGISTER, null, null, "post");
+
+            } else {
+                // EditText are going to appear with an exclamation mark and an explicative message.
+            }
+
+
+        } else if (id == R.id.admin_register_obtain_code_tv) {
+            FormEditText[] allFields = {mAdminPhoneEt, mAdminEmailEt};
+
+            boolean allValid = true;
+            for (FormEditText field : allFields) {
+                allValid = field.testValidity() && allValid;
+            }
+
+            if (allValid) {
+                mFlag = 10;
+                mTimer = new Timer();
+                mTimer.schedule(new TimerTask() {
+                    @Override
+                    public void run() {
+                        Message message = Message.obtain();
+                        message.what = VERIFICATION_TIME_TASK;
+                        mHandler.sendMessage(message);
+                    }
+                }, 0, 1000);
+
+
+                progressDialog.show();
+                String url = "http://192.168.253.66:8082/sso/userspace/checkcode";
+                Map<String, Object> params = new HashMap<>();
+                params.put("tel", mAdminPhoneEt.getText().toString());
+                params.put("email", mAdminEmailEt.getText().toString());
+                params.put("pageToken", CommonUtil.getSharedPreferences(ct, "pageToken"));
+                LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+                headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+                ViewUtil.httpSendRequest(this, url, params, mHandler, headers, OBTAIN_VERIFICATION_CODE, null, null, "get");
+
+            }
+        } else if (id == R.id.admin_register_password_visiable_iv) {
+            isPasswordVisiable = !isPasswordVisiable;
+            if (isPasswordVisiable) {
+                mAdminPasswordVisiableIv.setImageResource(R.drawable.ic_password_visiable);
+                mAdminPasswordEt.setTransformationMethod(new HideReturnsTransformationMethod());
+            } else {
+                mAdminPasswordVisiableIv.setImageResource(R.drawable.ic_password_invisible);
+//                mAdminPasswordEt.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+                mAdminPasswordEt.setTransformationMethod(new PasswordTransformationMethod());
+            }
+            mAdminPasswordEt.setSelection(mAdminPasswordEt.getText().length());
+        }
+    }
+}

+ 36 - 0
app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseCompleteActivity.java

@@ -0,0 +1,36 @@
+package com.modular.login.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+import com.core.base.BaseActivity;
+import com.modular.login.R;
+
+/**
+ * Created by RaoMeng on 2017/9/21.
+ */
+
+public class EnterpriseCompleteActivity extends BaseActivity {
+    private TextView mCompleteTextView;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_enterprise_complete);
+        getSupportActionBar().setTitle("注册完成");
+
+        mCompleteTextView = (TextView) findViewById(R.id.enterprise_complete_login_tv);
+
+        mCompleteTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent();
+                intent.setClass(EnterpriseCompleteActivity.this, LoginActivity.class);
+                startActivity(intent);
+                finish();
+            }
+        });
+    }
+}

+ 537 - 0
app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseRegisterActivity.java

@@ -0,0 +1,537 @@
+package com.modular.login.activity;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.annotation.NonNull;
+import android.text.TextUtils;
+import android.util.Base64;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.andreabaccega.widget.FormEditText;
+import com.common.LogUtil;
+import com.common.data.StringUtil;
+import com.common.system.DisplayUtil;
+import com.common.system.PermissionUtil;
+import com.common.ui.CameraUtil;
+import com.common.ui.ImageUtil;
+import com.core.app.AppConstant;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.net.http.ViewUtil;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
+import com.modular.login.R;
+import com.modular.login.model.ProfessionBean;
+import com.nostra13.universalimageloader.core.ImageLoader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by RaoMeng on 2017/9/21.
+ */
+
+public class EnterpriseRegisterActivity extends BaseActivity implements View.OnClickListener {
+    private final int ENTERPRISE_REGISTER = 0x11;
+
+    private Button mNextStepButton;
+    private FormEditText mEnterpriseCompanyEt;
+    private FormEditText mEnterpriseLicenseEt;
+    private FormEditText mEnterpriseRepresentEt;
+    private FormEditText mEnterpriseAddressEt;
+    private FormEditText mEnterpriseIndustryEt;
+    private FormEditText mEnterpriseBusinessEt;
+    private ImageView mEnterpriseLicenseIv;
+    private ImageView mTakePicImageView;
+    private TextView mEnterpriseClauseTv1;
+    private TextView mEnterpriseClauseTv2;
+    private TextView mEnterpriseClauseTv3;
+    private CheckBox mClauseCheckBox;
+    private PopupWindow mPopupWindow;
+    private Uri mNewPhotoUri;
+    private static final int REQUEST_CODE_CAPTURE_PHOTO = 1;// 拍照
+    private static final int REQUEST_CODE_PICK_PHOTO = 2;// 图库
+    private static final int REQUEST_CODE_CROP_PHOTO = 3;//裁剪
+    private String path = null;
+    private File mLicenseFile;
+    private List<ProfessionBean> mProfessionList;
+
+    private Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            String result = msg.getData().getString("result");
+            Log.d("enterpriseresponse", result);
+            switch (msg.what) {
+                case ENTERPRISE_REGISTER:
+                    progressDialog.dismiss();
+                    if (result != null) {
+                        try {
+                            JSONObject resultObject = new JSONObject(result);
+                            if (resultObject.optBoolean("success")) {
+                                JSONObject contentObject = resultObject.optJSONObject("content");
+                                if (contentObject != null) {
+                                    String pageToken = contentObject.optString("pageToken");
+                                    CommonUtil.setSharedPreferences(ct, "pageToken", pageToken);
+                                }
+                                Intent intent = new Intent();
+                                intent.setClass(EnterpriseRegisterActivity.this, AdminRegisterActivity.class);
+                                startActivity(intent);
+                            } else {
+                                String errMsg = resultObject.optString("errMsg");
+                                ToastUtil.showToast(EnterpriseRegisterActivity.this, errMsg);
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    break;
+                case Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    progressDialog.dismiss();
+                    if (result != null)
+                        ToastMessage(result);
+                    break;
+            }
+        }
+    };
+    private HttpClient mHttpClient;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_enterprise_register);
+        getSupportActionBar().setTitle("企业注册(1/2)");
+
+        initViews();
+//        initProfession();
+
+        mNextStepButton.setOnClickListener(this);
+        mEnterpriseLicenseIv.setOnClickListener(this);
+        mTakePicImageView.setOnClickListener(this);
+        mClauseCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                if (isChecked) {
+                    mNextStepButton.setEnabled(true);
+                } else {
+                    mNextStepButton.setEnabled(false);
+                }
+            }
+        });
+    }
+
+    private void initViews() {
+
+        mNextStepButton = (Button) findViewById(R.id.enterprise_register_next_step_btn);
+        mEnterpriseCompanyEt = (FormEditText) findViewById(R.id.enterprise_register_company_et);
+        mEnterpriseLicenseEt = (FormEditText) findViewById(R.id.enterprise_register_license_et);
+        mEnterpriseRepresentEt = (FormEditText) findViewById(R.id.enterprise_register_represent_et);
+        mEnterpriseAddressEt = (FormEditText) findViewById(R.id.enterprise_register_address_et);
+        mEnterpriseIndustryEt = (FormEditText) findViewById(R.id.enterprise_register_industry_et);
+        mEnterpriseBusinessEt = (FormEditText) findViewById(R.id.enterprise_register_business_et);
+        mEnterpriseLicenseIv = (ImageView) findViewById(R.id.enterprise_register_license_iv);
+        mTakePicImageView = (ImageView) findViewById(R.id.enterprise_register_picture_iv);
+        mEnterpriseClauseTv1 = (TextView) findViewById(R.id.enterprise_register_clause_tv1);
+        mEnterpriseClauseTv2 = (TextView) findViewById(R.id.enterprise_register_clause_tv2);
+        mEnterpriseClauseTv3 = (TextView) findViewById(R.id.enterprise_register_clause_tv3);
+        mClauseCheckBox = (CheckBox) findViewById(R.id.enterprise_register_clause_cb);
+        mProfessionList = new ArrayList<>();
+        mHttpClient = new
+//                HttpClient.Builder("https://account.ubtob.com/sso")
+                HttpClient.Builder("http://192.168.253.66:8082")
+//                HttpClient.Builder("http://192.168.253.200:8080")
+                .build();
+    }
+
+    private void initProfession() {
+        mProfessionList = new ArrayList<>();
+        String profession = CommonUtil.getAssetsJson(this, "profession.json");
+        try {
+            JSONObject professionObject = new JSONObject(profession);
+            Iterator<String> iterator = professionObject.keys();
+            while (iterator.hasNext()) {
+                ProfessionBean professionBean = new ProfessionBean();
+                String professionFirstTitle = iterator.next().toString();
+                professionBean.setProfessionFirstTitle(professionFirstTitle);
+
+                List<ProfessionBean.ProfessionSecondBean> professionSecondList = new ArrayList<>();
+
+                Object second = professionObject.opt(professionFirstTitle);
+                if (second instanceof JSONArray) {
+                    JSONArray secondArray = (JSONArray) second;
+                    if (secondArray != null) {
+                        for (int i = 0; i < secondArray.length(); i++) {
+                            ProfessionBean.ProfessionSecondBean professionSecond = new ProfessionBean.ProfessionSecondBean();
+                            String secondTitle = secondArray.optString(i);
+                            professionSecond.setProfessionSecondTitle(secondTitle);
+
+                            professionSecondList.add(professionSecond);
+                        }
+                    }
+                } else if (second instanceof JSONObject) {
+                    JSONObject secondObject = (JSONObject) second;
+                    Iterator<String> secondKeys = secondObject.keys();
+                    while (secondKeys.hasNext()) {
+                        ProfessionBean.ProfessionSecondBean professionSecond = new ProfessionBean.ProfessionSecondBean();
+                        String secondTitle = secondKeys.next().toString();
+                        professionSecond.setProfessionSecondTitle(secondTitle);
+
+                        List<String> thirdTitles = new ArrayList<>();
+                        Object third = secondObject.opt(secondTitle);
+                        if (third instanceof String) {
+                            thirdTitles.add((String) third);
+                        } else if (third instanceof JSONArray) {
+                            JSONArray thirdArray = (JSONArray) third;
+                            for (int i = 0; i < thirdArray.length(); i++) {
+                                String thirdTitle = thirdArray.optString(i);
+                                thirdTitles.add(thirdTitle);
+                            }
+                        }
+
+                        professionSecond.setProfessionThirdTitles(thirdTitles);
+
+                        professionSecondList.add(professionSecond);
+                    }
+                }
+
+                professionBean.setProfessionSecondTitles(professionSecondList);
+
+                mProfessionList.add(professionBean);
+            }
+            Log.d("professionList", mProfessionList.toString());
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        int i = v.getId();
+        if (i == R.id.enterprise_register_next_step_btn) {
+
+            if (mClauseCheckBox.isChecked()) {
+                FormEditText[] allFields = {mEnterpriseAddressEt, mEnterpriseRepresentEt
+                        , mEnterpriseCompanyEt, mEnterpriseLicenseEt};
+
+                boolean allValid = true;
+                for (FormEditText field : allFields) {
+                    allValid = field.testValidity() && allValid;
+                }
+
+                if (allValid) {
+                    if (mLicenseFile == null) {
+                        ToastUtil.showToast(this, "请选择您的营业执照");
+                    } else {
+                        progressDialog.show();
+                        obtainPageToken();
+                    }
+                } else {
+                    // EditText are going to appear with an exclamation mark and an explicative message.
+                }
+            } else {
+                ToastUtil.showToast(this, "请阅读并同意必读协议");
+            }
+        } else if (i == R.id.enterprise_register_license_iv) {
+            if (mLicenseFile != null) {
+                try {
+                    Intent intent = new Intent();
+                    intent.setAction("com.modular.tool.SingleImagePreviewActivity");
+                    intent.putExtra(AppConstant.EXTRA_IMAGE_URI, mLicenseFile.getCanonicalPath());
+                    startActivity(intent);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        } else if (i == R.id.enterprise_register_picture_iv) {
+            CommonUtil.closeKeybord(mEnterpriseCompanyEt, this);
+            showPicturePopup();
+        }
+    }
+
+    private void obtainPageToken() {
+        mHttpClient.Api().send(new HttpClient.Builder()
+                .url("/sso/mobile/userspace/register")
+//                .header("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"))
+                .method(Method.GET).build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object s) {
+                if (s != null) {
+                    try {
+                        JSONObject resultObject = new JSONObject(s.toString());
+                        if (resultObject.optBoolean("success")) {
+                            JSONObject contentObject = resultObject.optJSONObject("content");
+                            if (contentObject != null) {
+                                String pageToken = contentObject.optString("pageToken");
+                                String sessionId = contentObject.optString("sessionId");
+                                CommonUtil.setSharedPreferences(ct, "sessionId", sessionId);
+                                CommonUtil.setSharedPreferences(ct, "pageToken", pageToken);
+
+//                                Intent intent = new Intent();
+//                                intent.setClass(EnterpriseRegisterActivity.this, AdminRegisterActivity.class);
+//                                startActivity(intent);
+
+                                enterpriseRegister(pageToken, sessionId);
+                            } else {
+                                progressDialog.dismiss();
+                                ToastUtil.showToast(EnterpriseRegisterActivity.this
+                                        , "注册失败,请重试");
+                            }
+                        } else {
+                            progressDialog.dismiss();
+                            String errMsg = resultObject.optString("errMsg");
+                            ToastUtil.showToast(EnterpriseRegisterActivity.this
+                                    , TextUtils.isEmpty(errMsg) ? "注册失败,请重试" : errMsg);
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }));
+
+    }
+
+    private void enterpriseRegister(String pageToken, String sessionId) {
+
+        String url = "http://192.168.253.66:8082/sso/mobile/userspace/register";
+
+        String fileBytes = getFileBytes(mLicenseFile);
+        Map<String, Object> params = new HashMap<>();
+        params.put("name", mEnterpriseCompanyEt.getText().toString());
+        params.put("businessCode", mEnterpriseLicenseEt.getText().toString());
+        params.put("corporation", mEnterpriseRepresentEt.getText().toString());
+        params.put("address", mEnterpriseAddressEt.getText().toString());
+        params.put("pageToken", pageToken);
+        if (!TextUtils.isEmpty(mEnterpriseIndustryEt.getText())) {
+            params.put("profession", mEnterpriseIndustryEt.getText().toString());
+        }
+        if (!TextUtils.isEmpty(mEnterpriseBusinessEt.getText())) {
+            params.put("tags", mEnterpriseBusinessEt.getText().toString());
+        }
+        params.put("businessImage", fileBytes);
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + sessionId);
+        ViewUtil.httpSendRequest(this, url, params, mHandler, headers, ENTERPRISE_REGISTER, null, null, "post");
+
+//        String fileBytes = getFileBytes(mLicenseFile);
+//
+//        String url = "http://192.168.253.192:8080/account/api/file";
+//        Map<String, Object> params = new HashMap<>();
+//        params.put("data", fileBytes);
+//        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+//        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+//        ViewUtil.httpSendRequest(this, url, params, mHandler, headers, 111, null, null, "post");
+    }
+
+    private String getFileBytes(File licenseFile) {
+        String fileBytes = "";
+        FileInputStream inputStream = null;
+        ByteArrayOutputStream bos = null;
+        try {
+            inputStream = new FileInputStream(licenseFile);
+            bos = new ByteArrayOutputStream();
+            byte[] b = new byte[1024];
+            int len = -1;
+            while ((len = inputStream.read(b)) != -1) {
+                bos.write(b, 0, len);
+            }
+            byte[] bytes = bos.toByteArray();
+//            fileBytes = new String(bytes, "UTF-8");
+            fileBytes = Base64.encodeToString(bytes, Base64.NO_WRAP);
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+            return "";
+        } catch (IOException e) {
+            e.printStackTrace();
+            return "";
+        } finally {
+            try {
+                if (inputStream != null)
+                    inputStream.close();
+                if (bos != null)
+                    bos.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return fileBytes;
+    }
+
+    private void showPicturePopup() {
+        View headSelectView = View.inflate(this, R.layout.layout_select_head, null);
+
+        mPopupWindow = new PopupWindow(headSelectView,
+                LinearLayout.LayoutParams.MATCH_PARENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT);
+        mPopupWindow.setAnimationStyle(R.style.MenuAnimationFade);
+        mPopupWindow.setFocusable(true);
+        mPopupWindow.setOutsideTouchable(true);
+        DisplayUtil.backgroundAlpha(this, 0.5f);
+        mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closePopupWindow();
+            }
+        });
+        mPopupWindow.showAtLocation(View.inflate(this, R.layout.activity_base_info, null), Gravity.BOTTOM, 0, 0);
+        TextView takePicTv = (TextView) headSelectView.findViewById(R.id.head_take_picture);
+        TextView selectPicTv = (TextView) headSelectView.findViewById(R.id.head_select_photos);
+        TextView cancelTv = (TextView) headSelectView.findViewById(R.id.head_cancel);
+
+        takePicTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String[] permissions = new String[]{Manifest.permission.CAMERA};
+                if (PermissionUtil.lacksPermissions(ct, permissions)) {
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                        requestPermissions(permissions, PermissionUtil.DEFAULT_REQUEST);
+                    }
+                } else {
+                    mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
+                    CameraUtil.captureImage(EnterpriseRegisterActivity.this, mNewPhotoUri, REQUEST_CODE_CAPTURE_PHOTO);
+                    closePopupWindow();
+                }
+
+            }
+        });
+
+        selectPicTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                /*boolean is = CommonUtil.getSharedPreferencesBoolean(ct, "isImage", false);
+                if (!is) {
+                    Crouton.makeText(ct, "您当前未被允许使用相册,请使用拍照");
+                    return;
+                }*/
+                String[] permissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE};
+                if (PermissionUtil.lacksPermissions(ct, permissions)) {
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                        requestPermissions(permissions, 111);
+                    }
+                } else {
+                    mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
+                    CameraUtil.pickImageSimple(EnterpriseRegisterActivity.this, REQUEST_CODE_PICK_PHOTO);
+                    closePopupWindow();
+                }
+            }
+        });
+        cancelTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closePopupWindow();
+            }
+        });
+
+    }
+
+    private void closePopupWindow() {
+        if (mPopupWindow != null) {
+            mPopupWindow.dismiss();
+            mPopupWindow = null;
+            DisplayUtil.backgroundAlpha(this, 1f);
+        }
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        if (requestCode == PermissionUtil.DEFAULT_REQUEST) {
+            if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
+                LogUtil.i("没有获取到权限");
+            } else {
+                mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
+                CameraUtil.captureImage(EnterpriseRegisterActivity.this, mNewPhotoUri, REQUEST_CODE_CAPTURE_PHOTO);
+                closePopupWindow();
+            }
+        } else if (requestCode == 111) {
+            if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
+                LogUtil.i("没有获取到权限");
+            } else {
+                mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
+                CameraUtil.pickImageSimple(EnterpriseRegisterActivity.this, REQUEST_CODE_PICK_PHOTO);
+                closePopupWindow();
+            }
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (requestCode == REQUEST_CODE_CAPTURE_PHOTO) {// 拍照返回
+            if (resultCode == Activity.RESULT_OK) {
+                if (mNewPhotoUri != null) {
+                    path = mNewPhotoUri.getPath();
+//                    path = CameraUtil.getImagePathFromUri(ct, mNewPhotoUri);
+                    if (StringUtil.isEmpty(path)) return;
+
+                    mLicenseFile = ImageUtil.compressBitmapToFile(path, 100, 300, 300);
+                    if (StringUtil.isEmpty(path)) return;
+                    ImageLoader.getInstance().displayImage(Uri.fromFile(mLicenseFile).toString(), mEnterpriseLicenseIv);
+
+                } else {
+                    ToastUtil.showToast(this, R.string.c_take_picture_failed);
+                }
+            }
+        }
+        /*else if (requestCode == REQUEST_CODE_PICK_PHOTO) {// 选择一张图片,然后立即调用裁减
+            if (resultCode == Activity.RESULT_OK) {
+                if (data != null && data.getData() != null) {
+                    String path = CameraUtil.getImagePathFromUri(this, data.getData());
+                    Uri o = Uri.fromFile(new File(path));
+                    mNewPhotoUri = CameraUtil.getOutputMediaFileUri(this, CameraUtil.MEDIA_TYPE_IMAGE);
+                    mCurrentFile = new File(mNewPhotoUri.getPath());
+                    CameraUtil.cropImage(this, o, mNewPhotoUri, REQUEST_CODE_CROP_PHOTO, 1, 1, 300, 300);
+                } else {
+                    ToastUtil.showToast(this, R.string.c_photo_album_failed);
+                }
+            }
+        }*/
+        else if (requestCode == REQUEST_CODE_PICK_PHOTO) {
+            if (resultCode == Activity.RESULT_OK) {
+                if (data != null && data.getData() != null) {
+                    path = CameraUtil.getImagePathFromUri(ct, data.getData());
+                    LogUtil.i("path=" + path);
+                    if (StringUtil.isEmpty(path)) return;
+
+                    mLicenseFile = ImageUtil.compressBitmapToFile(path, 100, 300, 300);
+                    if (StringUtil.isEmpty(path)) return;
+                    ImageLoader.getInstance().displayImage(Uri.fromFile(mLicenseFile).toString(), mEnterpriseLicenseIv);
+                } else {
+                    ToastUtil.showToast(this, R.string.c_photo_album_failed);
+                }
+            }
+        }
+    }
+}

+ 3 - 1
app_modular/applogin/src/main/java/com/modular/login/LoginActivity.java → app_modular/applogin/src/main/java/com/modular/login/activity/LoginActivity.java

@@ -1,4 +1,4 @@
-package com.modular.login;
+package com.modular.login.activity;
 
 import android.Manifest;
 import android.app.ProgressDialog;
@@ -33,6 +33,8 @@ import com.core.utils.IntentUtils;
 import com.core.utils.ToastUtil;
 import com.core.utils.helper.AvatarHelper;
 import com.core.utils.helper.LoginHelper;
+import com.modular.login.R;
+import com.modular.login.activity.RegisterSelectActivity;
 
 import java.util.HashMap;
 

+ 2 - 1
app_modular/applogin/src/main/java/com/modular/login/PersonalRegActivity.java → app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java

@@ -1,4 +1,4 @@
-package com.modular.login;
+package com.modular.login.activity;
 
 import android.os.Bundle;
 import android.os.Handler;
@@ -19,6 +19,7 @@ import com.core.base.BaseActivity;
 import com.core.net.http.ViewUtil;
 import com.core.net.utils.NetUtils;
 import com.core.utils.CommonUtil;
+import com.modular.login.R;
 
 import java.util.HashMap;
 import java.util.LinkedHashMap;

+ 9 - 7
app_modular/applogin/src/main/java/com/modular/login/RegisterSelectActivity.java → app_modular/applogin/src/main/java/com/modular/login/activity/RegisterSelectActivity.java

@@ -1,17 +1,17 @@
-package com.modular.login;
+package com.modular.login.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 
 import com.core.base.BaseActivity;
-import com.core.utils.IntentUtils;
+import com.modular.login.R;
 
 import de.hdodenhof.circleimageview.CircleImageView;
 
 public class RegisterSelectActivity extends BaseActivity implements View.OnClickListener {
     private CircleImageView ivHead;
-    
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -29,15 +29,17 @@ public class RegisterSelectActivity extends BaseActivity implements View.OnClick
         findViewById(R.id.company_btn).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                IntentUtils.webLinks(mContext,
-                        "https://account.ubtob.com/sso/register",
-                        "企业注册");
+//                IntentUtils.webLinks(mContext,
+//                        "https://account.ubtob.com/sso/register",
+//                        "企业注册");
+                startActivity(new Intent(mContext, EnterpriseRegisterActivity.class));
+                finish();
             }
         });
     }
 
     @Override
     public void onClick(View v) {
-        
+
     }
 }

+ 65 - 0
app_modular/applogin/src/main/java/com/modular/login/model/ProfessionBean.java

@@ -0,0 +1,65 @@
+package com.modular.login.model;
+
+import java.util.List;
+
+/**
+ * Created by RaoMeng on 2017/9/23.
+ */
+
+public class ProfessionBean {
+    private String mProfessionFirstTitle;
+    private List<ProfessionSecondBean> mProfessionSecondTitles;
+
+    public String getProfessionFirstTitle() {
+        return mProfessionFirstTitle;
+    }
+
+    public void setProfessionFirstTitle(String professionFirstTitle) {
+        mProfessionFirstTitle = professionFirstTitle;
+    }
+
+    public List<ProfessionSecondBean> getProfessionSecondTitles() {
+        return mProfessionSecondTitles;
+    }
+
+    public void setProfessionSecondTitles(List<ProfessionSecondBean> professionSecondTitles) {
+        mProfessionSecondTitles = professionSecondTitles;
+    }
+
+    public static class ProfessionSecondBean {
+        private String mProfessionSecondTitle;
+        private List<String> mProfessionThirdTitles;
+
+        public String getProfessionSecondTitle() {
+            return mProfessionSecondTitle;
+        }
+
+        public void setProfessionSecondTitle(String professionSecondTitle) {
+            mProfessionSecondTitle = professionSecondTitle;
+        }
+
+        public List<String> getProfessionThirdTitles() {
+            return mProfessionThirdTitles;
+        }
+
+        public void setProfessionThirdTitles(List<String> professionThirdTitles) {
+            mProfessionThirdTitles = professionThirdTitles;
+        }
+
+        @Override
+        public String toString() {
+            return "ProfessionSecondBean{" +
+                    "mProfessionSecondTitle='" + mProfessionSecondTitle + '\'' +
+                    ", mProfessionThirdTitles=" + mProfessionThirdTitles +
+                    '}';
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "ProfessionBean{" +
+                "mProfessionFirstTitle='" + mProfessionFirstTitle + '\'' +
+                ", mProfessionSecondTitles=" + mProfessionSecondTitles +
+                '}';
+    }
+}

BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_admin_password.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_business_license.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_business_scope.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_circle_check.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_circle_uncheck.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_company_name.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_drop_down.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_password_invisible.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_password_visiable.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_address.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_camera.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_defaultpic.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_email.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_name.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_notice.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_reg_phone.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_regex_correct.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_trade_certify.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_b2b.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_mall.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_trademark_uu.png


BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_verification_code.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_admin_password.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_business_license.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_business_scope.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_circle_check.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_circle_uncheck.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_company_name.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_drop_down.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_password_invisible.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_password_visiable.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_address.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_camera.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_defaultpic.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_email.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_name.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_notice.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_reg_phone.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_regex_correct.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_trade_certify.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_b2b.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_mall.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_trademark_uu.png


BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_verification_code.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_admin_password.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_business_license.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_business_scope.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_circle_check.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_circle_uncheck.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_company_name.png


BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_drop_down.png


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików