|
@@ -88,15 +88,19 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
if (StringUtils.isEmpty(contacts.getName())){
|
|
|
httpRespMsg.setError("请输入联系人姓名");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
if (contacts.getCustomId()==null){
|
|
|
httpRespMsg.setError("客户信息为空");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(contacts.getPhone())){
|
|
|
httpRespMsg.setError("联系人电话号码为空");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
if (contacts.getOwnerId() == null) {
|
|
|
httpRespMsg.setError("负责人信息为空!");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<Contacts> lqw_contacts = new LambdaQueryWrapper<>();
|
|
@@ -107,6 +111,7 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
Contacts selectedOne = contactsMapper.selectOne(lqw_contacts);
|
|
|
if (selectedOne != null) {
|
|
|
httpRespMsg.setError("已存在该联系人!");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
contacts.setCompanyId(companyId)
|
|
|
//todo:联系人的所有人是可选择的
|
|
@@ -203,6 +208,7 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
oName+=businessOpportunity.getName()+" ";
|
|
|
}
|
|
|
msg.setError(oName+"等商机正在进行且跟联系人有关");
|
|
|
+ return msg;
|
|
|
}
|
|
|
}
|
|
|
List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().in("contacts_id", ids));
|
|
@@ -210,6 +216,7 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
List<Task> collect = taskList.stream().filter(t ->t.getStatus()!=null&&t.getStatus() != 2).collect(Collectors.toList());
|
|
|
if (!collect.isEmpty()){
|
|
|
msg.setError("存在任务未完成且跟联系人有关");
|
|
|
+ return msg;
|
|
|
}
|
|
|
}
|
|
|
contactsUpdateWrapper.in("id", ids);
|
|
@@ -305,7 +312,7 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
|
|
|
|
|
|
//附件信息查询
|
|
|
LambdaQueryWrapper<ContactsDocument> cDLqw = new LambdaQueryWrapper<>();
|
|
|
- cDLqw.eq(ContactsDocument::getContactsId,contactsSelect.getId());
|
|
|
+ cDLqw.eq(ContactsDocument::getContactsId,contactsSelect.getId()).ne(ContactsDocument::getIsDeleted,1);
|
|
|
List<ContactsDocument> contactsDocuments = contactsDocumentMapper.selectList(cDLqw);
|
|
|
|
|
|
//返回数据
|