Commit 2689ca5b by 裴大威

feat 1001745

parent f5bfcff8
package com.pcloud.book.group.biz.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
......@@ -66,7 +67,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -239,6 +240,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
}
}
String url = null;
List<ClassifyQrcodeVO> canUserQrcode = Lists.newArrayList();
for (ClassifyQrcodeVO vo : collect) {
if (vo.getUserNumber() >= classify.getChangeNumber()) {
//将二维码修改为已满群状态
......@@ -250,9 +252,14 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
log.info("[前端调用切群接口] getChangeGroupQrCode 处理超出了但是没有更新状态的群 vo:{}", vo);
}
if (vo.getUserNumber() < classify.getChangeNumber()) {
url = vo.getQrcodeUrl();
canUserQrcode.add(vo);
}
}
// 获取群人数最少的可用群二维码返回出去
if (!CollectionUtils.isEmpty(canUserQrcode)) {
ClassifyQrcodeVO vo = canUserQrcode.stream().min(Comparator.comparingInt(ClassifyQrcodeVO::getUserNumber)).orElseGet(ClassifyQrcodeVO::new);
url = StringUtil.isBlank(vo.getQrcodeUrl()) ? null : vo.getQrcodeUrl();
}
if (Objects.isNull(url)) {
// 如果没有群则新增一个
String qrcodeUrl = changeGroupQrCode(classifyId);
......@@ -262,6 +269,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
return url;
}
@Override
public String changeGroupQrCode(Long classifyId) {
return changeGroup(classifyId);
......
......@@ -422,9 +422,10 @@ public class BookGuideBizImpl implements BookGuideBiz {
@ParamLog("推关学习报告/猜谜语关键词消息")
private KeywordStatusDTO pushLearningReport(GroupClassifyQrcodeDTO classifyQrcodeInfo, String robotId, String weixinGroupId, String ip) {
Boolean reportOpen = false;
Boolean riddleOpen = false;
Boolean clockOpen = false;
boolean reportOpen = false;
boolean riddleOpen = false;
boolean clockOpen = false;
KeywordStatusDTO dto = new KeywordStatusDTO();
if (classifyQrcodeInfo.getHasOpenLearningReport() != null && classifyQrcodeInfo.getHasOpenLearningReport()) {
reportOpen = true;
}
......@@ -435,12 +436,12 @@ public class BookGuideBizImpl implements BookGuideBiz {
WeixinClockDto weixinClockDto = weixinClockGroupClassifyDao.getClockBaseInfoByClassify(classifyQrcodeInfo.getClassifyId());
if (null != weixinClockDto && !StringUtil.isEmpty(weixinClockDto.getClockGuide()) && !StringUtil.isEmpty(weixinClockDto.getClockKeyword())) {
clockOpen = true;
dto.setClockGuide(weixinClockDto.getClockGuide());
dto.setClockKeyword(weixinClockDto.getClockKeyword());
}
KeywordStatusDTO dto = new KeywordStatusDTO();
dto.setReportOpen(reportOpen);
dto.setRiddleOpen(riddleOpen);
dto.setClockOpen(clockOpen);
dto.setClockKeyword(null == weixinClockDto ? StringUtil.EMPTY : weixinClockDto.getClockKeyword());
return dto;
// if (reportOpen && riddleOpen && clockOpen) {
// SendWeixinRequestTools.sendTextMessage("关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值\n" +
......
......@@ -23,4 +23,9 @@ public class KeywordStatusDTO {
*/
private String clockKeyword;
/**
* 打卡引导语
*/
private String clockGuide;
}
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