Browse Source

优化人员数据

Shangyp 4 months ago
parent
commit
a57237abfe

+ 1 - 1
app/build.gradle

@@ -89,7 +89,7 @@ android {
     def appName = "HHLocal"
     applicationVariants.all { variant ->
         variant.outputs.all {
-            outputFileName = "${appName}_${defaultConfig.versionName}_${"V2"}.apk"
+            outputFileName = "${appName}_${defaultConfig.versionName}_${"ScenicCommon"}.apk"
         }
     }
 

File diff suppressed because it is too large
+ 4 - 0
app/src/main/assets/test.json


+ 3 - 1
app/src/main/java/com/hanghui/senic/activity/setup/PersonnelDataActivity.java

@@ -275,7 +275,9 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                     if (list.size() == 0){
                         addList(page);
                     }
-                    personnelDataAdapter.notifyDataSetChanged();
+                    if (personnelDataAdapter != null ){
+                        personnelDataAdapter.notifyDataSetChanged();
+                    }
                 }
             });
         }

+ 13 - 3
app/src/main/java/com/hanghui/senic/activity/setup/ResultConfigurationActivity.java

@@ -111,6 +111,16 @@ public class ResultConfigurationActivity extends BaseActivity implements View.On
             openORClosingTimeSignal = dataDTO.getSignalInterval();
             openORClosingTimeInterval = dataDTO.getOpenCloseInterval();
             doorSerialPort = dataDTO.getDoorSerialPort();
+            if (openORClosingTimeInterval >= 1000){
+                openORClosingTimeInterval = openORClosingTimeInterval/1000;
+            } else {
+                openORClosingTimeInterval = 1;
+            }
+            if (openORClosingTimeSignal >= 1000){
+                openORClosingTimeSignal = openORClosingTimeSignal/1000;
+            } else {
+                openORClosingTimeInterval = 1;
+            }
         }
 
         initFind();
@@ -263,7 +273,7 @@ public class ResultConfigurationActivity extends BaseActivity implements View.On
             @Override  //当滑块进度改变时,会执行该方法下的代码
             public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
                 openORClosingTimeInterval = i;
-                resultConfigurationActivity_ResultConfigurationActivity_OpenORClosingTimeIntervalText.setText(i);
+                resultConfigurationActivity_ResultConfigurationActivity_OpenORClosingTimeIntervalText.setText(String.valueOf(i));
             }
 
             @Override  //当开始滑动滑块时,会执行该方法下的代码
@@ -437,8 +447,8 @@ public class ResultConfigurationActivity extends BaseActivity implements View.On
         ConfigManager.getAuthenticationBean().getData().get(0).setRightTopBarText(rightTopBarText);
         ConfigManager.getAuthenticationBean().getData().get(0).setRelayOpenModel(relayOpenModel);
         ConfigManager.getAuthenticationBean().getData().get(0).setGateTimeOut(openDoorMagnetClosingTimeOut);
-        ConfigManager.getAuthenticationBean().getData().get(0).setSignalInterval(openORClosingTimeSignal);
-        ConfigManager.getAuthenticationBean().getData().get(0).setOpenCloseInterval(openORClosingTimeInterval);
+        ConfigManager.getAuthenticationBean().getData().get(0).setSignalInterval(openORClosingTimeSignal * 1000);
+        ConfigManager.getAuthenticationBean().getData().get(0).setOpenCloseInterval(openORClosingTimeInterval * 1000);
         ConfigManager.getAuthenticationBean().getData().get(0).setDoorSerialPort(doorSerialPort);
     }
 

+ 4 - 2
app/src/main/java/com/hanghui/senic/baiduface/BaiduFaceMainActivity.java

@@ -481,17 +481,19 @@ public class BaiduFaceMainActivity extends BaseActivity {
      * 更新网络类型 iv_networkType
      */
     private void updateNetworkTypeView() {
-        if (NetWorkUtils.getNetworkType() != -1){
+        if (NetWorkUtils.getNetworkType() != 0){
             ViewGroup.LayoutParams layoutParams = iv_networkType.getLayoutParams();
             layoutParams.width = (int) getResources().getDimension(R.dimen.dp_32);
             layoutParams.height =  (int) getResources().getDimension(R.dimen.dp_32);
-            iv_networkType.setImageResource(NetWorkUtils.getNetworkType());
+            ImageLoaderUtils.loadImage(NetWorkUtils.getNetworkType(),iv_networkType);
         } else {//无网络
             ViewGroup.LayoutParams layoutParams = iv_networkType.getLayoutParams();
             layoutParams.width = (int) getResources().getDimension(R.dimen.dp_72);
             layoutParams.height =  (int) getResources().getDimension(R.dimen.dp_32);
             iv_networkType.setImageResource(R.mipmap.network_icon_no);
+            ImageLoaderUtils.loadImage(R.mipmap.network_icon_no,iv_networkType);
         }
+
     }
 
     /**

File diff suppressed because it is too large
+ 23 - 0
app/src/main/java/com/hanghui/senic/baiduface/BaiduFacePreviewActivity.java


+ 3 - 3
app/src/main/java/com/hanghui/senic/service/usbserialdemo/utile/NetWorkUtils.java

@@ -45,9 +45,9 @@ public class NetWorkUtils {
      */
     public static boolean isNetwork(){
         try {
-            URL url = new URL("https://www.baidu.com");
+            URL url = new URL("http://www.baidu.com");
             HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-            connection.setRequestMethod("HEAD");
+            connection.setRequestMethod("GET");
             connection.setConnectTimeout(3 * 1000);
             int responseCode = connection.getResponseCode();
             return responseCode == HttpURLConnection.HTTP_OK;
@@ -75,7 +75,7 @@ public class NetWorkUtils {
                 return R.mipmap.network_icon_mobile;
             }
         }
-        return -1;
+        return 0;
     }
 
 }

+ 30 - 0
app/src/main/java/com/hanghui/senic/utils/GetJsonDataUtil.java

@@ -0,0 +1,30 @@
+package com.hanghui.senic.utils;
+
+import android.content.Context;
+import android.content.res.AssetManager;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+public class GetJsonDataUtil {
+
+
+    public String getJson(Context context, String fileName) {
+
+        StringBuilder stringBuilder = new StringBuilder();
+        try {
+            AssetManager assetManager = context.getAssets();
+            BufferedReader bf = new BufferedReader(new InputStreamReader(
+                    assetManager.open(fileName)));
+            String line;
+            while ((line = bf.readLine()) != null) {
+                stringBuilder.append(line);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return stringBuilder.toString();
+    }
+
+}

Some files were not shown because too many files changed in this diff