From dee1b9a3b5410a6dc1b271c4c9ff6b28d060a4ce Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 11 六月 2026 19:30:35 +0800
Subject: [PATCH] fix: 销售台账订单号使用D开头

---
 src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index 6303b04..c94f411 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -150,7 +150,7 @@
             // 鏌ヨ閫�璐т俊鎭�
             List<Long> productIds = salesLedgerProducts.stream().map(SalesLedgerProduct::getProductModelId).collect(Collectors.toList());
             List<SimpleReturnOrderGroupDto> groupListByProductIds = new ArrayList<>();
-            if(CollectionUtils.isNotEmpty(productIds)){
+            if (CollectionUtils.isNotEmpty(productIds)) {
                 groupListByProductIds = purchaseReturnOrderProductsMapper.getReturnOrderGroupListByProductIds(productIds);
             }
             Map<Long, BigDecimal> returnOrderGroupDtoMap = groupListByProductIds.stream().collect(Collectors.toMap(SimpleReturnOrderGroupDto::getProductModelId, SimpleReturnOrderGroupDto::getSumReturnQuantity));
@@ -301,7 +301,7 @@
             dto.setReceiptAmount(totalIncome);
             //寮�绁ㄩ噾棰�
             List<AccountInvoiceApplication> accountInvoiceApplications = accountInvoiceApplicationMapper.selectList(new LambdaQueryWrapper<AccountInvoiceApplication>()
-                            .eq(AccountInvoiceApplication::getStatus,1)
+                    .eq(AccountInvoiceApplication::getStatus, 1)
                     .between(AccountInvoiceApplication::getApplyDate, startTime, endTime));
             BigDecimal totalInvoiceAmount = Optional.of(
                     accountInvoiceApplications.stream()
@@ -449,7 +449,7 @@
             productWrapper.eq(SalesLedgerProduct::getType, 1);
             List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(productWrapper);
             for (SalesLedgerProduct product : products) {
-               product.setRegister(SecurityUtils.getLoginUser().getUser().getNickName());
+                product.setRegister(SecurityUtils.getLoginUser().getUser().getNickName());
                 product.setRegisterDate(LocalDateTime.now());
                 // 鍙戣揣淇℃伅
                 ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>()
@@ -656,14 +656,15 @@
             }
 
             // 2. 鏌ヨ褰撳ぉ/鍏徃宸插瓨鍦ㄧ殑搴忓垪鍙凤紙涓庡師閫昏緫涓�鑷达級
-            Long tenantId = SecurityUtils.getLoginUser().getTenantId();
-            if (null != tenantId) {
-                //鑾峰彇鍏徃缂栧彿
-                SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
-                if (!ObjectUtils.isEmpty(sysDept)) {
-                    datePart = (StringUtils.isEmpty(sysDept.getDeptNick()) ? "" : sysDept.getDeptNick()) + datePart;
-                }
-            }
+//            Long tenantId = SecurityUtils.getLoginUser().getTenantId();
+//            if (null != tenantId) {
+            //鑾峰彇鍏徃缂栧彿
+//                SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
+//                if (!ObjectUtils.isEmpty(sysDept)) {
+//                    datePart = (StringUtils.isEmpty(sysDept.getDeptNick()) ? "" : sysDept.getDeptNick()) + datePart;
+//                }
+//            }
+            datePart = "D" + datePart;
             List<Integer> existingSequences = salesLedgerMapper.selectSequencesByDate(datePart);
             int nextSequence = findFirstMissingSequence(existingSequences);
 

--
Gitblit v1.9.3