From 056da92becdda8deaf675cd665aa4692ebd96ab8 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Fri, 22 Apr 2022 09:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=9E=83=E5=9C=BE=E7=AE=B1=E9=82=AE=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/api/mail/MailAppController.java | 10 ++++++++++ .../cn/com/tenlion/systemoa/dao/mail/IMailDao.java | 2 ++ .../tenlion/systemoa/service/mail/IMailService.java | 1 + .../systemoa/service/mail/impl/MailServiceImpl.java | 11 +++++++++++ .../resources/mybatis/mapper/mail/mail-mapper.xml | 9 ++++++++- 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/mail/MailAppController.java b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/mail/MailAppController.java index ceed536..6c3d5eb 100644 --- a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/mail/MailAppController.java +++ b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/mail/MailAppController.java @@ -263,4 +263,14 @@ public class MailAppController extends DefaultBaseController { mailService.deleteDelMail(ids); } + @ApiOperation(value = "删除所有-垃圾箱邮件", notes = "删除所有-垃圾箱邮件") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @DeleteMapping("delete-app-del-mail-all") + public void deleteAppDelMailAll(@RequestHeader("token") String token){ + + mailService.deleteAppDelMailAll(token); + } + } diff --git a/src/main/java/cn/com/tenlion/systemoa/dao/mail/IMailDao.java b/src/main/java/cn/com/tenlion/systemoa/dao/mail/IMailDao.java index ece3dab..4c4d834 100644 --- a/src/main/java/cn/com/tenlion/systemoa/dao/mail/IMailDao.java +++ b/src/main/java/cn/com/tenlion/systemoa/dao/mail/IMailDao.java @@ -49,4 +49,6 @@ public interface IMailDao { MailDelDTO getDelMail(Map params); void deleteDelMail(String ids); + + void deleteAppDelMailAll(Map query); } diff --git a/src/main/java/cn/com/tenlion/systemoa/service/mail/IMailService.java b/src/main/java/cn/com/tenlion/systemoa/service/mail/IMailService.java index 8fa3fb4..041f2fb 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/mail/IMailService.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/mail/IMailService.java @@ -99,4 +99,5 @@ public interface IMailService { void deleteAppDraftMail(String token, String ids); + void deleteAppDelMailAll(String token); } diff --git a/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java index 7c227cf..714e019 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java @@ -485,6 +485,17 @@ public class MailServiceImpl extends DefaultBaseService implements IMailService mailDao.deleteDelMail(ids); } + @Override + public void deleteAppDelMailAll(String token) { + AppTokenUser appTokenUser = getAppTokenUser(token); + if(appTokenUser == null || "".equals(appTokenUser.getId())){ + return; + } + Map query = new HashMap<>(); + query.put("delUserId", appTokenUser.getId()); + mailDao.deleteAppDelMailAll(query); + } + @Override public SuccessResultList> listPageDelMail(ListPage page) { UserInfoBO currentUser = securityComponent.getCurrentUser(); diff --git a/src/main/resources/mybatis/mapper/mail/mail-mapper.xml b/src/main/resources/mybatis/mapper/mail/mail-mapper.xml index 4e6e7f8..00936d6 100644 --- a/src/main/resources/mybatis/mapper/mail/mail-mapper.xml +++ b/src/main/resources/mybatis/mapper/mail/mail-mapper.xml @@ -241,13 +241,20 @@ FIND_IN_SET(id, #{ids}) - + DELETE FROM oa_mail_del WHERE FIND_IN_SET(id, #{ids}) + + + DELETE FROM oa_mail_del + WHERE + del_user_id = #{delUserId} + + INSERT INTO oa_mail_del (