From 631bb51d5a78c2394cc28848d72ebf547562af8d Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Tue, 19 Mar 2024 18:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/lan/service/MailService.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java index feb88d0..52f2527 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java @@ -5,19 +5,17 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.constants.AppConstants; +import com.biutag.entity.setting.DictData; import com.biutag.entity.system.Dept; import com.biutag.enums.RoleEnum; import com.biutag.exception.BusinessException; import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.*; -import com.biutag.lan.domain.bo.CoHandlingReq; -import com.biutag.lan.domain.bo.FlowAction; -import com.biutag.lan.domain.bo.InvalidCompletion; -import com.biutag.lan.domain.bo.MailOuter; +import com.biutag.lan.domain.bo.*; import com.biutag.lan.domain.vo.MailApprovalVo; import com.biutag.lan.domain.vo.MailExtensionApprovalVo; import com.biutag.lan.domain.vo.MailFlowDetail; @@ -45,8 +43,6 @@ import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; -import static org.bouncycastle.asn1.iana.IANAObjectIdentifiers.mail; - @RequiredArgsConstructor @Service public class MailService extends ServiceImpl { @@ -81,9 +77,6 @@ public class MailService extends ServiceImpl { private final MailCoHandlingService mailCoHandlingService; - @Resource - private MailSourceMapper mailSourceMapper; - @Lazy @Autowired private List flowNodes; @@ -461,4 +454,19 @@ public class MailService extends ServiceImpl { return updateById(mail); } + public boolean delete(MailIdValidate mailId) { + if (mailId.getId()==null || mailId.getId().equals("")){ + return false; + } + Mail mail = baseMapper.selectById(mailId.getId()); + if (mailId.getId()!=null||!mailId.getId().equals("")){ + if (mail.getFlowKey().equals(FlowNodeEnum.FIRST_SIGN.getKey())||mail.getFlowKey().equals(FlowNodeEnum.FIRST_DISTRIBUTE.getKey())){ + baseMapper.deleteById(mailId.getId()); + mailSourceService.removeById(mailId.getId()); + workMapper.delete(new LambdaQueryWrapper().eq(Work::getMailId, mailId.getId())); + } + } + return true; + } + }