| | |
| | | * 新增子设备 |
| | | */ |
| | | public boolean addSub(InterphoneSubParam interphoneSubParam) { |
| | | List<InterphoneSub> list = list(Wrappers.lambdaQuery(InterphoneSub.class).eq(InterphoneSub::getSubMac, interphoneSubParam.getSubMac())); |
| | | if (list.size() > 0) { |
| | | throw new BusinessException("该设备已存在"); |
| | | } |
| | | InterphoneSub interphoneSub = new InterphoneSub(); |
| | | BeanUtils.copyProperties(interphoneSubParam, interphoneSub); |
| | | boolean save = save(interphoneSub); |
| | |
| | | /** |
| | | * 编辑一键求助子设备 日志记录结束 |
| | | */ |
| | | |
| | | return updateById(interphoneSub); |
| | | boolean b = updateById(interphoneSub); |
| | | List<InterphoneSub> list = list(Wrappers.lambdaQuery(InterphoneSub.class).eq(InterphoneSub::getSubMac, interphoneSubParam.getSubMac())); |
| | | if (list.size() > 1) { |
| | | throw new BusinessException("请检查设备mac是否重复"); |
| | | } |
| | | return b; |
| | | } |
| | | |
| | | /** |