weimingfei
2 小时以前 338e7ed513d21d1468c0908fdca2ea4097ee0621
指纹钥匙柜
已修改10个文件
430 ■■■■■ 文件已修改
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/bean/LoginBean.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/face/FaceActivity.java 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/KeyCabinetActivity.java 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ZWLRActivity.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ZWLRVM.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/main/MainActivity.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/utils/usb/UsbController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/res/layout/zwlist_activity.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/res/layout/zwlr_activity.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/res/layout/zwlr_rcv_item.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/bean/LoginBean.java
@@ -5,7 +5,7 @@
    private Integer autoMemberId;
    private Integer memberId;
    //用户验证方式 0刷脸 1刷卡 2指纹
    //用户验证方式 0刷脸 1刷卡 2管理员 3指纹
    private int authType;
    //0:取,1:还
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/face/FaceActivity.java
@@ -45,6 +45,7 @@
import com.doumee.lib_coremodel.util.SpUtil;
import com.doumee.lib_coremodel.util.StringUtil;
import com.doumee.lib_coremodel.view.ToastView;
import com.example.datalibrary.api.FaceApi;
import com.example.datalibrary.callback.CameraDataCallback;
import com.example.datalibrary.callback.FaceDetectCallBack;
import com.example.datalibrary.db.DBManager;
@@ -63,6 +64,8 @@
import org.greenrobot.eventbus.ThreadMode;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import dagger.hilt.android.AndroidEntryPoint;
@@ -536,10 +539,24 @@
            //System.out.println("==rgbInstance==>onFaceDetectCallback   "+livenessModel);
            // 开发模式
            //isCheckFace = false;
            if(handler.hasMessages(1)){
                handler.removeMessages(1);
            try {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        if(handler==null){
                            return;
                        }
                        if(handler.hasMessages(1)){
                            handler.removeMessages(1);
                        }
                        checkOpenDebugResult(livenessModel);
                    }
                });
            }catch (Exception e){
                e.printStackTrace();
                ToastView.show(MApplication.mContext,"人脸报错2:"+e.getMessage());
            }
            checkOpenDebugResult(livenessModel);
        }
        @Override
@@ -550,7 +567,7 @@
            /*getDB().clFail.setVisibility(View.VISIBLE);
            getDB().tv4.setText(msg);
            handler.sendEmptyMessageDelayed(0,1000);*/
            System.out.println("==isOk==>onTip:"+msg);
            //System.out.println("==isOk==>onTip:"+msg);
        }
        @Override
@@ -578,11 +595,15 @@
        if (livenessModel == null){
            return;
        }
        if (isPause){
            glMantleSurfacView.onGlDraw(livenessModel.getTrackFaceInfo() ,
                    livenessModel.getBdFaceImageInstance() ,
                    FaceOnDrawTexturViewUtil.drawFaceColor(mUser , livenessModel));
        try {
            if (isPause){
                glMantleSurfacView.onGlDraw(livenessModel.getTrackFaceInfo() ,
                        livenessModel.getBdFaceImageInstance() ,
                        FaceOnDrawTexturViewUtil.drawFaceColor(mUser , livenessModel));
            }
        }catch (Exception e){
            e.printStackTrace();
            ToastView.show(MApplication.mContext,"人脸报错1:"+e.getMessage());
        }
    }
@@ -633,6 +654,9 @@
                case 6:
                    getDB().message.setVisibility(View.GONE);
                    break;
                case 7:
                    identify();
                    break;
                default:
                    break;
            }
