Parcourir la source

Merge remote-tracking branch 'origin/FaceScenic_V2_baiduface' into FaceScenic_V2_baiduface

xwh il y a 2 semaines
Parent
commit
6f68f776b4

+ 27 - 16
app/src/main/java/com/hanghui/senic/activity/view/BaiDuFaceView.java

@@ -12,7 +12,6 @@ import android.graphics.drawable.Drawable;
 import android.inputmethodservice.Keyboard;
 import android.text.Editable;
 import android.text.TextWatcher;
-import android.util.Log;
 import android.view.View;
 import android.view.ViewTreeObserver;
 import android.widget.ImageView;
@@ -31,7 +30,6 @@ import com.bumptech.glide.request.RequestOptions;
 import com.bumptech.glide.request.target.SimpleTarget;
 import com.bumptech.glide.request.transition.Transition;
 import com.example.lib.QRCodeUtil.GenerateQRCodeUtil;
-import com.google.gson.Gson;
 import com.hanghui.senic.MyAppliction;
 import com.hanghui.senic.R;
 import com.hanghui.senic.adapter.OutcomeAdapter;
@@ -40,7 +38,6 @@ import com.hanghui.senic.adapter.OutcomeAdapter3;
 import com.hanghui.senic.adapter.OutcomeAdapter4;
 import com.hanghui.senic.adapter.StatusPendingAdapter;
 import com.hanghui.senic.baiduface.BaiduFaceController;
-import com.hanghui.senic.baiduface.BaiduFacePreviewActivity;
 import com.hanghui.senic.bean.CChoiseListBean;
 import com.hanghui.senic.bean.CheckNumBean;
 import com.hanghui.senic.bean.FederatedPlatformsRequestBean;
