From 15f7555b9f9d3e3ae2cdaa82d89bc7ea5160f62c Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期四, 08 十月 2026 14:34:14 +0800
Subject: [PATCH] fix: 修复采购导入质检增加重复数据问题

---
 src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java |  570 +++++++++++++++++++++++++++------------------------------
 1 files changed, 270 insertions(+), 300 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
index e5dd8a3..abc6081 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -1,74 +1,72 @@
 package com.ruoyi.purchase.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.account.pojo.AccountExpense;
-import com.ruoyi.account.pojo.AccountIncome;
-import com.ruoyi.account.service.AccountExpenseService;
-import com.ruoyi.account.service.AccountIncomeService;
+import com.ruoyi.approve.bean.vo.ApproveProcessVO;
 import com.ruoyi.approve.pojo.ApproveProcess;
 import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl;
-import com.ruoyi.approve.vo.ApproveProcessVO;
+import com.ruoyi.basic.enums.ApplicationTypeEnum;
+import com.ruoyi.basic.enums.RecordTypeEnum;
 import com.ruoyi.basic.mapper.ProductMapper;
 import com.ruoyi.basic.mapper.ProductModelMapper;
 import com.ruoyi.basic.mapper.SupplierManageMapper;
-import com.ruoyi.basic.pojo.Customer;
 import com.ruoyi.basic.pojo.Product;
 import com.ruoyi.basic.pojo.ProductModel;
 import com.ruoyi.basic.pojo.SupplierManage;
+import com.ruoyi.basic.utils.FileUtil;
 import com.ruoyi.common.enums.FileNameType;
 import com.ruoyi.common.exception.base.BaseException;
-import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.AmountUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.security.LoginUser;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.other.mapper.TempFileMapper;
-import com.ruoyi.other.pojo.TempFile;
 import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
 import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage;
+import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.mapper.SysDeptMapper;
 import com.ruoyi.project.system.mapper.SysUserMapper;
 import com.ruoyi.purchase.dto.PurchaseLedgerDto;
 import com.ruoyi.purchase.dto.PurchaseLedgerImportDto;
 import com.ruoyi.purchase.dto.PurchaseLedgerProductImportDto;
-import com.ruoyi.purchase.mapper.*;
-import com.ruoyi.purchase.pojo.*;
+import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
+import com.ruoyi.purchase.pojo.PurchaseLedger;
 import com.ruoyi.purchase.service.IPurchaseLedgerService;
-import com.ruoyi.quality.mapper.*;
-import com.ruoyi.quality.pojo.*;
-import com.ruoyi.sales.dto.SalesLedgerImportDto;
-import com.ruoyi.sales.dto.SalesLedgerProductImportDto;
-import com.ruoyi.sales.mapper.*;
+import com.ruoyi.quality.mapper.QualityInspectMapper;
+import com.ruoyi.quality.mapper.QualityInspectParamMapper;
+import com.ruoyi.quality.mapper.QualityTestStandardMapper;
+import com.ruoyi.quality.mapper.QualityTestStandardParamMapper;
+import com.ruoyi.quality.pojo.QualityInspect;
+import com.ruoyi.quality.pojo.QualityInspectParam;
+import com.ruoyi.quality.pojo.QualityTestStandard;
+import com.ruoyi.quality.pojo.QualityTestStandardParam;
+import com.ruoyi.sales.mapper.CommonFileMapper;
+import com.ruoyi.sales.mapper.SalesLedgerMapper;
+import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
 import com.ruoyi.sales.pojo.CommonFile;
-import com.ruoyi.sales.pojo.InvoiceRegistrationProduct;
 import com.ruoyi.sales.pojo.SalesLedger;
 import com.ruoyi.sales.pojo.SalesLedgerProduct;
 import com.ruoyi.sales.service.impl.CommonFileServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FilenameUtils;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.support.DefaultTransactionDefinition;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -84,54 +82,31 @@
  * @date 2025-05-09
  */
 @Service
-@RequiredArgsConstructor
 @Slf4j
