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
ba7a8458
Commit
ba7a8458
authored
May 28, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的客户列表支持多选
parent
f43a292e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
584 additions
and
11 deletions
+584
-11
CustomerMapper.java
...ao/module/customer/dal/mysql/customer/CustomerMapper.java
+9
-0
CustomerExportReqDTO.java
...coder/yudao/module/customer/dto/CustomerExportReqDTO.java
+90
-0
CustomerPageReqDTO.java
...iocoder/yudao/module/customer/dto/CustomerPageReqDTO.java
+95
-0
CustomerService.java
...dao/module/customer/service/customer/CustomerService.java
+7
-0
CustomerServiceImpl.java
...module/customer/service/customer/CustomerServiceImpl.java
+19
-4
CustomerMapper.xml
...ore/src/main/resources/mapper/customer/CustomerMapper.xml
+266
-0
CustomerController.java
...ustomer/controller/admin/customer/CustomerController.java
+4
-2
ProductMapper.java
...yudao/module/product/dal/mysql/product/ProductMapper.java
+74
-0
ProductExcelExportListener.java
...o/module/product/listener/ProductExcelExportListener.java
+5
-3
ProductService.java
.../yudao/module/product/service/product/ProductService.java
+2
-0
ProductServiceImpl.java
...dule/product/service/product/impl/ProductServiceImpl.java
+10
-0
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 @
ba7a8458
...
...
@@ -2,7 +2,9 @@ package cn.iocoder.yudao.module.customer.dal.mysql.customer;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerOrderQueryDTO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO
;
import
cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerDetailRespVO
;
import
cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerSelectReqVO
;
import
cn.iocoder.yudao.module.customer.vo.customerDetail.CustomerOrderBackPageVO
;
...
...
@@ -25,8 +27,14 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
IPage
<
CustomerDO
>
getPage
(
IPage
<
CustomerDO
>
page
,
@Param
(
Constants
.
WRAPPER
)
Wrapper
<
CustomerDO
>
queryWrapper
);
List
<
CustomerDO
>
getMyPage
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
CustomerPageReqDTO
customerPageReqDTO
);
long
getMyPageCount
(
@Param
(
"query"
)
CustomerPageReqDTO
pageReqVO
);
List
<
CustomerDO
>
getCustomerExcelVoList
(
@Param
(
Constants
.
WRAPPER
)
Wrapper
<
CustomerDO
>
queryWrapper
);
List
<
CustomerDO
>
getMyCustomerExcelVoList
(
@Param
(
"query"
)
CustomerExportReqDTO
pageReqVO
);
List
<
CustomerDO
>
getList
(
@Param
(
Constants
.
WRAPPER
)
Wrapper
<
CustomerDO
>
queryWrapper
);
List
<
CustomerDO
>
searchCustomer
(
@Param
(
"reqVO"
)
CustomerSelectReqVO
customerSelectReqVO
);
...
...
@@ -182,4 +190,5 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
List
<
CustomerOrderBackPageVO
>
orderList
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
CustomerOrderQueryDTO
query
);
}
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dto/CustomerExportReqDTO.java
0 → 100644
View file @
ba7a8458
package
cn
.
iocoder
.
yudao
.
module
.
customer
.
dto
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Data
public
class
CustomerExportReqDTO
{
@ApiModelProperty
(
value
=
"客户编号"
)
private
String
number
;
@ApiModelProperty
(
value
=
"客户名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"客户等级"
)
private
List
<
Integer
>
level
;
@ApiModelProperty
(
value
=
"客户来源"
)
private
List
<
Integer
>
source
;
@ApiModelProperty
(
value
=
"客户类别"
)
private
List
<
String
>
type
;
@ApiModelProperty
(
value
=
"客户货运类型"
,
notes
=
"参见customer_transport_type数据字典"
)
private
String
transportType
;
@ApiModelProperty
(
value
=
"客户资源类型"
,
notes
=
"参见customer_resource_type数据字典"
)
private
List
<
Integer
>
resourceType
;
@ApiModelProperty
(
value
=
"跟进客服"
)
private
Long
customerService
;
@ApiModelProperty
(
value
=
"客户状态"
)
private
List
<
Integer
>
status
;
@ApiModelProperty
(
value
=
"部门"
)
private
String
department
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始创建时间"
)
private
Date
beginCreateTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束创建时间"
)
private
Date
endCreateTime
;
@ApiModelProperty
(
value
=
"主联系人"
)
private
String
defaultContactName
;
@ApiModelProperty
(
value
=
"主联系电话"
)
private
String
defaultContactPhone
;
@ApiModelProperty
(
value
=
"信用等级"
)
private
List
<
Integer
>
creditLevel
;
@ApiModelProperty
(
value
=
"国家"
)
private
List
<
Integer
>
country
;
@ApiModelProperty
(
value
=
"是否在公海"
)
private
Boolean
isInOpenSea
;
@ApiModelProperty
(
value
=
"是否潜在客户"
)
private
Boolean
isPotential
;
//api不显示此3个字段
//是否接收,后台使用
@JsonIgnore
private
Boolean
isCustomerServiceConfirmed
;
//因接口公用方法新增:24小时内数据查询条件标识
private
String
flag4QueryCondition
;
private
List
<
Integer
>
marketType
;
}
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/dto/CustomerPageReqDTO.java
0 → 100644
View file @
ba7a8458
package
cn
.
iocoder
.
yudao
.
module
.
customer
.
dto
;
import
cn.iocoder.yudao.framework.common.pojo.PageParam
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@ApiModel
(
"管理后台 - 客户分页 Request DTO"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
CustomerPageReqDTO
extends
PageParam
{
@ApiModelProperty
(
value
=
"客户编号"
)
private
String
number
;
@ApiModelProperty
(
value
=
"客户名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"客户等级"
)
private
List
<
Integer
>
level
;
@ApiModelProperty
(
value
=
"客户来源"
)
private
List
<
Integer
>
source
;
@ApiModelProperty
(
value
=
"客户类别"
)
private
List
<
String
>
type
;
@ApiModelProperty
(
value
=
"客户货运类型"
,
notes
=
"参见customer_transport_type数据字典"
)
private
String
transportType
;
@ApiModelProperty
(
value
=
"客户资源类型"
,
notes
=
"参见customer_resource_type数据字典"
)
private
List
<
Integer
>
resourceType
;
@ApiModelProperty
(
value
=
"市场获客"
,
notes
=
"参见customer_market_type数据字典"
)
private
List
<
Integer
>
marketType
;
@ApiModelProperty
(
value
=
"跟进客服"
)
private
Long
customerService
;
@ApiModelProperty
(
value
=
"客户状态"
)
private
List
<
Integer
>
status
;
@ApiModelProperty
(
value
=
"部门"
)
private
String
department
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始创建时间"
)
private
Date
beginCreateTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束创建时间"
)
private
Date
endCreateTime
;
@ApiModelProperty
(
value
=
"主联系人"
)
private
String
defaultContactName
;
@ApiModelProperty
(
value
=
"主联系电话"
)
private
String
defaultContactPhone
;
@ApiModelProperty
(
value
=
"信用等级"
)
private
List
<
Integer
>
creditLevel
;
@ApiModelProperty
(
value
=
"国家"
)
private
List
<
Integer
>
country
;
//api不显示此3个字段
//是否接收,后台使用
@JsonIgnore
private
Boolean
isCustomerServiceConfirmed
;
//因接口公用方法新增:24小时内数据查询条件标识
private
String
flag4QueryCondition
;
@ApiModelProperty
(
value
=
"是否在公海"
)
private
Boolean
isInOpenSea
;
@ApiModelProperty
(
value
=
"是否潜在客户"
)
private
Boolean
isPotential
;
}
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerService.java
View file @
ba7a8458
...
...
@@ -2,10 +2,13 @@ package cn.iocoder.yudao.module.customer.service.customer;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.IService
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerHandoverApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO
;
import
cn.iocoder.yudao.module.customer.vo.customer.vo.*
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerStatusEnum
;
...
...
@@ -96,6 +99,8 @@ public interface CustomerService extends IService<CustomerDO> {
*/
PageResult
<
CustomerDO
>
getCustomerPage
(
CustomerPageReqVO
pageReqVO
);
PageResult
<
CustomerDO
>
getMyCustomerPage
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
);
/**
* 获得部门客户分页
*
...
...
@@ -170,6 +175,8 @@ public interface CustomerService extends IService<CustomerDO> {
*/
List
<
CustomerDO
>
getCustomerExcelVoList
(
CustomerExportReqVO
exportReqVO
);
List
<
CustomerDO
>
getMyCustomerExcelVoList
(
CustomerExportReqDTO
exportReqVO
);
/**
* 获得客户列表, 用于 Excel 导出
*
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customer/CustomerServiceImpl.java
View file @
ba7a8458
...
...
@@ -25,6 +25,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils
;
...
...
@@ -47,10 +48,7 @@ import cn.iocoder.yudao.module.customer.dal.mysql.customerAirLog.CustomerAirLogM
import
cn.iocoder.yudao.module.customer.dal.mysql.customerBank.CustomerBankMapper
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customerContacts.CustomerContactsMapper
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customerPublicCatchLog.CustomerPublicCatchLogMapper
;
import
cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerHandoverApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerHandoverDetailDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerOrderQueryDTO
;
import
cn.iocoder.yudao.module.customer.dto.*
;
import
cn.iocoder.yudao.module.customer.service.customerApproval.CustomerApprovalService
;
import
cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService
;
import
cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService
;
...
...
@@ -1118,6 +1116,18 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
new
PageResult
<>(
mpPage
.
getRecords
(),
mpPage
.
getTotal
());
}
@Override
public
PageResult
<
CustomerDO
>
getMyCustomerPage
(
CustomerPageReqDTO
pageReqVO
,
PageVO
page
)
{
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
.
getMyPage
(
start
,
size
,
pageReqVO
);
long
total
=
customerMapper
.
getMyPageCount
(
pageReqVO
)
;
return
new
PageResult
<>(
list
,
total
,
mpPage
.
getSize
(),
page
.
getPage
(),
(
total
+
mpPage
.
getSize
()
-
1
)
/
mpPage
.
getSize
());
}
@Override
public
PageResult
<
CustomerDO
>
getDeptCustomerPage
(
CustomerPageReqVO
reqVO
)
{
IPage
<
CustomerDO
>
mpPage
=
MyBatisUtils
.
buildPage
(
reqVO
);
...
...
@@ -1572,6 +1582,11 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
return
customerMapper
.
getCustomerExcelVoList
(
customerDOLambdaQueryWrapperX
);
}
@Override
public
List
<
CustomerDO
>
getMyCustomerExcelVoList
(
CustomerExportReqDTO
reqVO
)
{
return
customerMapper
.
getMyCustomerExcelVoList
(
reqVO
);
}
@Override
public
PageResult
<
CustomerDO
>
searchCustomer
(
CustomerSelectReqVO
customerSelectReqVO
)
{
...
...
yudao-module-customer/yudao-module-customer-core/src/main/resources/mapper/customer/CustomerMapper.xml
View file @
ba7a8458
...
...
@@ -61,8 +61,273 @@
where a.customer_service = #{loginUserId}
</select>
<select
id=
"getMyPage"
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=
"getMyCustomerExcelVoList"
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
</select>
<select
id=
"getMyPageCount"
resultType=
"java.lang.Long"
>
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>
<sql
id=
"myCustomerQuery"
>
<if
test=
"query.number != null and query.number != '' "
>
AND contact.number LIKE concat('%', concat( #{query.number}, '%' ))
</if>
<if
test=
"query.name != null and query.name != '' "
>
AND contact.name LIKE concat('%', concat( #{query.name}, '%' ))
</if>
<if
test=
"query.defaultContactPhone != null and query.defaultContactPhone != '' "
>
AND contact.default_contact_phone LIKE concat('%', concat( #{query.defaultContactPhone}, '%' ))
</if>
<if
test=
"query.defaultContactName != null and query.defaultContactName != '' "
>
AND contact.all_contact_phone LIKE concat('%', concat( #{query.defaultContactName}, '%' ))
</if>
<if
test=
"query.isInOpenSea != null and query.isInOpenSea != '' "
>
AND contact.is_in_open_sea = #{query.isInOpenSea}
</if>
<if
test=
"query.isPotential != null and query.isPotential != '' "
>
AND contact.is_potential = #{query.isPotential}
</if>
<if
test=
"query.beginCreateTime != null and query.endCreateTime != '' "
>
AND contact.create_time BETWEEN #{query.beginCreateTime} AND #{query.endCreateTime}
</if>
<!--跟进客服 -->
<if
test=
"query.customerService != null and query.customerService != '' "
>
AND contact.customer_service = #{query.customerService}
</if>
<!--是否接收 -->
<if
test=
"query.isCustomerServiceConfirmed != null and query.isCustomerServiceConfirmed != '' "
>
AND contact.is_customer_service_confirmed = #{query.isCustomerServiceConfirmed}
</if>
<if
test=
"query.department != null and query.department != '' "
>
AND contact.department = #{query.department}
</if>
<!--信用等级 -->
<if
test=
"query.marketType != null and query.marketType.size()>0"
>
<if
test=
"query.marketType != null and query.marketType != '' and query.marketType.size()==1 "
>
<foreach
item=
'marketType'
index=
"index"
collection=
'query.marketType'
>
<choose>
<when
test=
"marketType == 1"
>
AND contact.customer_service is not null
</when>
<when
test=
"marketType == 2"
>
AND contact.customer_service is null
</when>
</choose>
</foreach>
</if>
<if
test=
"query.marketType != null and query.marketType != '' and query.marketType.size()>1 "
>
AND (1!=1
<foreach
item=
'marketType'
index=
"index"
collection=
'query.marketType'
>
<choose>
<when
test=
"marketType == 1"
>
OR contact.customer_service is not null
</when>
<when
test=
"marketType == 2"
>
OR contact.customer_service is null
</when>
</choose>
</foreach>
)
</if>
</if>
<!--信用等级 -->
<if
test=
"query.creditLevel != null and query.creditLevel.size()>0"
>
<if
test=
"query.creditLevel != null and query.creditLevel != '' and query.creditLevel.size()==1 "
>
AND contact.credit_level =
<foreach
item=
'creditLevel'
index=
"index"
collection=
'query.creditLevel'
>
#{creditLevel}
</foreach>
</if>
<if
test=
"query.creditLevel != null and query.creditLevel != '' and query.creditLevel.size()>1 "
>
AND contact.credit_level in
<foreach
item=
'creditLevel'
index=
"index"
collection=
'query.creditLevel'
open=
'('
separator=
','
close=
')'
>
#{creditLevel}
</foreach>
</if>
</if>
<!--客户类别 -->
<if
test=
"query.type != null and query.type.size()>0"
>
<if
test=
"query.type != null and query.type != '' and query.type.size()==1 "
>
AND contact.type =
<foreach
item=
'type'
index=
"index"
collection=
'query.type'
>
#{type}
</foreach>
</if>
<if
test=
"query.type != null and query.type != '' and query.type.size()>1 "
>
AND contact.type in
<foreach
item=
'type'
index=
"index"
collection=
'query.type'
open=
'('
separator=
','
close=
')'
>
#{type}
</foreach>
</if>
</if>
<!--客户来源 -->
<if
test=
"query.source != null and query.source.size()>0"
>
<if
test=
"query.source != null and query.source != '' and query.source.size()==1 "
>
AND contact.source =
<foreach
item=
'source'
index=
"index"
collection=
'query.source'
>
#{source}
</foreach>
</if>
<if
test=
"query.source != null and query.source != '' and query.source.size()>1 "
>
AND contact.source in
<foreach
item=
'source'
index=
"index"
collection=
'query.source'
open=
'('
separator=
','
close=
')'
>
#{source}
</foreach>
</if>
</if>
<!--国家 -->
<if
test=
"query.country != null and query.country.size()>0"
>
<if
test=
"query.country != null and query.country != '' and query.country.size()==1 "
>
AND contact.country =
<foreach
item=
'country'
index=
"index"
collection=
'query.country'
>
#{country}
</foreach>
</if>
<if
test=
"query.country != null and query.country != '' and query.country.size()>1 "
>
AND contact.country in
<foreach
item=
'country'
index=
"index"
collection=
'query.country'
open=
'('
separator=
','
close=
')'
>
#{country}
</foreach>
</if>
</if>
<!--客户状态 -->
<if
test=
"query.status != null and query.status.size()>0"
>
<if
test=
"query.status != null and query.status != '' and query.status.size()==1 "
>
AND contact.status =
<foreach
item=
'status'
index=
"index"
collection=
'query.status'
>
#{status}
</foreach>
</if>
<if
test=
"query.status != null and query.status != '' and query.status.size()>1 "
>
AND contact.status in
<foreach
item=
'status'
index=
"index"
collection=
'query.status'
open=
'('
separator=
','
close=
')'
>
#{status}
</foreach>
</if>
</if>
</sql>
<select
id=
"searchCustomer"
resultType=
"cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO"
>
select contact.*,
level.name_zh as vip_level_name_zh,
...
...
@@ -766,4 +1031,5 @@
limit #{start}, #{size}
</select>
</mapper>
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
View file @
ba7a8458
...
...
@@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.convert.customer.CustomerConvert
;
...
...
@@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBank
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerHandoverApprovalInfoDto
;
import
cn.iocoder.yudao.module.customer.dto.CustomerPageReqDTO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.customer.commission.CustomerCommissionService
;
import
cn.iocoder.yudao.module.customer.service.customerBank.CustomerBankService
;
...
...
@@ -493,7 +495,7 @@ public class CustomerController {
@GetMapping
(
"/get-mine"
)
@ApiOperation
(
"获得我的客户列表"
)
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getMine
(
@Valid
CustomerPageReq
VO
customerPageReqVO
)
{
public
CommonResult
<
PageResult
<
CustomerRespVO
>>
getMine
(
@Valid
CustomerPageReq
DTO
customerPageReqVO
,
PageVO
page
)
{
customerPageReqVO
.
setCustomerService
(
WebFrameworkUtils
.
getLoginUserId
());
...
...
@@ -502,7 +504,7 @@ public class CustomerController {
// customerPageReqVO.setFlag4QueryCondition("Y");
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
get
CustomerPage
(
customerPageReqVO
);
PageResult
<
CustomerDO
>
pageResult
=
customerService
.
get
MyCustomerPage
(
customerPageReqVO
,
page
);
return
success
(
CustomerConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/product/ProductMapper.java
View file @
ba7a8458
...
...
@@ -195,6 +195,79 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
;
}
@ResultType
(
ProductDO
.
class
)
@Select
({
"<script>"
,
"select t.*, c.nickname as creator_name, u.nickname as updater_name "
,
"from ecw_product t "
,
"left join system_user c on t.creator = c.id "
,
"left join system_user u on t.updater = u.id "
,
"where t.deleted = 0 "
,
"<when test = 'query.productCode != null and query.productCode != \"\"'>"
,
"AND t.`product_code` like concat('%',concat(#{query.productCode},'%'))"
,
"</when>"
,
"<when test = 'query.customsCode != null and query.customsCode != \"\"'>"
,
"AND t.`customs_code` like concat('%',concat(#{query.customsCode},'%'))"
,
"</when>"
,
/* "<when test = 'query.typeId != null'>",
"AND t.`type_id` = #{query.typeId}",
"</when>",*/
"<when test=\"query.typeId != null and query.typeId.size()>0\">"
+
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()==1 \">"
+
" AND t.`type_id` =\n"
+
" <foreach item='typeId' index='index' collection='query.typeId' >\n"
+
" #{typeId}"
+
" </foreach>"
+
" </when>"
+
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()>1 \">"
+
" AND t.`type_id` in "
+
" <foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>"
+
" #{typeId}"
+
" </foreach>"
+
" </when>"
+
"</when>"
,
"<when test = 'query.status != null'>"
,
"AND t.`status` = #{query.status}"
,
"</when>"
,
"<when test = 'query.auditStatus != null'>"
,
"AND t.`audit_status` = #{query.auditStatus}"
,
"</when>"
,
"<when test = 'query.titleZh != null and query.titleZh != \"\"'>"
,
"AND (t.`title_zh` like concat('%',concat(#{query.titleZh},'%')) or t.`title_en` like concat('%',concat(#{query.titleZh},'%')))"
,
"</when>"
,
// "<when test = 'query.attrId != null and query.attrId != \"\" '>",
"<when test=\"query.attrId != null and query.attrId.size()>0\">"
,
"<when test=\"query.attrId != null and query.attrId != '' and query.attrId.size()==1 \">"
+
"<foreach item='attrId' index=\"index\" collection='query.attrId' >"
+
"AND t.`attr_id` = #{attrId}"
+
"</foreach>"
+
"</when>"
,
"<when test=\"query.attrId != null and query.attrId != '' and query.attrId.size()>1 \">"
+
"AND (1!=1 "
+
" <foreach item='attrId' index='index' collection='query.attrId'>"
+
" OR FIND_IN_SET(t.`attr_id`, #{attrId})"
+
"</foreach>"
+
" )"
+
"</when>"
,
// "AND FIND_IN_SET(t.`attr_id`, #{query.attrId})",
"</when>"
,
"order by t.id desc"
,
"</script>"
})
List
<
ProductDO
>
selectListReq
(
@Param
(
"query"
)
ProductReqDTO
reqVO
)
;
default
List
<
ProductDO
>
selectIdList
(
ProductPageReqVO
reqVO
)
{
return
selectList
(
new
LambdaQueryWrapperX
<
ProductDO
>()
.
likeIfPresent
(
ProductDO:
:
getProductCode
,
reqVO
.
getProductCode
())
...
...
@@ -240,6 +313,7 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
}
List
<
ProductTypeNumVO
>
getProductTypeNumList
(
List
<
Long
>
list
);
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/listener/ProductExcelExportListener.java
View file @
ba7a8458
...
...
@@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.product.convert.product.ProductConvert;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductAttrDO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductDO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductTypeDO
;
import
cn.iocoder.yudao.module.product.dto.ProductReqDTO
;
import
cn.iocoder.yudao.module.product.enums.AuditEnum
;
import
cn.iocoder.yudao.module.product.service.product.ProductAttrService
;
import
cn.iocoder.yudao.module.product.service.product.ProductService
;
...
...
@@ -81,10 +82,11 @@ public class ProductExcelExportListener {
}
String
fileName
=
event
.
getUserId
().
toString
().
concat
(
StrUtil
.
DASHED
).
concat
(
event
.
getUserType
().
toString
()).
concat
(
StrUtil
.
DASHED
).
concat
(
nowTime
).
concat
(
"product.xlsx"
);
ProductExportReqVO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
ProductExportReqVO
.
class
);
//ProductExportReqVO exportReqVO = JSONObject.parseObject(event.getRequestParams(), ProductExportReqVO.class);
ProductReqDTO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
ProductReqDTO
.
class
);
exportReqVO
.
setFilter
(
false
);
List
<
ProductDO
>
list
=
productService
.
getProductList
(
exportReqVO
);
//
List<ProductDO> list = productService.getProductList(exportReqVO);
List
<
ProductDO
>
list
=
productService
.
getProductListResp
(
exportReqVO
);
if
(
CollectionUtil
.
isEmpty
(
list
))
return
;
List
<
ProductAttrDO
>
attrList
=
productAttrService
.
getProductAttrList
(
new
ProductAttrExportReqVO
());
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/ProductService.java
View file @
ba7a8458
...
...
@@ -70,6 +70,7 @@ public interface ProductService {
*/
List
<
ProductDO
>
getProductList
();
/**
* 获得产品分页
*
...
...
@@ -82,6 +83,7 @@ public interface ProductService {
List
<
ProductDO
>
getProductList
(
ProductPageReqVO
pageReqVO
);
List
<
ProductDO
>
getProductListResp
(
ProductReqDTO
pageReqVO
);
/**
* 获得产品列表, 用于 Excel 导出
*
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/impl/ProductServiceImpl.java
View file @
ba7a8458
...
...
@@ -352,6 +352,8 @@ public class ProductServiceImpl implements ProductService {
);
}
@Override
public
List
<
ProductDO
>
getProductList
(
List
<
Long
>
idList
)
{
return
productMapper
.
selectList
(
...
...
@@ -427,6 +429,14 @@ public class ProductServiceImpl implements ProductService {
return
productMapper
.
selectList
(
pageReqVO
);
}
@Override
public
List
<
ProductDO
>
getProductListResp
(
ProductReqDTO
pageReqVO
)
{
if
(
pageReqVO
.
isFilter
())
{
pageReqVO
.
setAuditStatus
(
2
);
}
return
productMapper
.
selectListReq
(
pageReqVO
);
}
@Override
public
List
<
ProductDO
>
getProductList
(
ProductExportReqVO
exportReqVO
)
{
if
(
exportReqVO
.
isFilter
())
{
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/listener/CustomerExcelExportListener.java
View file @
ba7a8458
...
...
@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.apollo.core.event.export.base.CustomerExportEv
import
cn.iocoder.yudao.framework.excel.util.ExcelUtils
;
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
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.indirectCustomer.IndirectCustomerService
;
import
cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerExcelVO
;
...
...
@@ -67,8 +68,8 @@ public class CustomerExcelExportListener {
*/
@EventListener
(
CustomerMineExcelExportPushEvent
.
class
)
public
void
customerMineExcelExportPushEvent
(
CustomerMineExcelExportPushEvent
event
)
{
CustomerExportReq
VO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqV
O
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
getCustomerExcelVoList
(
exportReqVO
);
CustomerExportReq
DTO
exportReqVO
=
JSONObject
.
parseObject
(
event
.
getRequestParams
(),
CustomerExportReqDT
O
.
class
);
List
<
CustomerDO
>
list
=
customerService
.
get
My
CustomerExcelVoList
(
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