|
@@ -253,7 +253,17 @@ public class InfoServiceImpl implements InfoService {
|
|
|
|
|
|
if (dto.getType().equals(1)) {
|
|
|
QueryWrapper<PersonalMessage> wrapper = Wrappers.query();
|
|
|
- wrapper.eq("pm.folder_id", dto.getFolderId());
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getMailboxId()), "pm.mailbox_id", dto.getMailboxId());
|
|
|
+
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getDealingsEmail())) {
|
|
|
+ wrapper.and(q1 -> q1
|
|
|
+ .eq("pm.from_email", dto.getDealingsEmail())
|
|
|
+ .or().apply("FIND_IN_SET('" + dto.getDealingsEmail() + "', pm.recipients)")
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getFolderId()), "pm.folder_id", dto.getFolderId());
|
|
|
wrapper.and(ObjectUtil.isNotEmpty(dto.getKeyword()), q1 -> q1
|
|
|
.like("pm.from_email", dto.getKeyword())
|
|
|
.or().like("pm.subject", dto.getKeyword())
|
|
@@ -270,16 +280,20 @@ public class InfoServiceImpl implements InfoService {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
- PersonalFolder personalFolder = personalFolderService.getById(dto.getFolderId());
|
|
|
- if (personalFolder == null) {
|
|
|
- throw new ServiceException("文件夹已被删除");
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getFolderId())) {
|
|
|
+ PersonalFolder personalFolder = personalFolderService.getById(dto.getFolderId());
|
|
|
+ if (personalFolder == null) {
|
|
|
+ throw new ServiceException("文件夹已被删除");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
QueryWrapper<EnterpriseMessage> wrapper = Wrappers.query();
|
|
|
- wrapper.eq("em.folder_id", dto.getFolderId());
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getMailboxId()), "em.mailbox_id", dto.getMailboxId());
|
|
|
+
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(dto.getFolderId()), "em.folder_id", dto.getFolderId());
|
|
|
wrapper.and(ObjectUtil.isNotEmpty(dto.getKeyword()), q1 -> q1
|
|
|
.like("em.from_email", dto.getKeyword())
|
|
|
.or().like("em.subject", dto.getKeyword())
|
|
@@ -296,9 +310,11 @@ public class InfoServiceImpl implements InfoService {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
- EnterpriseFolder enterpriseFolder = enterpriseFolderService.getById(dto.getFolderId());
|
|
|
- if (enterpriseFolder == null) {
|
|
|
- throw new ServiceException("文件夹已被删除");
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getFolderId())) {
|
|
|
+ EnterpriseFolder enterpriseFolder = enterpriseFolderService.getById(dto.getFolderId());
|
|
|
+ if (enterpriseFolder == null) {
|
|
|
+ throw new ServiceException("文件夹已被删除");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|