+@RequiredArgsConstructor
 public class PurchaseLedgerServiceImpl extends ServiceImpl<PurchaseLedgerMapper, PurchaseLedger> implements IPurchaseLedgerService {
-    private final AccountExpenseService accountExpenseService;
-    private final PurchaseLedgerMapper purchaseLedgerMapper;
 
+    private final PurchaseLedgerMapper purchaseLedgerMapper;
     private final SalesLedgerMapper salesLedgerMapper;
     private final SalesLedgerProductMapper salesLedgerProductMapper;
-
     private final SysUserMapper userMapper;
-
     private final TempFileMapper tempFileMapper;
-
     private final CommonFileMapper commonFileMapper;
-
+    private final SysDeptMapper sysDeptMapper;
     private final SupplierManageMapper supplierManageMapper;
-
     private final ProductMapper productMapper;
-
     private final ProductModelMapper productModelMapper;
-
     private final SysUserMapper sysUserMapper;
-
-    private final TicketRegistrationMapper ticketRegistrationMapper;
-
-    private final ProductRecordMapper productRecordMapper;
-
-    private final PaymentRegistrationMapper paymentRegistrationMapper;
-
-    private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
-
     private final StringRedisTemplate redisTemplate;
     private final QualityInspectMapper qualityInspectMapper;
     private final CommonFileServiceImpl commonFileService;
-    private final QualityTestStandardBindingMapper qualityTestStandardBindingMapper;
     private final QualityTestStandardParamMapper qualityTestStandardParamMapper;
     private final QualityTestStandardMapper qualityTestStandardMapper;
     private final QualityInspectParamMapper qualityInspectParamMapper;
-
     private final ApproveProcessServiceImpl approveProcessService;
-
     private final ProcurementRecordMapper procurementRecordStorageMapper;
-
-    private final PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper;
-
-    private final SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper;
-    @Value("${file.upload-dir}")
-    private String uploadDir;
+    private final PlatformTransactionManager transactionManager;
+    private final FileUtil fileUtil;
 
     @Override
     public List<PurchaseLedger> selectPurchaseLedgerList(PurchaseLedger purchaseLedger) {
@@ -139,22 +114,36 @@
         if (StringUtils.isNotBlank(purchaseLedger.getPurchaseContractNumber())) {
             queryWrapper.like(PurchaseLedger::getPurchaseContractNumber, purchaseLedger.getPurchaseContractNumber());
         }
+        if(purchaseLedger.getSupplierId()!=null){
+            queryWrapper.eq(PurchaseLedger::getSupplierId, purchaseLedger.getSupplierId());
+        }
+        if (purchaseLedger.getApprovalStatus() != null) {
+            queryWrapper.eq(PurchaseLedger::getApprovalStatus, purchaseLedger.getApprovalStatus());
+        }
         return purchaseLedgerMapper.selectList(queryWrapper);
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int addOrEditPurchase(PurchaseLedgerDto purchaseLedgerDto) throws Exception {
-
+        PurchaseLedger purchaseLedger = new PurchaseLedger();
+        // DTO杞珽ntity
+        BeanUtils.copyProperties(purchaseLedgerDto, purchaseLedger);
+        AmountUtils.normalizeContractAmount(purchaseLedger);
         SalesLedger salesLedger = salesLedgerMapper.selectById(purchaseLedgerDto.getSalesLedgerId());
         //褰曞叆浜�
         SysUser sysUser = userMapper.selectUserById(purchaseLedgerDto.getRecorderId());
+        if (ObjectUtils.isNotEmpty(sysUser)) {
+            purchaseLedger.setRecorderName(sysUser.getNickName());
+            purchaseLedger.setPhoneNumber(sysUser.getPhonenumber());
+        }else {
+            purchaseLedger.setRecorderName(SecurityUtils.getLoginUser().getNickName());
+            SysUser sysUser1 = userMapper.selectUserById(SecurityUtils.getUserId());
+            purchaseLedger.setPhoneNumber(sysUser1.getPhonenumber());
+        }
 
         SupplierManage supplierManage = supplierManageMapper.selectById(purchaseLedgerDto.getSupplierId());
 
-        // DTO杞珽ntity
-        PurchaseLedger purchaseLedger = new PurchaseLedger();
-        BeanUtils.copyProperties(purchaseLedgerDto, purchaseLedger);
         LoginUser loginUser = SecurityUtils.getLoginUser();
         if (ObjectUtils.isNotEmpty(loginUser) && null != loginUser.getTenantId()) {
             purchaseLedger.setTenantId(loginUser.getTenantId());
@@ -163,8 +152,7 @@
         purchaseLedger.setSalesLedgerId(ObjectUtils.isNotEmpty(salesLedger) ? salesLedger.getId() : -1);
         purchaseLedger.setSupplierName(supplierManage.getSupplierName());
         purchaseLedger.setRecorderId(purchaseLedgerDto.getRecorderId());
-        purchaseLedger.setRecorderName(sysUser.getNickName());
-        purchaseLedger.setPhoneNumber(sysUser.getPhonenumber());
+
         purchaseLedger.setApprovalStatus(1);
         // 3. 鏂板鎴栨洿鏂颁富琛�
         if (purchaseLedger.getId() == null) {
@@ -181,31 +169,21 @@
             }
             purchaseLedgerMapper.updateById(purchaseLedger);
         }
-        // 6.閲囪喘瀹℃牳鏂板
-        addApproveByPurchase(loginUser, purchaseLedger);
 
         // 4. 澶勭悊瀛愯〃鏁版嵁
         List<SalesLedgerProduct> productList = purchaseLedgerDto.getProductData();
         if (productList != null && !productList.isEmpty()) {
             handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType());
         }
-        //鏂板鍘熸潗鏂欐楠�
-        if (productList != null) {
-            for (SalesLedgerProduct saleProduct : productList) {
-                //鏄惁鎺ㄩ�佽川妫�锛屽鏋渢rue灏辨坊鍔�
-                if (saleProduct.getIsChecked()) {
-                    addQualityInspect(purchaseLedger, saleProduct);
-                }
-            }
-        }
+        // 6.閲囪喘瀹℃牳鏂板锛涘鎵圭鐞嗘湭閰嶇疆閲囪喘瀹℃壒浜烘椂锛屽鎵规湇鍔′細鑷姩缃负瀹℃壒閫氳繃銆�
+        addApproveByPurchase(loginUser, purchaseLedger);
         // 5. 杩佺Щ涓存椂鏂囦欢鍒版寮忕洰褰�
-        if (purchaseLedgerDto.getTempFileIds() != null && !purchaseLedgerDto.getTempFileIds().isEmpty()) {
-            migrateTempFilesToFormal(purchaseLedger.getId(), purchaseLedgerDto.getTempFileIds());
-        }
+        fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, RecordTypeEnum.PURCHASE_LEDGER, purchaseLedger.getId(), purchaseLedgerDto.getStorageBlobDTOS());
         return 1;
     }
 