@@ -681,94 +705,94 @@
    private int resultCount = 0;
    // ***************开发模式结果输出*************
    private void checkOpenDebugResult(final LivenessModel livenessModel) {
        if(isFinishing()){
            return;
        }
        if(handler==null){
            return;
        }
        // 当未检测到人脸UI显示
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if(isToChose) {
                    return;
                }
                if (livenessModel == null) {
                    if (isCompareCheck) {
        try {
            if (isFinishing()) {
                return;
            }
            if (handler == null) {
                return;
            }
            // 当未检测到人脸UI显示
            if (isToChose) {
                return;
            }
            if (livenessModel == null) {
                if (isCompareCheck) {
                        /*getDB().clFail.setVisibility(View.VISIBLE);
                        getDB().tv4.setText(getString(R.string.face_tip2));
                        handler.sendEmptyMessageDelayed(0,1000);*/
                    }
                    System.out.println("======>人脸识别失败");
                    return;
                }
                if (livenessModel.isQualityCheck()){
                    //是否通过质量检测
                    if (isCompareCheck) {
                //System.out.println("======>人脸识别失败");
                return;
            }
            if (livenessModel.isQualityCheck()) {
                //是否通过质量检测
                if (isCompareCheck) {
                        /*getDB().clFail.setVisibility(View.VISIBLE);
                        getDB().tv4.setText(getString(R.string.face_tip2));
                        handler.sendEmptyMessageDelayed(0,1000);*/
                    }
                } else {
                    User user = livenessModel.getUser();
                    if (user == null) {
                        mUser = null;
                        //EventBus.getDefault().post(new HttpEvent("人脸用户检测失败------->"+(status==0?"管理员人脸检测:":"司机人脸检测:")));
                        if (isCompareCheck) {
                }
            } else {
                User user = livenessModel.getUser();
                if (user == null) {
                    mUser = null;
                    //EventBus.getDefault().post(new HttpEvent("人脸用户检测失败------->"+(status==0?"管理员人脸检测:":"司机人脸检测:")));
                    if (isCompareCheck) {
                            /*getDB().clFail.setVisibility(View.VISIBLE);
                            getDB().tv4.setText(getString(R.string.face_tip2));
                            handler.sendEmptyMessageDelayed(0,1000);*/
                        }
                    }
                    } else {
                        mUser = user;
                } else {
                    mUser = user;
                        /*EventBus.getDefault().post(new HttpEvent("人脸用户------->"+(status==0?"管理员人脸检测:":"司机人脸检测:")
                                +(user.getGroupId().equals("0")?"管理员":"司机")));*/
                        if (isCompareCheck) {
                            getDB().clFail.setVisibility(View.GONE);
                            if(handler.hasMessages(0)) {
                                handler.removeMessages(0);
                            }
                    if (isCompareCheck) {
                        getDB().clFail.setVisibility(View.GONE);
                        if (handler.hasMessages(0)) {
                            handler.removeMessages(0);
                        }
                            /*textHuanying.setVisibility(View.GONE);
                            userNameLayout.setVisibility(View.VISIBLE);
                            nameImage.setImageResource(R.mipmap.ic_tips_gate_success);
                            nameText.setTextColor(Color.parseColor("#0dc6ff"));
                            nameText.setText(FileUtils.spotString(user.getUserName()) + " 欢迎您");*/
                        }
                        isToChose = true;
                        //识别成功,跳转
                        if(status==0){
                            //取-管理员
                            MApplication.getLoginBean().setAutoMemberId(Integer.parseInt(user.getUserId()));
                            //handler.sendEmptyMessageDelayed(7,0);
                            EventBus.getDefault().post(new FaceStatusChangeEvent(5));
                        }else if(status==2){
                            //取-司机
                            CameraPreviewManager.getInstance().stopPreview();
                            MApplication.getLoginBean().setMemberId(Integer.parseInt(user.getUserId()));
                            MApplication.getLoginBean().setAuthType(0);
                            //handler.sendEmptyMessageDelayed(8,0);
                            //Toast.makeText(mContext, "是否酒精检测:"+MApplication.getConfigBean().getAlcoholStatus(), Toast.LENGTH_SHORT).show();
                            if(MApplication.getConfigBean()!=null&&MApplication.getConfigBean().getAlcoholStatus()==1) {
                                //非酒精检测
                                startActivity(KeyCabinetActivity.class);
                                finish();
                            }else {
                                //酒精检测
                                EventBus.getDefault().post(new FaceStatusChangeEvent(4));
                            }
                        }else if(status==7){
                            //还-司机
                            MApplication.getLoginBean().setMemberId(Integer.parseInt(user.getUserId()));
                            MApplication.getLoginBean().setAuthType(0);
                    }
                    isToChose = true;
                    //识别成功,跳转
                    if (status == 0) {
                        //取-管理员
                        MApplication.getLoginBean().setAutoMemberId(Integer.parseInt(user.getUserId()));
                        //handler.sendEmptyMessageDelayed(7,0);
                        EventBus.getDefault().post(new FaceStatusChangeEvent(5));
                    } else if (status == 2) {
                        //取-司机
                        CameraPreviewManager.getInstance().stopPreview();
                        MApplication.getLoginBean().setMemberId(Integer.parseInt(user.getUserId()));
                        MApplication.getLoginBean().setAuthType(0);
                        //handler.sendEmptyMessageDelayed(8,0);
                        //Toast.makeText(mContext, "是否酒精检测:"+MApplication.getConfigBean().getAlcoholStatus(), Toast.LENGTH_SHORT).show();
                        if (MApplication.getConfigBean() != null && MApplication.getConfigBean().getAlcoholStatus() == 1) {
                            //非酒精检测
                            startActivity(KeyCabinetActivity.class);
                            finish();
                        } else {
                            //酒精检测
                            EventBus.getDefault().post(new FaceStatusChangeEvent(4));
                        }
                    } else if (status == 7) {
                        //还-司机
                        MApplication.getLoginBean().setMemberId(Integer.parseInt(user.getUserId()));
                        MApplication.getLoginBean().setAuthType(0);
                        startActivity(KeyCabinetActivity.class);
                        finish();
                    }
                }
            }
        });
        }catch (Exception e){
            e.printStackTrace();
            ToastView.show(MApplication.mContext,"人脸报错:"+e.getMessage());
        }
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
@@ -828,14 +852,31 @@
            public void run() {
                FingerPrintDo printDo = DaoManager.getFingerPrintDao().getByFingerId(fingerId);
                if(printDo!=null){
                    List<User> users = FaceApi.getInstance().getAllUserList();
                    HashMap<String,String> map = new HashMap<>();
                    for(User u:users){
                        if(u.getUserId().equals(printDo.getMemberId()+"")){
                            map.put(u.getGroupId(),"");
                        }
                    }
                    if(status==10){
                        //取-管理员指纹验证
                        if(!map.containsKey("0")){
                            showToast("您当前不是管理员");
                            handler.sendEmptyMessageDelayed(7,2000);
                            return;
                        }
                        MApplication.getLoginBean().setAutoMemberId(printDo.getMemberId());
                        EventBus.getDefault().post(new FaceStatusChangeEvent(5));
                    }else if(status==11){
                        //取-司机指纹验证
                        if(!map.containsKey("1")){
                            showToast("您当前不是司机");
                            handler.sendEmptyMessageDelayed(7,2000);
                            return;
                        }
                        MApplication.getLoginBean().setMemberId(printDo.getMemberId());
                        MApplication.getLoginBean().setAuthType(2);
                        MApplication.getLoginBean().setAuthType(3);
                        if(MApplication.getConfigBean()!=null&&MApplication.getConfigBean().getAlcoholStatus()==1) {
                            //非酒精检测
                            startActivity(KeyCabinetActivity.class);
@@ -846,8 +887,13 @@
                        }
                    }else if(status==12){
                        //还-司机
                        if(!map.containsKey("1")){
                            showToast("您当前不是司机");
                            handler.sendEmptyMessageDelayed(7,2000);
                            return;
                        }
                        MApplication.getLoginBean().setMemberId(printDo.getMemberId());
                        MApplication.getLoginBean().setAuthType(2);
                        MApplication.getLoginBean().setAuthType(3);
                        startActivity(KeyCabinetActivity.class);
                        finish();
                    }
@@ -855,7 +901,7 @@
                    //找不到,删除指纹
                    if(deleteID(fingerId)) {
                        //继续查指纹
                        identify();
                        handler.sendEmptyMessageDelayed(7,2000);
                    }else {
                        showToast("未查询到用户");
                    }
@@ -933,7 +979,6 @@
    private void identify() {
        if (!mDevComm.IsInit())
            return;
        mBCancel = false;
        new Thread(new Runnable() {
            int w_nRet;
@@ -991,7 +1036,7 @@
                        //m_strPost = String.format("Result : Success\r\nTemplate No : %d, Learn Result : %d\r\nMatch Time : %dms", w_nID[0], w_nLearned[0], m_nPassedTime);
                    } else {
                        //没找到
                        //showToast("没找到");
                        showToast("未检测到该指纹");
                        /*m_strPost = String.format("\r\nMatch Time : %dms", m_nPassedTime);
                        m_strPost = GetErrorMsg(w_nRet) + m_strPost;*/
                    }
@@ -1045,7 +1090,7 @@
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
                    ToastView.show(MApplication.mContext,msg);
                }
            });
        }
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/KeyCabinetActivity.java
@@ -23,6 +23,7 @@
import com.doumee.keyCabinet.dao.DaoManager;
import com.doumee.keyCabinet.databinding.KeyCabinetActivityBinding;
import com.doumee.keyCabinet.event.CloseGridOneResultEvent;
import com.doumee.keyCabinet.event.HttpEvent;
import com.doumee.keyCabinet.event.KeyResultEvent;
import com.doumee.keyCabinet.event.GetKeyStatusEvent;
import com.doumee.keyCabinet.event.OpenErrEvent;
@@ -363,92 +364,13 @@
                handler.removeMessages(1);
            }
            //获取卡号
            EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>关门,获取钥匙信息"));
            EventBus.getDefault().post(new GetKeyStatusEvent());
            keyTime = new Date().getTime()+500;
            if(handler.hasMessages(0)){
                handler.removeMessages(0);
            }
            handler.sendEmptyMessageDelayed(0,1200);
            /*if(selectBean!=null){
                String key = SportUtils.intToHex(Integer.parseInt(selectBean.getBoardCode()))
                        +SportUtils.intToHex(Integer.parseInt(selectBean.getChannelCode()));
                if(key.equals(e.getKey())) {
                    stopCountTimer();
                    if(flag==0) {
                        //领取
                        if (e.getIsOpen() == 0) {
                            //关门成功
                            //查询钥匙号
                            CabinetGridDo gridDo = DaoManager.getCabinetGridDao().getGridByKey(key);
                            if (gridDo != null) {
                                if(gridDo.getUpdateTime().compareTo(openTime)<0){
                                    //开门前数据,不能使用
                                    EventBus.getDefault().post(new GetKeyStatusEvent());
                                    return;
                                }
                                //Toast.makeText(mContext, "1:"+gridDo.getKeyCode()+",2:"+selectBean.getKeyCode(), Toast.LENGTH_LONG).show();
                                if (!TextUtils.isEmpty(gridDo.getCurKeyCode())) {
                                    if (gridDo.getCurKeyCode().equals(selectBean.getKeyCode())) {
                                        //领取失败
                                        isOpened = false;
                                        getVM().doAction(6);
                                        getVM().closeGrid(gridDo);
                                    }else {
                                        //钥匙不匹配
                                        getVM().doAction(10,null);
                                        EventBus.getDefault().post(new OpenGridEvent(selectBean.getChannelCode(), selectBean.getBoardCode()));
                                    }
                                } else {
                                    //钥匙拿走了
                                    isOpened = false;
                                    getVM().doAction(5);
                                    getVM().closeGrid(gridDo);
                                }
                            }else {
                                ToastView.show(MApplication.mContext, "未查询到规格信息");
                            }
                        } else {
                            //关门失败
                        }
                    }else {
                        //归还
                        if (e.getIsOpen() == 0) {
                            //关门成功
                            //查询钥匙号
                            CabinetGridDo gridDo = DaoManager.getCabinetGridDao().getGridByKey(key);
                            if (gridDo != null) {
                                if(gridDo.getUpdateTime().compareTo(openTime)<0){
                                    //开门前数据,不能使用
                                    EventBus.getDefault().post(new GetKeyStatusEvent());
                                    return;
                                }
                                //Toast.makeText(mContext, "1:"+gridDo.getKeyCode()+",2:"+selectBean.getKeyCode(), Toast.LENGTH_LONG).show();
                                if (!TextUtils.isEmpty(gridDo.getCurKeyCode())) {
                                    if (gridDo.getCurKeyCode().equals(selectBean.getKeyCode())) {
                                        //相同归还成功
                                        isOpened = false;
                                        getVM().doAction(8);
                                        getVM().closeGrid(gridDo);
                                    }else {
                                        //钥匙不匹配
                                        getVM().doAction(10,null);
                                        EventBus.getDefault().post(new OpenGridEvent(selectBean.getChannelCode(), selectBean.getBoardCode()));
                                    }
                                } else {
                                    //钥匙未归还
                                    isOpened = false;
                                    getVM().doAction(9);
                                    getVM().closeGrid(gridDo);
                                }
                            }else {
                                ToastView.show(MApplication.mContext, "未查询到规格信息");
                            }
                        } else {
                            //关门失败
                        }
                    }
                }
            }*/
        }
    }
