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