-    private void addQualityInspect(PurchaseLedger purchaseLedger, SalesLedgerProduct saleProduct) {
+
+    public void addQualityInspect(PurchaseLedger purchaseLedger, SalesLedgerProduct saleProduct) {
         QualityInspect qualityInspect = new QualityInspect();
         qualityInspect.setInspectType(0);
         qualityInspect.setSupplier(purchaseLedger.getSupplierName());
@@ -237,6 +215,7 @@
         if (products == null || products.isEmpty()) {
             throw new BaseException("浜у搧淇℃伅涓嶅瓨鍦�");
         }
+        Integer ledgerType = type == null ? 2 : type;
 
         // 鎻愬墠鏀堕泦鎵�鏈夐渶瑕佹煡璇㈢殑ID
         Set<Long> productIds = products.stream()
@@ -264,6 +243,7 @@
 
         // 璁剧疆瀛楁
         for (SalesLedgerProduct product : products) {
+            AmountUtils.normalizeSalesLedgerProduct(product);
             product.setSalesLedgerId(salesLedgerId);
 
             Long productId = product.getProductId();
@@ -288,30 +268,27 @@
         // 鎵ц鏇存柊鎿嶄綔
         if (!updateList.isEmpty()) {
             for (SalesLedgerProduct product : updateList) {
-                product.setType(type);
+                product.setType(ledgerType);
                 salesLedgerProductMapper.updateById(product);
             }
         }
         // 鎵ц鎻掑叆鎿嶄綔
         if (!insertList.isEmpty()) {
             for (SalesLedgerProduct salesLedgerProduct : insertList) {
-                salesLedgerProduct.setType(type);
+                salesLedgerProduct.setType(ledgerType);
                 Date entryDate = purchaseLedger.getEntryDate();
 
                 LocalDateTime localDateTime = entryDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
                 salesLedgerProduct.setRegisterDate(localDateTime);
-                salesLedgerProduct.setFutureTickets(salesLedgerProduct.getQuantity());
-                salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getTaxInclusiveTotalPrice());
-                salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getTaxInclusiveTotalPrice());
                 salesLedgerProductMapper.insert(salesLedgerProduct);
             }
         }
 
         // 璁$畻鎬诲惈绋庨噾棰�
-        BigDecimal totalTaxInclusiveAmount = products.stream()
+        BigDecimal totalTaxInclusiveAmount = AmountUtils.scaleAmount(products.stream()
                 .map(SalesLedgerProduct::getTaxInclusiveTotalPrice)
                 .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add);
+                .reduce(BigDecimal.ZERO, BigDecimal::add));
 
         // 鏇存柊涓昏〃鐨勬�婚噾棰濆瓧娈�
         if (salesLedgerId != null) {
@@ -320,85 +297,17 @@
         }
     }
 
-    /**
-     * 灏嗕复鏃舵枃浠惰縼绉诲埌姝e紡鐩綍
-     *
-     * @param businessId  涓氬姟ID锛堥攢鍞彴璐D锛�
-     * @param tempFileIds 涓存椂鏂囦欢ID鍒楄〃
-     * @throws IOException 鏂囦欢鎿嶄綔寮傚父
-     */
-    private void migrateTempFilesToFormal(Long businessId, List<String> tempFileIds) throws IOException {
-        if (CollectionUtils.isEmpty(tempFileIds)) {
-            return;
-        }
-
-        // 鏋勫缓姝e紡鐩綍璺緞锛堟寜涓氬姟绫诲瀷鍜屾棩鏈熷垎缁勶級
-        String formalDir = uploadDir + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE);
-
-        Path formalDirPath = Paths.get(formalDir);
-
-        // 纭繚姝e紡鐩綍瀛樺湪锛堥�掑綊鍒涘缓锛�
-        if (!Files.exists(formalDirPath)) {
-            Files.createDirectories(formalDirPath);
-        }
-
-        for (String tempFileId : tempFileIds) {
-            // 鏌ヨ涓存椂鏂囦欢璁板綍
-            TempFile tempFile = tempFileMapper.selectById(tempFileId);
-            if (tempFile == null) {
-                log.warn("涓存椂鏂囦欢涓嶅瓨鍦紝璺宠繃澶勭悊: {}", tempFileId);
-                continue;
-            }
-
-            // 鏋勫缓姝e紡鏂囦欢鍚嶏紙鍖呭惈涓氬姟ID鍜屾椂闂存埑锛岄伩鍏嶅啿绐侊級
-            String originalFilename = tempFile.getOriginalName();
-            String fileExtension = FilenameUtils.getExtension(originalFilename);
-            String formalFilename = businessId + "_" +
-                    System.currentTimeMillis() + "_" +
-                    UUID.randomUUID().toString().substring(0, 8) +
-                    (StringUtils.hasText(fileExtension) ? "." + fileExtension : "");
-
-            Path formalFilePath = formalDirPath.resolve(formalFilename);
-
-            try {
-                // 鎵ц鏂囦欢杩佺Щ锛堜娇鐢ㄥ師瀛愭搷浣滅‘淇濆畨鍏ㄦ�э級
-//                Files.move(
-//                        Paths.get(tempFile.getTempPath()),
-//                        formalFilePath,
-//                        StandardCopyOption.REPLACE_EXISTING,
-//                        StandardCopyOption.ATOMIC_MOVE
-//                );
-                // 鍘熷瓙绉诲姩澶辫触锛屼娇鐢ㄥ鍒�+鍒犻櫎
-                Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING);
-                Files.deleteIfExists(Paths.get(tempFile.getTempPath()));
-                log.info("鏂囦欢杩佺Щ鎴愬姛: {} -> {}", tempFile.getTempPath(), formalFilePath);
-
-                // 鏇存柊鏂囦欢璁板綍锛堝叧鑱斿埌涓氬姟ID锛�
-                CommonFile fileRecord = new CommonFile();
-                fileRecord.setCommonId(businessId);
-                fileRecord.setName(originalFilename);
-                fileRecord.setUrl(formalFilePath.toString());
-                fileRecord.setCreateTime(LocalDateTime.now());
-                fileRecord.setType(FileNameType.PURCHASE.getValue());
-                commonFileMapper.insert(fileRecord);
-
-                // 鍒犻櫎涓存椂鏂囦欢璁板綍
-                tempFileMapper.deleteById(tempFile);
-
-                log.info("鏂囦欢杩佺Щ鎴愬姛: {} -> {}", tempFile.getTempPath(), formalFilePath);
-            } catch (IOException e) {
-                log.error("鏂囦欢杩佺Щ澶辫触: {}", tempFile.getTempPath(), e);
-                // 鍙�夋嫨鍥炴粴浜嬪姟鎴栬褰曞け璐ユ枃浠�
-                throw new IOException("鏂囦欢杩佺Щ寮傚父", e);
-            }
-        }
-    }
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int deletePurchaseLedgerByIds(Long[] ids) {
         if (ids == null || ids.length == 0) {
            throw new BaseException("璇烽�変腑鑷冲皯涓�鏉℃暟鎹�");
+        }
+        for (Long id : ids) {
+            PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id);
+            if (purchaseLedger.getApprovalStatus().equals(3)) {
+                throw new BaseException(purchaseLedger.getPurchaseContractNumber()+"宸茬粡瀹℃壒閫氳繃锛屼笉鍏佽鍒犻櫎");
+            }
         }
         // 鎵归噺鍒犻櫎鍏宠仈鐨勯噰璐叆搴撹褰�
         LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductQueryWrapper = new LambdaQueryWrapper<>();
