From 16c1cb7098f15b559ff02eedabd41b9eefd20ad9 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期四, 21 五月 2026 16:55:24 +0800
Subject: [PATCH]  feat: 报工补充加放数

---
 src/main/java/com/ruoyi/production/pojo/ProductionProductOutput.java                  |    6 ++++++
 src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java |    5 +++--
 src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml        |    2 +-
 src/main/resources/mapper/production/ProductionProductMainMapper.xml                  |    6 +++++-
 src/main/java/com/ruoyi/production/dto/ProductionProductMainDto.java                  |   19 +++++++++++++++----
 5 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/dto/ProductionProductMainDto.java b/src/main/java/com/ruoyi/production/dto/ProductionProductMainDto.java
index 0c2e0b9..7481074 100644
--- a/src/main/java/com/ruoyi/production/dto/ProductionProductMainDto.java
+++ b/src/main/java/com/ruoyi/production/dto/ProductionProductMainDto.java
@@ -38,6 +38,18 @@
     @Excel(name = "鎶ュ簾鏁伴噺")
     private BigDecimal scrapQty = BigDecimal.ZERO;
 
+    /**
+     * 琛ヤ骇鏁伴噺
+     */
+    @Excel(name = "琛ヤ骇鏁伴噺")
+    private BigDecimal replenishQty;
+
+    /**
+     * 鍔犳斁鏁�
+     */
+    @Excel(name = "鍔犳斁鏁�")
+    private BigDecimal addQty;
+
     //浜у搧鍚嶇О
     @Excel(name = "浜у搧鍚嶇О")
     private String productName;
@@ -74,10 +86,9 @@
 
     private List<Team> teamList;
 
-    /**
-     * 琛ヤ骇鏁伴噺
-     */
-    private BigDecimal replenishQty;
+
+
+
 
     @Data
     @AllArgsConstructor
diff --git a/src/main/java/com/ruoyi/production/pojo/ProductionProductOutput.java b/src/main/java/com/ruoyi/production/pojo/ProductionProductOutput.java
index e63ecfc..f05cdad 100644
--- a/src/main/java/com/ruoyi/production/pojo/ProductionProductOutput.java
+++ b/src/main/java/com/ruoyi/production/pojo/ProductionProductOutput.java
@@ -47,4 +47,10 @@
     @TableField(value = "replenish_qty")
     private BigDecimal replenishQty;
 
+    /**
+     * 鍔犳斁鏁�
+     */
+    @TableField(value = "add_qty")
+    private BigDecimal addQty;
+
 }
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
index 7de2682..96e4a2e 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -200,6 +200,7 @@
         productionProductOutput.setQuantity(dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO);
         productionProductOutput.setScrapQty(dto.getScrapQty() != null ? dto.getScrapQty() : BigDecimal.ZERO);
         productionProductOutput.setReplenishQty(dto.getReplenishQty());
+        productionProductOutput.setAddQty(dto.getAddQty() != null ? dto.getAddQty() : BigDecimal.ZERO);
         productionProductOutputMapper.insert(productionProductOutput);
         //鍚堟牸鏁伴噺=鎶ュ伐鏁伴噺-鎶ュ簾鏁伴噺
         BigDecimal productQty = productionProductOutput.getQuantity().subtract(productionProductOutput.getScrapQty());
@@ -211,7 +212,7 @@
             if (ObjectUtils.isNull(productWorkOrder.getActualStartTime())) {
                 productWorkOrder.setActualStartTime(LocalDate.now());//瀹為檯寮�濮嬫椂闂�
             }
-            if (productWorkOrder.getCompleteQuantity().compareTo(productWorkOrder.getPlanQuantity()) == 0) {
+            if (productWorkOrder.getCompleteQuantity().compareTo(productWorkOrder.getPlanQuantity()) >= 0) {
                 productWorkOrder.setActualEndTime(LocalDate.now());//瀹為檯缁撴潫鏃堕棿
             }
             productWorkOrder.setEndProductTime(now);
@@ -224,7 +225,7 @@
             if (productProcessRouteItem.getDragSort() == productProcessRouteItems.size()) {
                 //濡傛灉鏄渶鍚庝竴閬撳伐搴忔姤宸ヤ箣鍚庣敓浜ц鍗曞畬鎴愭暟閲�+
                 productOrder.setCompleteQuantity(productOrder.getCompleteQuantity().add(productQty));
-                if (productOrder.getCompleteQuantity().compareTo(productOrder.getQuantity()) == 0) {
+                if (productOrder.getCompleteQuantity().compareTo(productOrder.getQuantity()) >= 0) {
                     productOrder.setEndTime(now);//缁撴潫鏃堕棿
                 }
             }
diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index 842b872..21ad83c 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -22,6 +22,7 @@
         pm.model as productModelName,
         ppo.quantity,
         ppo.scrap_qty,
+        ppo.add_qty,
         pm.unit,
         sl.sales_contract_no salesContractNo
         from
@@ -83,7 +84,10 @@
         IFNULL(
         TIMESTAMPDIFF(MINUTE, ppm.start_time, ppm.end_time),
         0
-        ) AS work_minutes
+        ) AS work_minutes,
+        ppo.add_qty,
+        ppo.scrap_qty,
+        ppo.replenish_qty
         FROM
         production_product_main ppm
         LEFT JOIN sales_ledger_production_accounting slpa ON slpa.product_main_id = ppm.id
diff --git a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
index 87f3a21..556f6f0 100644
--- a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -22,7 +22,7 @@
         FROM
         sales_ledger_production_accounting t4
         LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id
-        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1
+        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 1
         <where>
             t3.type = 1
             <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">

--
Gitblit v1.9.3