@Override public void bindDevice(Device device, Store store) throws AppBizException { List<CupsTrmnl> cupsTrmnlList = cupsTrmnlService.findInactiviteTrmnl(store.getMrchNo(), store.getStoreNo()); if (cupsTrmnlList == null || cupsTrmnlList.size() <= 0) { throw new AppBizException(AppExCode.UNAVAILABLE_TERMINAL, "not find available terminal"); } CupsTrmnl cupsTrmnl = cupsTrmnlList.get(0); device.setTargetChannel(store.getTargetChannel()); device.setBindTransId(cupsTrmnl.getTrmnlId()); cupsTrmnl.setIsActive(Const.VLDSTATE_VALID); cupsTrmnl.setRemark( StringUtils.isNotBlank(device.getDevSn()) ? device.getDevSn() : device.getDevKsn()); cupsTrmnlService.updateCupsTrmnl(cupsTrmnl); }