@@ -418,21 +327,10 @@
         queryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids)
                 .eq(SalesLedgerProduct::getType, 2);
         salesLedgerProductMapper.delete(queryWrapper);
-        // 鎵归噺鍒犻櫎鍏宠仈鐨勯噰璐彴璐︾殑鏉ョエ鐧昏
-        LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getPurchaseLedgerId,ids);
-        ticketRegistrationMapper.delete(ticketRegistrationLambdaQueryWrapper);
-        // 鎵归噺鍒犻櫎鍏宠仈鐨勯噰璐彴璐︾殑鏉ョエ鐧昏璁板綍
-        LambdaQueryWrapper<ProductRecord> productRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        productRecordLambdaQueryWrapper.in(ProductRecord::getPurchaseLedgerId,ids);
-        productRecordMapper.delete(productRecordLambdaQueryWrapper);
-        // 鎵归噺鍒犻櫎浠樻鐧昏
-        LambdaQueryWrapper<PaymentRegistration> paymentRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        paymentRegistrationLambdaQueryWrapper.in(PaymentRegistration::getPurchaseLedgerId, ids);
-        paymentRegistrationMapper.delete(paymentRegistrationLambdaQueryWrapper);
         //鎵归噺鍒犻櫎妫�楠屾爣鍑�
         LambdaQueryWrapper<QualityInspect> materialInspectLambdaQueryWrapper = new LambdaQueryWrapper<>();
         materialInspectLambdaQueryWrapper.in(QualityInspect::getPurchaseLedgerId, ids);
+
         List<QualityInspect> qualityInspects = qualityInspectMapper.selectList(materialInspectLambdaQueryWrapper);
         qualityInspects.stream().forEach(qualityInspect -> {
             if (ObjectUtils.isNotEmpty(qualityInspect.getInspectState())&&qualityInspect.getInspectState().equals(1)) {
@@ -484,19 +382,16 @@
                 .eq(SalesLedgerProduct::getType, purchaseLedgerDto.getType());
         List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(productWrapper);
 
-        // 3.鏌ヨ涓婁紶鏂囦欢
-        LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>();
-        salesLedgerFileWrapper.eq(CommonFile::getCommonId, purchaseLedger.getId())
-                .eq(CommonFile::getType,FileNameType.PURCHASE.getValue());
-        List<CommonFile> salesLedgerFiles = commonFileMapper.selectList(salesLedgerFileWrapper);
 
         // 4. 杞崲 DTO
         PurchaseLedgerDto resultDto = new PurchaseLedgerDto();
         BeanUtils.copyProperties(purchaseLedger, resultDto);
+        AmountUtils.normalizeContractAmount(resultDto);
         if (!products.isEmpty()) {
+            AmountUtils.normalizeSalesLedgerProducts(products);
             resultDto.setHasChildren(true);
             resultDto.setProductData(products);
-            resultDto.setSalesLedgerFiles(salesLedgerFiles);
+            resultDto.setStorageBlobVOS(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.FILE, RecordTypeEnum.PURCHASE_LEDGER, purchaseLedger.getId()));
         }
         return resultDto;
     }
@@ -536,14 +431,7 @@
         queryWrapper.eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedger.getId())
                 .eq(SalesLedgerProduct::getType, 2);
         List<SalesLedgerProduct> productList = salesLedgerProductMapper.selectList(queryWrapper);
