From 0ca7d78f0e8e8a6984314803aba21ab1d25472b3 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期五, 24 四月 2026 15:06:21 +0800
Subject: [PATCH] feat(production): 新增印刷定印单实体及相关接口和分页信息完善

---
 src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
index 343f790..5eed99f 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
@@ -17,9 +17,11 @@
 import com.ruoyi.production.service.ProductOrderService;
 import com.ruoyi.production.service.ProductProcessService;
 import com.ruoyi.production.service.ProductWorkOrderService;
+import com.ruoyi.production.service.ProductionPrintOrderService;
 import com.ruoyi.quality.mapper.QualityInspectMapper;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -29,6 +31,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @Service
@@ -37,6 +40,10 @@
 
     private final ProductWorkOrderService productWorkOrderService;
     private final ProductProcessService productProcessService;
+
+    @Autowired
+    @Lazy
+    private ProductionPrintOrderService  productionPrintOrderService;
     @Autowired
     private ProductOrderMapper productOrderMapper;
     @Autowired
@@ -64,7 +71,23 @@
 
     @Override
     public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) {
-        return productOrderMapper.pageProductOrder(page, productOrder);
+        IPage<ProductOrderDto> productOrderDtoIPage = productOrderMapper.pageProductOrder(page, productOrder);
+        // 濉厖鍗板埛鍗曚俊鎭�
+        List<ProductOrderDto> records = productOrderDtoIPage.getRecords();
+        if (CollUtil.isNotEmpty(records)) {
+            List<Long> orderIds = records.stream().map(ProductOrderDto::getId).collect(Collectors.toList());
+            Map<Long, ProductionPrintOrder> collect = productionPrintOrderService.getListByOrders(orderIds).stream().collect(Collectors.toMap(ProductionPrintOrder::getProductOrderId, Function.identity()));
+            records.forEach(record -> {
+                ProductionPrintOrder productionPrintOrder = collect.get(record.getId());
+                if (productionPrintOrder != null) {
+                    productionPrintOrder.convertProductOrderDto(record);
+                }
+            });
+
+
+        }
+
+        return productOrderDtoIPage;
     }
 
     @Override

--
Gitblit v1.9.3