liyong
2026-04-20 0ef7f96095ae8f4e37c99b9ef226cce5554f3450
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -185,12 +185,15 @@
        if (!salesLedgers.isEmpty()) {
            throw new RuntimeException("客户档案下有销售合同,请先删除销售合同");
        }
        //  删除客户的同时也需要删除对应的客户跟随、附件和回访提醒
        for (Long id : ids) {
            customerFollowUpService.deleteByCustomerId(id);
            customerReturnVisitService.deleteByCustomerId(id);
        List<CustomerPrivatePool> customerPrivatePools = customerPrivatePoolMapper.selectList(new QueryWrapper<CustomerPrivatePool>().lambda().in(CustomerPrivatePool::getCustomerId, idList));
        if (!customerPrivatePools.isEmpty()) {
            throw new RuntimeException("客户档案下有客户私海,请先收回私海数据");
        }
        //  删除客户的同时也需要删除对应的客户跟随、附件和回访提醒
//        for (Long id : ids) {
//            customerFollowUpService.deleteByCustomerId(id);
//            customerReturnVisitService.deleteByCustomerId(id);
//        }
        return customerMapper.deleteBatchIds(idList);
    }