From 7ffca29de342a6e5f7a124a9eabba468cfb4f9a3 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 16 三月 2026 13:26:35 +0800
Subject: [PATCH] fix: 生产计划的产品ID、产品型号字段重命名
---
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java | 4 ++--
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java | 4 ++--
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java | 4 ++--
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml | 44 ++++++++++++++++++++++----------------------
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java b/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java
index a3dd70e..799f90b 100644
--- a/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java
+++ b/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java
@@ -33,11 +33,11 @@
*/
@ApiModelProperty("浜у搧瑙勬牸")
@Excel(name = "浜у搧瑙勬牸")
- private String specification;
+ private String model;
@ApiModelProperty("浜у搧鍗曚綅")
@Excel(name = "浜у搧鍗曚綅")
- private String baseUnit;
+ private String unit;
@ApiModelProperty(value = "鐢熶骇璁″垝id闆嗗悎")
private List<Long> ids;
diff --git a/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java b/src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java
index 261f110..2c31eff 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 specification;
+ private String model;
/**
* 浜у搧闀垮害
@@ -71,6 +71,6 @@
* 鍩烘湰鍗曚綅
*/
@ApiModelProperty("鍩烘湰鍗曚綅")
- private String baseUnit;
+ private String unit;
}
\ No newline at end of file
diff --git a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
index 698199c..6bc06ff 100644
--- a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -122,8 +122,8 @@
}
// 鏍¢獙鏄惁瀛樺湪涓嶅悓鐨勪骇鍝佽鏍�
- String firstProductSpec = plans.get(0).getSpecification();
- if (plans.stream().anyMatch(p -> p.getSpecification() == null || !p.getSpecification().equals(firstProductSpec))) {
+ String firstProductSpec = plans.get(0).getModel();
+ if (plans.stream().anyMatch(p -> p.getModel() == null || !p.getModel().equals(firstProductSpec))) {
throw new BaseException("鍚堝苟澶辫触锛屽瓨鍦ㄤ笉鍚岀殑浜у搧瑙勬牸");
}
diff --git a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
index 7192a76..4205a15 100644
--- a/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
+++ b/src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -38,25 +38,25 @@
SELECT
pp.*,
pms.material_code AS materialCode,
- pms.specification AS specification,
- pms.material_id AS productMaterialId,
- pm.material_name AS productName,
- pm.base_unit
+ pms.model,
+ pms.product_id AS productMaterialId,
+ pm.product_name AS productName,
+ pm.unit
FROM production_plan pp
left join product_material_sku pms on pp.product_material_sku_id = pms.id
- left join product_material pm on pms.material_id = pm.id
+ left join product_material pm on pms.product_id = pm.id
WHERE 1 = 1
<if test="c.customerName != null and c.customerName != '' ">
AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%')
</if>
<if test="c.productName != null and c.productName != '' ">
- AND pm.material_name LIKE CONCAT('%',#{c.productName},'%')
+ AND pm.product_name LIKE CONCAT('%',#{c.productName},'%')
</if>
<if test="c.materialCode != null and c.materialCode != '' ">
AND pms.material_code LIKE CONCAT('%',#{c.materialCode},'%')
</if>
- <if test="c.specification != null and c.specification != '' ">
- AND pms.specification LIKE CONCAT('%',#{c.specification},'%')
+ <if test="c.model != null and c.model != '' ">
+ AND pms.model LIKE CONCAT('%',#{c.model},'%')
</if>
<if test="c.applyNo != null and c.applyNo != '' ">
AND pp.apply_no LIKE CONCAT('%',#{c.applyNo},'%')
@@ -73,52 +73,52 @@
<select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto">
SELECT
sku.material_code AS materialCode,
- pm.material_name AS productName,
- sku.specification AS specification,
+ pm.product_name AS productName,
+ sku.model,
pp.length,
pp.width,
pp.height,
- pm.base_unit AS baseUnit,
+ pm.unit AS unit,
COALESCE(SUM(pp.quantity),0) AS quantity,
COALESCE(SUM(pp.volume),0) AS volume
FROM production_plan pp
LEFT JOIN product_material_sku sku
ON pp.product_material_sku_id = sku.id
LEFT JOIN product_material pm
- ON sku.material_id = pm.id
+ ON sku.product_id = pm.id
<where>
<if test="materialCode != null and materialCode != ''">
AND sku.material_code LIKE CONCAT('%', #{materialCode}, '%')
</if>
<if test="productName != null and productName != ''">
- AND pm.material_name LIKE CONCAT('%', #{productName}, '%')
+ AND pm.product_name LIKE CONCAT('%', #{productName}, '%')
</if>
- <if test="specification != null and specification != ''">
- AND sku.specification LIKE CONCAT('%', #{specification}, '%')
+ <if test="model != null and model != ''">
+ AND sku.model LIKE CONCAT('%', #{model}, '%')
</if>
</where>
GROUP BY
sku.material_code,
- pm.material_name,
- sku.specification,
+ pm.product_name,
+ sku.model,
pp.length,
pp.width,
pp.height,
- pm.base_unit
+ pm.unit
</select>
<select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">
SELECT
pp.*,
pms.material_code AS materialCode,
- pms.specification AS specification,
- pm.material_name AS productName,
- pm.base_unit
+ pms.model,
+ pm.product_name AS productName,
+ pm.unit
FROM production_plan pp
LEFT JOIN product_material_sku pms ON pp.product_material_sku_id = pms.id
- LEFT JOIN product_material pm ON pms.material_id = pm.id
+ LEFT JOIN product_material pm ON pms.product_id = pm.id
WHERE pp.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
--
Gitblit v1.9.3