Browse Source

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature

# Conflicts:
#	WeiChat/version.properties
Arison 6 years ago
parent
commit
db5286d3ea

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

@@ -342,6 +342,21 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         ViewUtil.httpSendRequest(ct, url, params, mUserCheckHander, headers, 0x12312, message, null, "get");
+
+//       new Thread(()->{
+//           while (true){
+//               try {
+//                   Thread.sleep(1000);
+//               } catch (InterruptedException e) {
+//                   e.printStackTrace();
+//               }
+//               LogUtil.d(TAG,"执行一次网络请求..."+DateFormatUtil.getStrDate4Date(new Date(),DateFormatUtil.YMD_HMS));
+//               ViewUtil.AutoLoginErp(this);
+//    
+//               com.core.utils.CommonUtil.displayBriefMemory();
+//           }
+//       }).start();
+
     }
 
     private void delay() {
@@ -665,19 +680,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
             }
         });
 
-
-        //查询数据库,取出中文名:
-//        DBManager  dbManager = new DBManager(ct);
-//        List<EmployeesEntity> db = dbManager.select_getEmployee(
-//                new String[]{CommonUtil.getSharedPreferences(ct, "erp_master"),
-//                        CommonUtil.getSharedPreferences(ct, "erp_username")}
-//                , "whichsys=? and em_code=? ");
-//        if (!ListUtils.isEmpty(db)){
-//            if (!StringUtil.isEmpty(db.get(0).getEM_NAME())){
-//                CommonUtil.setSharedPreferences(ct,"erp_emname",db.get(0).getEM_NAME());
-//            }
-//        }
-//        dbManager.closeDB();
+        
         doHiTask();
         autoPresenter = AutoPresenter.onCreate();
         SchedulePresenter.getInstance().startSchedule();
@@ -689,23 +692,11 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
         com.baidu.aip.excep.utils.FaceConfig.initFace(ct);
         Login();
         
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                testOOM();
-                 
-            }
-        }).start();
-    }
-    
-    public String testOOM(){
-        StringBuilder stringBuilder=new StringBuilder("");
-        for (int i=0;i<1;i++){
-            stringBuilder.append(""+i+testOOM());
-        }
+          
         
-        return stringBuilder.toString();
     }
+    
+ 
 
     private AutoPresenter autoPresenter;
     private Handler handler = new Handler();

+ 5 - 5
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Sun May 19 20:15:08 CST 2019
-debugName=972
-versionName=679
-debugCode=972
-versionCode=234
+#Mon May 27 17:26:29 CST 2019
+debugName=994
+versionName=680
+debugCode=994
+versionCode=235

+ 6 - 5
app_core/common/src/main/java/com/core/app/MyApplication.java

@@ -1,7 +1,6 @@
 package com.core.app;
 
 import android.app.Activity;
-import android.app.Application;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.os.Build;
@@ -49,6 +48,7 @@ import org.apache.http.cookie.Cookie;
 
 import java.io.File;
 
+
 /**
  * Created by Arison on 2017/8/25.
  */
@@ -96,16 +96,17 @@ public class MyApplication extends BaseApplication {
      * 提供网络全局监听
      ************************/
     private NetWorkObservable mNetWorkObservable;
-
+    private final static int CWJ_HEAP_SIZE = 6* 1024* 1024 ;
+    
+    
 
     @Override
     public void initConfig() throws Exception {
         //后台服务初始化application
         InitializeService.initApplication(this);
-
-//        LeakCanary.install(this);
-
         INSTANCE = this;
+        
+        
         mRequestQueue = Volley.newRequestQueue(this);
         mHttpUtils = new HttpUtils();
         configHttpUtils();

+ 8 - 2
app_core/common/src/main/java/com/core/net/http/HttpUtil.java

@@ -89,7 +89,7 @@ public class HttpUtil {
             response = httpClient.execute(httpGet);
             return Response.getResponse(response);
         } finally {
-
+            httpClient.getConnectionManager().shutdown();
         }
     }
 
@@ -136,6 +136,8 @@ public class HttpUtil {
             response = httpClient.execute(httpPost);
             return Response.getResponse(response);
         } finally {
+            // 关闭连接,释放资源
+            httpClient.getConnectionManager().shutdown();
         }
     }
 
@@ -181,7 +183,11 @@ public class HttpUtil {
             response = httpClient.execute(httpPost);
             return Response.getResponse(response);
         } finally {
-
+            // 关闭连接,释放资源
+            httpClient.getConnectionManager().shutdown();
+            /*if (httpClient!=null){
+                httpClient.getConnectionManager().shutdown();
+            }*/
         }
     }
 

+ 10 - 6
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -3,6 +3,7 @@ package com.core.utils;
 import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.app.Activity;
+import android.app.ActivityManager;
 import android.app.Dialog;
 import android.content.Context;
 import android.content.Intent;
@@ -100,18 +101,21 @@ public class CommonUtil {
 
     private final static String AppShareName = "setting";
     public static int counter = 0;
+    
+    public   static void displayBriefMemory(){
+        ActivityManager manager = (ActivityManager)MyApplication.getInstance().getSystemService(Context.ACTIVITY_SERVICE);
+        int heapSize = manager.getMemoryClass();
+        int maxHeapSize = manager.getLargeMemoryClass(); 
+        
+        LogUtil.d(TAG, "heapSize:"+heapSize+" maxHeapSize:"+maxHeapSize);
+        
+    }
 
     public static String getAppBaseUrl(Context ct) {
         if (ct == null) {
             ct = MyApplication.getInstance();
         }
         String baseUrl = getSharedPreferences(ct, "erp_baseurl");
-//        if (BaseConfig.isDebug()){
-//            baseUrl="http://192.168.253.243:8080/ERP/";
-//        }
-//        baseUrl = "http://192.168.253.12/APP/";
-//        baseUrl = "http://192.168.253.52:8080/ERP/";
-//        baseUrl = "http://192.168.253.63:8080/ERP/";
         return baseUrl;
     }
 

+ 4 - 4
app_modular/apputils/src/main/java/com/modular/apputils/presenter/BillPresenter.java

@@ -208,10 +208,10 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
 //        String otherGridStoreListStr = JSONUtil.map2JSON(otherGridStoreList);
         String formStoreStr = JSON.toJSONString(formStore);
         String otherGridStoreListStr = JSON.toJSONString(otherGridStoreList);
-//        LogUtil.prinlnLongMsg("billJson", formStoreStr);
-//        LogUtil.prinlnLongMsg("billJson", otherGridStoreListStr);
-//        LogUtil.prinlnLongMsg("billJson2", formStoreStr);
-//        LogUtil.prinlnLongMsg("billJson2", otherGridStoreListStr);
+        LogUtil.prinlnLongMsg("billJson", formStoreStr);
+        LogUtil.prinlnLongMsg("billJson", otherGridStoreListStr);
+        LogUtil.prinlnLongMsg("billJson", mCaller);
+        LogUtil.prinlnLongMsg("billJson",String.valueOf(mId));
 
         try {
             requestCompanyHttp(new Parameter.Builder()