From b2db67ae91c49db9d241e7727685c9d544eb9c83 Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 6 Jun 2025 09:26:05 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E9=97=AE=E9=A2=98120=EF=BC=9A?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=A2=9E=E5=8A=A0=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A0=E9=99=A4=EF=BC=88=E5=BE=85=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=B8=94=E6=97=A0=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=BB=91=E5=AE=9A=E5=8F=AF=E5=88=A0=EF=BC=89=E3=80=81?= =?UTF-8?q?=E7=9B=B8=E5=85=B3SQL=E6=B7=BB=E5=8A=A0is=5Fflag=20=3D=20'1'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/MesConstants.java | 4 +++ .../mapper/jindie/MesSaleOrderMapper.xml | 4 +-- .../java/com/hw/mes/domain/MesSaleOrder.java | 4 +-- .../service/impl/MesSaleOrderServiceImpl.java | 11 +++++++- .../mapper/mes/MesOrderBindMapper.xml | 1 + .../mapper/mes/MesPurchaseOrderMapper.xml | 1 + .../mapper/mes/MesSaleOrderMapper.xml | 5 ++-- .../mapper/wms/WmsProductInstockMapper.xml | 3 ++- .../mapper/wms/WmsProductOutstockMapper.xml | 3 ++- .../mapper/wms/WmsProductStockMapper.xml | 2 +- .../wms/WmsProductStockSaleorderMapper.xml | 5 ++-- .../mapper/wms/WmsRawOutstockMapper.xml | 4 +-- .../mapper/wms/WmsRawStockMapper.xml | 1 + .../mapper/wms/WmsStockTotalMapper.xml | 3 ++- hw-ui/src/views/mes/saleOrder/index.vue | 27 ++++++++++++++++--- 15 files changed, 59 insertions(+), 19 deletions(-) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java index 9cec974d..7e23b418 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java @@ -329,4 +329,8 @@ public class MesConstants { /**生产工单派工类型*/ public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_PRODUCE="1";//产线 public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_ROUTE="2";//工艺路线 + + /**MES删除标识(1否 0是)*/ + public static final String MES_IS_FLAG_YES="0"; + public static final String MES_IS_FLAG_NO="1"; } diff --git a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml index fcf063d3..54dec4ec 100644 --- a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml +++ b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml @@ -87,6 +87,7 @@ - SELECT max(erp_modify_date) FROM mes_sale_order order by erp_id,fentry_id + SELECT max(erp_modify_date) FROM mes_sale_order where is_flag = '1' order by erp_id,fentry_id + is_flag = '1' and erp_id = #{erpId} and fentry_id = #{fentryId} and saleorder_code = #{saleorderCode} @@ -105,7 +106,6 @@ and begin_date = #{beginDate} and end_date = #{endDate} and complete_date = #{completeDate} - and is_flag = #{isFlag} @@ -263,6 +263,7 @@ ((mso.material_id = mbmi.erp_id and (mso.sale_order_classfication='1' or mso.sale_order_classfication='3')) or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2')) left join mes_project_info mpi on mso.tond_base=mpi.erp_id + mso.is_flag = '1' and mso.saleorder_code like concat('%', #{saleorderCode}, '%') and mbmi.material_code like concat('%', #{materialCode}, @@ -279,7 +280,7 @@ and mso.sale_order_id = #{saleOrderId} and mso.sale_order_classfication = #{saleOrderClassfication} and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId}) - and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id) + and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id) and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds})) and mso.is_release in ('0','1','2') and mso.plan_delivery_date is not null and mso.plan_delivery_date < now() and mso.plan_delivery_date is not null and mso.plan_delivery_date >= now() diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml index e02f3854..08fffd4d 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml @@ -255,7 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wpi.plan_code left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id - where wpi.product_type = '3' + where mso.is_flag = '1' + and wpi.product_type = '3' and wpi.execute_status = '2' and (wpi.erp_status is null or wpi.erp_status != '1') and wpi.instock_amount > if(wpi.erp_amount is null, 0, wpi.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml index f76094f7..124abe8c 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml @@ -332,7 +332,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_material_info mbmi on mbmi.material_id = wpo.product_id left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_sale_order mso on mso.sale_order_id = wpo.sale_order_id - where wpo.outstock_type = '1' + where mso.is_flag = '1' + and wpo.outstock_type = '1' and wpo.outstock_qty > 0 and wpo.apply_qty >= wpo.outstock_qty and wpo.outstock_qty > if(wpo.erp_amount is null, 0, wpo.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml index 2b70aa70..011a601a 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml @@ -278,7 +278,7 @@ left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id - wps.total_amount>0 and wps.stock_type='3' + mso.is_flag = '1' and wps.total_amount>0 and wps.stock_type='3' and mso.saleorder_code = #{saleorderCode} and wps.warehouse_id = #{warehouseId} and wps.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml index 0da1236c..b484d0cf 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml @@ -145,11 +145,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wpss.product_stock_saleorder_id, wpss.warehouse_id, wpss.warehouse_floor, wpss.stock_type, wpss.product_id, wpss.saleorder_code, wpss.total_amount,wpss.apply_amount, wpss.occupy_amount,wpss.frozen_amount,wpss.outstock_amount, wpss.confirm_amount, mso.order_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name - from wms_product_stock_saleorder wpss left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id + from wms_product_stock_saleorder wpss + left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id left join wms_base_warehouse wbw on wpss.warehouse_id=wbw.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id=wpss.product_id - + mso.is_flag = '1' and wpss.saleorder_code = #{saleorderCode} and wpss.warehouse_id = #{warehouseId} and wpss.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml index 304aec2d..39a981b2 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml @@ -387,9 +387,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wro.plan_code left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id - - wro.real_outstock_amount > 0 + mso.is_flag = '1' + and wro.real_outstock_amount > 0 and wro.outstock_amount >= wro.real_outstock_amount and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount) and mbmi.material_classfication = '1' diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index ee37c382..96f4a215 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -325,6 +325,7 @@ left join mes_sale_order mso on wrs.sale_order_id = mso.sale_order_id left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id + mso.is_flag = '1' and wrs.warehouse_id = #{warehouseId} and wrs.location_code = #{locationCode} and wrs.stock_type = #{stockType} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index c2a43812..df69fb1e 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -273,7 +273,7 @@ left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id - wst.total_amount > 0 + mso.is_flag = '1' and wst.total_amount > 0 and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wst.stock_type = #{stockType} @@ -327,6 +327,7 @@ left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id + mso.is_flag = '1' and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wbw.warehouse_type = #{warehouseType} diff --git a/hw-ui/src/views/mes/saleOrder/index.vue b/hw-ui/src/views/mes/saleOrder/index.vue index 3624996b..8bf52ed3 100644 --- a/hw-ui/src/views/mes/saleOrder/index.vue +++ b/hw-ui/src/views/mes/saleOrder/index.vue @@ -273,7 +273,14 @@ v-hasPermi="['mes:saleOrder:used']" v-if="scope.row.saleOrderClassfication==='1' || scope.row.saleOrderClassfication==='3'" >物料使用 - + 删除 @@ -458,7 +465,14 @@