云
8 小时以前 d17024670efca145ff97bc26913bfd9b0fef2cd0
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
@@ -118,8 +118,12 @@
     * @return 客户信息 DO
     */
    private static CrmCustomerDO initCustomer(Object customer, Long ownerUserId) {
        return BeanUtils.toBean(customer, CrmCustomerDO.class).setOwnerUserId(ownerUserId)
        CrmCustomerDO result = BeanUtils.toBean(customer, CrmCustomerDO.class).setOwnerUserId(ownerUserId)
                .setOwnerTime(LocalDateTime.now());
        if (result.getAutoPoolEnabled() == null) {
            result.setAutoPoolEnabled(true);
        }
        return result;
    }
    @Override
@@ -383,6 +387,10 @@
        adminUserApi.validateUserList(singletonList(ownerUserId));
        // 1.3 校验状态
        customers.forEach(customer -> {
            // 关闭公海可见度的客户不能通过编号直接领取或分配。
            if (Boolean.FALSE.equals(customer.getAutoPoolEnabled())) {
                throw exception(CRM_PERMISSION_DENIED, CrmBizTypeEnum.CRM_CUSTOMER.getName());
            }
            // 校验是否已有负责人
            validateCustomerOwnerExists(customer, false);
            // 校验是否锁定
@@ -493,6 +501,11 @@
    }
    @Override
    public PageResult<CrmCustomerDO> getBusinessCustomerPage(CrmCustomerPageReqVO pageReqVO) {
        return customerMapper.selectBusinessPage(pageReqVO);
    }
    @Override
    public PageResult<CrmCustomerDO> getPutPoolRemindCustomerPage(CrmCustomerPageReqVO pageVO, Long userId) {
        CrmCustomerPoolConfigDO poolConfig = customerPoolConfigService.getCustomerPoolConfig();
        if (ObjUtil.isNull(poolConfig)