|
@@ -144,11 +144,13 @@ public class PinanbaoContactService {
|
|
careContact.setRelationType(vo.getRelationType());
|
|
careContact.setRelationType(vo.getRelationType());
|
|
boolean updated = this.careHouseContactService.updateById(careContact);
|
|
boolean updated = this.careHouseContactService.updateById(careContact);
|
|
|
|
|
|
- List<CareHouseContactRel> relVos = pinanbaoDeviceService.queryMyContactRelListByDeviceId(devId);
|
|
|
|
- if (updated && (relVos == null || relVos.stream().filter(v -> careContact.getId() == v.getContactId()).count() <= 0)) {
|
|
|
|
- boolean childSaved = pinanbaoDeviceService.bindHouseContact(devId, careContact.getId());
|
|
|
|
- if (childSaved == false) {
|
|
|
|
- throw new BDException("修改紧急联系人, 对该设备绑定联系人出错");
|
|
|
|
|
|
+ if (devId != null) {
|
|
|
|
+ List<CareHouseContactRel> relVos = pinanbaoDeviceService.queryMyContactRelListByDeviceId(devId);
|
|
|
|
+ if (updated && (relVos == null || relVos.stream().filter(v -> careContact.getId() == v.getContactId()).count() <= 0)) {
|
|
|
|
+ boolean childSaved = pinanbaoDeviceService.bindHouseContact(devId, careContact.getId());
|
|
|
|
+ if (childSaved == false) {
|
|
|
|
+ throw new BDException("修改紧急联系人, 对该设备绑定联系人出错");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return updated;
|
|
return updated;
|