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
92c09319
Commit
92c09319
authored
Jan 23, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备权限
parent
a290146b
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
50 deletions
+97
-50
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+2
-2
WxMsgPushController.java
...java/share/web/controller/common/WxMsgPushController.java
+75
-33
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+2
-6
SConsumerVo.java
...tem/src/main/java/share/system/domain/vo/SConsumerVo.java
+2
-0
SStoreConsumerMapper.java
...c/main/java/share/system/mapper/SStoreConsumerMapper.java
+1
-1
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+1
-1
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+10
-4
SConsumerMapper.xml
...stem/src/main/resources/mapper/system/SConsumerMapper.xml
+3
-2
SStoreConsumerMapper.xml
...src/main/resources/mapper/system/SStoreConsumerMapper.xml
+1
-1
No files found.
share-admin/src/main/java/share/web/controller/system/SStoreController.java
View file @
92c09319
...
...
@@ -186,9 +186,9 @@ public class SStoreController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:store:edit')"
)
@Log
(
title
=
"门店"
,
businessType
=
BusinessType
.
GRANT
)
@PutMapping
(
"/consumer/selectAll"
)
public
AjaxResult
selectAuthUserAll
(
Long
storeId
,
Long
[]
consumerIds
)
public
AjaxResult
selectAuthUserAll
(
Long
storeId
,
Long
[]
consumerIds
,
Integer
position
)
{
return
toAjax
(
sStoreService
.
insertStoreConsumers
(
storeId
,
consumerIds
));
return
toAjax
(
sStoreService
.
insertStoreConsumers
(
storeId
,
consumerIds
,
position
));
}
...
...
share-front/src/main/java/share/web/controller/common/WxMsgPushController.java
View file @
92c09319
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.enums.MessageReminderEnum
;
import
share.system.config.WxMaProperties
;
import
share.system.domain.vo.SendTemplateMessageItemVo
;
import
share.system.domain.vo.TemplateMessageVo
;
...
...
@@ -19,6 +20,7 @@ import share.system.util.WXMsgPushUtils;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -32,6 +34,8 @@ import java.util.Map;
public
class
WxMsgPushController
{
private
final
WxMaService
wxMaService
;
private
final
WxMaProperties
properties
;
@Autowired
private
WechatNewService
wechatNewService
;
/**
* // * 跳转的小程序页面
* //
...
...
@@ -66,43 +70,81 @@ public class WxMsgPushController {
@GetMapping
(
"/getOpenId"
)
public
void
getOpenId
(
String
openId
)
throws
Exception
{
// HashMap<String, SendTemplateMessageItemVo> data = new HashMap<>();
// TemplateMessageVo templateMessageVo = new TemplateMessageVo();
// templateMessageVo.setTouser(openId);
// templateMessageVo.setTemplate_id("oTc000e4NHkoc7v9OLBZiwM6Q6SFzguemrx6d0iuVS8");
// templateMessageVo.setUrl("http://www.baidu.com");
// data.put("thing4", new SendTemplateMessageItemVo("预约门店"));
// data.put("thing7", new SendTemplateMessageItemVo("服务名称"));
// data.put("date3", new SendTemplateMessageItemVo(LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss")));
// data.put("thing5", new SendTemplateMessageItemVo("地址"));
// templateMessageVo.setData(data);
// log.info("开始发送消息!!!!");
// Boolean b = wechatNewService.sendMiniSubscribeMessage(templateMessageVo);
// if(b){
// log.info("消息发送成功!!!!");
// }
HashMap
<
String
,
SendTemplateMessageItemVo
>
data
=
new
HashMap
<>();
TemplateMessageVo
templateMessageVo
=
new
TemplateMessageVo
();
templateMessageVo
.
setTouser
(
openId
);
templateMessageVo
.
setMiniprogram_state
(
"trial"
);
templateMessageVo
.
setPage
(
"/pages/orderResult/orderResult?orderNo=CJ431705545528576539"
);
templateMessageVo
.
setTemplate_id
(
MessageReminderEnum
.
END
.
getValue
());
data
.
put
(
"thing5"
,
new
SendTemplateMessageItemVo
(
"武汉"
));
//服务名称
data
.
put
(
"thing6"
,
new
SendTemplateMessageItemVo
(
"服务名称"
));
//订单时间
data
.
put
(
"time7"
,
new
SendTemplateMessageItemVo
(
"2020-12-12 12:12:12 ~ 2020-12-13 12:12:12"
));
//温馨提示
data
.
put
(
"thing4"
,
new
SendTemplateMessageItemVo
(
MessageReminderEnum
.
END
.
getTips
()));
templateMessageVo
.
setData
(
data
);
log
.
info
(
"开始发送消息!!!!"
);
Boolean
a
=
wechatNewService
.
sendMiniSubscribeMessage
(
templateMessageVo
);
if
(
a
)
{
log
.
info
(
"消息发送成功!!!!"
);
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"thing4"
,
"预约门店"
);
map
.
put
(
"thing7"
,
"服务名称"
);
map
.
put
(
"date3"
,
LocalDateTimeUtil
.
format
(
LocalDateTime
.
now
(),
"yyyy-MM-dd HH:mm:ss"
));
map
.
put
(
"thing5"
,
"地址"
);
WxMaSubscribeMessage
wxMaSubscribeMessage
=
WxMaSubscribeMessage
.
builder
()
.
toUser
(
openId
)
.
templateId
(
"oTc000e4NHkoc7v9OLBZiwM6Q6SFzguemrx6d0iuVS8"
)
.
page
(
PAGES_ZP
)
.
build
();
// 设置将推送的消息
map
.
forEach
((
k
,
v
)
->
{
wxMaSubscribeMessage
.
addData
(
new
WxMaSubscribeMessage
.
MsgData
(
k
,
v
));
});
try
{
templateMessageVo
.
setTemplate_id
(
MessageReminderEnum
.
RESERVER
.
getValue
());
//订单门店
data
.
put
(
"thing3"
,
new
SendTemplateMessageItemVo
(
"武汉"
));
//服务名称
data
.
put
(
"thing1"
,
new
SendTemplateMessageItemVo
(
"服务名称"
));
//订单时间
data
.
put
(
"date2"
,
new
SendTemplateMessageItemVo
(
LocalDateTimeUtil
.
format
(
LocalDateTime
.
now
(),
"yyyy-MM-dd HH:mm:ss"
)));
//温馨提示
data
.
put
(
"thing6"
,
new
SendTemplateMessageItemVo
(
MessageReminderEnum
.
RESERVER
.
getTips
()));
log
.
info
(
"开始发送消息!!!!"
);
wxMaService
.
getMsgService
().
sendSubscribeMsg
(
wxMaSubscribeMessage
);
Boolean
b
=
wechatNewService
.
sendMiniSubscribeMessage
(
templateMessageVo
);
if
(
b
)
{
log
.
info
(
"消息发送成功!!!!"
);
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
();
}
templateMessageVo
.
setTemplate_id
(
MessageReminderEnum
.
START
.
getValue
());
//预约门店
data
.
put
(
"thing6"
,
new
SendTemplateMessageItemVo
(
"武汉"
));
//服务名称
data
.
put
(
"thing7"
,
new
SendTemplateMessageItemVo
(
"服务名称"
));
//预约时间
data
.
put
(
"time8"
,
new
SendTemplateMessageItemVo
(
"2024-12-12 12:12:12 ~ 2024-12-13 12:12:12"
));
//温馨提示
data
.
put
(
"thing5"
,
new
SendTemplateMessageItemVo
(
MessageReminderEnum
.
START
.
getTips
()));
Boolean
c
=
wechatNewService
.
sendMiniSubscribeMessage
(
templateMessageVo
);
if
(
c
)
{
log
.
info
(
"消息发送成功!!!!"
);
}
// Map<String, String> data = new HashMap<>();
// data.put("thing5", "订单门店");
// //服务名称
// data.put("thin6", "服务名称");
// //订单时间
// data.put("time7", new Date().toString());
// //温馨提示
// data.put("thing4", MessageReminderEnum.RESERVER.getTips());
// WxMaSubscribeMessage wxMaSubscribeMessage = WxMaSubscribeMessage.builder()
// .toUser(openId)
// .templateId("UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg")
// .page(PAGES_ZP)
// .build();
// // 设置将推送的消息
// data.forEach((k, v) -> {
// wxMaSubscribeMessage.addData(new WxMaSubscribeMessage.MsgData(k, v));
// });
// try {
// log.info("开始发送消息!!!!");
// wxMaService.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
// log.info("消息发送成功!!!!");
// } catch (WxErrorException e) {
// e.printStackTrace();
// }
}
}
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
92c09319
...
...
@@ -79,15 +79,11 @@ public class SStoreController extends BaseController
}
/**
*
查询全部门店及全部房间,每个房间绑定的设备列表
*
用户负责的门店设备
*/
@GetMapping
(
"/storeList"
)
@GetMapping
(
"/storeList
ByConsumer
"
)
@ApiOperation
(
value
=
"查询全部门店及全部房间,每个房间绑定的设备列表"
)
public
AjaxResult
storeList
()
{
return
success
(
sStoreService
.
storeList
());
}
}
share-system/src/main/java/share/system/domain/vo/SConsumerVo.java
View file @
92c09319
...
...
@@ -14,4 +14,6 @@ public class SConsumerVo extends SConsumer {
private
Long
storeId
;
private
Integer
position
;
}
share-system/src/main/java/share/system/mapper/SStoreConsumerMapper.java
View file @
92c09319
...
...
@@ -34,7 +34,7 @@ public interface SStoreConsumerMapper extends BaseMapper<SStoreConsumer> {
public
int
deleteInfos
(
@Param
(
"storeId"
)
Long
storeId
,
@Param
(
"consumerIds"
)
Long
[]
consumerIds
);
List
<
Long
>
selectByConsumerId
(
Long
id
,
Integer
position
);
List
<
Long
>
selectByConsumerId
(
@Param
(
"consumerId"
)
Long
consumerId
,
@Param
(
"position"
)
Integer
position
);
List
<
SStoreConsumer
>
queryByConsumerId
(
Long
id
);
}
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
92c09319
...
...
@@ -92,7 +92,7 @@ public interface ISStoreService extends IService<SStore>
int
deleteStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
);
int
insertStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
);
int
insertStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
,
Integer
position
);
List
<
SStore
>
listVoByCleaner
();
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
92c09319
...
...
@@ -351,14 +351,14 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
@Override
public
int
insertStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
)
{
public
int
insertStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
,
Integer
position
)
{
// 新增保洁与门店关系
List
<
SStoreConsumer
>
list
=
new
ArrayList
<
SStoreConsumer
>();
for
(
Long
consumerId
:
consumerIds
)
{
SStoreConsumer
sc
=
new
SStoreConsumer
();
sc
.
setStoreId
(
storeId
);
sc
.
setConsumerId
(
consumerId
);
sc
.
setPosition
(
PositionEnum
.
CLEANER
.
getCode
()
);
sc
.
setPosition
(
position
);
list
.
add
(
sc
);
}
return
storeConsumerMapper
.
batchSStoreConsumer
(
list
);
...
...
@@ -448,8 +448,14 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
public
List
<
SStoreVo
>
storeList
()
{
//查询所有门店
List
<
SStore
>
sStores
=
baseMapper
.
selectSStoreList
(
new
SStore
());
//获取所有门店id
List
<
Long
>
storeIds
=
sStores
.
stream
().
map
(
SStore:
:
getId
).
collect
(
Collectors
.
toList
());
SConsumer
user
=
consumerService
.
getInfo
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
BaseException
(
"当前用户不是店员!"
);
}
List
<
Long
>
storeIds
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
CLEANER
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
new
ArrayList
<>();
}
List
<
SStoreVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
sStores
))
{
voList
=
convertDosToVos
(
sStores
);
...
...
share-system/src/main/resources/mapper/system/SConsumerMapper.xml
View file @
92c09319
...
...
@@ -54,7 +54,7 @@
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' and t2.position=
'1'
and t2.store_id = #{storeId}
where t1.role_type = '1' and t2.position=
#{position}
and t2.store_id = #{storeId}
<if
test=
"nickName != null and nickName != ''"
>
AND t1.nick_name like concat('%', #{nickName}, '%')
</if>
...
...
@@ -67,7 +67,8 @@
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
where t1.role_type = '1'
and t1.id not in (select consumer_id from s_store_consumer where store_id = #{storeId} and position = '1')
and t1.id not in (select consumer_id from s_store_consumer where store_id = #{storeId} and position =
#{position})
<if
test=
"nickName != null and nickName != ''"
>
AND t1.nick_name like concat('%', #{nickName}, '%')
</if>
...
...
share-system/src/main/resources/mapper/system/SStoreConsumerMapper.xml
View file @
92c09319
...
...
@@ -50,7 +50,7 @@
from s_store_consumer
where consumer_id = #{consumerId}
and store_id = #{storeId}
and position =
'1'
and position =
#{position}
</delete>
<delete
id=
"deleteInfos"
>
...
...
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