-        productList.forEach(product -> {
-            product.setFutureTickets(product.getFutureTickets() != null ? product.getFutureTickets() : product.getQuantity());
-            product.setFutureTicketsAmount(product.getFutureTicketsAmount() != null ? product.getFutureTicketsAmount() : product.getTaxInclusiveTotalPrice());
-            product.setTicketsNum(null);
-            product.setTicketsAmount(null);
-            product.setTempFutureTickets(product.getFutureTickets());
-            product.setTempFutureTicketsAmount(product.getFutureTicketsAmount());
-        });
+        AmountUtils.normalizeSalesLedgerProducts(productList);
         resultDto.setProductData(productList);
         return resultDto;
     }
@@ -570,35 +458,19 @@
         PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id);
 
         BeanUtils.copyProperties(purchaseLedger, purchaseLedgerDto);
-//        TicketRegistration ticketRegistration = ticketRegistrationMapper.selectOne(new LambdaQueryWrapper<TicketRegistration>().eq(TicketRegistration::getPurchaseLedgerId, id));
-//        if (ticketRegistration != null) {
-//            purchaseLedgerDto.setInvoiceNumber(ticketRegistration.getInvoiceNumber());
-//            purchaseLedgerDto.setInvoiceAmount(ticketRegistration.getInvoiceAmount());
-//            purchaseLedgerDto.setTicketRegistrationId(ticketRegistration.getId());
-//        }
         return purchaseLedgerDto;
     }
 
     @Override
     public IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger) {
-        IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger);
-        purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> {
-            List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASE.getValue()));
-            purchaseLedgerDto.setSalesLedgerFiles(commonFiles);
-        });
-        return purchaseLedgerDtoIPage;
-    }
-
-    @Override
-    public List<InvoiceRegistrationProduct> getProductBySalesNo(Long id) {
-        List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>()
-                .select(InvoiceRegistrationProduct::getId, InvoiceRegistrationProduct::getProductCategory, InvoiceRegistrationProduct::getSpecificationModel,
-                        InvoiceRegistrationProduct::getUnit, InvoiceRegistrationProduct::getQuantity)
-                .eq(InvoiceRegistrationProduct::getSalesLedgerId, id));
-        if (invoiceRegistrationProducts.isEmpty()) {
-            return new ArrayList<>();
+        IPage<PurchaseLedgerDto> page = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger);
+        if (!CollectionUtils.isEmpty(page.getRecords())) {
+            page.getRecords().forEach(record -> {
+                AmountUtils.normalizeContractAmount(record);
+                AmountUtils.normalizeSalesLedgerProducts(record.getProductData());
+            });
         }
-        return invoiceRegistrationProducts;
+        return page;
     }
 
     @Override
