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 (