Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
be186ce8
Commit
be186ce8
authored
May 31, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公海池客户列表导出优化
parent
cb8ddf1e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
6 deletions
+138
-6
CustomerMapper.java
...ao/module/customer/dal/mysql/customer/CustomerMapper.java
+6
-0
CustomerService.java
...dao/module/customer/service/customer/CustomerService.java
+4
-0
CustomerServiceImpl.java
...module/customer/service/customer/CustomerServiceImpl.java
+20
-0
CustomerMapper.xml
...ore/src/main/resources/mapper/customer/CustomerMapper.xml
+101
-0
CustomerController.java
...ustomer/controller/admin/customer/CustomerController.java
+4
-4
CustomerExcelExportListener.java
...dao/module/sale/listener/CustomerExcelExportListener.java
+3
-2
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/customer/CustomerMapper.java
View file @
be186ce8
...
...
@@ -211,4 +211,10 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
long
getWaitToConfirmCustomerPageReqCount
(
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
List
<
CustomerDO
>
getWaitToConfirmCustomerExcelVoListReq
(
@Param
(
"query"
)
CustomerExportReqDTO
reqVO
);
//公海客户列表
List
<
CustomerDO
>
getOpenSeaCustomerPageReq
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
//公海客户列表统计total
long
getOpenSeaCustomerPageReqCount
(
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
List
<
CustomerDO
>
getPublicCustomerExcelVoReqList
(
@Param
(
"query"
)
CustomerExportReqDTO
reqVO
);
}
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerService.java
View file @
be186ce8
...
...
@@ -184,6 +184,8 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult
<
CustomerDO
>
getOpenSeaCustomerPage
(
CustomerPageReqVO
pageReqVO
);
PageResult
<
CustomerDO
>
getOpenSeaCustomerPageReq
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
);
/**
* 获得公海池客户列表, 用于 Excel 导出
*
...
...
@@ -192,6 +194,8 @@ public interface CustomerService extends IService<CustomerDO> {
*/
List
<
CustomerDO
>
getPublicCustomerExcelVoList
(
CustomerExportReqVO
exportReqVO
);
List
<
CustomerDO
>
getPublicCustomerExcelVoReqList
(
CustomerExportReqDTO
exportReqVO
);
/**
* 获得客户列表, 用于 Excel 导出
*
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerServiceImpl.java
View file @
be186ce8
...
...
@@ -82,6 +82,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.context.ApplicationContext
;
...
...
@@ -1544,6 +1545,19 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
new
PageResult
<>(
mpPage
.
getRecords
(),
mpPage
.
getTotal
());
}
@Override
public
PageResult
<
CustomerDO
>
getOpenSeaCustomerPageReq
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
){
pageReqVO
.
setIsInOpenSea
(
true
);
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
.
getOpenSeaCustomerPageReq
(
start
,
size
,
pageReqVO
);
long
total
=
customerMapper
.
getOpenSeaCustomerPageReqCount
(
pageReqVO
)
;
return
new
PageResult
<>(
list
,
total
,
mpPage
.
getSize
(),
page
.
getPage
(),
(
total
+
mpPage
.
getSize
()
-
1
)
/
mpPage
.
getSize
());
}
@Override
public
List
<
CustomerDO
>
getPublicCustomerExcelVoList
(
CustomerExportReqVO
reqVO
)
{
LambdaQueryWrapper
<
CustomerDO
>
customerDOLambdaQueryWrapperX
=
new
LambdaQueryWrapperX
<
CustomerDO
>()
...
...
@@ -1591,6 +1605,12 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
customerMapper
.
getCustomerExcelVoList
(
customerDOLambdaQueryWrapperX
);
}
@Override
public
List
<
CustomerDO
>
getPublicCustomerExcelVoReqList
(
@Param
(
"query"
)
CustomerExportReqDTO
reqVO
){
reqVO
.
setIsInOpenSea
(
true
)
;
return
customerMapper
.
getPublicCustomerExcelVoReqList
(
reqVO
)
;
}
@Override
public
List
<
CustomerDO
>
getCustomerExcelVoList
(
CustomerExportReqVO
reqVO
)
{
LambdaQueryWrapper
<
CustomerDO
>
customerDOLambdaQueryWrapperX
=
new
LambdaQueryWrapperX
<
CustomerDO
>()
...
...
yudao-module-customer/yudao-module-customer-core/src/main/resources/mapper/customer/CustomerMapper.xml
View file @
be186ce8
...
...
@@ -1461,6 +1461,107 @@
<include
refid=
"myCustomerQuery"
/>
</select>
<select
id=
"getOpenSeaCustomerPageReq"
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 AND contact.enter_open_sea_time is NOT NULL
<include
refid=
"myCustomerQuery"
/>
GROUP BY contact.id
order by contact.id desc
limit #{start}, #{size}
</select>
<select
id=
"getOpenSeaCustomerPageReqCount"
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 AND contact.enter_open_sea_time is NOT NULL
<include
refid=
"myCustomerQuery"
/>
</select>
<select
id=
"getPublicCustomerExcelVoReqList"
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 AND contact.enter_open_sea_time is NOT NULL
<include
refid=
"myCustomerQuery"
/>
</select>
</mapper>
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
View file @
be186ce8
...
...
@@ -412,9 +412,9 @@ public class CustomerController {
@GetMapping
(
"/get-public"
)
@ApiOperation
(
"获得公海池客户列表"
)
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getPublicCustomerList
(
@Valid
CustomerPageReq
VO
customerPageReqVO
)
{
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getPublicCustomerList
(
@Valid
CustomerPageReq
DTO
customerPageReqVO
,
PageVO
page
)
{
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getOpenSeaCustomerPage
(
customerPageReqVO
);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
getOpenSeaCustomerPage
Req
(
customerPageReqVO
,
page
);
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
...
...
@@ -681,7 +681,7 @@ public class CustomerController {
@GetMapping
(
"/waite-confirm-export-excel"
)
@ApiOperation
(
"我的待接收客户列表导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportWaiteConfirmCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportWaiteConfirmCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
sendFileMake
(
exportReqVO
,
DownloadTypeEnum
.
CUSTOMER_WAIT_CONFIRM_PUBLIC_EXCEL_EXPORT
,
"我的待接收客户导出Excel"
);
return
success
(
true
);
...
...
@@ -690,7 +690,7 @@ public class CustomerController {
@GetMapping
(
"/public-export-excel"
)
@ApiOperation
(
"公海池客户列表导出"
)
@OperateLog
(
type
=
EXPORT
)
public
CommonResult
<
Boolean
>
exportPublicCustomerExcel
(
@Valid
CustomerExportReq
V
O
exportReqVO
,
public
CommonResult
<
Boolean
>
exportPublicCustomerExcel
(
@Valid
CustomerExportReq
DT
O
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
sendFileMake
(
exportReqVO
,
DownloadTypeEnum
.
CUSTOMER_PUBLIC_EXCEL_EXPORT
,
"公海池客户导出Excel"
);
return
success
(
true
);
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/listener/CustomerExcelExportListener.java
View file @
be186ce8
...
...
@@ -109,8 +109,9 @@ public class CustomerExcelExportListener {
*/
@EventListener
(
CustomerPublicExcelExportPushEvent
.
class
)
public
void
customerPublicExcelExportPushEvent
(
CustomerPublicExcelExportPushEvent
event
)
{
CustomerExportReqVO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqVO
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
getPublicCustomerExcelVoList
(
exportReqVO
);
//CustomerExportReqVO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqVO.class);
CustomerExportReqDTO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqDTO
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
getPublicCustomerExcelVoReqList
(
exportReqVO
);
makeExcelUpload
(
event
,
list
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment