|
|
|
|
@ -2,9 +2,9 @@ package org.dromara.oa.crm.service.impl;
|
|
|
|
|
|
|
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
@ -39,23 +39,23 @@ public class CrmCustomerInfoServiceImpl implements ICrmCustomerInfoService {
|
|
|
|
|
* @return 客户信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public CrmCustomerInfoVo queryById(Long customerId){
|
|
|
|
|
public CrmCustomerInfoVo queryById(Long customerId) {
|
|
|
|
|
return baseMapper.selectVoById(customerId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询客户信息列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 客户信息分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<CrmCustomerInfoVo> queryPageList(CrmCustomerInfoBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<CrmCustomerInfo> lqw = buildQueryWrapper(bo);
|
|
|
|
|
Page<CrmCustomerInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询客户信息列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 客户信息分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<CrmCustomerInfoVo> queryPageList(CrmCustomerInfoBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<CrmCustomerInfo> lqw = buildQueryWrapper(bo);
|
|
|
|
|
Page<CrmCustomerInfoVo> result = baseMapper.selectCustomCrmCustomerInfoVoList(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询符合条件的客户信息列表
|
|
|
|
|
@ -66,32 +66,34 @@ public class CrmCustomerInfoServiceImpl implements ICrmCustomerInfoService {
|
|
|
|
|
@Override
|
|
|
|
|
public List<CrmCustomerInfoVo> queryList(CrmCustomerInfoBo bo) {
|
|
|
|
|
MPJLambdaWrapper<CrmCustomerInfo> lqw = buildQueryWrapper(bo);
|
|
|
|
|
return baseMapper.selectVoList(lqw);
|
|
|
|
|
return baseMapper.selectCustomCrmCustomerInfoVoList(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<CrmCustomerInfo> buildQueryWrapper(CrmCustomerInfoBo bo) {
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<CrmCustomerInfo> lqw = JoinWrappers.lambda(CrmCustomerInfo.class)
|
|
|
|
|
.selectAll(CrmCustomerInfo.class)
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getCustomerName()), CrmCustomerInfo::getCustomerName, bo.getCustomerName())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getMnemonicName()), CrmCustomerInfo::getMnemonicName, bo.getMnemonicName())
|
|
|
|
|
.eq(bo.getIndustryId() != null, CrmCustomerInfo::getIndustryId, bo.getIndustryId())
|
|
|
|
|
.eq(bo.getCustomerType() != null, CrmCustomerInfo::getCustomerType, bo.getCustomerType())
|
|
|
|
|
.eq(bo.getCustomerStatus() != null, CrmCustomerInfo::getCustomerStatus, bo.getCustomerStatus())
|
|
|
|
|
.eq(bo.getCustomerLevel() != null, CrmCustomerInfo::getCustomerLevel, bo.getCustomerLevel())
|
|
|
|
|
.eq(bo.getCustomerSource() != null, CrmCustomerInfo::getCustomerSource, bo.getCustomerSource())
|
|
|
|
|
.eq(bo.getOwnerId() != null, CrmCustomerInfo::getOwnerId, bo.getOwnerId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getDetailedAddress()), CrmCustomerInfo::getDetailedAddress, bo.getDetailedAddress())
|
|
|
|
|
.eq(bo.getCustomerScale() != null, CrmCustomerInfo::getCustomerScale, bo.getCustomerScale())
|
|
|
|
|
.eq(bo.getParentCustomerId() != null, CrmCustomerInfo::getParentCustomerId, bo.getParentCustomerId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getCustomerRelationship()), CrmCustomerInfo::getCustomerRelationship, bo.getCustomerRelationship())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getLegalRepresentative()), CrmCustomerInfo::getLegalRepresentative, bo.getLegalRepresentative())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBusinessLicenseNumber()), CrmCustomerInfo::getBusinessLicenseNumber, bo.getBusinessLicenseNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getTaxNumber()), CrmCustomerInfo::getTaxNumber, bo.getTaxNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBankAccountOpening()), CrmCustomerInfo::getBankAccountOpening, bo.getBankAccountOpening())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBankNumber()), CrmCustomerInfo::getBankNumber, bo.getBankNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getOssId()), CrmCustomerInfo::getOssId, bo.getOssId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), CrmCustomerInfo::getActiveFlag, bo.getActiveFlag());
|
|
|
|
|
.selectAll(CrmCustomerInfo.class)
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getCustomerName()), CrmCustomerInfo::getCustomerName, bo.getCustomerName())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getMnemonicName()), CrmCustomerInfo::getMnemonicName, bo.getMnemonicName())
|
|
|
|
|
.eq(bo.getIndustryId() != null, CrmCustomerInfo::getIndustryId, bo.getIndustryId())
|
|
|
|
|
.eq(bo.getCustomerType() != null, CrmCustomerInfo::getCustomerType, bo.getCustomerType())
|
|
|
|
|
.eq(bo.getCustomerStatus() != null, CrmCustomerInfo::getCustomerStatus, bo.getCustomerStatus())
|
|
|
|
|
.eq(bo.getCustomerLevel() != null, CrmCustomerInfo::getCustomerLevel, bo.getCustomerLevel())
|
|
|
|
|
.eq(bo.getCustomerSource() != null, CrmCustomerInfo::getCustomerSource, bo.getCustomerSource())
|
|
|
|
|
.eq(bo.getOwnerId() != null, CrmCustomerInfo::getOwnerId, bo.getOwnerId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getDetailedAddress()), CrmCustomerInfo::getDetailedAddress, bo.getDetailedAddress())
|
|
|
|
|
.eq(bo.getCustomerScale() != null, CrmCustomerInfo::getCustomerScale, bo.getCustomerScale())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getCustomerRelationship()), CrmCustomerInfo::getCustomerRelationship, bo.getCustomerRelationship())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getLegalRepresentative()), CrmCustomerInfo::getLegalRepresentative, bo.getLegalRepresentative())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBusinessLicenseNumber()), CrmCustomerInfo::getBusinessLicenseNumber, bo.getBusinessLicenseNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getTaxNumber()), CrmCustomerInfo::getTaxNumber, bo.getTaxNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBankAccountOpening()), CrmCustomerInfo::getBankAccountOpening, bo.getBankAccountOpening())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBankNumber()), CrmCustomerInfo::getBankNumber, bo.getBankNumber())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getOssId()), CrmCustomerInfo::getOssId, bo.getOssId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), CrmCustomerInfo::getActiveFlag, bo.getActiveFlag())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getOurCompanyFlag()), CrmCustomerInfo::getOurCompanyFlag, bo.getOurCompanyFlag())
|
|
|
|
|
.eq(bo.getParentCustomerId() != null, CrmCustomerInfo::getParentCustomerId, bo.getParentCustomerId())
|
|
|
|
|
.eq("t.del_flag", "0");
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|