From feb2dbebb1c06e8e2833510ec3eedc051ab4c728 Mon Sep 17 00:00:00 2001 From: JiilingLee <462362@qq.com> Date: Thu, 2 Nov 2023 13:47:42 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B7=B2=E5=BD=92=E6=A1=A3=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=A0=E9=99=A4=202.=E5=8F=91=E7=A5=A8=E5=B7=B2=E5=85=B3?= =?UTF-8?q?=E8=81=94=E8=BF=87=E7=9A=84=E4=B8=8D=E8=83=BD=E5=86=8D=E5=85=B3?= =?UTF-8?q?=E8=81=94=203.=E6=B0=B8=E4=B9=85=E4=BF=9D=E5=AD=98=E7=A7=BB?= =?UTF-8?q?=E4=BA=A4=E5=B9=B4=E6=95=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/invoices/InvoicesController.java | 4 ++++ .../controller/admin/voucher/VoucherController.java | 5 +++++ .../archives/service/coderule/CodeRuleServiceImpl.java | 3 +++ 3 files changed, 12 insertions(+) diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/invoices/InvoicesController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/invoices/InvoicesController.java index 687a9b7c..5b13573a 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/invoices/InvoicesController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/invoices/InvoicesController.java @@ -75,6 +75,10 @@ public class InvoicesController { @Operation(summary = "更新发票") @PreAuthorize("@ss.hasPermission('accounting:invoices:update')") public CommonResult updateInvoices(@Valid @RequestBody InvoicesUpdateReqVO updateReqVO) { + InvoicesDO invoices = invoicesService.getInvoices(updateReqVO.getId()); + if (invoices.getVoucherId() !=null){ + return error("该发票已被关联"); + } invoicesService.updateInvoices(updateReqVO); return success(true); } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java index b2b1027d..3a01ccfc 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java @@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.accounting.dal.dataobject.attachment.AttachmentDO import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.invoices.InvoicesDO; +import cn.iocoder.yudao.module.accounting.enums.AccountingStatusEnum; import cn.iocoder.yudao.module.accounting.service.attachment.AttachmentService; import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService; import cn.iocoder.yudao.module.accounting.service.flow.FlowService; @@ -97,6 +98,10 @@ public class VoucherController { @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('accounting:voucher:delete')") public CommonResult deleteVoucher(@RequestParam("id") Long id) { + VoucherDO voucher = voucherService.getVoucher(id); + if (voucher.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){ + return error("该凭证已归档,请勿删除!"); + } voucherService.deleteVoucher(id); return success(true); } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/coderule/CodeRuleServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/coderule/CodeRuleServiceImpl.java index 0af4df44..df189b5f 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/coderule/CodeRuleServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/coderule/CodeRuleServiceImpl.java @@ -116,6 +116,9 @@ public class CodeRuleServiceImpl implements CodeRuleService { int year = calendar.get(Calendar.YEAR); //保管期限 String timeLimit = authenticateDO.getTimeLimit(); + if (timeLimit.equals("永久保存")){ + timeLimit="30"; + } int year2 = year + Integer.valueOf(timeLimit); //只有延长保存的 synchronized (this) {