|
@@ -203,6 +203,18 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
if (contacts == null || contacts.getId() == null) {
|
|
|
msg.setError("关键信息为空");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<Contacts> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.ne(Contacts::getId,contacts.getId()).eq(Contacts::getCompanyId,companyId);
|
|
|
+ List<Contacts> list = contactsMapper.selectList(queryWrapper);
|
|
|
+ if (!list.isEmpty()){
|
|
|
+ for (Contacts c : list) {
|
|
|
+ if (StringUtils.isNotEmpty(c.getPhone())&&StringUtils.isNotEmpty(contacts.getPhone())&&c.getPhone().equals(contacts.getPhone())){
|
|
|
+ msg.setError("联系人电话存在重复,请修改");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
contactsMapper.updateById(contacts);
|
|
|
|