@@ -471,10 +393,12 @@
            if(selectBean!=null){
                //校验时间
                if(keyTime==null){
                    EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息1"));
                    return;
                }
                if(keyTime!=null&&keyTime>System.currentTimeMillis()){
                    //校验返回时间<命令时间
                    EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息2"));
                    return;
                }
                if(handler.hasMessages(0)){
@@ -483,11 +407,13 @@
                if("1".equals(e.getType())){
                    //1号板
                    if(!"1".equals(selectBean.getBoardCode())){
                        EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息3"));
                        return;
                    }
                }else if("2".equals(e.getType())){
                    //2号板
                    if(!"2".equals(selectBean.getBoardCode())){
                        EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息4"));
                        return;
                    }
                }
@@ -529,6 +455,7 @@
                    }
                }else {
                    //归还
                    EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息5"));
                    CabinetGridDo gridDo = DaoManager.getCabinetGridDao().getGridByKey(key);
                    if (gridDo != null) {
                        if (gridDo.getIsOpen() == 0) {
@@ -539,6 +466,7 @@
                                    isOpened = false;
                                    getVM().doAction(8);
                                    getVM().closeGrid(gridDo);
                                    EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息-归还成功"));
                                }else {
                                    //钥匙不匹配
                                    getVM().doAction(10);
@@ -549,12 +477,15 @@
                                isOpened = false;
                                getVM().doAction(9);
                                getVM().closeGrid(gridDo);
                                EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息-钥匙未归还"));
                            }
                        }else {
                            EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息-没关门"));
                            //没关门
                            if(!TextUtils.isEmpty(gridDo.getCurKeyCode())){
                                //有钥匙了
                                getVM().doAction(7);
                                EventBus.getDefault().post(new HttpEvent("xxxxxxxxxx==>钥匙信息-没关门-有钥匙"));
                            }
                        }
                    } else {
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ZWLRActivity.java
@@ -32,12 +32,14 @@
import com.doumee.lib_coremodel.bean.event.ActionEventData;
import com.doumee.lib_coremodel.http.utils.FrescoUtils;
import com.doumee.lib_coremodel.util.RecyclerHelp;
import com.doumee.lib_coremodel.view.ToastView;
import com.example.datalibrary.model.User;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import dagger.hilt.android.AndroidEntryPoint;
@@ -114,6 +116,7 @@
                getDB().tvAdd.setVisibility(View.VISIBLE);
            }
        }else {
            adapter.refreshData(new ArrayList<>());
            getDB().tvAdd.setVisibility(View.VISIBLE);
            getVM().emptyVisibility.set(View.VISIBLE);
        }
