keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/bean/CabinetDetailBean.java
@@ -6,6 +6,8 @@ import lombok.Data; public class CabinetDetailBean implements Serializable { //管理员id private Integer memberId; //设备编号 private String code; //设备ID @@ -30,6 +32,13 @@ //柜格信息 private List<ManageKeyCabinetBean> cabinetGridInfoVOList; public Integer getMemberId() { return memberId; } public void setMemberId(Integer memberId) { this.memberId = memberId; } public String getCode() { return code; keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/bean/DevConfigBean.java
@@ -8,6 +8,8 @@ private List<String> bannerList; //设备编号 private String code; //管理联系电话 private String linkPhone; //设备ID private String devId; //是否双重验证 0否 1是 @@ -86,6 +88,14 @@ this.cabinetGridInfoVOList = cabinetGridInfoVOList; } public String getLinkPhone() { return linkPhone; } public void setLinkPhone(String linkPhone) { this.linkPhone = linkPhone; } public CabinetConfigDataBean getCabinetConfigDataVO() { return cabinetConfigDataVO; } keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/dao/CabinetGridDao.java
@@ -69,7 +69,7 @@ List<CabinetGridDo> getGridByOpenStatus(int isOpen); @Transaction @Query("SELECT * FROM cabinet_grid WHERE is_open = 1 and working_status = 0 and grid_status = 0 order by grid_key asc") @Query("SELECT * FROM cabinet_grid WHERE is_open = 1 and working_status = 0 and grid_status = 0 and key_status !=3 order by grid_key asc") List<CabinetGridDo> getOpenGrids(); @Transaction keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/http/Apis.java
@@ -87,7 +87,7 @@ Observable<BaseResponse> timeOutUnCloseAlarm(@Body RequestBody requestBody); /** * 关闭柜格 - 司机 * 关闭柜格 */ @POST("visitsAdmin/cloudService/web/cabinet/closeGrid") Observable<BaseResponse> closeGrid(@Body RequestBody requestBody); keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/face/FaceActivity.java
@@ -9,8 +9,12 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.SpannableString; import android.text.Spanned; import android.text.TextUtils; import android.text.style.TextAppearanceSpan; import android.view.View; import android.widget.TextView; import com.baidu.idl.main.facesdk.model.BDFaceSDKCommon; import com.doumee.keyCabinet.MApplication; @@ -84,6 +88,15 @@ @Override protected void timeChange(String djs) { getDB().tvDjs.setText(djs); } private SpannableString getErrPhoneText(){ String phone = MApplication.getConfigBean().getLinkPhone(); 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); styledText.setSpan(new TextAppearanceSpan(this,R.style.style_tip1), text.length()-phone.length()+1, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return styledText; } private void statusFsm(int toStatus){ @@ -273,7 +286,7 @@ SingleBaseConfig.getBaseConfig().getMirrorVideoRGB() , SingleBaseConfig.getBaseConfig().isOpenGl()); CameraPreviewManager.getInstance().startPreview(glMantleSurfacView, SingleBaseConfig.getBaseConfig().getRgbVideoDirection() , PREFER_WIDTH, PERFER_HEIGH); getDB().tvJg2.setText(getErrPhoneText(), TextView.BufferType.SPANNABLE); } @Override keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/KeyCabinetActivity.java
@@ -55,32 +55,6 @@ private int status; private int ysDownCount = 10; private Handler handler = new Handler(){ @Override public void handleMessage(@NonNull Message msg) { switch (msg.what){ case 0: /*if (ysDownCount==4) { //领取钥匙倒计时 doRegister(7,null); ysDownCount--; handler.sendEmptyMessageDelayed(0,1000); }else if (ysDownCount==0) { //领取钥匙倒计时 //doRegister(MApplication.nextBoolean()?5:6,null); }else { ysDownCount--; handler.sendEmptyMessageDelayed(0,1000); }*/ break; case 1: break; default: break; } } }; @Override public int getLayoutId() { @@ -203,6 +177,7 @@ getDB().clTip1.setVisibility(View.GONE); if(status==0) { //重新开门 openTime = StringUtil.DateToStr(new Date()); EventBus.getDefault().post(new OpenGridEvent(selectBean.getChannelCode(), selectBean.getBoardCode())); } downTime = 60; @@ -234,7 +209,6 @@ getDB().clTip2.setVisibility(View.VISIBLE); EventBus.getDefault().post(new GetKeyStatusEvent()); ysDownCount = 8; handler.sendEmptyMessageDelayed(0,1000); break; case 7: //提醒关柜门 @@ -312,7 +286,7 @@ } private SpannableString getErrPhoneText(){ String phone = "15899098765"; String phone = MApplication.getConfigBean().getLinkPhone(); String text = "如有问题请联系管理员"+phone; SpannableString styledText = new SpannableString(text); styledText.setSpan(new TextAppearanceSpan(this, R.style.style_tip2), 0, text.length()-phone.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -340,13 +314,13 @@ if (gridDo != null) { if(flag==0){ //取 if(TextUtils.isEmpty(gridDo.getKeyCode())){ if(TextUtils.isEmpty(gridDo.getCurKeyCode())){ //空了 doRegister(7,null); } }else { //还 if(!TextUtils.isEmpty(gridDo.getKeyCode())){ if(!TextUtils.isEmpty(gridDo.getCurKeyCode())){ //有钥匙了 doRegister(7,null); } @@ -359,8 +333,6 @@ @Override protected void onDestroy() { super.onDestroy(); handler.removeCallbacksAndMessages(null); handler = null; } private String openTime = ""; @@ -377,7 +349,6 @@ return; } isOpened = true; openTime = StringUtil.DateToStr(new Date()); Toast.makeText(mContext, "操作4", Toast.LENGTH_LONG).show(); doRegister(4, null); } else { @@ -443,9 +414,6 @@ isOpened = false; doRegister(5, null); getVM().closeGrid(gridDo); } if (handler.hasMessages(0)) { handler.removeMessages(0); } }else { Toast.makeText(mContext, "未查询到", Toast.LENGTH_LONG).show(); keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/KeyCabinetVM.java
@@ -12,6 +12,7 @@ import com.doumee.keyCabinet.bean.KeyCabinetBean; import com.doumee.keyCabinet.bean.LoginBean; import com.doumee.keyCabinet.dao.CabinetGridDo; import com.doumee.keyCabinet.event.HttpEvent; import com.doumee.keyCabinet.http.Apis; import com.doumee.keyCabinet.http.param.BaseResponse; import com.doumee.keyCabinet.http.param.CloseGridParam; @@ -109,6 +110,7 @@ public void onNext(@NonNull BaseResponse response) { if(200==response.getCode()){ //开门 toast("开门接口成功"); doAction(2); }else { toast(response.getMessage()); @@ -144,7 +146,8 @@ .subscribe(new SimpleObserver<BaseResponse>(rxJavaGcManager) { @Override public void onNext(@NonNull BaseResponse response) { EventBus.getDefault().post(new HttpEvent("关闭柜格接口调用成功")); toast("关闭柜格:"+response.getMessage()); } @Override keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ManageCabinetActivity.java
@@ -20,9 +20,11 @@ import com.doumee.keyCabinet.dao.CabinetGridDo; import com.doumee.keyCabinet.dao.DaoManager; import com.doumee.keyCabinet.databinding.ManageCabinetActivityBinding; import com.doumee.keyCabinet.event.CloseGridOneResultEvent; import com.doumee.keyCabinet.event.HttpEvent; import com.doumee.keyCabinet.event.ManageOpenGridResultEvent; import com.doumee.keyCabinet.event.OpenAllGridEvent; import com.doumee.keyCabinet.event.OpenGridEvent; import com.doumee.keyCabinet.event.OpenGridListEvent; import com.doumee.keyCabinet.event.TimeClockEvent; import com.doumee.keyCabinet.ui.keyCabinet.adapter.ManageCabinetRcvAdapter; @@ -45,9 +47,12 @@ @AndroidEntryPoint public class ManageCabinetActivity extends MyBaseActivity<ManageCabinetVM, ManageCabinetActivityBinding> { private ManageCabinetRcvAdapter adapter; //1待全开,2待批量开 private int status; private boolean isCanCZ = false; //是否可批量操作 private boolean isCanPL = false; //可标记:全借出、全故障 private boolean isCanBJ = false; private int keyStatus = -1; @Override public int getLayoutId() { @@ -64,21 +69,7 @@ adapter = new ManageCabinetRcvAdapter(this, R.layout.manage_cabinet_rcv_item, new ManageCabinetRcvAdapter.OnItemClick() { @Override public void onItemClick(ManageKeyCabinetBean item) { List<ManageKeyCabinetBean> datas = adapter.getListData(); isCanCZ = false; for(ManageKeyCabinetBean d:datas){ if(d.getIsSelected().get()){ isCanCZ = true; break; } } if(isCanCZ){ getDB().tvPlOpen.setBackgroundResource(R.drawable.shape_mb_bt_ok); getDB().tvBj.setBackgroundResource(R.drawable.shape_mb_bt_ok); }else { getDB().tvPlOpen.setBackgroundResource(R.drawable.shape_mb_bt_faile); getDB().tvBj.setBackgroundResource(R.drawable.shape_mb_bt_faile); } updateBtnStatus(); } }); RecyclerHelp.bindVG(this,getDB().rcvKm,3,30); @@ -90,6 +81,9 @@ getVM().getDatasLD().observe(this, new Observer<List<ManageKeyCabinetBean>>() { @Override public void onChanged(List<ManageKeyCabinetBean> gridInfoBeans) { if(getDB().clCz.getVisibility()==View.VISIBLE){ getDB().clCz.setVisibility(View.GONE); } if(gridInfoBeans.size()>0){ adapter.refreshData(gridInfoBeans); getVM().emptyVisibility.set(View.GONE); @@ -101,6 +95,45 @@ } }); getVM().getCabinetDetail(); } private void updateBtnStatus(){ List<ManageKeyCabinetBean> datas = adapter.getListData(); isCanPL = false; isCanBJ = false; keyStatus = -1; for(ManageKeyCabinetBean d:datas){ if(d.getIsSelected().get()){ isCanPL = true; if(keyStatus==-1){ keyStatus = getGridStatus(d); }else { if(keyStatus!=getGridStatus(d)){ //不同 keyStatus = -2; } } } } if(isCanPL){ getDB().tvPlOpen.setBackgroundResource(R.drawable.shape_mb_bt_ok); }else { getDB().tvPlOpen.setBackgroundResource(R.drawable.shape_mb_bt_faile); } if(keyStatus==2||keyStatus==4){ isCanBJ = true; getDB().tvBj.setBackgroundResource(R.drawable.shape_mb_bt_ok); }else { getDB().tvBj.setBackgroundResource(R.drawable.shape_mb_bt_faile); } } private int getGridStatus(ManageKeyCabinetBean grid){ if(grid.getWorkingStatus()==1){ return 4; }else { return grid.getKeyStatus(); } } private void updateDao(List<ManageKeyCabinetBean> beans){ @@ -153,7 +186,6 @@ } private List<Integer> bjIds = new ArrayList<>(); private boolean isGz = true; private boolean isAllOpen = false; @Override protected void doRegister(int type, ActionEventData data) { @@ -168,7 +200,6 @@ case 2: { //全开 status = 1; //批量开门,校验是否可打开 List<Integer> ids = new ArrayList<>(); List<ManageKeyCabinetBean> datas = adapter.getListData(); @@ -183,7 +214,7 @@ } break; case 3: { if(!isCanCZ){ if(!isCanPL){ return; } //批量开门,校验是否可打开 @@ -228,34 +259,33 @@ }break; case 4: { //标记 if(!isCanCZ){ if(!isCanPL){ return; } bjIds.clear(); isGz = true; List<ManageKeyCabinetBean> datas = adapter.getListData(); for (ManageKeyCabinetBean bean : datas) { if (bean.getIsSelected().get()) { bjIds.add(bean.getId()); if(bean.getWorkingStatus()==0){ isGz = false; } } } if (bjIds.size() == 0) { Toast.makeText(mContext, "请选择柜格", Toast.LENGTH_SHORT).show(); return; } if(isGz){ if(keyStatus==4){ //全为故障 getDB().tvBjgz.setText("标记为正常"); getDB().tvBjgz.setTextColor(0xff279BAA); getDB().tvBjgz.setBackgroundResource(R.drawable.shape_mb_cz_2_bg); getDB().tvBy.setVisibility(View.GONE); }else { //标记故障 getDB().tvBjgz.setText("标记为故障"); getDB().tvBjgz.setTextColor(0xffFF3600); getDB().tvBjgz.setBackgroundResource(R.drawable.shape_mb_cz_1_bg); getDB().tvBy.setVisibility(View.VISIBLE); } getDB().clCz.setVisibility(View.VISIBLE); }break; @@ -267,7 +297,7 @@ getVM().markRepair(bjIds); break; case 7: if(isGz) { if(keyStatus==4) { //正常 getVM().cancelFault(bjIds); }else { @@ -276,6 +306,7 @@ } break; case 9: { updateBtnStatus(); if(isShowOpenTip==true) { //清空开门提醒 isShowOpenTip = false; @@ -284,6 +315,9 @@ getDB().clKmTip.setVisibility(View.GONE); } }break; case 11: updateBtnStatus(); break; default: break; } @@ -370,6 +404,17 @@ return styledText; } private void showKeyErrTip(CabinetGridDo gridDo){ getDB().imgClKm1.setImageResource(R.mipmap.ic_jjfail); getDB().tvClKm1.setText("识别失败"); getDB().tvClKm2.setText(getTipText2("钥匙柜",gridDo.getCabinetName(),"识别失败"), TextView.BufferType.SPANNABLE); getDB().tvClKmClose.setText("重新存放"); getDB().tvClKmClose.setTextColor(0xffffffff); getDB().tvClKmClose.setBackgroundResource(R.drawable.shape_mb_bt_ok); isShowOpenTip = false; getDB().clKmTip.setVisibility(View.VISIBLE); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK){ @@ -380,6 +425,10 @@ return super.onKeyDown(keyCode, event); } /** * 开门返回 * @param e */ @Subscribe(threadMode = ThreadMode.MAIN) public void ManageOpenGridResultEvent(ManageOpenGridResultEvent e){ if(!isFinishing()){ @@ -397,6 +446,10 @@ } } if(waitOpenMap.size()==0){ if(getDB().clKmTip.getVisibility()==View.VISIBLE){ //已弹出就不提示了 return; } EventBus.getDefault().post(new HttpEvent("全部打开了:"+waitOpenMap.size())); //打开成功 if(isAllOpen){ @@ -464,4 +517,41 @@ waitOpenMap.clear(); } } /** * 关门 * @param e */ @Subscribe(threadMode= ThreadMode.MAIN) public void CloseGridOneResultEvent(CloseGridOneResultEvent e){ if(!isFinishing()){ //校验卡号 CabinetGridDo gridDo = DaoManager.getCabinetGridDao().getGridByKey(e.getKey()); if(gridDo!=null){ //校验钥匙是否匹配 if(gridDo.getGridKey()==null){ if(!TextUtils.isEmpty(gridDo.getCurKeyCode())){ //未绑定的存放了钥匙 showKeyErrTip(gridDo); //开门 EventBus.getDefault().post(new OpenGridEvent(Integer.parseInt(e.getKey().substring(2,4), 16)+"", Integer.parseInt(e.getKey().substring(0,2), 16)+"")); return; } }else { if(!TextUtils.isEmpty(gridDo.getCurKeyCode())){ if(!gridDo.getCurKeyCode().equals(gridDo.getKeyCode())){ //钥匙不匹配 showKeyErrTip(gridDo); //开门 EventBus.getDefault().post(new OpenGridEvent(Integer.parseInt(e.getKey().substring(2,4), 16)+"", Integer.parseInt(e.getKey().substring(0,2), 16)+"")); return; } } } getVM().closeGrid(gridDo); } } } } keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ManageCabinetVM.java
@@ -1,6 +1,7 @@ package com.doumee.keyCabinet.ui.keyCabinet; import android.app.Application; import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.databinding.ObservableField; @@ -9,11 +10,15 @@ import com.doumee.keyCabinet.MApplication; import com.doumee.keyCabinet.bean.CabinetDetailBean; import com.doumee.keyCabinet.bean.LoginBean; import com.doumee.keyCabinet.bean.ManageKeyCabinetBean; import com.doumee.keyCabinet.dao.CabinetGridDo; import com.doumee.keyCabinet.event.HttpEvent; import com.doumee.keyCabinet.http.Apis; import com.doumee.keyCabinet.http.param.BaseResponse; import com.doumee.keyCabinet.http.param.BatchOpenGridAdminParam; import com.doumee.keyCabinet.http.param.CancelFaultParam; import com.doumee.keyCabinet.http.param.CloseGridParam; import com.doumee.keyCabinet.http.param.MarkFaultParam; import com.doumee.keyCabinet.http.param.MarkRepairParam; import com.doumee.keyCabinet.utils.ParamsUtil; @@ -21,6 +26,8 @@ import com.doumee.lib_coremodel.base.DataViewModel; import com.doumee.lib_coremodel.http.rxJava.SimpleObserver; import com.doumee.lib_coremodel.http.utils.RxUtils; import org.greenrobot.eventbus.EventBus; import java.util.ArrayList; import java.util.List; @@ -40,7 +47,7 @@ } public void getCabinetDetail(){ CabinetDetailBean bean = new CabinetDetailBean(); /*CabinetDetailBean bean = new CabinetDetailBean(); bean.setGridNum(24); bean.setOnlineKeyNum(1); bean.setOutKeyNum(2); @@ -95,11 +102,8 @@ b4.setWorkingStatus(1); b4.setBindStatus(1); datasLD.setValue(datas); datasLD.setValue(datas);*/ if(true){ return; } showLoading(true); getRetrofitService(Apis.class).getCabinetDetail(MApplication.getLoginBean().getToken(), MApplication.getConfigBean().getId()) @@ -110,6 +114,7 @@ if(200==response.getCode()){ dataOb.set(response.getData()); if(response.getData()!=null){ MApplication.getLoginBean().setMemberId(response.getData().getMemberId()); if(response.getData().getCabinetGridInfoVOList()!=null){ datasLD.setValue(response.getData().getCabinetGridInfoVOList()); }else { @@ -136,14 +141,14 @@ } public void batchOpenGridAdmin(List<Integer> gridIdList,boolean isAll){ if(isAll) { /*if(isAll) { doAction(8); }else { doAction(10); } if(true){ return; } }*/ showLoading(true); BatchOpenGridAdminParam param = new BatchOpenGridAdminParam(); param.setCabinetId(MApplication.getConfigBean().getId()); @@ -156,6 +161,7 @@ public void onNext(@NonNull BaseResponse response) { if(200==response.getCode()){ if(isAll) { toast("批量开门成功"); doAction(8); }else { doAction(10); @@ -190,6 +196,7 @@ @Override public void onNext(@NonNull BaseResponse response) { if(200==response.getCode()){ toast("标记柜格正常成功"); getCabinetDetail(); }else { toast(response.getMessage()); @@ -220,6 +227,7 @@ @Override public void onNext(@NonNull BaseResponse response) { if(200==response.getCode()){ toast("标记柜格故障成功"); getCabinetDetail(); }else { toast(response.getMessage()); @@ -250,6 +258,7 @@ @Override public void onNext(@NonNull BaseResponse response) { if(200==response.getCode()){ toast("标记维修保养成功"); getCabinetDetail(); }else { toast(response.getMessage()); @@ -268,6 +277,42 @@ }); } /** * 关门 * @param gridDo */ public void closeGrid(CabinetGridDo gridDo){ CloseGridParam param = new CloseGridParam(); LoginBean loginBean = MApplication.getLoginBean(); param.setCabinetId(MApplication.getConfigBean().getId()); param.setAuthType(loginBean.getAuthType()); param.setMemberId(loginBean.getMemberId()); param.setGridId(gridDo.getGridId()); param.setKeyStatus(!TextUtils.isEmpty(gridDo.getCurKeyCode())?1:2); toast(gridDo.getGridKey()+"关闭,当前钥匙号:"+gridDo.getCurKeyCode()); getRetrofitService(Apis.class).closeGrid(ParamsUtil.encodeRequestBody(param)) .compose(RxUtils.schedulersTransformer()) .subscribe(new SimpleObserver<BaseResponse>(rxJavaGcManager) { @Override public void onNext(@NonNull BaseResponse response) { if(response.getCode()==200){ getCabinetDetail(); doAction(11); } } @Override public void onError(@NonNull Throwable e) { } @Override public void onComplete() { } }); } public MutableLiveData<List<ManageKeyCabinetBean>> getDatasLD() { return datasLD; } keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/keyCabinet/ManageLoginVM.java
@@ -29,10 +29,6 @@ } public void loginCabinet(String userName,String pw){ if(true){ doAction(5); return; } LoginCabinetParam param = new LoginCabinetParam(); param.setUsername(userName); param.setPassword(pw); @@ -45,6 +41,7 @@ if(200==response.getCode()){ MApplication.setLoginBean(null); MApplication.getLoginBean().setToken(response.getData()); MApplication.getLoginBean().setAuthType(2); doAction(5); }else { doAction(4); keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/main/MainActivity.java
@@ -39,11 +39,9 @@ import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.transition.Transition; import com.doumee.keyCabinet.BuildConfig; import com.doumee.keyCabinet.base.BannerPicResponsePara; import com.doumee.keyCabinet.bean.CabinetConfigDataBean; import com.doumee.keyCabinet.bean.DevConfigBean; import com.doumee.keyCabinet.bean.FaceUserBean; import com.doumee.keyCabinet.bean.LoginBean; import com.doumee.keyCabinet.dao.CabinetGridDo; import com.doumee.keyCabinet.dao.DaoManager; import com.doumee.keyCabinet.databinding.MainActivityBinding; @@ -60,9 +58,9 @@ import com.doumee.keyCabinet.event.OpenGridEvent; import com.doumee.keyCabinet.event.OpenGridListEvent; import com.doumee.keyCabinet.event.OpenGridOneResultEvent; import com.doumee.keyCabinet.event.ReLoginEvent; import com.doumee.keyCabinet.event.TimeClockEvent; import com.doumee.keyCabinet.ui.face.ActivationActivity; import com.doumee.keyCabinet.ui.face.FaceActivity; import com.doumee.keyCabinet.ui.keyCabinet.ChangeUrlActivity; import com.doumee.keyCabinet.ui.keyCabinet.KeyCabinetActivity; import com.doumee.keyCabinet.ui.keyCabinet.ManageLoginActivity; @@ -273,6 +271,7 @@ getDB().tvId.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(ManageLoginActivity.class); //更改url if(lastDownTime2!=null){ if(System.currentTimeMillis()-lastDownTime2>1000){ @@ -286,6 +285,13 @@ lastDownTime2=null; startActivity(ChangeUrlActivity.class); } } }); getDB().tvVersion.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //todo 临时代码 setJiuConfig(); } }); upErrInfo(); @@ -305,6 +311,8 @@ } private void setJiuConfig(){ getVM().addInfo("酒精配置:"+(MApplication.getConfigBean().getCabinetConfigDataVO()!=null)+ ",串口开启:"+(jiuPort!=null)); if(MApplication.getConfigBean().getCabinetConfigDataVO()!=null&& jiuPort!=null){ setJiuConfig(0); @@ -355,49 +363,19 @@ case 2: case 3: { //校验是否登录 /*if(MApplication.getConfigBean().getId()==null){ if(MApplication.getConfigBean().getId()==null){ Toast.makeText(mContext, "设备未添加,无法操作", Toast.LENGTH_SHORT).show(); getVM().devLogin(); return; } MApplication.getLoginBean().setFlag(type==2?0:1); startActivity(FaceActivity.class);*/ /*if(type==2){ send485(1,"A002010000000003"); }else { send485(1,"A001010000000002"); }*/ //send485(1,"A001010000000002"); //send485(1,"A002010000000003"); //startActivity(KeyCabinetActivity.class,b); checkGridStatus(0); List<CabinetGridDo> gridDos = getVM().getOpenGrids(); if (gridDos.size() > 0) { tipDownCount = 10; isShowTip = true; getDB().tvDjs.setText(tipDownCount + "s"); StringBuilder sb = new StringBuilder(); for(CabinetGridDo d:gridDos){ if (sb.length()>0) { sb.append("、"); } String name = d.getCabinetName(); if (TextUtils.isEmpty(name)) { name = gridDos.get(0).getGridKey(); } sb.append(name); } getDB().tvTip22.setText(getTipText(sb.toString()), TextView.BufferType.SPANNABLE); getDB().clTip.setVisibility(View.VISIBLE); showUnCloseTip(gridDos); return; } MApplication.setLoginBean(null); MApplication.getLoginBean().setFlag(type == 2 ? 0 : 1); if(type==3){ startActivity(ManageLoginActivity.class); return; } startActivity(KeyCabinetActivity.class); } break; @@ -408,22 +386,7 @@ case 5: { List<CabinetGridDo> gridDos = getVM().getOpenGrids(); if (gridDos.size() > 0) { tipDownCount = 10; isShowTip = true; getDB().tvDjs.setText(tipDownCount + "s"); StringBuilder sb = new StringBuilder(); for(CabinetGridDo d:gridDos){ if (sb.length()>0) { sb.append("、"); } String name = d.getCabinetName(); if (TextUtils.isEmpty(name)) { name = gridDos.get(0).getGridKey(); } sb.append(name); } getDB().tvTip22.setText(getTipText(sb.toString()), TextView.BufferType.SPANNABLE); getDB().clTip.setVisibility(View.VISIBLE); showUnCloseTip(gridDos); }else { isShowTip = false; getDB().clTip.setVisibility(View.GONE); @@ -436,6 +399,35 @@ default: break; } } private void showUnCloseTip(List<CabinetGridDo> gridDos){ tipDownCount = 10; isShowTip = true; getDB().tvDjs.setText(tipDownCount + "s"); StringBuilder sb = new StringBuilder(); for(CabinetGridDo d:gridDos){ if (sb.length()>0) { sb.append("、"); } String name = d.getCabinetName(); if (TextUtils.isEmpty(name)) { name = gridDos.get(0).getGridKey(); } sb.append(name); } getDB().tvTip22.setText(getTipText(sb.toString()), TextView.BufferType.SPANNABLE); getDB().tvTip23.setText(getErrPhoneText(), TextView.BufferType.SPANNABLE); getDB().clTip.setVisibility(View.VISIBLE); } private SpannableString getErrPhoneText(){ String phone = MApplication.getConfigBean().getLinkPhone(); 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); styledText.setSpan(new TextAppearanceSpan(this,R.style.style_tip1), text.length()-phone.length()+1, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return styledText; } private boolean isShowing = false; @@ -1171,7 +1163,6 @@ EventBus.getDefault().post(new OpenGridEvent(Integer.parseInt(e.getKey().substring(2,4), 16)+"", Integer.parseInt(e.getKey().substring(0,2), 16)+"")); }else { //todo 关门成功 if(isShowTip){ doRegister(5,null); } keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/ui/main/MainVM.java
@@ -295,7 +295,7 @@ .subscribe(new SimpleObserver<BaseResponse>(rxJavaGcManager) { @Override public void onNext(@NonNull BaseResponse response) { toast("超时未关门接口调用成功"); } @Override @@ -323,7 +323,7 @@ .subscribe(new SimpleObserver<BaseResponse>(rxJavaGcManager) { @Override public void onNext(@NonNull BaseResponse response) { toast("关门接口调用成功"); } @Override keyCabinet-android/app/src/main/res/layout/face_activity.xml
@@ -439,7 +439,7 @@ android:id="@+id/tv_jg2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="如有问题请联系管理员15899098765" android:text="如有问题请联系管理员" android:textColor="#ff666666" android:textSize="24sp" app:layout_constraintTop_toBottomOf="@+id/tv_jg1" keyCabinet-android/app/src/main/res/layout/home_fragment_lbt_item.xml
@@ -3,14 +3,14 @@ android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:paddingLeft="60dp" android:paddingRight="60dp"> android:paddingLeft="30dp" android:paddingRight="30dp"> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/sim_icon" android:layout_width="match_parent" android:layout_height="0dp" app:viewAspectRatio="2.3" app:viewAspectRatio="2.2" style="@style/sim_nomal" app:roundedCornerRadius="20dp" app:layout_constraintTop_toTopOf="parent" keyCabinet-android/app/src/main/res/layout/key_cabinet_activity.xml
@@ -147,7 +147,7 @@ android:id="@+id/tv_jg2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="如有问题请联系管理员15899098765" android:text="如有问题请联系管理员" android:textColor="#ff666666" android:textSize="24sp" app:layout_constraintTop_toBottomOf="@+id/tv_jg1" @@ -211,7 +211,7 @@ android:id="@+id/tv_tip2_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="如有问题请联系管理员15899098765" android:text="如有问题请联系管理员" android:textColor="#ff666666" android:textSize="24sp" app:layout_constraintTop_toBottomOf="@+id/tv_tip2_1" keyCabinet-android/app/src/main/res/layout/main_activity.xml
@@ -165,17 +165,14 @@ android:id="@+id/img2" android:layout_width="match_parent" android:layout_height="0dp" android:background="@mipmap/bg_home" android:scaleType="fitXY" app:viewAspectRatio="2.2" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" app:layout_constraintTop_toBottomOf="@+id/bg_huan" android:layout_marginTop="30dp"/> <com.bigkoo.convenientbanner.ConvenientBanner android:id="@+id/banner" android:layout_width="0dp" android:layout_width="match_parent" android:layout_height="0dp" app:layout_constraintTop_toTopOf="@+id/img2" app:layout_constraintBottom_toBottomOf="@+id/img2" @@ -351,6 +348,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"/> <TextView android:id="@+id/tv_tip2_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="如有问题请联系管理员15899098765" android:textColor="#ff666666" android:textSize="24sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="45dp"/> </androidx.constraintlayout.widget.ConstraintLayout> <androidx.core.widget.NestedScrollView keyCabinet-android/app/src/main/res/layout/manage_cabinet_activity.xml
@@ -443,7 +443,8 @@ app:commandType="@{6}" app:onClickCommand="@{model.myTypeCommand}" android:layout_marginLeft="30dp" android:layout_marginRight="30dp"/> android:layout_marginRight="30dp" /> <TextView android:id="@+id/tv_bjgz" keyCabinet-android/app/src/main/res/layout/manage_login_activity.xml
@@ -76,7 +76,7 @@ android:layout_width="0dp" android:layout_height="75dp" android:background="@null" android:text="" android:text="15055153182" android:textColor="#111111" android:hint="请输入登录账号" android:textColorHint="#999999" @@ -126,7 +126,7 @@ android:layout_width="0dp" android:layout_height="75dp" android:background="@null" android:text="" android:text="123456a" android:hint="请输入账号密码" android:textColorHint="#999999" android:textSize="24sp" keyCabinet-android/app/src/main/res/values/styles.xml
@@ -113,4 +113,7 @@ <style name="style_tip2"> <item name="android:textColor">#FF111111</item> </style> <style name="style_tip3"> <item name="android:textColor">#ff666666</item> </style> </resources>