From f0cad2574c5d2bb36fff8e1baa3922bee45cc11c Mon Sep 17 00:00:00 2001 From: 21819 Date: Tue, 5 Mar 2024 20:25:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=89=E6=B5=81=E7=A8=8B=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/lan/domain/MailAppeal.java | 2 +- .../biutag/lan/service/MailAppealService.java | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailAppeal.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailAppeal.java index 6b32b59..721a5f7 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailAppeal.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailAppeal.java @@ -44,7 +44,7 @@ public class MailAppeal { /** * 申诉状态:0,未审诉;1,正在申诉;2申诉成功;3,申诉失败 */ - private String appealStatus; + private String appealState; /** * 申诉步骤:1,发起;2,二级机构;3,市局 */ diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java index 92a3665..57e2f9e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java @@ -1,5 +1,6 @@ package com.biutag.lan.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.core.AjaxResult; import com.biutag.entity.system.Dept; import com.biutag.lan.config.AdminThreadLocal; @@ -26,12 +27,17 @@ public class MailAppealService { * @return */ public AjaxResult launchAppeal(MailAppeal appeal) { - appeal.setHandlingDept(AdminThreadLocal.getDeptId()) - .setAppealStatus("1") - .setThreeDept(AdminThreadLocal.getDeptId()); + long count = mailAppealMapper.selectCount(new LambdaQueryWrapper().eq(MailAppeal::getMailId, appeal.getMailId())); + if (count > 0) { + return AjaxResult.failed("此邮件您已发起过申诉,请勿重复申诉"); + } else { + appeal.setHandlingDept(AdminThreadLocal.getDeptId()) + .setAppealState("1") + .setThreeDept(AdminThreadLocal.getDeptId()); - mailAppealMapper.insert(appeal); - return AjaxResult.success(); + mailAppealMapper.insert(appeal); + return AjaxResult.success(); + } } /** @@ -65,7 +71,7 @@ public class MailAppealService { } appeal.setHandlingDept(deptId) .setOverruleReason(overruleReason) - .setAppealStatus("3"); + .setAppealState("3"); mailAppealMapper.updateById(appeal); return AjaxResult.success(); @@ -84,7 +90,7 @@ public class MailAppealService { appeal.setHandlingDept(deptId); switch (dept.getLevel()) { case 1: - appeal.setStep("3").setAppealStatus("2"); + appeal.setStep("3").setAppealState("2"); break; case 2: appeal.setSecondDept(deptId).setStep("2");