@@ -130,12 +133,6 @@
                tipDownCount = 60;
                isShowTip = true;
                enrollBtn();
                break;
            case 5:
                getDB().nsv.setVisibility(getDB().nsv.getVisibility()==View.VISIBLE?View.GONE:View.VISIBLE);
                break;
            case 55:
                getVM().infoObs.set("");
                break;
            default:
                break;
@@ -208,7 +205,7 @@
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
                    ToastView.show(mContext, msg);
                }
            });
        }
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ZWLRVM.java
@@ -23,7 +23,7 @@
    }
    public void addInfo(String s) {
        String x = infoObs.get();
        infoObs.set(s+"\n"+x);
        /*String x = infoObs.get();
        infoObs.set(s+"\n"+x);*/
    }
}
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/main/MainActivity.java
@@ -351,6 +351,9 @@
                    if(devConfigBean.getBannerList()!=null) {
                        setBanner(devConfigBean.getBannerList());
                    }
                    if(!isFaceOk) {
                        initLicense();
                    }
                    setJiuConfig();
                    initPort();
                    EventBus.getDefault().post(new GetFacesEvent());
@@ -411,6 +414,10 @@
        switch (type){
            case 2:
            case 3: {
                if(!isFaceOk) {
                    initLicense();
                    return;
                }
                //校验是否登录
                if(MApplication.getConfigBean().getId()==null){
                    Toast.makeText(mContext, "设备未添加,无法操作", Toast.LENGTH_SHORT).show();
@@ -494,9 +501,6 @@
        MCUtils.hind(mcSystemUi);
        mcHome.setHomePackage("com.doumee.keyCabinet");
        showTime = System.currentTimeMillis();
        if(!isFaceOk) {
            initLicense();
        }
        if(isHavePermission) {
            checkUpdate();
        }
@@ -712,11 +716,14 @@
    }
    private void initModel(List<FaceUserBean> userBeans) {
        if(!isFaceOk){
            return;
        }
        if (com.example.datalibrary.manager.FaceSDKManager.initStatus == com.example.datalibrary.manager.FaceSDKManager.SDK_MODEL_LOAD_SUCCESS) {
            getVM().addInfo("更新人脸===》开始更新");
            //getVM().addInfo("更新人脸===》开始更新");
            waitUpdate(userBeans);
        }else {
            getVM().addInfo("更新人脸===》初始化");
            //getVM().addInfo("更新人脸===》初始化");
            initFaceSDKManager(userBeans);
        }
    }
@@ -1828,19 +1835,18 @@
            /*SpUtil.setString("port_grid","/dev/ttyS0");
            SpUtil.setString("port_key","/dev/ttyS4");
            SpUtil.setString("port_jiu","/dev/ttyS9");*/
            gridPath = SpUtil.getString("port_grid");
            getVM().addInfo("门串口链接:"+gridPath);
            keyPath = SpUtil.getString("port_key");
            getVM().addInfo("钥匙串口链接:"+keyPath);
            jiuPath = SpUtil.getString("port_jiu");
            getVM().addInfo("酒精串口链接:"+jiuPath);
            if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))&&
                    !TextUtils.isEmpty(SpUtil.getString("port_key"))&&
                    !TextUtils.isEmpty(SpUtil.getString("port_jiu"))){
                if(isInitPort){
                    return;
                }
                gridPath = SpUtil.getString("port_grid");
                getVM().addInfo("门串口链接:"+gridPath);
                keyPath = SpUtil.getString("port_key");
                getVM().addInfo("钥匙串口链接:"+keyPath);
                jiuPath = SpUtil.getString("port_jiu");
                getVM().addInfo("酒精串口链接:"+jiuPath);
                xhCount=0;
                closePort(chosePort);
                if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))){
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/utils/usb/UsbController.java
@@ -100,18 +100,18 @@
            UsbDevice d = deviter.next();
            l("Found device: " + String.format("%04X:%04X", d.getVendorId(), d.getProductId()));
            Toast.makeText(mApplicationContext, "Found device: " + String.format("%04X:%04X", d.getVendorId(), d.getProductId()), Toast.LENGTH_SHORT).show();
            //Toast.makeText(mApplicationContext, "Found device: " + String.format("%04X:%04X", d.getVendorId(), d.getProductId()), Toast.LENGTH_SHORT).show();
            if (d.getVendorId() == VID && d.getProductId() == PID) {
                bFound = true;
                l("Device under: " + d.getDeviceName());
                if (!mUsbManager.hasPermission(d))
                {
                    Toast.makeText(mApplicationContext, "enumerate, hasPermission return false" , Toast.LENGTH_SHORT).show();
                    //Toast.makeText(mApplicationContext, "enumerate, hasPermission return false" , Toast.LENGTH_SHORT).show();
                    listener.onPermissionDenied(d);
                }
                else{
                    Toast.makeText(mApplicationContext, "enumerate, GetConnInerface start" , Toast.LENGTH_SHORT).show();
                    //Toast.makeText(mApplicationContext, "enumerate, GetConnInerface start" , Toast.LENGTH_SHORT).show();
                    //startHandler(d);
                    GetConnInerface(d);
                    //TestComm(d);
@@ -122,7 +122,7 @@
        }
        if (bFound == false)
        {
            Toast.makeText(mApplicationContext, "no more devices found" , Toast.LENGTH_SHORT).show();
            Toast.makeText(mApplicationContext, "未发现设备" , Toast.LENGTH_SHORT).show();
            mConnectionHandler.onDeviceNotFound();
        }
    }
keyCabinet-android/app/src/main/res/layout/zwlist_activity.xml
@@ -83,28 +83,5 @@
            app:layout_constraintEnd_toEndOf="@+id/recycler_view"
            android:visibility="@{model.emptyVisibility}"/>
        <LinearLayout
            android:id="@+id/deviceListLayout"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintTop_toBottomOf="@+id/viewBack"
            app:layout_constraintBottom_toBottomOf="parent"
            android:layout_marginTop="14dp"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:orientation="vertical"
            android:visibility="visible"/>
        <Button
            android:id="@+id/bt_con"
            android:layout_width="200dp"
            android:layout_height="70dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:text="比较"
            android:textSize="30sp"
            app:commandType="@{5}"
            app:onClickCommand="@{model.myTypeCommand}"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>
keyCabinet-android/app/src/main/res/layout/zwlr_activity.xml
@@ -318,58 +318,5 @@
        </androidx.constraintlayout.widget.ConstraintLayout>
        <androidx.core.widget.NestedScrollView
            android:id="@+id/nsv"
            android:layout_width="match_parent"
            android:layout_height="700dp"
            app:layout_constraintTop_toTopOf="parent"
            android:background="@color/white"
            android:visibility="gone">
            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    android:text="@{model.infoObs}"
                    android:textColor="@color/black"
                    android:textSize="20sp">
                </TextView>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.core.widget.NestedScrollView>
        <TextView
            android:id="@+id/tv11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="清空"
            android:textColor="#ff279baa"
            android:textSize="20sp"
            android:textStyle="bold"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:commandType="@{55}"
            app:onClickCommand="@{model.myTypeCommand}"/>
        <Button
            android:id="@+id/bt_con"
            android:layout_width="100dp"
            android:layout_height="70dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:text="日志"
            android:textSize="30sp"
            app:commandType="@{5}"
            app:onClickCommand="@{model.myTypeCommand}"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>
keyCabinet-android/app/src/main/res/layout/zwlr_rcv_item.xml
@@ -25,8 +25,9 @@
        
        <ImageView
            android:id="@+id/img_close"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:padding="15dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"