From cfad72d6b9d5b67920068c556819dd52bebd6935 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 24 六月 2025 14:40:07 +0800
Subject: [PATCH] 2025-06-23 采购-来票登记上传接口开发

---
 src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 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 6a2536e..a31835b 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -10,6 +10,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.basic.mapper.CustomerMapper;
 import com.ruoyi.basic.pojo.Customer;
+import com.ruoyi.common.enums.FileNameType;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -91,6 +92,7 @@
         return salesLedgerMapper.selectSalesLedgerList(salesLedgerDto);
     }
 
+    @Override
     public SalesLedgerDto getSalesLedgerWithProducts(SalesLedgerDto salesLedgerDto) {
         // 1. 鏌ヨ涓昏〃
         SalesLedger salesLedger = salesLedgerMapper.selectById(salesLedgerDto.getId());
@@ -107,6 +109,8 @@
             // 鎻愪緵涓存椂鏈紑绁ㄦ暟锛屾湭寮�绁ㄩ噾棰濅緵鍓嶆璁$畻
             product.setTempnoInvoiceAmount(product.getNoInvoiceAmount());
             product.setTempNoInvoiceNum(product.getNoInvoiceNum());
+            product.setRegister(SecurityUtils.getLoginUser().getUser().getNickName());
+            product.setRegisterDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
         }
 
         // 3.鏌ヨ涓婁紶鏂囦欢
@@ -425,7 +429,8 @@
                 fileRecord.setName(originalFilename);
                 fileRecord.setUrl(formalFilePath.toString());
                 fileRecord.setCreateTime(LocalDateTime.now());
-                fileRecord.setType("1");
+                //閿�鍞�
+                fileRecord.setType(FileNameType.SALE.getValue());
                 commonFileMapper.insert(fileRecord);
 
                 // 鍒犻櫎涓存椂鏂囦欢璁板綍
@@ -505,10 +510,10 @@
 
             // 2. 鏌ヨ褰撳ぉ/鍏徃宸插瓨鍦ㄧ殑搴忓垪鍙凤紙涓庡師閫昏緫涓�鑷达級
             Long tenantId = SecurityUtils.getLoginUser().getTenantId();
-            if(null != tenantId){
+            if (null != tenantId) {
                 //鑾峰彇鍏徃缂栧彿
                 SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
-                if(!ObjectUtils.isEmpty(sysDept)){
+                if (!ObjectUtils.isEmpty(sysDept)) {
                     datePart = (StringUtils.isEmpty(sysDept.getDeptNick()) ? "" : sysDept.getDeptNick()) + datePart;
                 }
             }

--
Gitblit v1.9.3