Commit dc41f803 by 田超

Merge branch 'addchScan' into 'master'

feat:[none]加字段

See merge request rays/pcloud-book!1431
parents 87a45417 28b6df59
......@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.pcloud.analysisengine.browse.dto.BookBrowseAndScanStatsDTO;
import com.pcloud.analysisengine.browse.dto.BrowseCacheRecordDto;
import com.pcloud.analysisengine.qrcode.dto.BookScanCountDto;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.book.base.dto.CountDto;
import com.pcloud.book.base.exception.BookBizException;
......@@ -54,6 +55,7 @@ import com.pcloud.book.group.dto.*;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.enums.AppAndProductTypeEnum;
import com.pcloud.book.group.enums.JoinGroupTypeEnum;
import com.pcloud.book.mapper.clickhouse.BookMapper;
import com.pcloud.book.mq.producer.UpdateSuperSearchProducer;
import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import com.pcloud.book.rightsSetting.constants.RightsSettingConstant;
......@@ -219,6 +221,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
private ResourcePageItemDao resourcePageItemDao;
@Autowired
private ReaderConsr readerConsr;
@Autowired
private BookMapper bookMapper;
@Override
public List<BookDto> listByAdviserId(Long adviserId) {
......@@ -1029,6 +1033,13 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
List<Long> bookIds = Lists.newArrayList(setBookIds);
Map<String, BookDataStatisticsDTO> stringBookDataStatisticsDTOMap = mapBookDataStatistics(adviserIds, bookIds, channelIds);
List<Long> xiaoRuiEducation = channelConsr.isXiaoRuiEducation(bookIds);
List<BookScanCountDto> bookScanCounts = bookMapper.getBookScanCounts(bookIds);
Map<Long,Integer> chMap = new HashMap<>();
for (BookScanCountDto bookScanCount : bookScanCounts) {
chMap.put(bookScanCount.getBookId(),bookScanCount.getScanCount().intValue());
}
Map<Long, UserLogin> userLoginInfoMap= new HashMap<>();
Map<Long, AdviserBaseInfoDto> adviserAgentMap = new HashMap<>();
Map<Long, String> channelNameMap = new HashMap<>();
......@@ -1064,6 +1075,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if(xiaoRuiEducation.contains(bookVO.getBookId())){
bookVO.setXiaoRuiEducation(1);
}
Integer chScan = chMap.get(bookVO.getBookId());
if(chScan!=null) {
bookVO.setChScanCount(chScan);
}
}
Long adviserId = bookVO.getAdviserId();
if(adviserId != null && MapUtils.isNotEmpty(userLoginInfoMap) && userLoginInfoMap.containsKey(adviserId)) {
......
......@@ -63,5 +63,6 @@ public class ErpAdviserBookVO implements Serializable {
private int scanCount;
private int userCount;
private int xiaoRuiEducation;
private int chScanCount;
}
package com.pcloud.book.mapper.clickhouse;
import com.pcloud.analysisengine.qrcode.dto.BookScanCountDto;
import com.pcloud.book.group.vo.ListBook4ChannelVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
......@@ -15,4 +16,6 @@ public interface BookMapper {
Integer countBookGroup4Channel(Map<String,Object> params);
List<BookScanCountDto>getBookScanCounts(@Param("list") List<Long>bookIds);
}
......@@ -35,6 +35,20 @@
LIMIT ${offset}, ${limit}
</select>
<select id="getBookScanCounts" resultType="com.pcloud.analysisengine.qrcode.dto.BookScanCountDto">
select book_id bookId, scans scanCount
from collect.total_scan_gmv
where toDate(create_time) = today()
and toInt64(scans) > 0
and bookId in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="countBookGroup4Channel" resultType="java.lang.Integer">
SELECT uniqExact(b.BOOK_ID)
FROM (SELECT BOOK_ID, COVER_IMG, ISBN, BOOK_NAME
......
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