CRM后端六模块代码生成完毕
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaBusinessProduct;
|
||||
import com.ruoyi.oa.domain.vo.OaBusinessProductVo;
|
||||
import com.ruoyi.oa.domain.bo.OaBusinessProductBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 商机产品关联Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaBusinessProductService {
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联
|
||||
*/
|
||||
OaBusinessProductVo queryById(Long businessProductId);
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联列表
|
||||
*/
|
||||
TableDataInfo<OaBusinessProductVo> queryPageList(OaBusinessProductBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联列表
|
||||
*/
|
||||
List<OaBusinessProductVo> queryList(OaBusinessProductBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 商机产品关联
|
||||
*/
|
||||
Boolean insertByBo(OaBusinessProductBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 商机产品关联
|
||||
*/
|
||||
Boolean updateByBo(OaBusinessProductBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 商机产品关联信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaBusiness;
|
||||
import com.ruoyi.oa.domain.vo.OaBusinessVo;
|
||||
import com.ruoyi.oa.domain.bo.OaBusinessBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 商机Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaBusinessService {
|
||||
|
||||
/**
|
||||
* 查询CRM 商机
|
||||
*/
|
||||
OaBusinessVo queryById(Long businessId);
|
||||
|
||||
/**
|
||||
* 查询CRM 商机列表
|
||||
*/
|
||||
TableDataInfo<OaBusinessVo> queryPageList(OaBusinessBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 商机列表
|
||||
*/
|
||||
List<OaBusinessVo> queryList(OaBusinessBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 商机
|
||||
*/
|
||||
Boolean insertByBo(OaBusinessBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 商机
|
||||
*/
|
||||
Boolean updateByBo(OaBusinessBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 商机信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaClue;
|
||||
import com.ruoyi.oa.domain.vo.OaClueVo;
|
||||
import com.ruoyi.oa.domain.bo.OaClueBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 线索Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaClueService {
|
||||
|
||||
/**
|
||||
* 查询CRM 线索
|
||||
*/
|
||||
OaClueVo queryById(Long clueId);
|
||||
|
||||
/**
|
||||
* 查询CRM 线索列表
|
||||
*/
|
||||
TableDataInfo<OaClueVo> queryPageList(OaClueBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 线索列表
|
||||
*/
|
||||
List<OaClueVo> queryList(OaClueBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 线索
|
||||
*/
|
||||
Boolean insertByBo(OaClueBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 线索
|
||||
*/
|
||||
Boolean updateByBo(OaClueBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 线索信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaCustomer;
|
||||
import com.ruoyi.oa.domain.vo.OaCustomerVo;
|
||||
import com.ruoyi.oa.domain.bo.OaCustomerBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 客户Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaCustomerService {
|
||||
|
||||
/**
|
||||
* 查询CRM 客户
|
||||
*/
|
||||
OaCustomerVo queryById(Long customerId);
|
||||
|
||||
/**
|
||||
* 查询CRM 客户列表
|
||||
*/
|
||||
TableDataInfo<OaCustomerVo> queryPageList(OaCustomerBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 客户列表
|
||||
*/
|
||||
List<OaCustomerVo> queryList(OaCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 客户
|
||||
*/
|
||||
Boolean insertByBo(OaCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 客户
|
||||
*/
|
||||
Boolean updateByBo(OaCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 客户信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaFollowUpRecord;
|
||||
import com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
|
||||
import com.ruoyi.oa.domain.bo.OaFollowUpRecordBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 跟进记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaFollowUpRecordService {
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录
|
||||
*/
|
||||
OaFollowUpRecordVo queryById(Long followId);
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录列表
|
||||
*/
|
||||
TableDataInfo<OaFollowUpRecordVo> queryPageList(OaFollowUpRecordBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录列表
|
||||
*/
|
||||
List<OaFollowUpRecordVo> queryList(OaFollowUpRecordBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 跟进记录
|
||||
*/
|
||||
Boolean insertByBo(OaFollowUpRecordBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 跟进记录
|
||||
*/
|
||||
Boolean updateByBo(OaFollowUpRecordBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 跟进记录信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaProduct;
|
||||
import com.ruoyi.oa.domain.vo.OaProductVo;
|
||||
import com.ruoyi.oa.domain.bo.OaProductBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CRM 产品Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
public interface IOaProductService {
|
||||
|
||||
/**
|
||||
* 查询CRM 产品
|
||||
*/
|
||||
OaProductVo queryById(Long productId);
|
||||
|
||||
/**
|
||||
* 查询CRM 产品列表
|
||||
*/
|
||||
TableDataInfo<OaProductVo> queryPageList(OaProductBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询CRM 产品列表
|
||||
*/
|
||||
List<OaProductVo> queryList(OaProductBo bo);
|
||||
|
||||
/**
|
||||
* 新增CRM 产品
|
||||
*/
|
||||
Boolean insertByBo(OaProductBo bo);
|
||||
|
||||
/**
|
||||
* 修改CRM 产品
|
||||
*/
|
||||
Boolean updateByBo(OaProductBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除CRM 产品信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaBusinessProductBo;
|
||||
import com.ruoyi.oa.domain.vo.OaBusinessProductVo;
|
||||
import com.ruoyi.oa.domain.OaBusinessProduct;
|
||||
import com.ruoyi.oa.mapper.OaBusinessProductMapper;
|
||||
import com.ruoyi.oa.service.IOaBusinessProductService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 商机产品关联Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaBusinessProductServiceImpl implements IOaBusinessProductService {
|
||||
|
||||
private final OaBusinessProductMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联
|
||||
*/
|
||||
@Override
|
||||
public OaBusinessProductVo queryById(Long businessProductId){
|
||||
return baseMapper.selectVoById(businessProductId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaBusinessProductVo> queryPageList(OaBusinessProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaBusinessProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<OaBusinessProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 商机产品关联列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaBusinessProductVo> queryList(OaBusinessProductBo bo) {
|
||||
LambdaQueryWrapper<OaBusinessProduct> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaBusinessProduct> buildQueryWrapper(OaBusinessProductBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaBusinessProduct> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getBusinessId() != null, OaBusinessProduct::getBusinessId, bo.getBusinessId());
|
||||
lqw.eq(bo.getProductId() != null, OaBusinessProduct::getProductId, bo.getProductId());
|
||||
lqw.eq(bo.getProductPrice() != null, OaBusinessProduct::getProductPrice, bo.getProductPrice());
|
||||
lqw.eq(bo.getBusinessPrice() != null, OaBusinessProduct::getBusinessPrice, bo.getBusinessPrice());
|
||||
lqw.eq(bo.getCount() != null, OaBusinessProduct::getCount, bo.getCount());
|
||||
lqw.eq(bo.getTotalPrice() != null, OaBusinessProduct::getTotalPrice, bo.getTotalPrice());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 商机产品关联
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaBusinessProductBo bo) {
|
||||
OaBusinessProduct add = BeanUtil.toBean(bo, OaBusinessProduct.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setBusinessProductId(add.getBusinessProductId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 商机产品关联
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaBusinessProductBo bo) {
|
||||
OaBusinessProduct update = BeanUtil.toBean(bo, OaBusinessProduct.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaBusinessProduct entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 商机产品关联
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaBusinessBo;
|
||||
import com.ruoyi.oa.domain.vo.OaBusinessVo;
|
||||
import com.ruoyi.oa.domain.OaBusiness;
|
||||
import com.ruoyi.oa.mapper.OaBusinessMapper;
|
||||
import com.ruoyi.oa.service.IOaBusinessService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 商机Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaBusinessServiceImpl implements IOaBusinessService {
|
||||
|
||||
private final OaBusinessMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 商机
|
||||
*/
|
||||
@Override
|
||||
public OaBusinessVo queryById(Long businessId){
|
||||
return baseMapper.selectVoById(businessId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 商机列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaBusinessVo> queryPageList(OaBusinessBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaBusiness> lqw = buildQueryWrapper(bo);
|
||||
Page<OaBusinessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 商机列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaBusinessVo> queryList(OaBusinessBo bo) {
|
||||
LambdaQueryWrapper<OaBusiness> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaBusiness> buildQueryWrapper(OaBusinessBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaBusiness> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), OaBusiness::getName, bo.getName());
|
||||
lqw.eq(bo.getCustomerId() != null, OaBusiness::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(bo.getFollowUpStatus() != null, OaBusiness::getFollowUpStatus, bo.getFollowUpStatus());
|
||||
lqw.eq(bo.getContactLastTime() != null, OaBusiness::getContactLastTime, bo.getContactLastTime());
|
||||
lqw.eq(bo.getContactNextTime() != null, OaBusiness::getContactNextTime, bo.getContactNextTime());
|
||||
lqw.eq(bo.getOwnerUserId() != null, OaBusiness::getOwnerUserId, bo.getOwnerUserId());
|
||||
lqw.eq(bo.getStatusTypeId() != null, OaBusiness::getStatusTypeId, bo.getStatusTypeId());
|
||||
lqw.eq(bo.getStatusId() != null, OaBusiness::getStatusId, bo.getStatusId());
|
||||
lqw.eq(bo.getEndStatus() != null, OaBusiness::getEndStatus, bo.getEndStatus());
|
||||
lqw.eq(bo.getDealTime() != null, OaBusiness::getDealTime, bo.getDealTime());
|
||||
lqw.eq(bo.getTotalProductPrice() != null, OaBusiness::getTotalProductPrice, bo.getTotalProductPrice());
|
||||
lqw.eq(bo.getDiscountPercent() != null, OaBusiness::getDiscountPercent, bo.getDiscountPercent());
|
||||
lqw.eq(bo.getTotalPrice() != null, OaBusiness::getTotalPrice, bo.getTotalPrice());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEndRemark()), OaBusiness::getEndRemark, bo.getEndRemark());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 商机
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaBusinessBo bo) {
|
||||
OaBusiness add = BeanUtil.toBean(bo, OaBusiness.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setBusinessId(add.getBusinessId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 商机
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaBusinessBo bo) {
|
||||
OaBusiness update = BeanUtil.toBean(bo, OaBusiness.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaBusiness entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 商机
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaClueBo;
|
||||
import com.ruoyi.oa.domain.vo.OaClueVo;
|
||||
import com.ruoyi.oa.domain.OaClue;
|
||||
import com.ruoyi.oa.mapper.OaClueMapper;
|
||||
import com.ruoyi.oa.service.IOaClueService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 线索Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaClueServiceImpl implements IOaClueService {
|
||||
|
||||
private final OaClueMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 线索
|
||||
*/
|
||||
@Override
|
||||
public OaClueVo queryById(Long clueId){
|
||||
return baseMapper.selectVoById(clueId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 线索列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaClueVo> queryPageList(OaClueBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaClue> lqw = buildQueryWrapper(bo);
|
||||
Page<OaClueVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 线索列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaClueVo> queryList(OaClueBo bo) {
|
||||
LambdaQueryWrapper<OaClue> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaClue> buildQueryWrapper(OaClueBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaClue> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClueName()), OaClue::getClueName, bo.getClueName());
|
||||
lqw.eq(bo.getFollowUpStatus() != null, OaClue::getFollowUpStatus, bo.getFollowUpStatus());
|
||||
lqw.eq(bo.getContactLastTime() != null, OaClue::getContactLastTime, bo.getContactLastTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactLastContent()), OaClue::getContactLastContent, bo.getContactLastContent());
|
||||
lqw.eq(bo.getContactNextTime() != null, OaClue::getContactNextTime, bo.getContactNextTime());
|
||||
lqw.eq(bo.getOwnerUserId() != null, OaClue::getOwnerUserId, bo.getOwnerUserId());
|
||||
lqw.eq(bo.getTransformStatus() != null, OaClue::getTransformStatus, bo.getTransformStatus());
|
||||
lqw.eq(bo.getCustomerId() != null, OaClue::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMobile()), OaClue::getMobile, bo.getMobile());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTelephone()), OaClue::getTelephone, bo.getTelephone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQq()), OaClue::getQq, bo.getQq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWechat()), OaClue::getWechat, bo.getWechat());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmail()), OaClue::getEmail, bo.getEmail());
|
||||
lqw.eq(bo.getAreaId() != null, OaClue::getAreaId, bo.getAreaId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDetailAddress()), OaClue::getDetailAddress, bo.getDetailAddress());
|
||||
lqw.eq(bo.getIndustryId() != null, OaClue::getIndustryId, bo.getIndustryId());
|
||||
lqw.eq(bo.getLevel() != null, OaClue::getLevel, bo.getLevel());
|
||||
lqw.eq(bo.getSource() != null, OaClue::getSource, bo.getSource());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 线索
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaClueBo bo) {
|
||||
OaClue add = BeanUtil.toBean(bo, OaClue.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setClueId(add.getClueId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 线索
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaClueBo bo) {
|
||||
OaClue update = BeanUtil.toBean(bo, OaClue.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaClue entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 线索
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaCustomerBo;
|
||||
import com.ruoyi.oa.domain.vo.OaCustomerVo;
|
||||
import com.ruoyi.oa.domain.OaCustomer;
|
||||
import com.ruoyi.oa.mapper.OaCustomerMapper;
|
||||
import com.ruoyi.oa.service.IOaCustomerService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 客户Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaCustomerServiceImpl implements IOaCustomerService {
|
||||
|
||||
private final OaCustomerMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 客户
|
||||
*/
|
||||
@Override
|
||||
public OaCustomerVo queryById(Long customerId){
|
||||
return baseMapper.selectVoById(customerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 客户列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaCustomerVo> queryPageList(OaCustomerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
Page<OaCustomerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 客户列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaCustomerVo> queryList(OaCustomerBo bo) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaCustomer> buildQueryWrapper(OaCustomerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaCustomer> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), OaCustomer::getName, bo.getName());
|
||||
lqw.eq(bo.getFollowUpStatus() != null, OaCustomer::getFollowUpStatus, bo.getFollowUpStatus());
|
||||
lqw.eq(bo.getContactLastTime() != null, OaCustomer::getContactLastTime, bo.getContactLastTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactLastContent()), OaCustomer::getContactLastContent, bo.getContactLastContent());
|
||||
lqw.eq(bo.getContactNextTime() != null, OaCustomer::getContactNextTime, bo.getContactNextTime());
|
||||
lqw.eq(bo.getOwnerUserId() != null, OaCustomer::getOwnerUserId, bo.getOwnerUserId());
|
||||
lqw.eq(bo.getOwnerTime() != null, OaCustomer::getOwnerTime, bo.getOwnerTime());
|
||||
lqw.eq(bo.getDealStatus() != null, OaCustomer::getDealStatus, bo.getDealStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMobile()), OaCustomer::getMobile, bo.getMobile());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTelephone()), OaCustomer::getTelephone, bo.getTelephone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQq()), OaCustomer::getQq, bo.getQq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWechat()), OaCustomer::getWechat, bo.getWechat());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmail()), OaCustomer::getEmail, bo.getEmail());
|
||||
lqw.eq(bo.getAreaId() != null, OaCustomer::getAreaId, bo.getAreaId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDetailAddress()), OaCustomer::getDetailAddress, bo.getDetailAddress());
|
||||
lqw.eq(bo.getIndustryId() != null, OaCustomer::getIndustryId, bo.getIndustryId());
|
||||
lqw.eq(bo.getLevel() != null, OaCustomer::getLevel, bo.getLevel());
|
||||
lqw.eq(bo.getSource() != null, OaCustomer::getSource, bo.getSource());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 客户
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaCustomerBo bo) {
|
||||
OaCustomer add = BeanUtil.toBean(bo, OaCustomer.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setCustomerId(add.getCustomerId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 客户
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaCustomerBo bo) {
|
||||
OaCustomer update = BeanUtil.toBean(bo, OaCustomer.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaCustomer entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 客户
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaFollowUpRecordBo;
|
||||
import com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
|
||||
import com.ruoyi.oa.domain.OaFollowUpRecord;
|
||||
import com.ruoyi.oa.mapper.OaFollowUpRecordMapper;
|
||||
import com.ruoyi.oa.service.IOaFollowUpRecordService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 跟进记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaFollowUpRecordServiceImpl implements IOaFollowUpRecordService {
|
||||
|
||||
private final OaFollowUpRecordMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录
|
||||
*/
|
||||
@Override
|
||||
public OaFollowUpRecordVo queryById(Long followId){
|
||||
return baseMapper.selectVoById(followId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaFollowUpRecordVo> queryPageList(OaFollowUpRecordBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaFollowUpRecord> lqw = buildQueryWrapper(bo);
|
||||
Page<OaFollowUpRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 跟进记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaFollowUpRecordVo> queryList(OaFollowUpRecordBo bo) {
|
||||
LambdaQueryWrapper<OaFollowUpRecord> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaFollowUpRecord> buildQueryWrapper(OaFollowUpRecordBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaFollowUpRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getType() != null, OaFollowUpRecord::getType, bo.getType());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContent()), OaFollowUpRecord::getContent, bo.getContent());
|
||||
lqw.eq(bo.getNextTime() != null, OaFollowUpRecord::getNextTime, bo.getNextTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPicUrls()), OaFollowUpRecord::getPicUrls, bo.getPicUrls());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileUrls()), OaFollowUpRecord::getFileUrls, bo.getFileUrls());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBusinessIds()), OaFollowUpRecord::getBusinessIds, bo.getBusinessIds());
|
||||
lqw.eq(bo.getBusinessId() != null, OaFollowUpRecord::getBusinessId, bo.getBusinessId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactIds()), OaFollowUpRecord::getContactIds, bo.getContactIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 跟进记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaFollowUpRecordBo bo) {
|
||||
OaFollowUpRecord add = BeanUtil.toBean(bo, OaFollowUpRecord.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setFollowId(add.getFollowId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 跟进记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaFollowUpRecordBo bo) {
|
||||
OaFollowUpRecord update = BeanUtil.toBean(bo, OaFollowUpRecord.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaFollowUpRecord entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 跟进记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaProductBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProductVo;
|
||||
import com.ruoyi.oa.domain.OaProduct;
|
||||
import com.ruoyi.oa.mapper.OaProductMapper;
|
||||
import com.ruoyi.oa.service.IOaProductService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* CRM 产品Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaProductServiceImpl implements IOaProductService {
|
||||
|
||||
private final OaProductMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询CRM 产品
|
||||
*/
|
||||
@Override
|
||||
public OaProductVo queryById(Long productId){
|
||||
return baseMapper.selectVoById(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 产品列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaProductVo> queryPageList(OaProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<OaProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询CRM 产品列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaProductVo> queryList(OaProductBo bo) {
|
||||
LambdaQueryWrapper<OaProduct> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaProduct> buildQueryWrapper(OaProductBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaProduct> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductName()), OaProduct::getProductName, bo.getProductName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductNumber()), OaProduct::getProductNumber, bo.getProductNumber());
|
||||
lqw.eq(bo.getUnit() != null, OaProduct::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getPrice() != null, OaProduct::getPrice, bo.getPrice());
|
||||
lqw.eq(bo.getStatus() != null, OaProduct::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getCategoryId() != null, OaProduct::getCategoryId, bo.getCategoryId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDescription()), OaProduct::getDescription, bo.getDescription());
|
||||
lqw.eq(bo.getOwnerUserId() != null, OaProduct::getOwnerUserId, bo.getOwnerUserId());
|
||||
lqw.eq(bo.getDeleted() != null, OaProduct::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CRM 产品
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaProductBo bo) {
|
||||
OaProduct add = BeanUtil.toBean(bo, OaProduct.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setProductId(add.getProductId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CRM 产品
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaProductBo bo) {
|
||||
OaProduct update = BeanUtil.toBean(bo, OaProduct.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaProduct entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除CRM 产品
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user