From d8adaddf1886dfeb28599ef2e047da905883e42d Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 01 四月 2026 15:08:19 +0800
Subject: [PATCH] 销售看板完成

---
 src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java
index fd80560..7325c59 100644
--- a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java
@@ -1,10 +1,26 @@
 package com.ruoyi.productionPlan.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.production.dto.ProductOrderDto;
+import com.ruoyi.production.mapper.ProductOrderMapper;
+import com.ruoyi.production.mapper.ProductionOrderRouteMapper;
+import com.ruoyi.production.mapper.ProductionProductMainMapper;
+import com.ruoyi.production.pojo.ProductionProductMain;
+import com.ruoyi.productionPlan.dto.OrderDto;
+import com.ruoyi.productionPlan.dto.ProductionPlanDto;
+import com.ruoyi.productionPlan.dto.TrackDto;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.productionPlan.mapper.ProductionPlanMapper;
 import com.ruoyi.productionPlan.pojo.ProductOrderPlan;
 import com.ruoyi.productionPlan.mapper.ProductOrderPlanMapper;
 import com.ruoyi.productionPlan.service.ProductOrderPlanService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * <p>
@@ -17,4 +33,52 @@
 @Service
 public class ProductOrderPlanServiceImpl extends ServiceImpl<ProductOrderPlanMapper, ProductOrderPlan> implements ProductOrderPlanService {
 
+    @Autowired
+    private ProductOrderPlanMapper productOrderPlanMapper;
+
+    @Autowired
+    private ProductionPlanMapper productionPlanMapper;
+
+    @Autowired
+    private ProductOrderMapper productOrderMapper;
+
+    @Autowired
+    private ProductionProductMainMapper productionProductMainMapper;
+
+    @Override
+    public TrackDto trackProgressByNo(String applyNo) {
+        TrackDto trackDto = new TrackDto();
+        //鐢熶骇璁″垝鏁版嵁
+        ProductionPlanDto planDto = new ProductionPlanDto();
+        planDto.setApplyNo(applyNo);
+        ProductionPlanDto productionPlanDto = productionPlanMapper.listPage(new Page(1, -1), planDto).getRecords().get(0);
+        trackDto.setProductionPlanDto(productionPlanDto);
+        //鐢熶骇璁㈠崟鏁版嵁
+        List<OrderDto> orderDtos = listByApplyNo(productionPlanDto);
+        trackDto.setOrderDtoList(orderDtos);
+        return trackDto;
+    }
+
+    private List<OrderDto> listByApplyNo(ProductionPlanDto productionPlanDto) {
+        List<OrderDto> orderDtos = new ArrayList<>();
+        //1.鍏堟煡璇㈣鐢熶骇璁″垝涓嬫墍鏈夊叧鑱旂殑鐢熶骇璁㈠崟
+        List<ProductOrderPlan> productOrderPlans = productOrderPlanMapper.selectList(Wrappers.<ProductOrderPlan>lambdaQuery()
+                .eq(ProductOrderPlan::getProductionPlanId, productionPlanDto.getId()));
+        if (CollectionUtils.isEmpty(productOrderPlans)){
+            return null;
+        }
+        productOrderPlans.forEach(productOrderPlan -> {
+            OrderDto orderDto = new OrderDto();
+            //鐢熶骇璁㈠崟淇℃伅
+            ProductOrderDto productOrderDto=productOrderMapper.getProductOrderDto(productOrderPlan.getProductOrderId());
+            orderDto.setProductOrderDto(productOrderDto);
+            //鎶ュ伐璇︽儏
+            List<ProductionProductMain> productionProductMains = productionProductMainMapper.selectList(Wrappers.<ProductionProductMain>lambdaQuery()
+                    .eq(ProductionProductMain::getProductOrderId, productOrderPlan.getProductOrderId())
+                    .orderByAsc(ProductionProductMain::getReportingTime));
+            orderDto.setProductionProductMains(productionProductMains);
+            orderDtos.add(orderDto);
+        });
+        return orderDtos;
+    }
 }

--
Gitblit v1.9.3