Commit f2a7bac2 authored by hywang's avatar hywang

1.绑定耳标验证高频耳标是否已绑定

parent aeea7b36
......@@ -144,7 +144,28 @@ public class BindVM extends BackBarVM<Repository> implements OnInventoryListener
return;
}
bindRfid();
//判断是否已经绑定过高频耳标
QueryBuilder<CattleResumeEntity> builder0 =
DbUtil.getInstance().getQueryBuilder(CattleResumeEntity.class)
.where(CattleResumeEntityDao.Properties.RegistrationNo.eq(registrationNo.get()));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleResumeEntity>() {
@Override
public void onSuccess(List<CattleResumeEntity> result) {
if (result != null && result.size() > 0) {
ToastUtils.showShort("该耳标已被绑定,请重新扫描!");
return;
} else {
bindRfid();
}
}
@Override
public void onFailed() {
ToastUtils.showShort("查询基础数据数量失败!");
dismissDialog();
}
}).queryAsyncAll(CattleResumeEntity.class, builder0);
}
private void bindRfid() {
......@@ -191,7 +212,7 @@ public class BindVM extends BackBarVM<Repository> implements OnInventoryListener
if (msg.what == 0x333) {
InventoryData inventoryData = (InventoryData) msg.obj;
if (inventoryData.getDataLength() > 0 && inventoryData.getEpcLength() > 0) {
String epc = TextUtil.byteToHexString(inventoryData.getEPC_Data(), inventoryData.getEpcLength());
String epc = TextUtil.byteToHexString(inventoryData.getEPC_Data(), inventoryData.getEpcLength()).substring(1);
String tid = TextUtil.byteToHexString(inventoryData.getData(), inventoryData.getDataLength());
soundPool.play(musicId.get(1), 1, 1, 0, 0, 1);
App.getInstance().getLinkage().stopInventory();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment