Commit b95ba6e2 by 阮思源

1002108建分类不自动建群导致的问题排查与修改

parent 8b250fd8
......@@ -48,6 +48,7 @@ import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.consumer.user.PartyConsr;
import com.pcloud.book.consumer.voicemessage.MerchantVideoConsr;
import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.dao.BookGroupClassifyDao;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupStatisticDTO;
......@@ -161,6 +162,8 @@ public class BookSet {
private BookGroupDao bookGroupDao;
@Autowired
private BookGroupClassifyBiz bookGroupClassifyBiz;
@Autowired
private BookGroupClassifyDao bookGroupClassifyDao;
/**
* 检验书号是否合法,包括ISSN,ISBN,CSSN
......@@ -1354,7 +1357,7 @@ public class BookSet {
bookDto.setBookGroupId(bookGroupDTO.getId());
bookDto.setGroupQrcodeUrl(bookGroupDTO.getGroupQrcodeUrl());
bookDto.setGroupQrcodeName(bookGroupDTO.getGroupQrcodeName());
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyBiz.getBookGroupStatistic(Arrays.asList(bookGroupDTO.getId()));
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyDao.getClassifyCountAbout(Arrays.asList(bookGroupDTO.getId()));
if (!MapUtils.isEmpty(statisMap) && statisMap.containsKey(bookGroupDTO.getId())) {
BookGroupStatisticDTO statisticDTO = statisMap.get(bookGroupDTO.getId());
bookDto.setClassifyCount(null != statisticDTO.getClassifyCount() ? statisticDTO.getClassifyCount().longValue() : 0L);
......
......@@ -769,7 +769,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
if(ListUtils.isEmpty(bookGroupIds)){
return new PageBean(0, 0, new ArrayList<>());
}
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyBiz.getBookGroupStatistic(bookGroupIds);
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyDao.getClassifyCountAbout(bookGroupIds);
listBookGroup4Channel.getRecordList().forEach( e ->{
ListBook4ChannelVO listBook4ChannelVO = (ListBook4ChannelVO) e;
if (!MapUtils.isEmpty(statisMap) && statisMap.containsKey(listBook4ChannelVO.getBookGroupId())) {
......@@ -1796,7 +1796,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
if(ListUtils.isEmpty(bookGroupIds)){
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
}
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyBiz.getBookGroupStatistic(groupIds);
Map<Long, BookGroupStatisticDTO> statisMap = bookGroupClassifyDao.getClassifyCountAbout(groupIds);
for (ListBook4ChannelVO listBook4ChannelVO : resultInfos.getRecordList()) {
GroupStoreMyPayDto groupStoreMyPayDto = new GroupStoreMyPayDto();
groupStoreMyPayDto.setOriginId(listBook4ChannelVO.getBookGroupId());
......@@ -1819,7 +1819,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
@Override
public BookGroupStatisticsDTO getBookGroupStatisByBookGroupId(Long bookGroupId) {
Map<Long, BookGroupStatisticDTO> bookGroupStatisticMap = bookGroupClassifyBiz.getBookGroupStatistic(Arrays.asList(bookGroupId));
Map<Long, BookGroupStatisticDTO> bookGroupStatisticMap = bookGroupClassifyDao.getClassifyCountAbout(Arrays.asList(bookGroupId));
BookGroupStatisticsDTO bookGroupStatisticsDTO = new BookGroupStatisticsDTO();
Long appCount = appTouchRecordDao.getCountByBokkGroupId(bookGroupId, "APP");
Long productCount = appTouchRecordDao.getCountByBokkGroupId(bookGroupId, "PRODUCT");
......
......@@ -193,7 +193,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
@Transactional(rollbackFor = Exception.class)
public void addClassify(AddClassifyVO addClassifyVO, Long partyId) {
checkClassifyIsExist(addClassifyVO.getClassify(), null, addClassifyVO.getBookGroupId());
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyBiz.getBookGroupStatistic(Collections.singletonList(addClassifyVO.getBookGroupId()));
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyDao.getClassifyCountAbout(Collections.singletonList(addClassifyVO.getBookGroupId()));
Integer classifyCount = 0;
if (!CollectionUtils.isEmpty(statistic) && null != statistic.get(addClassifyVO.getBookGroupId())) {
classifyCount = statistic.get(addClassifyVO.getBookGroupId()).getClassifyCount();
......@@ -524,7 +524,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
ClassifyAndGroupCountVO classifyAndGroupCountVO = new ClassifyAndGroupCountVO();
Integer groupCount = bookGroupClassifyDao.getGroupCount(bookGroupId);
//获取分类数量
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyBiz.getBookGroupStatistic(Collections.singletonList(bookGroupId));
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyDao.getClassifyCountAbout(Collections.singletonList(bookGroupId));
if (CollectionUtils.isEmpty(statistic) || null == statistic.get(bookGroupId)) {
classifyAndGroupCountVO.setClassifyCount(0);
} else {
......@@ -540,7 +540,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
@ParamLog("获取分类数与用户总数")
public ClassifyAndUserCountVO getClassifyAndUserCount(Long bookGroupId) {
ClassifyAndUserCountVO classifyAndUserCountVO = new ClassifyAndUserCountVO();
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyBiz.getBookGroupStatistic(Collections.singletonList(bookGroupId));
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyDao.getClassifyCountAbout(Collections.singletonList(bookGroupId));
if (CollectionUtils.isEmpty(statistic) || null == statistic.get(bookGroupId)) {
classifyAndUserCountVO.setClassifyCount(0);
} else {
......
......@@ -215,7 +215,7 @@ public class GroupSet {
endTime = DateUtils.formatDate(DateUtils.getMonthEnd(DateUtils.getDateByStr(startTime)), DateUtils.DATE_FORMAT_DATEONLY);
}
//分类数,群数,群人数
Map<Long, BookGroupStatisticDTO> bookGroupStatisticDTOMap = bookGroupClassifyDao.getBookGroupStatistic(bookGroupIds);
Map<Long, BookGroupStatisticDTO> bookGroupStatisticDTOMap = bookGroupClassifyDao.getClassifyCountAbout(bookGroupIds);
//社群码下资源数量(关键词及1v1配置资源)
Map<Long, KeywordResourceDTO> keywordResourceDTOMap = bookKeywordDao.getBookGroupResourceCount(bookGroupIds);
//累计进群人数-按月
......
......@@ -662,16 +662,17 @@
<select id="getStatistic4Adviser" resultType="StatisticVO" parameterType="Long">
SELECT
count(1) groupNumber,
sum(user_number) userNumber,
count(DISTINCT classify_id) classifyCount
count(q.id) groupNumber,
IFNULL(SUM(q.user_number),0) userNumber,
count(DISTINCT c.id) classifyCount
FROM
book_group_classify c
JOIN
left JOIN
book_group_qrcode q ON c.id = q.classify_id
AND q.is_delete = 0
join book_adviser ba on c.book_id = ba.book_id and c.channel_id = ba.channel_id and c.create_user = ba.adviser_id
WHERE
c.create_user = #{_parameter} AND c.is_delete = 0 and q.is_delete = 0 and ba.is_delete = 0
c.create_user = #{_parameter} AND c.is_delete = 0 and ba.is_delete = 0
</select>
<resultMap id="GroupQrcodeMap" type="GroupQrcodeBaseDTO">
......@@ -849,10 +850,10 @@
IFNULL(SUM(t2.user_number),0) userNumber
FROM
book_group_classify t1
INNER JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
left JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
AND t2.is_delete = 0
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
AND t1.book_id = #{bookId}
</select>
......@@ -862,13 +863,13 @@
t1.id classifyId,
t1.classify classify,
COUNT(DISTINCT t2.id) groupCount,
SUM(t2.user_number) userCount
IFNULL(SUM(t2.user_number),0) userCount
FROM
book_group_classify t1
INNER JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
left JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
AND t2.is_delete = 0
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
AND t1.book_id = #{bookId}
group by t1.id
</select>
......
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