| | |
| | | import com.doumee.keyCabinet.event.OpenGridOneResultEvent; |
| | | import com.doumee.keyCabinet.event.TimeClockEvent; |
| | | import com.doumee.keyCabinet.ui.face.ActivationActivity; |
| | | import com.doumee.keyCabinet.ui.face.ChoseActivationActivity; |
| | | import com.doumee.keyCabinet.ui.face.FaceActivity; |
| | | import com.doumee.keyCabinet.ui.keyCabinet.ChangeUrlActivity; |
| | | import com.doumee.keyCabinet.ui.keyCabinet.KeyCabinetActivity; |
| | |
| | | |
| | | private SpannableString getErrPhoneText(){ |
| | | String phone = MApplication.getConfigBean().getLinkPhone(); |
| | | if(phone==null){ |
| | | String text = "如有问题请联系管理员"; |
| | | SpannableString styledText = new SpannableString(text); |
| | | styledText.setSpan(new TextAppearanceSpan(this, R.style.style_tip3), 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | return styledText; |
| | | } |
| | | String text = "如有问题请联系管理员"+phone; |
| | | SpannableString styledText = new SpannableString(text); |
| | | styledText.setSpan(new TextAppearanceSpan(this, R.style.style_tip3), 0, text.length()-phone.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | |
| | | /* |
| | | *要执行的操作*/ |
| | | |
| | | startActivity(new Intent(mContext, ActivationActivity.class)); |
| | | startActivity(new Intent(mContext, ChoseActivationActivity.class)); |
| | | } |
| | | }; |
| | | Timer timer = new Timer(); |
| | |
| | | getVM().addInfo(e.getMsg()); |
| | | } |
| | | } |
| | | |
| | | private long lastCloseDoorTime; |
| | | @Subscribe(threadMode = ThreadMode.MAIN) |
| | | public void CLGridEvent(CLGridEvent e){ |
| | | if(!isFinishing()){ |
| | |
| | | String open = data.substring(6,8); |
| | | String key = bh+tdh; |
| | | CabinetGridDo gridDo = DaoManager.getCabinetGridDao().getGridByKey(key); |
| | | lastCloseDoorTime = System.currentTimeMillis(); |
| | | if(gridDo!=null){ |
| | | gridDo.setIsOpen("00".equals(open)?1:0); |
| | | gridDo.setUpdateTime(StringUtil.DateToStr(new Date())); |
| | |
| | | //一号版 |
| | | bh = 1; |
| | | } |
| | | String[] sp = data.split("AA"); |
| | | List<String> sp = new ArrayList<>(); |
| | | String data2 = data.substring(8,data.length()); |
| | | while (data2.length()>0){ |
| | | if (data2.length()<22) { |
| | | sp.add(data2+""); |
| | | data2 = ""; |
| | | }else { |
| | | sp.add(data2.substring(0,22)); |
| | | data2 = data2.substring(22); |
| | | } |
| | | } |
| | | for(String s:sp){ |
| | | if(s.length()>=20){ |
| | | String key = SportUtils.intToHex(bh)+s.substring(4,6); |
| | |
| | | }else { |
| | | gridDo.setCurKeyCode(""); |
| | | } |
| | | if("0101".equals(key)) { |
| | | /*if("0101".equals(key)) { |
| | | getVM().addInfo(key+" , "+isHaveKey+" "+keyCode); |
| | | getVM().addInfo(key + "设置钥匙:" + gridDo.getCurKeyCode()); |
| | | } |
| | | }*/ |
| | | gridDo.setUpdateTime(StringUtil.DateToStr(new Date())); |
| | | updateList.add(gridDo); |
| | | } |
| | |
| | | } |
| | | |
| | | getVM().updateGrids(updateList); |
| | | EventBus.getDefault().post(new KeyResultEvent()); |
| | | EventBus.getDefault().post(new KeyResultEvent(bh+"")); |
| | | } |
| | | |
| | | private SerialPortModel jiuPort; |