From 32863d68c09f45cd501fd3db59c7f13e57130fe4 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期三, 10 九月 2025 17:51:36 +0800
Subject: [PATCH] 热处理报工优化

---
 src/main/java/org/jeecg/modules/mes/service/impl/MesWorkReportingServiceImpl.java |    5 +++--
 src/main/java/org/jeecg/modules/mes/entity/MesProductionWorkOrder.java            |    4 ++++
 src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml   |    1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/mes/entity/MesProductionWorkOrder.java b/src/main/java/org/jeecg/modules/mes/entity/MesProductionWorkOrder.java
index f11b2f7..1d76dd4 100644
--- a/src/main/java/org/jeecg/modules/mes/entity/MesProductionWorkOrder.java
+++ b/src/main/java/org/jeecg/modules/mes/entity/MesProductionWorkOrder.java
@@ -153,6 +153,10 @@
     /**浜х嚎鍚嶇О*/
     @TableField(exist = false)
     private String factoryName;
+    /**浜х嚎绫诲瀷*/
+    @TableField(exist = false)
+    @Dict(dicCode = "production_type")
+    private String productionType;
     /**鐝粍鍚嶇О*/
     @TableField(exist = false)
     private String groupName;
diff --git a/src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml b/src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml
index 9aee0db..d314f2e 100644
--- a/src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml
+++ b/src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml
@@ -8,6 +8,7 @@
             t1.work_order_code AS text,
             t1.id AS value,
             t2.factory_code factoryCode,
+            t2.production_type productionType,
             t3.shift_code shiftCode
         FROM mes_production_work_order t1
         LEFT JOIN base_factory t2 ON t1.factory_id = t2.id
diff --git a/src/main/java/org/jeecg/modules/mes/service/impl/MesWorkReportingServiceImpl.java b/src/main/java/org/jeecg/modules/mes/service/impl/MesWorkReportingServiceImpl.java
index 3427afb..2dda41a 100644
--- a/src/main/java/org/jeecg/modules/mes/service/impl/MesWorkReportingServiceImpl.java
+++ b/src/main/java/org/jeecg/modules/mes/service/impl/MesWorkReportingServiceImpl.java
@@ -205,8 +205,9 @@
                 .eq(LswMaterialInventory::getWarehouseId, lineSideWarehouse.getId())
                 .eq(LswMaterialInventory::getInventoryStatus, MaterialInventoryStatusEnum.OUTBOUND.name())
                 .eq(LswMaterialInventory::getHeatTreatmentFlag, CommonConstant.STATUS_0)
-                .apply("EXISTS SELECT 1 FROM lsw_material t WHERE t.id = lsw_material_inventory.material_id AND t.material_number = {0} " +
-                        "AND t.del_flag = {1} AND t.material_status = {2}", workOrder.getMaterialNumber(), CommonConstant.DEL_FLAG_0, CommonConstant.STATUS_1)).stream().findFirst().orElse(null);
+                .apply("EXISTS (SELECT 1 FROM lsw_material t WHERE t.id = lsw_material_inventory.material_id AND t.material_number = {0} " +
+                        "AND t.del_flag = {1} AND t.material_status = {2})", workOrder.getMaterialNumber(), CommonConstant.DEL_FLAG_0, CommonConstant.STATUS_1))
+                .stream().findFirst().orElse(null);
         if (materialInventory == null) {
             throw new JeecgBootException("绾胯竟搴撴棤璇ョ墿鏂欏簱瀛樹俊鎭紒");
         }

--
Gitblit v1.9.3