From 82660aa93b7207d9fbf237f21261a914f94e0eb2 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Tue, 27 May 2025 14:25:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B1=80=E9=95=BF?= =?UTF-8?q?=E4=BF=A1=E7=AE=B1=E5=A4=9A=E6=AC=A1=E5=BB=B6=E6=9C=9F=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=EF=BC=8C=E7=AC=AC=E4=BA=8C=E6=AC=A1=E4=BC=9A=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=B4=AF=E8=AE=A1=E5=BB=B6?= =?UTF-8?q?=E6=9C=9F=E5=A4=A9=E6=95=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mailbox-lan/sql/20250527.sql | 29 +++++++++++++++++++ .../com/biutag/lan/domain/MailExtension.java | 5 ++-- .../biutag/lan/flow/node/ThreeVerifyFlow.java | 3 +- .../com/biutag/lan/service/MailService.java | 1 + 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 mailbox-lan/sql/20250527.sql diff --git a/mailbox-lan/sql/20250527.sql b/mailbox-lan/sql/20250527.sql new file mode 100644 index 0000000..24dd0af --- /dev/null +++ b/mailbox-lan/sql/20250527.sql @@ -0,0 +1,29 @@ +ALTER TABLE "mailbox"."mail_label" + ADD COLUMN "sort" int; + +CREATE TABLE "mailbox"."mail_extension" ( + "id" varchar(40) NOT NULL, + "mail_id" varchar(40) NOT NULL, + "days" int2, + "extension_reason" text, + "create_time" datatime, + CONSTRAINT "mail_extension_pkey" PRIMARY KEY ("id") +); + +COMMENT ON COLUMN "mailbox"."mail_extension"."days" IS '延期天数'; + +COMMENT ON COLUMN "mailbox"."mail_extension"."extension_reason" IS '延期理由'; + +COMMENT ON TABLE "mailbox"."mail_extension" IS '信件延期'; + + +INSERT INTO mail_extension ( ID, mail_id, days, extension_reason ) +SELECT + extension_request_id, + ID, + extension_days, + extension_reason +FROM + mail +WHERE + extension_state = 'applying' \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailExtension.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailExtension.java index c5e47ee..e30737f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailExtension.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailExtension.java @@ -1,6 +1,5 @@ package com.biutag.lan.domain; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; @@ -14,8 +13,8 @@ import java.time.LocalDateTime; @Getter public class MailExtension { - @TableId(type = IdType.AUTO) - private Integer id; + @TableId + private String id; /** * 信件ID diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java index 79bca99..6fadfcc 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java @@ -84,6 +84,7 @@ public class ThreeVerifyFlow extends Flow { work.setWorkType(WorkType.extension_approval.name()).setFlowName("待审批(申请延期)").setUpdateTime(now); workService.updateTodoById(work); MailExtension mailExtension = new MailExtension(); + mailExtension.setId(IdUtil.simpleUUID()); mailExtension.setMailId(mailId); mailExtension.setExtensionReason(reason); mailExtension.setDays(extensionDays); @@ -91,7 +92,7 @@ public class ThreeVerifyFlow extends Flow { mailExtensionMapper.insert(mailExtension); mail.setUpdateTime(now) .setExtensionState(ExtensionState.applying.name()) - .setExtensionRequestId(mailExtension.getId().toString()); + .setExtensionRequestId(mailExtension.getId()); mailService.updateById(mail); return null; } 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 c848214..5f73954 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 @@ -400,6 +400,7 @@ public class MailService extends ServiceImpl { MailExtension mailExtension = mailExtensionMapper.selectById(mail.getExtensionRequestId()); mail.setExtensionState(ExtensionState.completion.name()) .setExtensionDays(NumberUtil.nullToZero(mail.getExtensionDays()) + mailExtension.getDays()) + .setExtensionFlag(true) // 信件状态(已延期) .setMailState(MailState.delayed.name()); return updateById(mail);