From 95a2747c090f62bdf07080f3c67d5fc10b612ff1 Mon Sep 17 00:00:00 2001 From: x_z Date: Wed, 21 Dec 2022 22:35:36 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=85=BB=E6=8A=A4=E7=AD=89?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/inventory/impl/InvMAOrderDetailServiceImpl.java | 5 +++-- .../mybatis/mapper/inventory/InvMaintenanceOrderDao.xml | 3 ++- .../mapper/inventory/InvMaintenanceOrderDetailDao.xml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvMAOrderDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvMAOrderDetailServiceImpl.java index 853b0358..8ba65104 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvMAOrderDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvMAOrderDetailServiceImpl.java @@ -116,9 +116,10 @@ public class InvMAOrderDetailServiceImpl implements InvMAOrderDetailService { if (invMaintenanceOrderDetailEntity.getCount() > 1) { invMaintenanceOrderDetailEntity.setCount(invMaintenanceOrderDetailEntity.getCount() - 1); invMAOrderDetailDao.updateByPrimaryKey(invMaintenanceOrderDetailEntity); + } else { + //养护数量为1,直接删除养护记录详情 + invMAOrderDetailDao.deleteByPrimaryKey(id); } - //养护数量为1,直接删除养护记录详情 - invMAOrderDetailDao.deleteByPrimaryKey(id); return ResultVOUtils.success(); } diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDao.xml index daf7eaf7..17324435 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDao.xml @@ -192,7 +192,8 @@ inv_space.name invSpaceName from inv_maintenance_order ma left join inv_warehouse_sub on ma.invWarehouseCode = inv_warehouse_sub.code - left join inv_space on ma.invSpaceCode = inv_space.code + left join inv_space + on ma.invSpaceCode = inv_space.code and inv_warehouse_sub.code = inv_space.invWarehouseCode AND ma.id = #{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDetailDao.xml index 658398f1..b6b8e780 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvMaintenanceOrderDetailDao.xml @@ -241,7 +241,7 @@ mad.createTime, mad.updateTime, basic_products.cpmctymc productName, - ip.ggxh, + basic_products.ggxh, basic_products.zczbhhzbapzbh, basic_products.ylqxzcrbarmc FROM inv_maintenance_order_detail mad