Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
hooloo
ms
soss
Commits
0a9997d3
Commit
0a9997d3
authored
May 29, 2022
by
张新旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码永远在路上
parent
0a2b2609
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
17 deletions
+117
-17
soss-admin/src/main/java/com/soss/web/controller/coffee/CustomerController.java
+5
-14
soss-system/src/main/java/com/soss/system/domain/vo/customer/CustomerQueryVo.java
+20
-0
soss-system/src/main/java/com/soss/system/domain/vo/customer/CustomerResultVo.java
+35
-0
soss-system/src/main/java/com/soss/system/mapper/CustomerMapper.java
+4
-0
soss-system/src/main/java/com/soss/system/service/ICustomerService.java
+3
-1
soss-system/src/main/java/com/soss/system/service/impl/CustomerServiceImpl.java
+6
-2
soss-system/src/main/resources/mapper/system/CustomerMapper.xml
+42
-0
soss-system/src/main/resources/mapper/system/SysUserMapper.xml
+2
-0
No files found.
soss-admin/src/main/java/com/soss/web/controller/coffee/CustomerController.java
View file @
0a9997d3
...
...
@@ -7,6 +7,8 @@ import com.soss.common.core.page.TableDataInfo;
import
com.soss.common.enums.BusinessType
;
import
com.soss.common.utils.poi.ExcelUtil
;
import
com.soss.system.domain.Customer
;
import
com.soss.system.domain.vo.customer.CustomerQueryVo
;
import
com.soss.system.domain.vo.customer.CustomerResultVo
;
import
com.soss.system.service.ICustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -33,25 +35,14 @@ public class CustomerController extends BaseController
*/
@PreAuthorize
(
"@ss.hasPermi('system:customer:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Customer
customer
)
public
TableDataInfo
list
(
Customer
QueryVo
customerQueryVo
)
{
startPage
();
List
<
Customer
>
list
=
customerService
.
selectCustomerList
(
customer
);
List
<
Customer
ResultVo
>
list
=
customerService
.
selectCustomerList
(
customerQueryVo
);
return
getDataTable
(
list
);
}
/**
* 导出用户信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:customer:export')"
)
@Log
(
title
=
"用户信息"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
Customer
customer
)
{
List
<
Customer
>
list
=
customerService
.
selectCustomerList
(
customer
);
ExcelUtil
<
Customer
>
util
=
new
ExcelUtil
<
Customer
>(
Customer
.
class
);
util
.
exportExcel
(
response
,
list
,
"用户信息数据"
);
}
/**
* 获取用户信息详细信息
...
...
soss-system/src/main/java/com/soss/system/domain/vo/customer/CustomerQueryVo.java
0 → 100644
View file @
0a9997d3
package
com
.
soss
.
system
.
domain
.
vo
.
customer
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.xml.crypto.Data
;
import
java.io.Serializable
;
@Getter
@Setter
public
class
CustomerQueryVo
implements
Serializable
{
private
String
userInfo
;
private
Data
createAtStart
;
private
Data
createAtEnd
;
//1 有购买 2无购买 3有复购
private
String
buyRecords
;
}
soss-system/src/main/java/com/soss/system/domain/vo/customer/CustomerResultVo.java
0 → 100644
View file @
0a9997d3
package
com
.
soss
.
system
.
domain
.
vo
.
customer
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Getter
@Setter
public
class
CustomerResultVo
implements
Serializable
{
private
String
userName
;
private
String
phoneNumber
;
private
String
orderCount
;
private
BigDecimal
amount
;
private
String
cancelCount
;
private
BigDecimal
cancelAmount
;
private
String
refundCount
;
private
BigDecimal
refundAmount
;
private
Date
lastOrderDate
;
private
Date
createDate
;
private
String
source
;
}
soss-system/src/main/java/com/soss/system/mapper/CustomerMapper.java
View file @
0a9997d3
...
...
@@ -2,6 +2,8 @@ package com.soss.system.mapper;
import
java.util.List
;
import
com.soss.system.domain.Customer
;
import
com.soss.system.domain.vo.customer.CustomerQueryVo
;
import
com.soss.system.domain.vo.customer.CustomerResultVo
;
/**
* 用户信息Mapper接口
...
...
@@ -58,4 +60,6 @@ public interface CustomerMapper
* @return 结果
*/
public
int
deleteCustomerByIds
(
Long
[]
ids
);
List
<
CustomerResultVo
>
selectCustomerByQuery
(
CustomerQueryVo
customer
);
}
soss-system/src/main/java/com/soss/system/service/ICustomerService.java
View file @
0a9997d3
...
...
@@ -2,6 +2,8 @@ package com.soss.system.service;
import
java.util.List
;
import
com.soss.system.domain.Customer
;
import
com.soss.system.domain.vo.customer.CustomerQueryVo
;
import
com.soss.system.domain.vo.customer.CustomerResultVo
;
/**
* 用户信息Service接口
...
...
@@ -25,7 +27,7 @@ public interface ICustomerService
* @param customer 用户信息
* @return 用户信息集合
*/
public
List
<
Customer
>
selectCustomerList
(
Customer
customer
);
public
List
<
Customer
ResultVo
>
selectCustomerList
(
CustomerQueryVo
customer
);
/**
* 新增用户信息
...
...
soss-system/src/main/java/com/soss/system/service/impl/CustomerServiceImpl.java
View file @
0a9997d3
...
...
@@ -2,6 +2,8 @@ package com.soss.system.service.impl;
import
java.util.List
;
import
com.soss.common.utils.DateUtils
;
import
com.soss.system.domain.vo.customer.CustomerQueryVo
;
import
com.soss.system.domain.vo.customer.CustomerResultVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.soss.system.mapper.CustomerMapper
;
...
...
@@ -39,9 +41,11 @@ public class CustomerServiceImpl implements ICustomerService
* @return 用户信息
*/
@Override
public
List
<
Customer
>
selectCustomerList
(
Customer
customer
)
public
List
<
Customer
ResultVo
>
selectCustomerList
(
CustomerQueryVo
customer
)
{
return
customerMapper
.
selectCustomerList
(
customer
);
List
<
CustomerResultVo
>
customerResultVos
=
customerMapper
.
selectCustomerByQuery
(
customer
);
return
customerResultVos
;
}
/**
...
...
soss-system/src/main/resources/mapper/system/CustomerMapper.xml
View file @
0a9997d3
...
...
@@ -73,4 +73,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select
id=
"selectCustomerByQuery"
resultType=
"com.soss.system.domain.vo.customer.CustomerResultVo"
>
select * from (select
c.user_name as userName,
c.phone as phoneNumber,
(select count(*) from `order` o where o.user_id = c.id) as orderCount,
(select sum(o.amount) from `order` o where o.user_id = c.id) as amount,
(select count(*) from `order` o where o.user_id = c.id and o.state in ('8','9','10','11')) as cancelCount,
(select sum(o.amount) from `order` o where o.user_id = c.id and o.state in ('8','9','10','11')) as cancelAmount,
(select count(*) from `order` o where o.user_id = c.id and o.state in ('12','14','15')) as refundCount,
(select sum(o.amount) from `order` o where o.user_id = c.id and o.state in ('12','14','15')) as refundAmount,
(select o.created_at from `order` o where o.user_id = c.id order by o.created_at desc limit 1) as lastOrderDate,
c.create_time as createDate,
c.soucre
from
customer c ) a
<where>
<if
test=
"userInfo != null and userInfo != ''"
>
and ((a.user_name like concat('%', #{userInfo}, '%')) or (a.phone like concat('%', #{userInfo}, '%') ))
</if>
<if
test=
"buyRecords != null and buyRecords != ''"
>
and
<if
test=
"buyRecords == '1'"
>
a.orderCount >0
</if>
<if
test=
"buyRecords == '2'"
>
a.orderCount =0
</if>
<if
test=
"buyRecords == '3'"
>
a.orderCount >1
</if>
</if>
<if
test=
"createAtStart !='' and createAtStart!=null"
>
and createDate
>
=#{createAtStart}
</if>
<if
test=
"createAtEnd !='' and createAtEnd!=null"
>
and createDate
<
=#{createAtEnd}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
soss-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
0a9997d3
...
...
@@ -145,7 +145,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag='0'
<if
test=
"userInfo != null and userInfo != ''"
>
and ((u.user_name like concat('%', #{userInfo}, '%')) or (u.phonenumber like concat('%', #{userInfo}, '%') ))
</if>
<if
test=
"status != null and status != ''"
>
AND u.status =#{status}
</if>
...
...
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