From e7b0a628cba8549348748e49e825f498dc5f7faf Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 15 Jul 2025 16:38:18 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=89=A9=E6=96=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E6=98=AF=E5=90=A6=E4=BD=8E=E4=BA=8E?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/mes/MesBaseMaterialInfoMapper.xml | 10 +++++----- hw-ui/src/views/mes/materialinfo/index.vue | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml index 846cd6f6..1c8b82a8 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml @@ -59,7 +59,7 @@ bmi.material_categories, bmi.material_subclass, bmi.material_type_id, - bmt.type_name material_type_name, + bmt.type_name material_type_name, bmi.batch_flag, bmi.batch_amount, bmi.material_unit_id, @@ -91,12 +91,12 @@ bmi.erp_modify_date, bmi.safe_stock_amount, mbui.unit_name, - wst.availableAmount, - IF(wst.availableAmount >= bmi.safe_stock_amount, '1', '0') isExceeded + IF(wst.availableAmount IS NULL, 0, wst.availableAmount) availableAmount, + IF(bmi.safe_stock_amount > IF(wst.availableAmount IS NULL, 0, wst.availableAmount) , '1', '0') isExceeded from mes_base_material_info bmi left join mes_base_material_type bmt on bmt.matrial_type_id = bmi.material_type_id left join mes_base_unit_info mbui on bmi.material_unit_id = mbui.erp_id - left join (select material_id, SUM(total_amount - occupy_amount) availableAmount + left join (select material_id, SUM(total_amount) availableAmount from wms_stock_total GROUP BY material_id) wst on bmi.material_id = wst.material_id @@ -142,7 +142,7 @@ and bmi.accessories_flag = #{accessoriesFlag} and bmi.low_value_consumable_flag = #{lowValueConsumableFlag} and bmi.always_flag = #{alwaysFlag} - and IF(wst.availableAmount >= bmi.safe_stock_amount, '1', '0') = #{isExceeded} + and IF(bmi.safe_stock_amount > IF(wst.availableAmount IS NULL, 0, wst.availableAmount) , '1', '0') = #{isExceeded} and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id) and exists (select 1 from (select m1.material_id, m1.material_name, m2.material_id prod_id, m2.material_name prod_name diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue index 43e70bea..730ebcc6 100644 --- a/hw-ui/src/views/mes/materialinfo/index.vue +++ b/hw-ui/src/views/mes/materialinfo/index.vue @@ -109,8 +109,8 @@ /> - - + +