Browse Source

merge FaceScenic_V2

yang 3 months ago
parent
commit
9f6ea69f44

+ 45 - 39
app/src/main/java/com/hanghui/senic/activity/MainActivity.java

@@ -243,44 +243,7 @@ public class MainActivity extends BaseActivity {
     private Runnable startHardwareRunnable = new Runnable() {
         @Override
         public void run() {
-            //所有的外设硬件初始化后,最后再初始化smile
-            if (DeviceInitManager.getInstance().totalOpenHardwareNum == DeviceInitManager.getInstance().getAlreadyInitHardwareNum()){
-                AppHandler.getHandler().postDelayed(new Runnable() {
-                    @Override
-                    public void run() {
-                        //smile服务
-                        SmileController.getInstance().init();
-                    }
-                }, DeviceInitManager.getInstance().getAlreadyInitHardwareNum() * 2000);
-            }
-            //顶部图标显示
-            switch (DeviceInitManager.getInstance().getSelectHardwareToInt()){
-                case Constants.Code_hardware_icon_idCard_succeed:
-                    hardwareIcon_IDCard.setImageResource(R.mipmap.hardware_icon_idcard_succeed);
-                    break;
-                case Constants.Code_hardware_icon_idCard_fail:
-                    hardwareIcon_IDCard.setImageResource(R.mipmap.hardware_icon_idcard_fail);
-                    break;
-                case Constants.Code_hardware_icon_qrCode_succeed:
-                    hardwareIcon_QRCode.setImageResource(R.mipmap.hardware_icon_qrcode_succeed);
-                    break;
-                case Constants.Code_hardware_icon_qrCode_fail:
-                    hardwareIcon_QRCode.setImageResource(R.mipmap.hardware_icon_qrcode_fail);
-                    break;
-                case Constants.Code_hardware_icon_passport_succeed:
-                    hardwareIcon_Passport.setImageResource(R.mipmap.hardware_icon_passport_succeed);
-                    break;
-                case Constants.Code_hardware_icon_passport_fail:
-                    hardwareIcon_Passport.setImageResource(R.mipmap.hardware_icon_passport_fail);
-                    break;
-                case Constants.Code_hardware_icon_icCard_succeed:
-                    hardwareIcon_IcCard.setImageResource(R.mipmap.hardware_icon_iccard_succeed);
-                    break;
-                case Constants.Code_hardware_icon_icCard_fail:
-                    hardwareIcon_IcCard.setImageResource(R.mipmap.hardware_icon_iccard_fail);
-                    break;
-            }
-            appStatusTextView.setText(DeviceInitManager.getInstance().getSelectHardwareToString());
+
         }
     };
 
@@ -288,7 +251,50 @@ public class MainActivity extends BaseActivity {
         @Override
         public void updateView(int code, String msg) {
             int alreadyInitHardwareNumber = DeviceInitManager.getInstance().getAlreadyInitHardwareNum();
-            AppHandler.getHandler().postDelayed(startHardwareRunnable,alreadyInitHardwareNumber * 2000);
+            AppLogUtils.e(false,"","---------------alreadyInitHardwareNumber "+alreadyInitHardwareNumber);
+            AppHandler.getHandler().postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    //所有的外设硬件初始化后,最后再初始化smile
+                    if (DeviceInitManager.getInstance().totalOpenHardwareNum == DeviceInitManager.getInstance().getAlreadyInitHardwareNum()){
+                        AppHandler.getHandler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                //smile服务
+                                SmileController.getInstance().init();
+                            }
+                        }, DeviceInitManager.getInstance().getAlreadyInitHardwareNum() * 2000);
+                    }
+                    //顶部图标显示
+                    switch (code){
+                        case Constants.Code_hardware_icon_idCard_succeed:
+                            hardwareIcon_IDCard.setImageResource(R.mipmap.hardware_icon_idcard_succeed);
+                            break;
+                        case Constants.Code_hardware_icon_idCard_fail:
+                            hardwareIcon_IDCard.setImageResource(R.mipmap.hardware_icon_idcard_fail);
+                            break;
+                        case Constants.Code_hardware_icon_qrCode_succeed:
+                            hardwareIcon_QRCode.setImageResource(R.mipmap.hardware_icon_qrcode_succeed);
+                            break;
+                        case Constants.Code_hardware_icon_qrCode_fail:
+                            hardwareIcon_QRCode.setImageResource(R.mipmap.hardware_icon_qrcode_fail);
+                            break;
+                        case Constants.Code_hardware_icon_passport_succeed:
+                            hardwareIcon_Passport.setImageResource(R.mipmap.hardware_icon_passport_succeed);
+                            break;
+                        case Constants.Code_hardware_icon_passport_fail:
+                            hardwareIcon_Passport.setImageResource(R.mipmap.hardware_icon_passport_fail);
+                            break;
+                        case Constants.Code_hardware_icon_icCard_succeed:
+                            hardwareIcon_IcCard.setImageResource(R.mipmap.hardware_icon_iccard_succeed);
+                            break;
+                        case Constants.Code_hardware_icon_icCard_fail:
+                            hardwareIcon_IcCard.setImageResource(R.mipmap.hardware_icon_iccard_fail);
+                            break;
+                    }
+                    appStatusTextView.setText(msg);
+                }
+            }, alreadyInitHardwareNumber * 2000);
             DeviceInitManager.getInstance().setAlreadyInitHardwareNumAddOne();
         }
     };