@@ -622,117 +494,190 @@
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public AjaxResult importData(MultipartFile file) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
+        int successCount = 0;
+        int skipCount = 0;
+        int failCount = 0;
+        List<String> failList = new ArrayList<>();
+        List<String> skipList = new ArrayList<>();
+
         try {
             InputStream inputStream = file.getInputStream();
             ExcelUtil<PurchaseLedgerImportDto> salesLedgerImportDtoExcelUtil = new ExcelUtil<>(PurchaseLedgerImportDto.class);
-            Map<String, List<PurchaseLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(Arrays.asList("閲囪喘鍙拌处鏁版嵁", "閲囪喘浜у搧鏁版嵁"), inputStream, 0);
+            Map<String, List<PurchaseLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(
+                    Arrays.asList("閲囪喘鍙拌处鏁版嵁", "閲囪喘浜у搧鏁版嵁"), inputStream, 0);
             if (CollectionUtils.isEmpty(stringListMap)) return AjaxResult.error("閲囪喘琛ㄦ牸涓虹┖锛�");
-            // 涓氬姟灞傚悎骞�
-            List<PurchaseLedgerImportDto> salesLedgerImportDtoList = stringListMap.get("閲囪喘鍙拌处鏁版嵁");
-            if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return AjaxResult.error("閲囪喘鍙拌处鏁版嵁涓虹┖锛�");
-            List<PurchaseLedgerImportDto> salesLedgerProductImportDtoList = stringListMap.get("閲囪喘浜у搧鏁版嵁");
-            if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("閲囪喘浜у搧鏁版嵁涓虹┖锛�");
-            // 渚涘簲鍟嗘暟鎹�
-            List<SupplierManage> customers = supplierManageMapper.selectList(new LambdaQueryWrapper<SupplierManage>().in(SupplierManage::getSupplierName,
-                    salesLedgerImportDtoList.stream().map(PurchaseLedgerImportDto::getSupplierName).collect(Collectors.toList())));
-            List<Map<String,Object>> list = productModelMapper.getProductAndModelList();
-            // 褰曞叆浜烘暟鎹�
-            List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().in(SysUser::getNickName,
-                    salesLedgerImportDtoList.stream().map(PurchaseLedgerImportDto::getRecorderName).collect(Collectors.toList())));
-            for (PurchaseLedgerImportDto salesLedgerImportDto : salesLedgerImportDtoList) {
-                PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectOne(new LambdaQueryWrapper<PurchaseLedger>()
-                        .eq(PurchaseLedger::getPurchaseContractNumber, salesLedgerImportDto.getPurchaseContractNumber())
+
+            List<PurchaseLedgerImportDto> ledgerList = stringListMap.get("閲囪喘鍙拌处鏁版嵁");
+            if (CollectionUtils.isEmpty(ledgerList)) return AjaxResult.error("閲囪喘鍙拌处鏁版嵁涓虹┖锛�");
+            List<PurchaseLedgerImportDto> productList = stringListMap.get("閲囪喘浜у搧鏁版嵁");
+            if (CollectionUtils.isEmpty(productList)) return AjaxResult.error("閲囪喘浜у搧鏁版嵁涓虹┖锛�");
+
+            // 棰勫姞杞戒緵搴斿晢銆佷骇鍝併�佸綍鍏ヤ汉鏁版嵁锛堝叏閲忥紝閬垮厤姣忔潯閮芥煡锛�
+            List<SupplierManage> customers = supplierManageMapper.selectList(Wrappers.lambdaQuery());
+            List<Map<String, Object>> productModelList = productModelMapper.getProductAndModelList();
+            List<SysUser> sysUsers = sysUserMapper.selectList(Wrappers.lambdaQuery());
+
+            int rowNum = 0;
+            for (PurchaseLedgerImportDto dto : ledgerList) {
+                rowNum++;
+                String contractNo = dto.getPurchaseContractNumber();
+                String rowLabel = "绗�" + rowNum + "琛孾" + (contractNo != null ? contractNo : "鏃犻噰璐崟鍙�") + "]";
+
+                // 宸插瓨鍦ㄥ垯璺宠繃
+                PurchaseLedger exist = purchaseLedgerMapper.selectOne(Wrappers.<PurchaseLedger>lambdaQuery()
+                        .eq(PurchaseLedger::getPurchaseContractNumber, contractNo)
                         .last("limit 1"));
-                if(purchaseLedger != null){
+                if (exist != null) {
+                    skipCount++;
+                    skipList.add(rowLabel + " 閲囪喘鍗曞彿宸插瓨鍦紝璺宠繃");
                     continue;
                 }
-                PurchaseLedger salesLedger = new PurchaseLedger();
-                BeanUtils.copyProperties(salesLedgerImportDto, salesLedger);
-                // 閫氳繃渚涘簲鍟嗗悕绉版煡璇D
-                salesLedger.setSupplierId(customers.stream()
-                        .filter(customer -> customer.getSupplierName().equals(salesLedger.getSupplierName()))
-                        .findFirst()
-                        .map(SupplierManage::getId)
-                        .orElse(null));
-                Long aLong = sysUsers.stream()
-                        .filter(sysUser -> sysUser.getNickName().equals(salesLedger.getRecorderName()))
-                        .findFirst()
-                        .map(SysUser::getUserId)
-                        .orElse(null);
-                if (aLong == null)
-                    throw new RuntimeException("褰曞叆浜�:" + salesLedger.getRecorderName() + ",鏃犲搴旂敤鎴凤紒");
-                salesLedger.setRecorderId(aLong);
-                // 閲囪喘浜у搧鏁版嵁缁戝畾锛岄�氳繃閲囪喘鍗曞彿鑾峰彇瀵瑰簲閲囪喘浜у搧鏁版嵁
-                List<PurchaseLedgerProductImportDto> salesLedgerProductImportDtos = salesLedgerProductImportDtoList.stream()
-                        .filter(salesLedgerProductImportDto -> salesLedgerProductImportDto.getPurchaseContractNumber().equals(salesLedger.getPurchaseContractNumber()))
-                        .collect(Collectors.toList());
-                if (CollectionUtils.isEmpty(salesLedgerProductImportDtos))
-                    throw new RuntimeException("閲囪喘鍗曞彿:" + salesLedgerImportDto.getPurchaseContractNumber() + ",鏃犲搴斾骇鍝佹暟鎹紒");
-                salesLedger.setContractAmount(salesLedgerProductImportDtos.stream()
-                        .map(PurchaseLedgerProductImportDto::getTaxInclusiveTotalPrice)
-                        .reduce(BigDecimal.ZERO,BigDecimal::add));
-                // 閫氳繃閿�鍞崟鍙风粦瀹氶攢鍞�
-                SalesLedger salesLedger1 = salesLedgerMapper.selectOne(new LambdaQueryWrapper<SalesLedger>()
-                        .eq(SalesLedger::getSalesContractNo, salesLedger.getSalesContractNo())
-                        .last("LIMIT 1"));
-                if(salesLedger1 != null){
-                    salesLedger.setSalesLedgerId(salesLedger1.getId());
-                }
-                // 閲囪喘瀹℃牳
-                // 閫氳繃鏄电О鑾峰彇鐢ㄦ埛ID
-                String[] split = salesLedger.getApproveUserIds().split("锛�");
-                List<Long> ids = new ArrayList<>();
-                for (int i = 0; i < split.length; i++) {
-                    SysUser sysUser = sysUserMapper.selectOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getNickName, split[i])
-                            .last("LIMIT 1"));
-                    if (sysUser != null) {
-                        ids.add(sysUser.getUserId());
-                    }
-                }
-                // 灏嗛泦鍚堣浆涓哄瓧绗︿覆锛岄殧寮�
-                String collect = ids.stream().map(Object::toString).collect(Collectors.joining(","));
-                salesLedger.setApproveUserIds(collect);
-                purchaseLedgerMapper.insert(salesLedger);
 
-                for (PurchaseLedgerProductImportDto salesLedgerProductImportDto : salesLedgerProductImportDtos) {
-                    SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct();
-                    BeanUtils.copyProperties(salesLedgerProductImportDto, salesLedgerProduct);
-                    salesLedgerProduct.setSalesLedgerId(salesLedger.getId());
-                    salesLedgerProduct.setType(2);
-                    // 璁$畻涓嶅惈绋庢�讳环
-                    salesLedgerProduct.setTaxExclusiveTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice().divide(new BigDecimal(1).add(salesLedgerProduct.getTaxRate().divide(new BigDecimal(100))), 2, RoundingMode.HALF_UP));
-                    salesLedgerProduct.setFutureTickets(salesLedgerProduct.getQuantity());
-                    salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getTaxExclusiveTotalPrice());
-                    list.stream()
-                            .filter(map -> map.get("productName").equals(salesLedgerProduct.getProductCategory()) && map.get("model").equals(salesLedgerProduct.getSpecificationModel()))
-                            .findFirst()
-                            .ifPresent(map -> {
-                                salesLedgerProduct.setProductModelId(Long.parseLong(map.get("modelId").toString()));
-                                salesLedgerProduct.setProductId(Long.parseLong(map.get("id").toString()));
-                            });
-                    salesLedgerProduct.setRegister(loginUser.getNickName());
-                    salesLedgerProduct.setRegisterDate(LocalDateTime.now());
-                    salesLedgerProduct.setApproveStatus(0);
-                    salesLedgerProduct.setPendingTicketsTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice());
-                    // 鏄惁璐ㄦ鍒ゆ柇
-                    salesLedgerProduct.setIsChecked(salesLedgerProductImportDto.getIsChecked() == 1);
-                    if(salesLedgerProductImportDto.getIsChecked() == 1){
-                        addQualityInspect(salesLedger, salesLedgerProduct);
-                    }
-                    salesLedgerProductMapper.insert(salesLedgerProduct);
+                // 姣忔潯涓�涓嫭绔嬩簨鍔★紝澶辫触鍙洖婊氬綋鍓嶆潯
+                TransactionStatus txStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
+                try {
+                    importOneLedger(dto, productList, customers, productModelList, sysUsers, loginUser);
+                    transactionManager.commit(txStatus);
+                    successCount++;
+                } catch (Exception e) {
+                    transactionManager.rollback(txStatus);
+                    failCount++;
+                    failList.add(rowLabel + " " + e.getMessage());
+                    log.error("瀵煎叆澶辫触 - {}", rowLabel, e);
                 }
