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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
117 additions
and
20 deletions
+117
-20
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
+31
-0
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;
import
share.common.enums.BusinessType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
share.system.service.ConsumerMemberService
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -32,9 +33,9 @@ public class ConsumerMemberController extends BaseController {
*/
@PreAuthorize
(
"@ss.hasPermi('system:member:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
ConsumerMember
consumerMember
)
{
public
TableDataInfo
list
(
ConsumerMember
Vo
consumerMember
)
{
startPage
();
List
<
ConsumerMember
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
List
<
ConsumerMember
Vo
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
return
getDataTable
(
list
);
}
...
...
@@ -44,9 +45,9 @@ public class ConsumerMemberController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:member:export')"
)
@Log
(
title
=
"会员用户"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
ConsumerMember
consumerMember
)
{
List
<
ConsumerMember
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
ExcelUtil
<
ConsumerMember
>
util
=
new
ExcelUtil
<
ConsumerMember
>(
ConsumerMember
.
class
);
public
void
export
(
HttpServletResponse
response
,
ConsumerMember
Vo
consumerMember
)
{
List
<
ConsumerMember
Vo
>
list
=
consumerMemberService
.
selectConsumerMemberList
(
consumerMember
);
ExcelUtil
<
ConsumerMember
Vo
>
util
=
new
ExcelUtil
<>(
ConsumerMemberVo
.
class
);
util
.
exportExcel
(
response
,
list
,
"会员用户数据"
);
}
...
...
share-common/src/main/java/share/common/enums/PositionEnum.java
View file @
3cf47103
...
...
@@ -5,6 +5,8 @@ public enum PositionEnum {
//1保洁人员 2管理员
CLEANER
(
1
,
"保洁人员"
),
ADMIN
(
2
,
"管理员"
),
//客服
CUSTOMER_SERVICE
(
3
,
"客服"
);
;
private
Integer
code
;
private
String
name
;
...
...
share-system/src/main/java/share/system/domain/SStoreConsumer.java
View file @
3cf47103
...
...
@@ -18,10 +18,10 @@ public class SStoreConsumer {
private
Integer
position
;
//电控
//电控
是否接收公众号
private
Integer
controller
;
//门控
//门控
是否接收短信
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;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
java.util.List
;
...
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberMapper extends BaseMapper<ConsumerMember> {
* @param consumerMember 会员用户
* @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;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
java.util.List
;
...
...
@@ -26,7 +27,7 @@ public interface ConsumerMemberService extends IService<ConsumerMember> {
* @param consumerMember 会员用户
* @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
;
import
cn.hutool.core.util.ObjectUtil
;
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.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.ConsumerMemberVo
;
import
share.system.mapper.ConsumerMemberMapper
;
import
share.system.service.ConsumerMemberService
;
import
share.system.service.SConsumerService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 会员用户Service业务层处理
...
...
@@ -20,6 +29,8 @@ import java.util.List;
public
class
ConsumerMemberServiceImpl
extends
ServiceImpl
<
ConsumerMemberMapper
,
ConsumerMember
>
implements
ConsumerMemberService
{
@Autowired
private
ConsumerMemberMapper
consumerMemberMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
/**
* 查询会员用户
...
...
@@ -39,8 +50,24 @@ public class ConsumerMemberServiceImpl extends ServiceImpl<ConsumerMemberMapper,
* @return 会员用户
*/
@Override
public
List
<
ConsumerMember
>
selectConsumerMemberList
(
ConsumerMember
consumerMember
)
{
return
consumerMemberMapper
.
selectConsumerMemberList
(
consumerMember
);
public
List
<
ConsumerMemberVo
>
selectConsumerMemberList
(
ConsumerMemberVo
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;
import
share.system.domain.*
;
import
share.system.domain.vo.*
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
...
...
@@ -127,6 +128,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Resource
private
RoomLabelService
roomLabelService
;
@Autowired
private
SStoreConsumerMapper
storeConsumerMapper
;
private
final
static
Long
FIVE
=
5
l
;
...
...
@@ -953,12 +957,26 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setPosition
(
3
);
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
)
{
logger
.
info
(
"订单预订成功通知发送开始"
);
consumers
.
forEach
(
o
->
{
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
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
);
logger
.
info
(
"订单预订成功通知发送结束"
);
...
...
@@ -1480,12 +1498,25 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sConsumer
.
setStoreId
(
sStore
.
getId
());
sConsumer
.
setPosition
(
3
);
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
)
{
logger
.
info
(
"订单预订成功通知发送开始"
);
consumers
.
forEach
(
o
->{
SStoreConsumer
sStoreConsumer
=
consumerMap
.
get
(
o
.
getId
());
if
(
ObjectUtil
.
isNotEmpty
(
sStoreConsumer
))
{
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
);
logger
.
info
(
"订单预订成功通知发送结束"
);
...
...
share-system/src/main/resources/mapper/system/ConsumerMemberMapper.xml
View file @
3cf47103
...
...
@@ -37,16 +37,33 @@
from s_consumer_member
</sql>
<select
id=
"selectConsumerMemberList"
parameterType=
"ConsumerMember"
resultMap=
"ConsumerMemberResult"
>
<include
refid=
"selectConsumerMemberVo"
/>
<select
id=
"selectConsumerMemberList"
parameterType=
"ConsumerMemberVo"
resultMap=
"ConsumerMemberResult"
>
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>
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
<if
test=
"membershipLevel != null "
>
and membership_level = #{membershipLevel}
</if>
<if
test=
"memberType != null "
>
and member_type = #{memberType}
</if>
<if
test=
"memberConfigId != null "
>
and member_config_id = #{memberConfigId}
</if>
<if
test=
"expirationDate != null "
>
and expiration_date = #{expirationDate}
</if>
<if
test=
"membershipProgress != null "
>
and membership_progress = #{membershipProgress}
</if>
<if
test=
"isDelete != null "
>
and is_delete = #{isDelete}
</if>
<if
test=
"nickName != null and nickName != ''"
>
and c.nick_name like concat('%', #{nickName},'%')
</if>
<if
test=
"phone != null and phone != ''"
>
and c.phone like concat('%', #{phone},'%')
</if>
<if
test=
"consumerId != null "
>
and m.consumer_id = #{consumerId}
</if>
<if
test=
"membershipLevel != null "
>
and m.membership_level = #{membershipLevel}
</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>
</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