Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
3cf47103
Commit
3cf47103
authored
Jun 26, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客服增加公众号和短信的接收控制
parent
f1ad419f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
123 additions
and
26 deletions
+123
-26
ConsumerMemberController.java
...share/web/controller/system/ConsumerMemberController.java
+6
-5
PositionEnum.java
...common/src/main/java/share/common/enums/PositionEnum.java
+2
-0
SStoreConsumer.java
...tem/src/main/java/share/system/domain/SStoreConsumer.java
+2
-2
ConsumerMemberVo.java
...rc/main/java/share/system/domain/vo/ConsumerMemberVo.java
+17
-0
ConsumerMemberMapper.java
...c/main/java/share/system/mapper/ConsumerMemberMapper.java
+2
-1
ConsumerMemberService.java
...main/java/share/system/service/ConsumerMemberService.java
+2
-1
ConsumerMemberServiceImpl.java
.../share/system/service/impl/ConsumerMemberServiceImpl.java
+29
-2
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+37
-6
ConsumerMemberMapper.xml
...src/main/resources/mapper/system/ConsumerMemberMapper.xml
+26
-9
No files found.
share-admin/src/main/java/share/web/controller/system/ConsumerMemberController.java
View file @
3cf47103
...
@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
...
@@ -10,6 +10,7 @@ import share.common.core.page.TableDataInfo;
import
share.common.enums.BusinessType
;
import
share.common.enums.BusinessType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
share.system.service.ConsumerMemberService
;
import
share.system.service.ConsumerMemberService
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -32,9 +33,9 @@ public class ConsumerMemberController extends BaseController {
...
@@ -32,9 +33,9 @@ public class ConsumerMemberController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:member:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:member:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
ConsumerMember
consumerMember
)
{
public
TableDataInfo
list
(
ConsumerMember
Vo
consumerMember
)
{
startPage
();
startPage
();
List
<
ConsumerMember
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
List
<
ConsumerMember
Vo
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -44,9 +45,9 @@ public class ConsumerMemberController extends BaseController {
...
@@ -44,9 +45,9 @@ public class ConsumerMemberController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:member:export')"
)
@PreAuthorize
(
"@ss.hasPermi('system:member:export')"
)
@Log
(
title
=
"会员用户"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"会员用户"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
ConsumerMember
consumerMember
)
{
public
void
export
(
HttpServletResponse
response
,
ConsumerMember
Vo
consumerMember
)
{
List
<
ConsumerMember
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
List
<
ConsumerMember
Vo
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
ExcelUtil
<
ConsumerMember
>
util
=
new
ExcelUtil
<
ConsumerMember
>(
ConsumerMember
.
class
);
ExcelUtil
<
ConsumerMember
Vo
>
util
=
new
ExcelUtil
<>(
ConsumerMemberVo
.
class
);
util
.
exportExcel
(
response
,
list
,
"会员用户数据"
);
util
.
exportExcel
(
response
,
list
,
"会员用户数据"
);
}
}
...
...
share-common/src/main/java/share/common/enums/PositionEnum.java
View file @
3cf47103
...
@@ -5,6 +5,8 @@ public enum PositionEnum {
...
@@ -5,6 +5,8 @@ public enum PositionEnum {
//1保洁人员 2管理员
//1保洁人员 2管理员
CLEANER
(
1
,
"保洁人员"
),
CLEANER
(
1
,
"保洁人员"
),
ADMIN
(
2
,
"管理员"
),
ADMIN
(
2
,
"管理员"
),
//客服
CUSTOMER_SERVICE
(
3
,
"客服"
);
;
;
private
Integer
code
;
private
Integer
code
;
private
String
name
;
private
String
name
;
...
...
share-system/src/main/java/share/system/domain/SStoreConsumer.java
View file @
3cf47103
...
@@ -18,10 +18,10 @@ public class SStoreConsumer {
...
@@ -18,10 +18,10 @@ public class SStoreConsumer {
private
Integer
position
;
private
Integer
position
;
//电控
//电控
是否接收公众号
private
Integer
controller
;
private
Integer
controller
;
//门控
//门控
是否接收短信
private
Integer
gating
;
private
Integer
gating
;
}
}
share-system/src/main/java/share/system/domain/vo/ConsumerMemberVo.java
0 → 100644
View file @
3cf47103
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
share.system.domain.ConsumerMember
;
@Data
public
class
ConsumerMemberVo
extends
ConsumerMember
{
private
String
nickName
;
private
String
avatar
;
/**
* 用户手机号
*/
private
String
phone
;
}
share-system/src/main/java/share/system/mapper/ConsumerMemberMapper.java
View file @
3cf47103
...
@@ -2,6 +2,7 @@ package share.system.mapper;
...
@@ -2,6 +2,7 @@ package share.system.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> {
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> {
* @param consumerMember 会员用户
* @param consumerMember 会员用户
* @return 会员用户集合
* @return 会员用户集合
*/
*/
public
List
<
ConsumerMember
>
selectConsumerMemberList
(
ConsumerMember
consumerMember
);
public
List
<
ConsumerMember
>
selectConsumerMemberList
(
ConsumerMember
Vo
consumerMember
);
/**
/**
* 新增会员用户
* 新增会员用户
...
...
share-system/src/main/java/share/system/service/ConsumerMemberService.java
View file @
3cf47103
...
@@ -2,6 +2,7 @@ package share.system.service;
...
@@ -2,6 +2,7 @@ package share.system.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberService extends IService<ConsumerMember> {
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberService extends IService<ConsumerMember> {
* @param consumerMember 会员用户
* @param consumerMember 会员用户
* @return 会员用户集合
* @return 会员用户集合
*/
*/
public
List
<
ConsumerMember
>
selectConsumerMemberList
(
ConsumerMember
consumerMember
);
public
List
<
ConsumerMember
Vo
>
selectConsumerMemberList
(
ConsumerMemberVo
consumerMember
);
/**
/**
* 新增会员用户
* 新增会员用户
...
...
share-system/src/main/java/share/system/service/impl/ConsumerMemberServiceImpl.java
View file @
3cf47103
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
share.system.mapper.ConsumerMemberMapper
;
import
share.system.mapper.ConsumerMemberMapper
;
import
share.system.service.ConsumerMemberService
;
import
share.system.service.ConsumerMemberService
;
import
share.system.service.SConsumerService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* 会员用户Service业务层处理
* 会员用户Service业务层处理
...
@@ -20,6 +29,8 @@ import java.util.List;
...
@@ -20,6 +29,8 @@ import java.util.List;
public
class
ConsumerMemberServiceImpl
extends
ServiceImpl
<
ConsumerMemberMapper
,
ConsumerMember
>
implements
ConsumerMemberService
{
public
class
ConsumerMemberServiceImpl
extends
ServiceImpl
<
ConsumerMemberMapper
,
ConsumerMember
>
implements
ConsumerMemberService
{
@Autowired
@Autowired
private
ConsumerMemberMapper
consumerMemberMapper
;
private
ConsumerMemberMapper
consumerMemberMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
/**
/**
* 查询会员用户
* 查询会员用户
...
@@ -39,8 +50,24 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper,
...
@@ -39,8 +50,24 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper,
* @return 会员用户
* @return 会员用户
*/
*/
@Override
@Override
public
List
<
ConsumerMember
>
selectConsumerMemberList
(
ConsumerMember
consumerMember
)
{
public
List
<
ConsumerMemberVo
>
selectConsumerMemberList
(
ConsumerMemberVo
consumerMember
)
{
return
consumerMemberMapper
.
selectConsumerMemberList
(
consumerMember
);
List
<
ConsumerMember
>
consumerMembers
=
consumerMemberMapper
.
selectConsumerMemberList
(
consumerMember
);
Map
<
Long
,
SConsumer
>
sConsumerMap
=
sConsumerService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
s
->
s
));
List
<
ConsumerMemberVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
consumerMembers
))
{
consumerMembers
.
stream
().
forEach
(
o
->
{
ConsumerMemberVo
vo
=
new
ConsumerMemberVo
();
BeanUtils
.
copyProperties
(
o
,
vo
);
SConsumer
sConsumer
=
sConsumerMap
.
get
(
o
.
getConsumerId
());
if
(
ObjectUtil
.
isNotEmpty
(
sConsumer
))
{
vo
.
setPhone
(
sConsumer
.
getPhone
());
vo
.
setNickName
(
sConsumer
.
getNickName
());
vo
.
setAvatar
(
sConsumer
.
getAvatar
());
}
voList
.
add
(
vo
);
});
}
return
voList
;
}
}
/**
/**
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
3cf47103
...
@@ -36,6 +36,7 @@ import share.common.vo.TableDataInfoVo;
...
@@ -36,6 +36,7 @@ import share.common.vo.TableDataInfoVo;
import
share.system.domain.*
;
import
share.system.domain.*
;
import
share.system.domain.vo.*
;
import
share.system.domain.vo.*
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderComputedPriceRequest
;
...
@@ -127,6 +128,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -127,6 +128,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Resource
@Resource
private
RoomLabelService
roomLabelService
;
private
RoomLabelService
roomLabelService
;
@Autowired
private
SStoreConsumerMapper
storeConsumerMapper
;
private
final
static
Long
FIVE
=
5
l
;
private
final
static
Long
FIVE
=
5
l
;
...
@@ -953,12 +957,26 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -953,12 +957,26 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setPosition
(
3
);
sConsumer
.
setPosition
(
3
);
List
<
SConsumer
>
consumers
=
sConsumerService
.
selectAllocatedList
(
sConsumer
);
List
<
SConsumer
>
consumers
=
sConsumerService
.
selectAllocatedList
(
sConsumer
);
//获取用户id
List
<
Long
>
sconsumerIds
=
consumers
.
stream
().
map
(
SConsumer:
:
getId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
SStoreConsumer
>
consumerMap
=
storeConsumerMapper
.
selectList
(
new
LambdaQueryWrapper
<
SStoreConsumer
>()
.
in
(
SStoreConsumer:
:
getConsumerId
,
sconsumerIds
)
.
eq
(
SStoreConsumer:
:
getPosition
,
PositionEnum
.
CUSTOMER_SERVICE
.
getCode
())
.
eq
(
SStoreConsumer:
:
getStoreId
,
sOrder
.
getStoreId
())
).
stream
().
collect
(
Collectors
.
toMap
(
SStoreConsumer:
:
getConsumerId
,
Function
.
identity
()));
if
(
consumers
.
size
()
>
0
)
{
if
(
consumers
.
size
()
>
0
)
{
logger
.
info
(
"订单预订成功通知发送开始"
);
logger
.
info
(
"订单预订成功通知发送开始"
);
consumers
.
forEach
(
o
->
{
consumers
.
forEach
(
o
->
{
phones
.
add
(
o
.
getPhone
());
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
//公众号发送订单预订成功通知
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
wechatNewService
.
sendPublicTemplateMessage
(
sOrder
,
MessageReminderEnum
.
ORDER_RESERVE
,
o
.
getId
());
if
(
sStoreConsumer
.
getGating
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
phones
.
add
(
o
.
getPhone
());
}
if
(
sStoreConsumer
.
getController
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
//公众号发送订单预订成功通知
wechatNewService
.
sendPublicTemplateMessage
(
sOrder
,
MessageReminderEnum
.
ORDER_RESERVE
,
o
.
getId
());
}
}
});
});
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
room
);
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
room
);
logger
.
info
(
"订单预订成功通知发送结束"
);
logger
.
info
(
"订单预订成功通知发送结束"
);
...
@@ -1480,12 +1498,25 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1480,12 +1498,25 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setPosition
(
3
);
sConsumer
.
setPosition
(
3
);
List
<
SConsumer
>
consumers
=
sConsumerService
.
selectAllocatedList
(
sConsumer
);
List
<
SConsumer
>
consumers
=
sConsumerService
.
selectAllocatedList
(
sConsumer
);
List
<
Long
>
sconsumerIds
=
consumers
.
stream
().
map
(
SConsumer:
:
getId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
SStoreConsumer
>
consumerMap
=
storeConsumerMapper
.
selectList
(
new
LambdaQueryWrapper
<
SStoreConsumer
>()
.
in
(
SStoreConsumer:
:
getConsumerId
,
sconsumerIds
)
.
eq
(
SStoreConsumer:
:
getPosition
,
PositionEnum
.
CUSTOMER_SERVICE
.
getCode
())
.
eq
(
SStoreConsumer:
:
getStoreId
,
sOrder
.
getStoreId
())
).
stream
().
collect
(
Collectors
.
toMap
(
SStoreConsumer:
:
getConsumerId
,
Function
.
identity
()));
if
(
consumers
.
size
()
>
0
)
{
if
(
consumers
.
size
()
>
0
)
{
logger
.
info
(
"订单预订成功通知发送开始"
);
logger
.
info
(
"订单预订成功通知发送开始"
);
consumers
.
forEach
(
o
->{
consumers
.
forEach
(
o
->{
phones
.
add
(
o
.
getPhone
());
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
//公众号发送订单预订成功通知
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
wechatNewService
.
sendPublicTemplateMessage
(
sOrder
,
MessageReminderEnum
.
ORDER_RESERVE
,
o
.
getId
());
if
(
sStoreConsumer
.
getGating
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
phones
.
add
(
o
.
getPhone
());
}
if
(
sStoreConsumer
.
getController
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
//公众号发送订单预订成功通知
wechatNewService
.
sendPublicTemplateMessage
(
sOrder
,
MessageReminderEnum
.
ORDER_RESERVE
,
o
.
getId
());
}
}
});
});
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
sRoom
);
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
sRoom
);
logger
.
info
(
"订单预订成功通知发送结束"
);
logger
.
info
(
"订单预订成功通知发送结束"
);
...
...
share-system/src/main/resources/mapper/system/ConsumerMemberMapper.xml
View file @
3cf47103
...
@@ -37,16 +37,33 @@
...
@@ -37,16 +37,33 @@
from s_consumer_member
from s_consumer_member
</sql>
</sql>
<select
id=
"selectConsumerMemberList"
parameterType=
"ConsumerMember"
resultMap=
"ConsumerMemberResult"
>
<select
id=
"selectConsumerMemberList"
parameterType=
"ConsumerMemberVo"
resultMap=
"ConsumerMemberResult"
>
<include
refid=
"selectConsumerMemberVo"
/>
select m.id,
m.consumer_id,
m. membership_level,
m.member_type,
m.member_config_id,
m.expiration_date,
m.membership_progress,
m.is_delete,
m.create_by,
m.create_time,
m.update_by,
m.update_time,
m.remark
from s_consumer_member m join s_consumer c on m.consumer_id = c.id
<where>
<where>
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
<if
test=
"nickName != null and nickName != ''"
>
and c.nick_name like concat('%', #{nickName},'%')
<if
test=
"membershipLevel != null "
>
and membership_level = #{membershipLevel}
</if>
</if>
<if
test=
"memberType != null "
>
and member_type = #{memberType}
</if>
<if
test=
"phone != null and phone != ''"
>
and c.phone like concat('%', #{phone},'%')
<if
test=
"memberConfigId != null "
>
and member_config_id = #{memberConfigId}
</if>
</if>
<if
test=
"expirationDate != null "
>
and expiration_date = #{expirationDate}
</if>
<if
test=
"consumerId != null "
>
and m.consumer_id = #{consumerId}
</if>
<if
test=
"membershipProgress != null "
>
and membership_progress = #{membershipProgress}
</if>
<if
test=
"membershipLevel != null "
>
and m.membership_level = #{membershipLevel}
</if>
<if
test=
"isDelete != null "
>
and is_delete = #{isDelete}
</if>
<if
test=
"memberType != null "
>
and m.member_type = #{memberType}
</if>
<if
test=
"memberConfigId != null "
>
and m.member_config_id = #{memberConfigId}
</if>
<if
test=
"expirationDate != null "
>
and m.expiration_date = #{expirationDate}
</if>
<if
test=
"membershipProgress != null "
>
and m.membership_progress = #{membershipProgress}
</if>
<if
test=
"isDelete != null "
>
and m.is_delete = #{isDelete}
</if>
</where>
</where>
</select>
</select>
...
...
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