CRM提交更新

This commit is contained in:
2025-03-12 21:14:46 +08:00
parent 6fbac23101
commit 0ce49d1504
52 changed files with 2918 additions and 179 deletions

View File

@@ -5,6 +5,7 @@ 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 com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
import com.ruoyi.oa.domain.vo.OaProductVo;
import java.util.Collection;
@@ -53,4 +54,5 @@ public interface IOaBusinessService {
* 联查商机与产品以及其关联表
*/
TableDataInfo<OaProductVo> getBusinessProducts(OaBusinessBo bo);
}

View File

@@ -46,4 +46,12 @@ public interface IOaClueService {
* 校验并批量删除CRM 线索信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询使用xml 关联到user表
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaClueVo> queryPageListVo(OaClueBo bo, PageQuery pageQuery);
}

View File

@@ -46,4 +46,20 @@ public interface IOaCustomerService {
* 校验并批量删除CRM 客户信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询已分配的用户
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaCustomerVo> queryPageListToUser(OaCustomerBo bo, PageQuery pageQuery);
/**
* 查询公海中的客户
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaCustomerVo> queryPageListToSea(OaCustomerBo bo, PageQuery pageQuery);
}

View File

@@ -46,4 +46,6 @@ public interface IOaFollowUpRecordService {
* 校验并批量删除CRM 跟进记录信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
List<OaFollowUpRecordVo> selectByBusinessIds(Collection<Long> list);
}

View File

@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.oa.domain.vo.FileUser;
import com.ruoyi.oa.domain.vo.UserFilesVo;
import com.ruoyi.system.service.ISysUserService;
import liquibase.pro.packaged.A;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@@ -8,6 +8,7 @@ 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 com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
import com.ruoyi.oa.domain.vo.OaProductVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -17,6 +18,7 @@ import com.ruoyi.oa.domain.OaBusiness;
import com.ruoyi.oa.mapper.OaBusinessMapper;
import com.ruoyi.oa.service.IOaBusinessService;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@@ -128,7 +130,7 @@ public class OaBusinessServiceImpl implements IOaBusinessService {
@Override
public TableDataInfo<OaProductVo> getBusinessProducts(OaBusinessBo bo) {
QueryWrapper<OaBusiness> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(bo.getBusinessId() != null,"oa_business.business_id", bo.getBusinessId());
queryWrapper.eq(bo.getBusinessId() != null,"ob.business_id", bo.getBusinessId());
return TableDataInfo.build(baseMapper.getBusinessProducts(bo,queryWrapper));
}
}

View File

@@ -123,4 +123,11 @@ public class OaClueServiceImpl implements IOaClueService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public TableDataInfo<OaClueVo> queryPageListVo(OaClueBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaClue> lqw = buildQueryWrapper(bo);
Page<OaClueVo> result = baseMapper.selectVoListPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
}

View File

@@ -1,6 +1,7 @@
package com.ruoyi.oa.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
@@ -66,19 +67,8 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
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;
}
@@ -123,4 +113,20 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public TableDataInfo<OaCustomerVo> queryPageListToUser(OaCustomerBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
lqw.eq(OaCustomer::getOwnerUserId, LoginHelper.getUserId());
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@Override
public TableDataInfo<OaCustomerVo> queryPageListToSea(OaCustomerBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
lqw.isNull(OaCustomer::getOwnerUserId);
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
}

View File

@@ -15,6 +15,7 @@ import com.ruoyi.oa.domain.OaFollowUpRecord;
import com.ruoyi.oa.mapper.OaFollowUpRecordMapper;
import com.ruoyi.oa.service.IOaFollowUpRecordService;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@@ -113,4 +114,17 @@ public class OaFollowUpRecordServiceImpl implements IOaFollowUpRecordService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public List<OaFollowUpRecordVo> selectByBusinessIds(Collection<Long> businessIds) {
LambdaQueryWrapper<OaFollowUpRecord> queryWrapper = new LambdaQueryWrapper<>();
// 将多个业务id用 or 拼接
for (Long id : businessIds) {
queryWrapper.or().apply("FIND_IN_SET({0}, business_ids)", id);
}
return baseMapper.selectVoList(queryWrapper);
}
}

View File

@@ -69,7 +69,6 @@ public class OaProductServiceImpl implements IOaProductService {
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;
}