|
@@ -1406,13 +1406,18 @@ public class IndexController {
|
|
|
LambdaQueryWrapper<TWechat> wechatQuery = Wrappers.lambdaQuery();
|
|
|
wechatQuery.eq(TWechat::getAdminId, equipment.getAdminId());
|
|
|
TWechat wechat = wechatService.getOne(wechatQuery);
|
|
|
+ // 查询用户
|
|
|
+ TAdmin admin = adminService.getById(equipment.getAdminId());
|
|
|
// 如果有绑定微信
|
|
|
- if (wechat != null && StringUtils.isNotEmpty(wechat.getOpenId())) {
|
|
|
- // 发送模板消息
|
|
|
- TAdmin admin = adminService.getById(equipment.getAdminId());
|
|
|
+ if (wechat != null && StringUtils.isNotEmpty(wechat.getOpenId()) && admin != null) {
|
|
|
// 查询是申泽还是七云的
|
|
|
String companyType = admin.getCompanyType();
|
|
|
- wechatService.sendOnOffMessage(wechat.getOpenId(), equipment.getClientId(), netTime, companyType, name, eqeStatus);
|
|
|
+ // 查询用户是否开启设备上线提醒功能
|
|
|
+ String onOffNotice = admin.getOnOffNotice();
|
|
|
+ if (StringUtils.isNotEmpty(onOffNotice) && onOffNotice.equals("1")) {
|
|
|
+ // 发送设备上下线提醒消息
|
|
|
+ wechatService.sendOnOffMessage(wechat.getOpenId(), equipment.getClientId(), netTime, companyType, name, eqeStatus);
|
|
|
+ }
|
|
|
}
|
|
|
if (eqeStatus == 0) {
|
|
|
equipment.setCabinetTm("");
|