浏览代码

处理登录bug问题,dex方法数超载解决;商务消息完成;

Arisono 9 年之前
父节点
当前提交
58e22c456c

+ 21 - 1
WeiChat/build.gradle

@@ -1,4 +1,5 @@
 apply plugin: 'com.android.application'
+apply plugin: 'com.getkeepsafe.dexcount'
 
 android {
     signingConfigs {
@@ -36,10 +37,29 @@ android {
     }
 }
 
+buildscript {
+    repositories {
+        mavenCentral() // or jcenter()
+    }
+
+    dependencies {
+        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.5.5'
+    }
+}
 
+dexcount {
+    format = "json"
+    includeClasses = false
+    includeFieldCount = true
+    includeTotalMethodCount = false
+    orderByMethodCount = false
+    verbose = false
+    maxTreeDepth = Integer.MAX_VALUE
+    teamCityIntegration = false
+    enableForInstantRun = false
+}
 
 dependencies {
-
     compile project(':pullToRefershLibraryMy')
     compile project(':materialdialogs')
     compile project(':MPAndroidChart')

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

@@ -214,6 +214,7 @@ public class ViewUtil {
     }
 
 
+    @Deprecated
     public static void startNetThread(final String url,
                                       final Map<String, String> params, final Handler handler,
                                       final int what, final Message message, final Bundle bundle,
@@ -354,6 +355,7 @@ public class ViewUtil {
                     break;
                 case Constants.SUCCESS_ERP://切换公司成功
                     String result = msg.getData().getString("result");
+                    Log.i("Arison", "" + result);
                     boolean success = JSON.parseObject(result).getBoolean("success");
                     if (success) {
                         Intent intent = new Intent("com.app.home.update");
@@ -374,6 +376,9 @@ public class ViewUtil {
                     }
                     ToastMessage(MyApplication.getInstance(), "服务器拒绝访问!");
                     break;
+                case Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    ToastMessage(MyApplication.getInstance(), "服务器拒绝此账套登录!");
+                    break;
                 default:
                     break;
             }
@@ -800,11 +805,12 @@ public class ViewUtil {
         String master = CommonUtil.getSharedPreferences(ct, "erp_master");
         String phone = CommonUtil.getSharedPreferences(ct, "user_phone");
         String password = CommonUtil.getSharedPreferences(ct, "user_password");
-        Map<String, String> params = new HashMap<String, String>();
+        Map<String, Object> params = new HashMap<String, Object>();
         params.put("username", phone);
         params.put("password", password);
         params.put("master", master);
-        startNetThread(url, params, handler, what, null, null, "post");
+        httpSendRequest(ct, url, params, handler, null, what, null, null, "post");
+        //startNetThread(url, params, handler, what, null, null, "post");
     }
 
     // 登录ERP
@@ -812,12 +818,12 @@ public class ViewUtil {
                                     String password) {
         mdProcessDialog.setContent("正在验证ERP...");
         url = url + "mobile/login.action";
-        Map<String, String> params = new HashMap<String, String>();
+        Map<String, Object> params = new HashMap<String, Object>();
         params.put("username", username);
         params.put("password", password);
         params.put("master", master);
-        startNetThread(url, params, handler, Constants.SUCCESS_ERP, null, null,
-                "post");
+
+        httpSendRequest(ct, url, params, handler, null, Constants.SUCCESS_ERP, null, null, "post");
     }
 
 

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

@@ -680,7 +680,7 @@ public class MessageFragment extends EasyFragment {
         DBManager db = new DBManager(getActivity());
         String master = CommonUtil.getSharedPreferences(getActivity(), "erp_master");
         Log.i("Arison", "" + master);
-
+        if (StringUtils.isEmpty(master)) return;
         List<B2BMsg> bMsgs = db.queryB2bList(new String[]{"0", master}, " b2b_hasRead=? and b2b_master=? ");
         Log.i("B2B", "" + JSON.toJSONString(bMsgs));
         if (!ListUtils.isEmpty(bMsgs)) {

+ 4 - 0
build.gradle

@@ -6,9 +6,13 @@ buildscript {
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:2.1.0'
+
     }
 }
 
+
+
+
 allprojects {
     repositories {
         jcenter()