-                // 閲囪喘瀹℃牳
-                addApproveByPurchase(loginUser,salesLedger);
             }
 
-            return AjaxResult.success("瀵煎叆鎴愬姛");
+            // 鏋勫缓杩斿洖缁撴灉
+            StringBuilder msg = new StringBuilder();
+            msg.append("瀵煎叆瀹屾垚锛氭垚鍔�").append(successCount).append("鏉�");
+            if (skipCount > 0) msg.append("锛岃烦杩�").append(skipCount).append("鏉�");
+            if (failCount > 0) msg.append("锛屽け璐�").append(failCount).append("鏉�");
+
+            Map<String, Object> result = new HashMap<>();
+            result.put("successCount", successCount);
+            result.put("skipCount", skipCount);
+            result.put("failCount", failCount);
+            result.put("failList", failList);
+            result.put("skipList", skipList);
+            result.put("msg", msg.toString());
+
+            AjaxResult ajaxResult = AjaxResult.success(msg.toString());
+            ajaxResult.putAll(result);
+            return ajaxResult;
+
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("閲囪喘鍙拌处瀵煎叆寮傚父", e);
+            return AjaxResult.error("瀵煎叆寮傚父锛�" + e.getMessage());
         }
-        return AjaxResult.success("瀵煎叆澶辫触");
+    }
+
+    /**
+     * 瀵煎叆鍗曟潯閲囪喘鍙拌处锛堝惈浜у搧鏄庣粏+瀹℃壒娴佺▼锛�
+     */
+    private void importOneLedger(PurchaseLedgerImportDto dto,
+                                 List<PurchaseLedgerImportDto> productList,
+                                 List<SupplierManage> customers,
+                                 List<Map<String, Object>> productModelList,
+                                 List<SysUser> sysUsers,
+                                 LoginUser loginUser) throws Exception {
+        PurchaseLedger ledger = new PurchaseLedger();
+        BeanUtils.copyProperties(dto, ledger);
+
+        // 渚涘簲鍟�
+        ledger.setSupplierId(customers.stream()
+                .filter(c -> c.getSupplierName() != null && c.getSupplierName().equals(dto.getSupplierName()))
+                .findFirst()
+                .map(SupplierManage::getId)
+                .orElse(null));
+        if (ledger.getSupplierId() == null) {
+            throw new RuntimeException("渚涘簲鍟嗕笉瀛樺湪锛�" + dto.getSupplierName());
+        }
+
+        // 褰曞叆浜�
+        Long recorderId = sysUsers.stream()
+                .filter(u -> u.getNickName() != null && u.getNickName().equals(dto.getRecorderName()))
+                .findFirst()
+                .map(SysUser::getUserId)
+                .orElse(null);
+        if (recorderId == null) {
+            throw new RuntimeException("褰曞叆浜轰笉瀛樺湪锛�" + dto.getRecorderName());
+        }
+        ledger.setRecorderId(recorderId);
+
+        // 浜у搧鏄庣粏
+        List<PurchaseLedgerProductImportDto> productDtos = productList.stream()
+                .filter(p -> p.getPurchaseContractNumber() != null
+                        && p.getPurchaseContractNumber().equals(dto.getPurchaseContractNumber()))
+                .collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(productDtos)) {
+            throw new RuntimeException("鏃犲搴斾骇鍝佹暟鎹�");
+        }
+        ledger.setContractAmount(productDtos.stream()
+                .map(PurchaseLedgerProductImportDto::getTaxInclusiveTotalPrice)
+                .reduce(BigDecimal.ZERO, BigDecimal::add));
+
+        // 鍏宠仈閿�鍞崟鍙�
+        SalesLedger salesLedger = salesLedgerMapper.selectOne(Wrappers.<SalesLedger>lambdaQuery()
+                .eq(SalesLedger::getSalesContractNo, dto.getSalesContractNo())
+                .last("LIMIT 1"));
+        if (salesLedger != null) {
+            ledger.setSalesLedgerId(salesLedger.getId());
+        }
+
+        // 瀹℃牳浜猴紙涓枃閫楀彿鍒嗛殧鐨勫鍚嶈浆ID锛�
+        if (StringUtils.hasText(ledger.getApproveUserIds())) {
+            String[] split = ledger.getApproveUserIds().split("锛�");
+            List<Long> ids = new ArrayList<>();
+            for (String name : split) {
+                String trimmed = name.trim();
+                if (trimmed.isEmpty()) continue;
+                sysUsers.stream()
+                        .filter(u -> trimmed.equals(u.getNickName()))
+                        .findFirst()
+                        .ifPresent(u -> ids.add(u.getUserId()));
+            }
+            ledger.setApproveUserIds(ids.stream().map(String::valueOf).collect(Collectors.joining(",")));
+        }
+
+        purchaseLedgerMapper.insert(ledger);
+
+        // 浜у搧鏄庣粏鍏ュ簱
+        for (PurchaseLedgerProductImportDto prodDto : productDtos) {
+            SalesLedgerProduct product = new SalesLedgerProduct();
+            BeanUtils.copyProperties(prodDto, product);
+            product.setSalesLedgerId(ledger.getId());
+            product.setType(2);
+            AmountUtils.normalizeSalesLedgerProduct(product);
+            product.setTaxExclusiveTotalPrice(
+                    AmountUtils.calcTaxExclusiveTotalPrice(
+                            product.getTaxInclusiveTotalPrice(),
+                            product.getTaxRate()
+                    )
+            );
+            productModelList.stream()
+                    .filter(map -> prodDto.getProductCategory() != null
+                            && prodDto.getSpecificationModel() != null
+                            && prodDto.getProductCategory().equals(map.get("productName"))
+                            && prodDto.getSpecificationModel().equals(map.get("model")))
+                    .findFirst()
+                    .ifPresent(map -> {
+                        product.setProductModelId(Long.parseLong(map.get("modelId").toString()));
+                        product.setProductId(Long.parseLong(map.get("id").toString()));
+                    });
+            product.setRegister(loginUser.getNickName());
+            product.setRegisterDate(LocalDateTime.now());
+            product.setApproveStatus(0);
+            product.setIsChecked(prodDto.getIsChecked() != null && prodDto.getIsChecked() == 1);
+            //if (prodDto.getIsChecked() != null && prodDto.getIsChecked() == 1) {
+            //    addQualityInspect(ledger, product);
+            //}
+            salesLedgerProductMapper.insert(product);
+        }
+
+        // 閲囪喘瀹℃牳
+        addApproveByPurchase(loginUser, ledger);
     }
 
     @Override
