| | |
| | | throw new RuntimeException("客户档案下有销售合同,请先删除销售合同"); |
| | | } |
| | | // 查询是否有已分配的公海客户 |
| | | List<Customer> assignedPools = customerMapper.selectList( |
| | | /*List<Customer> assignedPools = customerMapper.selectList( |
| | | new QueryWrapper<Customer>().lambda() |
| | | .in(Customer::getId, idList) |
| | | .eq(Customer::getType, 1). |
| | |
| | | ); |
| | | if (!assignedPools.isEmpty()) { |
| | | throw new RuntimeException("客户档案下有已分配的公海客户,请先收回"); |
| | | } |
| | | }*/ |
| | | // 删除客户的同时也需要删除对应的客户跟随、附件和回访提醒 |
| | | for (Long id : ids) { |
| | | customerFollowUpService.deleteByCustomerId(id); |
| | |
| | | } |
| | | |
| | | // 根据 type 参数设置客户类型(私海/公海) |
| | | if (type != null) { |
| | | /*if (type != null) { |
| | | userList.forEach(customer -> { |
| | | customer.setType(type); |
| | | }); |
| | | } |
| | | }*/ |
| | | this.saveOrUpdateBatch(userList); |
| | | return R.ok(true); |
| | | } catch (Exception e) { |