+ 2 - 2
app/src/main/java/com/hanghui/senic/activity/view/ResultViewManager.java

@@ -1512,7 +1512,7 @@ public class ResultViewManager {
         outcomeActivity_Outcome.setVisibility(View.GONE);
         outcomeActivity_loadingLocally.setVisibility(View.GONE);
         if (!ConfigManager.isFloatingPages()) {
-            if (!StringIsNull.IsStringNull(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl())){
+            if (TaskStatus.taskStatus.equals(TaskStatus.TASK_STATUS_FACE) && !StringIsNull.IsStringNull(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl())){
                 URL url = null;
                 try {
                     url = new URL(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl());
@@ -1616,7 +1616,7 @@ public class ResultViewManager {
         outcomeActivity_loadingLocally.setVisibility(View.GONE);
         outcomeActivity_PAGE_TYPE_CLOSING_PENDING_MULTIPLE.setVisibility(View.GONE);
         if (!ConfigManager.isFloatingPages()) {
-            if (!StringIsNull.IsStringNull(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl())){
+            if (TaskStatus.taskStatus.equals(TaskStatus.TASK_STATUS_FACE) && !StringIsNull.IsStringNull(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl())){
                 URL url = null;
                 try {
                     url = new URL(ConfigManager.getAuthenticationBeanListBean().getScanFaceFailedPageUrl());

+ 11 - 65
app/src/main/java/com/hanghui/senic/common/DeviceInitManager.java

@@ -37,53 +37,6 @@ public class DeviceInitManager {
         this.alreadyInitHardwareNum = alreadyInitHardwareNum;
     }
 
-
-    String selectHardwareToString = "";
-    int selectHardwareToInt = 0;
-    /**
-     * @param selectHardware 文字赋值释义:
-     * 0 "身份证阅读器初始化成功";
-     * 1 "身份证阅读器初始化失败,请检查模块是否正常连接";
-     * 2 "二维码读头初始化成功";
-     * 3 "二维码读头初始化失败,请检查模块是否正常连接";
-     * 4 "护照机初始化成功";
-     * 5 "护照机初始化失败,请检查模块是否正常连接,并重启设备";
-     * 6 "IC卡阅读器初始化成功";
-     * 7 "IC卡阅读器初始化失败,请检查模块是否正常连接";
-     */
-    public void setSelectHardwareToString(int selectHardware){
-        selectHardwareToInt = selectHardware;
-        switch (selectHardware){
-            case Constants.Code_hardware_idCard_succeed:
-                selectHardwareToString = "身份证阅读器初始化成功";
-            break;
-            case Constants.Code_hardware_idCard_fail:
-                selectHardwareToString = "身份证阅读器初始化失败,请检查模块是否正常连接";
-                break;
-            case Constants.Code_hardware_qrCode_succeed:
-                selectHardwareToString = "二维码读头初始化成功";
-                break;
-            case Constants.Code_hardware_qrCode_fail:
-                selectHardwareToString = "二维码读头初始化失败,请检查模块是否正常连接";
-                break;
-            case Constants.Code_hardware_passport_succeed:
-                selectHardwareToString = "护照机初始化成功";
-                break;
-            case Constants.Code_hardware_passport_fail:
-                selectHardwareToString = "护照机初始化失败,请检查模块是否正常连接,并重启设备";
-                break;
-            case Constants.Code_hardware_icCard_succeed:
-                selectHardwareToString = "IC卡阅读器初始化成功";
-                break;
-            case Constants.Code_hardware_icCard_fail:
-                selectHardwareToString = "IC卡阅读器初始化失败,请检查模块是否正常连接";
-                break;
-            default:
-                selectHardwareToString = "";
-                break;
-        }
-    }
-
     /**
      * 二维码读头是否启动成功
      */
@@ -94,12 +47,13 @@ public class DeviceInitManager {
         }
         isOpenFirstQRCode = false;
         if (isStartQRCode){
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_qrCode_succeed);
+            deviceInitCallback.updateView(Constants.Code_hardware_qrCode_succeed,"二维码读头初始化成功");
         }else {
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_qrCode_fail);
+            deviceInitCallback.updateView(Constants.Code_hardware_qrCode_fail,"二维码读头初始化失败,请检查模块是否正常连接");
         }
-        deviceInitCallback.updateView(Constants.Code_DeviceInitCallback_HardwareQRCode,"二维码硬件启动");
+
     }
+
     /**
      * 身份证阅读器硬件启动是否成功
      */
@@ -110,14 +64,15 @@ public class DeviceInitManager {
         }
         isOpenFirstIDCard = false;
         if (isStartIDCard){
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_idCard_succeed);
+            deviceInitCallback.updateView(Constants.Code_hardware_idCard_succeed,"身份证阅读器初始化成功");
         }else {
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_idCard_fail);
+            deviceInitCallback.updateView(Constants.Code_hardware_idCard_fail,"身份证阅读器初始化失败,请检查模块是否正常连接");
         }
-        deviceInitCallback.updateView(Constants.Code_DeviceInitCallback_HardwareIDCard,"身份证阅读器硬件启动");
+
     }
     /**
      * IC卡硬件启动是否成功
+     * isDXAllOneIDCard 判断是否是东信多合一
      */
     boolean isOpenFirstICCard = true;
     public void setHardwareICCard(boolean isStartICCard) {
@@ -126,11 +81,11 @@ public class DeviceInitManager {
         }
         isOpenFirstICCard = false;
         if (isStartICCard){
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_icCard_succeed);
+            deviceInitCallback.updateView(Constants.Code_hardware_icCard_succeed,"IC卡阅读器初始化成功");
         }else {
-            DeviceInitManager.getInstance().setSelectHardwareToString(Constants.Code_hardware_icCard_fail);
+            deviceInitCallback.updateView(Constants.Code_hardware_icCard_fail,"IC卡阅读器初始化失败,请检查模块是否正常连接");
         }
-        deviceInitCallback.updateView(Constants.Code_DeviceInitCallback_HardwareICCard,"IC卡硬件启动");
+
     }
 
     public void setHardwareStart() {
@@ -139,15 +94,6 @@ public class DeviceInitManager {
         isOpenFirstICCard = true;
     }
 
-    public String getSelectHardwareToString(){
-        return selectHardwareToString;
-    }
-    public int getSelectHardwareToInt(){
-        return selectHardwareToInt;
-    }
-
-
-
     public DeviceInitCallback getDeviceInitCallback() {
         return deviceInitCallback;
     }

+ 0 - 1
app/src/main/java/com/hanghui/senic/controller/DXAllInOneIDCardNewController.java

@@ -56,7 +56,6 @@ public class DXAllInOneIDCardNewController extends IDCardController {
         cardReader = new CardReader(MyAppliction.getContext());
         cardReader.Donsee_Beep(50);
         result = cardReader.Donsee_Open("USB");
-        AppLogUtils.e(false,"","-----------result "+result);
         if (result != 0) {
             //硬件状态赋值
             setHardwareStart(false);

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

@@ -525,7 +525,7 @@ public class HttpRequest {
         }
         httpResponseCallback.updateView(Constants.Code_HttpResponseCallback_ShowQRCodeIcon, "二维码读头开启");
         //虚拟串口的二维码阅读器才需要初始化QRCodeController,串口的二维码阅读器走的是SerialController
-        if (ConfigManager.getAuthenticationBeanListBean().getQrCodeReaderCommunicationMode() == 1) {
+        if (ConfigManager.getAuthenticationBeanListBean().getQrCodeReaderCommunicationMode() == 1 && ConfigManager.getAuthenticationBeanListBean().getQrCodeReaderBrand() != 6) {
             QRCodeController.getInstance().init();
         } else {
             QRCodeController.getInstance().destroy();