From acc94dd2dc309e50882f7b10c20d955ed2f14716 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 26 五月 2026 14:51:51 +0800
Subject: [PATCH] feat:修改自动编号的生成,根据传入的CreateTime生成对应的编号

---
 src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java b/src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java
index 1861d83..305ea9d 100644
--- a/src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java
+++ b/src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java
@@ -76,7 +76,7 @@
         String billStatus = validateAddParam(finReimbursementDto);
 
         // 鐢熸垚鎶ラ攢鍗曞彿
-        String billNo = OrderUtils.countTodayByCreateTime(finReimbursementMapper, "BXD", "bill_no");
+        String billNo = OrderUtils.countTodayByCreateTime(finReimbursementMapper, "BXD", "bill_no", finReimbursementDto.getCreateTime() != null ? finReimbursementDto.getCreateTime() : LocalDateTime.now());
         List<FinReimbursementDetail> details = finReimbursementDto.getDetails();
         BigDecimal totalAmount = details.stream()
                 .map(FinReimbursementDetail::getAmount)
@@ -381,7 +381,7 @@
     private void startApproval(FinReimbursement reimbursement, FinReimbursementDto finReimbursementDto) {
         Long businessType = resolveBusinessType(finReimbursementDto.getReimbursementType());
         ApprovalInstanceDto approvalInstanceDto = new ApprovalInstanceDto();
-        approvalInstanceDto.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no"));
+        approvalInstanceDto.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no", approvalInstanceDto.getCreateTime() != null ? approvalInstanceDto.getCreateTime() : LocalDateTime.now()));
         approvalInstanceDto.setBusinessId(reimbursement.getId());
         approvalInstanceDto.setTemplateId(null);
         approvalInstanceDto.setTemplateName(TypeEnums.getLabelByValue(businessType) + "瀹℃壒");

--
Gitblit v1.9.3