@@ -754,7 +699,9 @@
         // 4. 杞崲 DTO
         PurchaseLedgerDto resultDto = new PurchaseLedgerDto();
         BeanUtils.copyProperties(purchaseLedger, resultDto);
+        AmountUtils.normalizeContractAmount(resultDto);
         if (!products.isEmpty()) {
+            AmountUtils.normalizeSalesLedgerProducts(products);
             resultDto.setHasChildren(true);
             resultDto.setProductData(products);
         }
@@ -762,6 +709,9 @@
     }
 
     public void addApproveByPurchase(LoginUser loginUser,PurchaseLedger purchaseLedger) throws Exception {
+        if (loginUser == null) {
+            return;
+        }
         ApproveProcessVO approveProcessVO = new ApproveProcessVO();
         approveProcessVO.setApproveType(5);
         approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId());
@@ -769,6 +719,7 @@
         approveProcessVO.setApproveUserIds(purchaseLedger.getApproveUserIds());
         approveProcessVO.setApproveUser(loginUser.getUserId());
         approveProcessVO.setApproveTime(LocalDate.now().toString());
+        approveProcessVO.setPrice(AmountUtils.scaleAmount(purchaseLedger.getContractAmount()));
         approveProcessService.addApprove(approveProcessVO);
     }
 
@@ -793,4 +744,23 @@
         }
         return sb.toString();
     }
+
+    @Override
+    public Map<String, Object> getPrintData(Long id) {
+        PurchaseLedger purchaseLedger = getById(id);
+        if (purchaseLedger == null) {
+            return null;
+        }
+        List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(
+            new LambdaQueryWrapper<SalesLedgerProduct>()
+                .eq(SalesLedgerProduct::getSalesLedgerId, id)
+                .eq(SalesLedgerProduct::getType, 2)
+        );
+        SysDept dept = sysDeptMapper.selectDeptById(100L);
+        Map<String, Object> result = new HashMap<>();
+        result.put("companyName", dept != null ? dept.getDeptName() : "");
+        result.put("ledger", purchaseLedger);
+        result.put("products", products);
+        return result;
+    }
 }

--
Gitblit v1.9.3