@@ -150,6 +147,7 @@ public class BaiDuFaceView {
     TextView loadingLocally_ThrLabel;
     ImageView loadingLocally_ThrValue;
     RelativeLayout outcomeActivity_Outcome;
+    RelativeLayout outcomeActivity_FloatingButton;
     //大图结果页
     RelativeLayout outcomeActivity_OutcomeMAXPicture;
     ImageView outcomeActivity_OutcomeImageMAXPicture;
@@ -404,6 +402,9 @@ public class BaiDuFaceView {
         loadingLocally_ThrLabel = view.findViewById(R.id.LoadingLocally_ThrLabel);
         loadingLocally_ThrValue = view.findViewById(R.id.LoadingLocally_ThrValue);
         outcomeActivity_Outcome = view.findViewById(R.id.OutcomeActivity_Outcome);
+        if (ConfigManager.isFloatingPages()) {
+            outcomeActivity_FloatingButton = view.findViewById(R.id.outcomeActivity_FloatingButton);
+        }
         //大图成功结果页
         outcomeActivity_OutcomeImageMAXPicture = view.findViewById(R.id.OutcomeActivity_OutcomeImageMAXPicture);
         outcomeActivity_OutcomeTextViewMAXPicture = view.findViewById(R.id.OutcomeActivity_OutcomeTextViewMAXPicture);
@@ -2305,6 +2306,11 @@ public class BaiDuFaceView {
             outcomeActivity_PAGE_TYPE_CLOSING_PENDING_MULTIPLE.setVisibility(View.GONE);
             loadingLocally_TopLinearLayout.setVisibility(View.VISIBLE);
             loadingLocally_TopLinearLayoutImageRelativeLayout.setVisibility(View.VISIBLE);
+            if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList() == null ){
+                outcomeActivity_FloatingButton.setVisibility(View.GONE);
+            }else {
+                outcomeActivity_FloatingButton.setVisibility(View.VISIBLE);
+            }
         }
         outcomeActivity_PAGE_TYPE_CLOSING_PENDING_MULTIPLE.setVisibility(View.GONE);
         String name = federatedPlatformsResponseBean.getData().getName();
@@ -2367,16 +2373,21 @@ public class BaiDuFaceView {
         if (ConfigManager.isFloatingPages()) {
 //            outcomeActivity_LocalError_idNumberLinear2.setVisibility(View.GONE);
             RequestOptions options = new RequestOptions().bitmapTransform(new RoundedCorners(10));
-            if (!StringIsNull.IsStringNull(ScenePhoto)) {
-                ImageLoaderUtils.loadImage(ScenePhoto,outcomeActivity_OutcomeImage,options);
-            } else if (!StringIsNull.IsStringNull(IDPhoto)) {
-                ImageLoaderUtils.loadImage(IDPhoto,outcomeActivity_OutcomeImage,options);
-            }else if (bitmap != null) {
-                Drawable drawable=new BitmapDrawable(outcomeActivity_OutcomeImage.getResources(),bitmap);
-                options.placeholder(drawable).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true);
-                ImageLoaderUtils.loadImage(bitmap,outcomeActivity_OutcomeImage,options);
-            } else {
-                ImageLoaderUtils.loadImage(R.mipmap.outcomeactivity_outcomeimagemax_picture,outcomeActivity_OutcomeImage);
+            if (ConfigManager.isSuccessShowPersenalInfoPhoto){
+                outcomeActivity_OutcomeImage.setVisibility(View.VISIBLE);
+                if (!StringIsNull.IsStringNull(ScenePhoto)) {
+                    ImageLoaderUtils.loadImage(ScenePhoto,outcomeActivity_OutcomeImage,options);
+                } else if (!StringIsNull.IsStringNull(IDPhoto)) {
+                    ImageLoaderUtils.loadImage(IDPhoto,outcomeActivity_OutcomeImage,options);
+                }else if (bitmap != null) {
+                    Drawable drawable=new BitmapDrawable(outcomeActivity_OutcomeImage.getResources(),bitmap);
+                    options.placeholder(drawable).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true);
+                    ImageLoaderUtils.loadImage(bitmap,outcomeActivity_OutcomeImage,options);
+                } else {
+                    ImageLoaderUtils.loadImage(R.mipmap.outcomeactivity_outcomeimagemax_picture,outcomeActivity_OutcomeImage);
+                }
+            }else {
+                outcomeActivity_OutcomeImage.setVisibility(View.GONE);
             }
             if (!StringIsNull.IsStringNull(federatedPlatformsResponseBean.getData().getALineThrValue())) {
                 ImageLoaderUtils.loadImage(federatedPlatformsResponseBean.getData().getALineThrValue(),loadingLocally_ThrValue,options);
@@ -2384,19 +2395,19 @@ public class BaiDuFaceView {
             ImageLoaderUtils.loadImage(R.mipmap.blue_background_gradient,loadingLocally_TopLinearLayoutImage);
             ImageLoaderUtils.loadImage(R.mipmap.mainactivity_aicon,loadingLocally_Image);
             loadingLocally_TopLinearLayoutImageRelativeLayout.setVisibility(View.VISIBLE);
-            if (!StringIsNull.IsStringNull(name)) {
+            if (!StringIsNull.IsStringNull(name) && ConfigManager.isSuccessShowPersenalInfoName) {
                 outcomeActivity_OutcomeName.setVisibility(View.VISIBLE);
                 outcomeActivity_OutcomeName.setText(name);
             } else {
                 outcomeActivity_OutcomeName.setVisibility(View.GONE);
             }
-            if (!StringIsNull.IsStringNull(idCard)) {
+            if (!StringIsNull.IsStringNull(idCard) && ConfigManager.isSuccessShowPersenalInfoIDCard) {
                 outcomeActivity_OutcomeSecond.setVisibility(View.VISIBLE);
                 outcomeActivity_OutcomeSecond.setText(idCard);
             } else {
                 outcomeActivity_OutcomeSecond.setVisibility(View.GONE);
             }
-            if (!StringIsNull.IsStringNull(phone)) {
+            if (!StringIsNull.IsStringNull(phone) && ConfigManager.isSuccessShowPersenalInfoPhone) {
                 OutcomeActivity_Phone.setVisibility(View.VISIBLE);
                 OutcomeActivity_Phone.setText(phone);
             } else {

+ 17 - 10
app/src/main/java/com/hanghui/senic/baiduface/BaiduFacePreviewActivity.java

@@ -843,10 +843,6 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
         DataReturns.getInstance().clearData();
         //判断用户是否在有效期内
         if (ConfigManager.getAuthenticationBeanListBean().getValidTimeSwitch() && isUserExpire(user)) {
-            AppLogUtils.e(true, TAG + " ,用户是否过期", "doScanFaceResult_Success(), 用户已过期");
-            FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome(
-                    "LocalError_B", "人员不在有效期", 500, "人员不在有效期");
-            BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
             return;
         }
         //判断黑名单中是否存在该用户
@@ -918,15 +914,26 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
         long startTime = user.getStartTime();
         long endTime = user.getEndTime();
         long curTime = System.currentTimeMillis();
-
-        //已过期
-        if (curTime <= startTime || curTime >= endTime) {
-
-            FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome("LocalError_B", "不在有效期", 500, "不在有效期");
+        if (curTime <= startTime){
+            AppLogUtils.e(true, TAG + " ,用户是否过期", "doScanFaceResult_Success(), 用户未到有效时间");
+            FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome("LocalError_B", "未到有效时间", 500, "未到有效时间");
             BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
-
             return true;
         }
+        if (curTime >= endTime){
+            AppLogUtils.e(true, TAG + " ,用户是否过期", "doScanFaceResult_Success(), 用户已过期");
+            FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome("LocalError_B", "已过期", 500, "已过期");
+            BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
+            return true;
+        }
+//        //已过期
+//        if (curTime <= startTime || curTime >= endTime) {
+//
+//            FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome("LocalError_B", "不在有效期", 500, "不在有效期");
+//            BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
+//
+//            return true;
+//        }
         return false;
     }
 

+ 10 - 0
app/src/main/java/com/hanghui/senic/bean/AuthenticationBean.java

@@ -494,6 +494,16 @@ public class AuthenticationBean {
         private long serverTime;//服务器时间
         @SerializedName("setPersonalList")
         List<Integer> setPersonalList; //设置——人员列表”【控制设置页里的人员数据的信息】 1-照片,2-证件号,3-手机号
+        @SerializedName("successShowPersonalInfoList")
+        List<Integer> successShowPersonalInfoList;//成功显示人员信息列表1-照片,2-姓名,3-证件号,4-手机号
+
+        public List<Integer> getSuccessShowPersonalInfoList() {
+            return successShowPersonalInfoList;
+        }
+
+        public void setSuccessShowPersonalInfoList(List<Integer> successShowPersonalInfoList) {
+            this.successShowPersonalInfoList = successShowPersonalInfoList;
+        }
 
 
 

+ 4 - 0
app/src/main/java/com/hanghui/senic/common/gson/CompleteDataUtil.java

@@ -475,6 +475,10 @@ public class CompleteDataUtil {
 
     //补全在线配置数据类型为int、boolean类型的字段
     public static void completeData(AuthenticationBean authenticationBean) {
+        if (authenticationBean.getData().get(0).getSuccessShowPersonalInfoList() == null ||
+                authenticationBean.getData().get(0).getSuccessShowPersonalInfoList().size() == 0){
+            authenticationBean.getData().get(0).setSuccessShowPersonalInfoList(null);
+        }
         if (authenticationBean.getData().get(0).getSameFaceInterval() == null){
             authenticationBean.getData().get(0).setSameFaceInterval(0);
         }

+ 2 - 1
app/src/main/java/com/hanghui/senic/network/HttpRequest.java

@@ -264,7 +264,8 @@ public class HttpRequest {
         setMediaVolume();
         //设置下拉通知栏及导航栏
         setNotificationAndNavigationBar();
-
+        //设置本地结果页证件照片等信息是否显示
+//        ConfigManager.isSuccessShowPersenalInfo();
         //补光灯设置
         RelaysAndLedUtile.getInstance().setLedLight(ConfigManager.getAuthenticationBeanListBean().getLightMode(), false);
 

+ 27 - 0
app/src/main/java/com/hanghui/senic/service/usbserialdemo/utile/ConfigManager.java

@@ -1567,4 +1567,31 @@ public class ConfigManager {
         }
 
     }
+
+    /**
+     * 1-照片,2-姓名,3-证件号,4-手机号
+     * @param type
+     * @return
+     */
+    public static boolean isSuccessShowPersenalInfoName = false;
+    public static boolean isSuccessShowPersenalInfoPhone = false;
+    public static boolean isSuccessShowPersenalInfoPhoto = false;
+    public static boolean isSuccessShowPersenalInfoIDCard = false;
+    public static void isSuccessShowPersenalInfo(){
+        if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList() ==null ||
+                ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().size() == 0){
+            return;
+        }
+        for (int i = 0; i < ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().size(); i++) {
+            if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().get(i) == 1){
+                isSuccessShowPersenalInfoPhoto = true;
+            } else if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().get(i) == 2){
+                isSuccessShowPersenalInfoName = true;
+            } else if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().get(i) == 3) {
+                isSuccessShowPersenalInfoIDCard = true;
+            } else if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().get(i) == 4) {
+                isSuccessShowPersenalInfoPhone = true;
+            }
+        }
+    }
 }

+ 1 - 0
app/src/main/res/layout/window_outcome_floating_pages.xml

@@ -391,6 +391,7 @@
                 </LinearLayout>
 
                 <RelativeLayout
+                    android:id="@+id/outcomeActivity_FloatingButton"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_alignParentBottom="true"