| | |
| | | updateReqVO.setOwnerUserId(null); // 更新的时候,要把 updateReqVO 负责人设置为空,避免修改 |
| | | // 1. 校验存在 |
| | | CrmCustomerDO oldCustomer = validateCustomerExists(updateReqVO.getId()); |
| | | // 1.1 校验所属上级经销商不能是自己 |
| | | if (updateReqVO.getParentDealerId() != null |
| | | && updateReqVO.getParentDealerId().equals(updateReqVO.getId())) { |
| | | throw exception(CUSTOMER_PARENT_DEALER_SELF); |
| | | } |
| | | |
| | | // 2. 更新客户 |
| | | CrmCustomerDO updateObj = BeanUtils.toBean(updateReqVO, CrmCustomerDO.class); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CrmCustomerDO> getCustomerList() { |
| | | return customerMapper.selectList(); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<CrmCustomerDO> getCustomerPage(CrmCustomerPageReqVO pageReqVO, Long userId) { |
| | | return customerMapper.selectPage(pageReqVO, userId); |
| | | } |