From 67fda7b2dfbfc9e6a8d8b9472499a67906d2bad1 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期六, 09 五月 2026 18:05:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_浪潮_pro' into dev_浪潮_pro
---
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml | 5 ++++-
src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java | 3 +++
src/main/java/com/ruoyi/production/controller/ProductionPlanController.java | 4 ++++
src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java | 1 +
src/main/resources/mapper/production/ProductionProductMainMapper.xml | 10 ++++++++--
src/main/java/com/ruoyi/production/pojo/ProductionOrder.java | 5 +++++
src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java | 6 ++++++
src/main/resources/mapper/production/ProductionOrderMapper.xml | 9 ++++++++-
src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java | 6 ++++++
src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java | 6 ++++++
10 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java b/src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java
index c4363a8..df35d83 100644
--- a/src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java
+++ b/src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java
@@ -1,5 +1,6 @@
package com.ruoyi.production.bean.dto;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.production.pojo.ProductionPlan;
@@ -52,6 +53,8 @@
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate requiredDateEnd;
+ @Schema(description = "杞﹂棿id")
+ private Long workshopId;
@Schema(description = "閿�鍞悎鍚屽彿")
private String salesContractNo;
diff --git a/src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java b/src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java
index cbac4b5..ac13e04 100644
--- a/src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java
+++ b/src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java
@@ -71,4 +71,10 @@
@Schema(description = "宸ュ簭鍙傛暟鍒楄〃")
private List<ProductionOrderRoutingOperationParam> productionOperationParamList;
+
+ @Schema(description = "杞﹂棿id")
+ private Long workshopId;
+
+ @Schema(description = "杞﹂棿鍚嶇О")
+ private String workshopName;
}
diff --git a/src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java b/src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java
index 9929f19..eedb544 100644
--- a/src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java
+++ b/src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java
@@ -47,6 +47,12 @@
@Schema(description = "鏄惁缁撴潫锛�")
private Boolean endOrder;
+ @Schema(description = "杞﹂棿id")
+ private Long workshopId;
+
+ @Schema(description = "杞﹂棿鍚嶇О")
+ private String workshopName;
+
@Schema(description = "绫诲瀷 鍖哄垎璁℃椂鍜岃浠�(0璁℃椂1璁′欢)")
private Integer type;
}
diff --git a/src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java b/src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java
index 01ef33a..2dab5c9 100644
--- a/src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java
+++ b/src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java
@@ -44,4 +44,10 @@
@Schema(description = "鏄惁宸查��鏂�")
private Boolean returned;
+
+ @Schema(description = "杞﹂棿鍚嶇О")
+ @Excel(name = "杞﹂棿鍚嶇О",sort = 11)
+ private String workshopName;
+
+
}
diff --git a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
index 923f95c..e736f1e 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -54,6 +55,9 @@
if (productionPlanDto.getTotalAssignedQuantity() == null || productionPlanDto.getTotalAssignedQuantity().compareTo(BigDecimal.ZERO) <= 0) {
return R.fail("璇疯緭鍏ヤ笅鍙戞暟閲�");
}
+ if(productionPlanDto.getWorkshopId() == null){
+ throw new BaseException("璇烽�夋嫨杞﹂棿淇℃伅");
+ }
return R.ok(productionPlanService.combine(productionPlanDto));
}
diff --git a/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java b/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
index e52ee9d..231e0bc 100644
--- a/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
+++ b/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
@@ -88,4 +88,9 @@
@Schema(description = "鏄惁缁撴潫锛�")
@TableField("is_end_order")
private Boolean endOrder;
+
+
+ @TableField("workshop_id")
+ @Schema(description = "杞﹂棿id")
+ private Long workshopId;
}
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
index b00266b..3bc5aa5 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
@@ -150,6 +150,7 @@
productionOrder.setProductionPlanIds(formatPlanIds(issuedPlanIds));
productionOrder.setProductModelId(firstPlan.getProductModelId());
productionOrder.setQuantity(assignedQuantity);
+ productionOrder.setWorkshopId(productionPlanDto.getWorkshopId());
productionOrder.setPlanCompleteTime(productionPlanDto.getPlanCompleteTime());
if (!productionOrderService.saveProductionOrder(productionOrder)) {
throw new ServiceException("涓嬪彂澶辫触锛岀敓浜ц鍗曚繚瀛樺け璐�");
diff --git a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
index 6db5455..aa2a99d 100644
--- a/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
+++ b/src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -35,7 +35,9 @@
CASE
WHEN pot.work_order_no LIKE 'FG%' THEN '杩斿伐杩斾慨'
ELSE '姝e父'
- END AS work_order_type
+ END AS work_order_type,
+ t8.id as workshop_id,
+ t8.name as workshop_name
from production_operation_task pot
left join production_order po on pot.production_order_id = po.id
left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
@@ -48,6 +50,7 @@
left join production_product_output ppo on ppo.production_product_main_id = ppm.id
group by ppm.production_operation_task_id
) scrapStat on scrapStat.taskId = pot.id
+ left join workshop as t8 on po.workshop_id = t8.id
<where>
<if test="c != null and c.id != null">
and pot.id = #{c.id}
diff --git a/src/main/resources/mapper/production/ProductionOrderMapper.xml b/src/main/resources/mapper/production/ProductionOrderMapper.xml
index 1a304ef..35a7941 100644
--- a/src/main/resources/mapper/production/ProductionOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -54,7 +54,9 @@
tr.process_route_code as processRouteCode,
ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus,
tb.bom_no as bomNo,
- pop_return.returned as returned
+ pop_return.returned as returned,
+ t7.name as workshop_name,
+ t7.id as workshop_id
</sql>
<sql id="ProductionOrderVoFrom">
@@ -81,6 +83,8 @@
from production_order_pick
group by production_order_id
) pop_return on pop_return.productionOrderId = po.id
+ left join workshop as t7 on po.workshop_id = t7.id
+
</sql>
<sql id="ProductionOrderWhere">
@@ -125,6 +129,9 @@
<if test="c.endTime != null">
and po.end_time <= #{c.endTime}
</if>
+ <if test="c.workshopId != null">
+ and t7.id = #{c.workshopId}
+ </if>
</if>
</where>
</sql>
diff --git a/src/main/resources/mapper/production/ProductionProductMainMapper.xml b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
index df585f9..ac42925 100644
--- a/src/main/resources/mapper/production/ProductionProductMainMapper.xml
+++ b/src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -34,11 +34,14 @@
date(ppm.create_time) as schedulingDate,
su.nick_name as schedulingUserName,
po_sales.customerName,
- poro.operation_name as process
+ poro.operation_name as process,
+ t5.id as workshop_id,
+ t5.name as workshop_name
from production_product_main ppm
left join production_operation_task pot on ppm.production_operation_task_id = pot.id
left join production_order po on pot.production_order_id = po.id
left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
+ left join workshop as t5 on po.workshop_id = t5.id
left join (
select po2.id as orderId,
group_concat(distinct sl2.sales_contract_no order by sl2.sales_contract_no separator ',') as salesContractNo,
@@ -113,7 +116,9 @@
end
end
as decimal(18,4)
- ) as wages
+ ) as wages,
+ t10.id as workshop_id,
+ t10.name as workshop_name
from production_account pa
left join production_product_main ppm on ppm.id = pa.production_product_main_id
left join production_operation_task pot on ppm.production_operation_task_id = pot.id
@@ -123,6 +128,7 @@
left join product p on pm.product_id = p.id
left join product p_parent on p_parent.id = p.parent_id
left join production_product_output ppo on ppo.production_product_main_id = ppm.id
+ left join workshop as t10 on po.workshop_id = t10.id
<where>
<if test="c != null">
<if test="c.productCategory != null and c.productCategory != ''">
--
Gitblit v1.9.3