Commit 15a7c181 by 裴大威

Merge branch 'feat-1002364' into 'master'

判断发邮件

See merge request rays/pcloud-book!441
parents e532d515 26d3358a
......@@ -648,4 +648,13 @@ public class WechatGroupConsr {
}
return list;
}
@ParamLog(value = "发送登录二维码邮件")
public void sendQrcodeLoginEmail(String wxId){
try {
groupMemberService.sendQrcodeLoginEmail(wxId);
}catch (Exception e){
log.error("[groupMemberService.sendQrcodeLoginEmail]发送登录二维码邮件调用失败" + e.getMessage(), e);
}
}
}
......@@ -21,6 +21,11 @@ public class BookBusinessConstants {
public static final String ACTIVE_ROBOT_CACHE_KEY_PREFIX = "activerobot:";
/**
* 发邮件间隔时长
*/
public static final String EMAIL_SPAN_TIME = "emailSpanTime:";
/**
* 收款状态
*/
public enum CollectionStatus {
......
......@@ -114,6 +114,19 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
if (1 == status) {
JedisClusterUtils.hset(BookBusinessConstants.ACTIVE_ROBOT_CACHE_KEY_PREFIX, wxId, String.valueOf(System.currentTimeMillis() + 7 * 1000));
}
//如果是手动上线,真实下线,发登录邮件
if (0 == status && 1 == robot.getState()) {
String emailKey = BookBusinessConstants.EMAIL_SPAN_TIME + wxId;
String wxid = JedisClusterUtils.get(emailKey);
if(wxid == null) {
ThreadPoolUtils.OTHER_THREAD_POOL.execute(() -> {
LOGGER.info("发送登录二维码邮件===开始" + wxId);
wechatGroupConsr.sendQrcodeLoginEmail(wxId);
LOGGER.info("发送登录二维码邮件===结束" + wxId);
});
JedisClusterUtils.set(emailKey, wxId , 5 * 60);
}
}
// 处理无响应的上线状态小号,更新为下线
List<RobotClassifyDTO> allPcloudRobot = pcloudRobotDao.getAllPcloudRobot();
List<String> ids = allPcloudRobot.stream().filter(x -> 1 == x.getRealStatus()).map(RobotClassifyDTO::getWxId).collect(Collectors.toList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment