Commit c4dd5f4c authored by liuzeheng's avatar liuzeheng

潜在客户多选

parent bcfd7de1
......@@ -206,4 +206,9 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
List<CustomerOrderBackPageVO> orderList(@Param("start") int start, @Param("size") int size, @Param("query") CustomerOrderQueryDTO query);
List<CustomerDO> getWaitToConfirmCustomerPageReq(@Param("start") int start, @Param("size") int size, @Param("query") CustomerPageReqDTO pageReqVO);
long getWaitToConfirmCustomerPageReqCount( @Param("query") CustomerPageReqDTO pageReqVO);
List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(@Param("query") CustomerExportReqDTO reqVO);
}
......@@ -131,7 +131,7 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult<CustomerDO> getWaitToConfirmCustomerPage(CustomerPageReqVO pageReqVO);
PageResult<CustomerDO> getWaitToConfirmCustomerPageReq(CustomerPageReqDTO pageReqVO,PageVO page);
/**
* "我的待接收客户列表, 用于 Excel 导出
*
......@@ -140,6 +140,12 @@ public interface CustomerService extends IService<CustomerDO> {
*/
List<CustomerDO> getWaitToConfirmCustomerExcelVoList(CustomerExportReqVO exportReqVO);
/**
* 我的待接收客户列表, 用于 Excel 导出 ,支持多选
* @param exportReqVO
* @return
*/
List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO exportReqVO);
/**
* 获得待分配客户分页
*
......@@ -148,6 +154,7 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult<CustomerDO> getWaitToAssignedCustomerPage(CustomerPageReqVO pageReqVO);
/**
* 获得待分配客户分页 支持多选
* @param pageReqVO
......
......@@ -1412,6 +1412,18 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
}
@Override
public PageResult<CustomerDO> getWaitToConfirmCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page){
pageReqVO.setIsCustomerServiceConfirmed(false) ;
pageReqVO.setIsInOpenSea(false) ;
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerDO> list = customerMapper.getWaitToConfirmCustomerPageReq(start,size,pageReqVO);
long total = customerMapper.getWaitToConfirmCustomerPageReqCount(pageReqVO) ;
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public List<CustomerDO> getWaitToConfirmCustomerExcelVoList(CustomerExportReqVO reqVO) {
......@@ -1462,7 +1474,15 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return customerMapper.getCustomerExcelVoList(customerDOLambdaQueryWrapperX);
}
/**
* 我的待接收客户列表, 用于 Excel 导出 ,支持多选
* @param reqVO
* @return
*/
@Override
public List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO reqVO){
return customerMapper.getWaitToConfirmCustomerExcelVoListReq(reqVO) ;
}
@Override
public PageResult<CustomerDO> getOpenSeaCustomerPage(CustomerPageReqVO reqVO) {
......
......@@ -472,7 +472,7 @@
AND contact.all_contact_phone LIKE concat('%', concat( #{query.defaultContactName}, '%' ))
</if>
<if test="query.isInOpenSea != null and query.isInOpenSea != '' ">
<if test="query.isInOpenSea != null ">
AND contact.is_in_open_sea = #{query.isInOpenSea}
</if>
......@@ -486,7 +486,7 @@
<!--是否接收 -->
<if test="query.isCustomerServiceConfirmed != null and query.isCustomerServiceConfirmed != '' ">
<if test="query.isCustomerServiceConfirmed != null">
AND contact.is_customer_service_confirmed = #{query.isCustomerServiceConfirmed}
</if>
......@@ -1358,7 +1358,109 @@
limit #{start}, #{size}
</select>
<select id="getWaitToConfirmCustomerPageReq"
resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO">
select contact.*,
level.name_zh as vip_level_name_zh,
level.name_en as vip_level_name_en,
credit.name_zh as credit_level_name_zh,
credit.name_en as credit_level_name_en,
ec.name_zh as country_name,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
left join (select * from ecw_customer_contacts where is_default = 1 and deleted = 0) as c on a.id = c.customer_id
left join system_user su on a.customer_service = su.id
where a.deleted = 0) contact
left join ecw_customer_level level
on contact.level = level.id
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
WHERE 1=1 AND contact.deleted = 0
<include refid="myCustomerQuery"/>
GROUP BY contact.id
order by contact.id desc
limit #{start}, #{size}
</select>
<select id="getWaitToConfirmCustomerPageReqCount" resultType="java.lang.Long"
parameterType="cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO">
select count(1)
from (select a.*,
c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
left join (select * from ecw_customer_contacts where is_default = 1 and deleted = 0) as c on a.id = c.customer_id
left join system_user su on a.customer_service = su.id
where a.deleted = 0) contact
left join ecw_customer_level level
on contact.level = level.id
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
WHERE 1=1 AND contact.deleted = 0
<include refid="myCustomerQuery"/>
</select>
<select id="getWaitToConfirmCustomerExcelVoListReq"
resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO"
parameterType="cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO">
select contact.*,
level.name_zh as vip_level_name_zh,
level.name_en as vip_level_name_en,
credit.name_zh as credit_level_name_zh,
credit.name_en as credit_level_name_en,
ec.name_zh as country_name,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
left join (select * from ecw_customer_contacts where is_default = 1 and deleted = 0) as c on a.id = c.customer_id
left join system_user su on a.customer_service = su.id
where a.deleted = 0) contact
left join ecw_customer_level level
on contact.level = level.id
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
WHERE 1=1 AND contact.deleted = 0
<include refid="myCustomerQuery"/>
</select>
</mapper>
......@@ -364,12 +364,15 @@ public class CustomerController {
@GetMapping("/get-wait-for-confirm")
@ApiOperation("获得待接收列表")
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getWaitConfirmList(@Valid CustomerPageReqVO customerPageReqVO) {
public CommonResult<PageResult<CustomerRespVO>> getWaitConfirmList(@Valid CustomerPageReqDTO customerPageReqVO,PageVO page) {
//lanbm 2024-05-26 添加注释
customerPageReqVO.setCustomerService(WebFrameworkUtils.getLoginUserId());
//customerPageReqVO.setCustomerService(WebFrameworkUtils.getLoginUserId());
List<Long> setCustomerService = new ArrayList<>();
setCustomerService.add(WebFrameworkUtils.getLoginUserId()) ;
customerPageReqVO.setCustomerService(setCustomerService) ;
PageResult<CustomerDO> pageResult =
customerService.getWaitToConfirmCustomerPage(customerPageReqVO);
customerService.getWaitToConfirmCustomerPageReq(customerPageReqVO,page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult));
}
......@@ -399,10 +402,10 @@ public class CustomerController {
@GetMapping("/get-wait-for-distribution")
@ApiOperation("获得待分配客户列表")
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getWaitForDistributionList(@Valid CustomerPageReqVO customerPageReqVO) {
public CommonResult<PageResult<CustomerRespVO>> getWaitForDistributionList(@Valid CustomerPageReqDTO customerPageReqVO,PageVO page) {
//lanbm 2024-05-26 添加注释
PageResult<CustomerDO> pageResult =
customerService.getWaitToAssignedCustomerPage(customerPageReqVO);
customerService.getWaitToAssignedCustomerPageReq(customerPageReqVO,page);
return success(CustomerConvert.INSTANCE.convertPage(pageResult));
}
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apollo.core.event.export.*;
import cn.iocoder.yudao.framework.apollo.core.event.export.base.CustomerExportEvent;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import cn.iocoder.yudao.module.customer.convert.customer.CustomerConvert;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO;
......@@ -27,6 +28,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import static cn.iocoder.yudao.framework.excel.constant.ExportConstant.DATA_FORMAT;
......@@ -70,6 +72,12 @@ public class CustomerExcelExportListener {
@EventListener(CustomerMineExcelExportPushEvent.class)
public void customerMineExcelExportPushEvent(CustomerMineExcelExportPushEvent event) {
CustomerExportReqDTO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqDTO.class);
List<Long> setCustomerService = new ArrayList<>();
setCustomerService.add(WebFrameworkUtils.getLoginUserId()) ;
exportReqVO.setCustomerService(setCustomerService) ;
//未被接收
exportReqVO.setIsCustomerServiceConfirmed(true);
List<CustomerDO> list = customerService.getMyCustomerExcelVoList(exportReqVO);
makeExcelUpload(event, list);
......@@ -83,8 +91,13 @@ public class CustomerExcelExportListener {
@EventListener(CustomerWaitConfirmExcelExportPushEvent.class)
public void customerWaitConfirmExcelExportPushEvent(CustomerWaitConfirmExcelExportPushEvent event) {
CustomerExportReqVO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqVO.class);
List<CustomerDO> list = customerService.getWaitToConfirmCustomerExcelVoList(exportReqVO);
CustomerExportReqDTO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqDTO.class);
exportReqVO.setIsCustomerServiceConfirmed(false) ;
exportReqVO.setIsInOpenSea(false) ;
List<Long> setCustomerService = new ArrayList<>();
setCustomerService.add(WebFrameworkUtils.getLoginUserId()) ;
exportReqVO.setCustomerService(setCustomerService) ;
List<CustomerDO> list = customerService.getWaitToConfirmCustomerExcelVoListReq(exportReqVO);
makeExcelUpload(event, list);
}
......@@ -126,8 +139,15 @@ public class CustomerExcelExportListener {
*/
@EventListener(CustomerPotentialExcelExportPushEvent.class)
public void customerPotentialExcelExportPushEvent(CustomerPotentialExcelExportPushEvent event) {
CustomerExportReqVO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqVO.class);
List<CustomerDO> list = customerService.getCustomerExcelVoList(exportReqVO);
//CustomerExportReqVO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqVO.class);
CustomerExportReqDTO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqDTO.class);
if (exportReqVO.getCustomerService() != null) {
exportReqVO.setIsInOpenSea(false);
}
//设置潜在客户标识
exportReqVO.setIsPotential(true);
List<CustomerDO> list = customerService.getMyCustomerExcelVoList(exportReqVO);
makeExcelUpload(event, list);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment