gongchunyi
5 天以前 a97c858191738243d52a7bc5520592e274f9a579
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -23,6 +23,8 @@
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.vo.CustomerTransactionsDetailsVo;
import com.ruoyi.sales.vo.CustomerTransactionsVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@@ -221,7 +223,7 @@
            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).
@@ -229,7 +231,7 @@
        );
        if (!assignedPools.isEmpty()) {
            throw new RuntimeException("客户档案下有已分配的公海客户,请先收回");
        }
        }*/
        // 删除客户的同时也需要删除对应的客户跟随、附件和回访提醒
        for (Long id : ids) {
            customerFollowUpService.deleteByCustomerId(id);
@@ -269,11 +271,11 @@
            }
            // 根据 type 参数设置客户类型(私海/公海)
            if (type != null) {
            /*if (type != null) {
                userList.forEach(customer -> {
                    customer.setType(type);
                });
            }
            }*/
            this.saveOrUpdateBatch(userList);
            return R.ok(true);
        } catch (Exception e) {
@@ -375,10 +377,20 @@
        //将客户的type改为1 且直接分配给当前用户
        Customer customer = customerMapper.selectById(id);
        customer.setType(1);
        customer.setIsAssigned(1);
        customer.setIsAssigned(0);
        return this.updateById(customer);
    }
    @Override
    public IPage<CustomerTransactionsVo> customewTransactions(Page page, String customerName) {
        return customerMapper.customewTransactions(page, customerName);
    }
    @Override
    public IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, Long customerId) {
        return customerMapper.customewTransactionsDetails(page, customerId);
    }
    /**
     * 下划线命名转驼峰命名
     */