From dc0486883d9201a12f3db234985e603cfb56456d Mon Sep 17 00:00:00 2001 From: xs Date: Wed, 27 Aug 2025 09:39:48 +0800 Subject: [PATCH] =?UTF-8?q?4.2.1=20=E8=A1=A5=E5=85=854.2.0=E6=8F=90?= =?UTF-8?q?=E4=BA=A4xml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-modules/hw-mes/pom.xml | 16 +- .../mapper/mes/MesBomAttachChangeMapper.xml | 142 ++++++++++++++++++ .../mapper/mes/MesMaterialBomMapper.xml | 26 +++- .../mapper/mes/MesProductPlanMapper.xml | 1 + .../mapper/mes/MesPurchaseOrderMapper.xml | 2 +- .../mes/MesPurchaseReceiveBillMapper.xml | 2 +- 6 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 hw-modules/hw-mes/src/main/resources/mapper/mes/MesBomAttachChangeMapper.xml diff --git a/hw-modules/hw-mes/pom.xml b/hw-modules/hw-mes/pom.xml index 21dbd3a9..28880247 100644 --- a/hw-modules/hw-mes/pom.xml +++ b/hw-modules/hw-mes/pom.xml @@ -78,12 +78,6 @@ hw-common-swagger - - com.hw - hw-api-printer - 3.6.3 - compile - com.hw hw-api-jindie @@ -98,6 +92,16 @@ com.hw hw-api-system + + com.hw + hw-api-mes + + + com.ibm.icu + icu4j + 61.1 + compile + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBomAttachChangeMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBomAttachChangeMapper.xml new file mode 100644 index 00000000..ecfa1f00 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBomAttachChangeMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + select attach_change_id, material_bom_id,attach_type, old_attach_id, new_attach_id, change_type, plan_id, plan_code, change_user_id, change_by, change_time from mes_bom_attach_change + + + + + + + + insert into mes_bom_attach_change + + material_bom_id, + attach_type, + old_attach_id, + new_attach_id, + change_type, + plan_id, + plan_code, + change_user_id, + change_by, + change_time, + + + #{materialBomId}, + #{attachType}, + #{oldAttachId}, + #{newAttachId}, + #{changeType}, + #{planId}, + #{planCode}, + #{changeUserId}, + #{changeBy}, + #{changeTime}, + + + + + update mes_bom_attach_change + + material_bom_id = #{materialBomId}, + old_attach_id = #{oldAttachId}, + new_attach_id = #{newAttachId}, + change_type = #{changeType}, + plan_id = #{planId}, + plan_code = #{planCode}, + change_user_id = #{changeUserId}, + change_by = #{changeBy}, + change_time = #{changeTime}, + + where attach_change_id = #{attachChangeId} + + + + delete from mes_bom_attach_change where attach_change_id = #{attachChangeId} + + + + delete from mes_bom_attach_change where attach_change_id in + + #{attachChangeId} + + + + + + insert into mes_bom_attach_change( material_bom_id,attach_type, old_attach_id, new_attach_id, change_type, plan_id, plan_code, change_user_id, change_by, change_time) values + + ( #{item.materialBomId}, #{item.attachType}, #{item.oldAttachId}, #{item.newAttachId}, #{item.changeType}, #{item.planId}, #{item.planCode}, #{item.changeUserId}, #{item.changeBy}, #{item.changeTime}) + + + + + + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml index c785794a..9259acf5 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml @@ -30,6 +30,8 @@ + + @@ -55,7 +57,7 @@ attach_id, sop_id, CONCAT(material_name, '-', material_bom_desc) materialNameDesc - from mes_material_bom + from mes_material_bom mmb + + + exists (select 1 from mes_material_bom mmb2 where mmb.material_bom_id =mmb2.parent_id and mmb2.material_id = #{materialId}) + and active_flag = #{activeFlag} + and parent_id = #{parentId} + + order by material_bom_id desc + + + + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index 6221e7a3..914b5908 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -670,6 +670,7 @@ and mpp.plan_status = #{planStatus} and mpp.is_flag = #{isFlag} + order by mpp.create_time desc diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index 913b1e94..da6fe5b0 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -547,7 +547,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" join mes_base_material_info mbmi on mprb.material_id = mbmi.erp_id and mpo.po_no like concat('%', #{poNo}, '%') - and mpo.material_id = #{materialId} + and mbmi.material_id = #{materialId} order by mpo.create_time desc diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseReceiveBillMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseReceiveBillMapper.xml index ce15190c..bc339022 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseReceiveBillMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseReceiveBillMapper.xml @@ -197,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mpo.purchase_order_id, CASE WHEN mbbi.receive_bill_id IS NOT NULL THEN '1' ELSE '0' END AS has_barcode_flag from mes_purchase_receive_bill mprb - left join mes_purchase_order mpo on mprb.fs_id = mpo.fentry_id + left join mes_purchase_order mpo on mprb.fs_id = mpo.fentry_id and mpo.material_id=mprb.material_id left join mes_base_material_info mbmi on mprb.material_id = mbmi.erp_id LEFT JOIN (SELECT DISTINCT receive_bill_id FROM mes_base_barcode_info) mbbi ON mprb.receive_bill_id = mbbi.receive_bill_id