From 973b5221a85660b3b1e026e119256e35e95336ea Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 13 三月 2026 16:31:58 +0800
Subject: [PATCH] fix: 产品规则返回命名修改

---
 src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java |    8 +++++++-
 src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml        |   17 +++++++++++------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java b/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java
index 0831d89..261f110 100644
--- a/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java
+++ b/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java
@@ -35,7 +35,7 @@
      * 浜у搧瑙勬牸
      */
     @ApiModelProperty("浜у搧瑙勬牸")
-    private String productSpec;
+    private String specification;
 
     /**
      * 浜у搧闀垮害
@@ -67,4 +67,10 @@
     @ApiModelProperty("姹囨�绘柟鏁�")
     private BigDecimal volume;
 
+    /**
+     * 鍩烘湰鍗曚綅
+     */
+    @ApiModelProperty("鍩烘湰鍗曚綅")
+    private String baseUnit;
+
 }
\ No newline at end of file
diff --git a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
index faa92ae..7192a76 100644
--- a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
+++ b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -28,7 +28,6 @@
         <result property="modifierName" column="modifier_name"/>
         <result property="formCreatedTime" column="form_created_time"/>
         <result property="formModifiedTime" column="form_modified_time"/>
-        <result property="dataSyncType" column="data_sync_type"/>
         <result property="dataSourceType" column="data_source_type"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
@@ -68,17 +67,18 @@
         <if test="c.endDate != null">
             AND pp.end_date &lt;= DATE_FORMAT(#{c.endDate},'%Y-%m-%d')
         </if>
-        ORDER BY pp.id DESC
+        ORDER BY COALESCE(pp.form_modified_time, pp.id) DESC
     </select>
 
     <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto">
         SELECT
-        sku.material_code,
-        pm.material_name AS product_name,
-        sku.specification AS product_spec,
+        sku.material_code AS materialCode,
+        pm.material_name AS productName,
+        sku.specification AS specification,
         pp.length,
         pp.width,
         pp.height,
+        pm.base_unit AS baseUnit,
         COALESCE(SUM(pp.quantity),0) AS quantity,
         COALESCE(SUM(pp.volume),0) AS volume
         FROM production_plan pp
@@ -94,6 +94,10 @@
             <if test="productName != null and productName != ''">
                 AND pm.material_name LIKE CONCAT('%', #{productName}, '%')
             </if>
+
+            <if test="specification != null and specification != ''">
+                AND sku.specification LIKE CONCAT('%', #{specification}, '%')
+            </if>
         </where>
         GROUP BY
         sku.material_code,
@@ -101,7 +105,8 @@
         sku.specification,
         pp.length,
         pp.width,
-        pp.height
+        pp.height,
+        pm.base_unit
     </select>
 
     <select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">

--
Gitblit v1.9.3