Commit 4d7c9791 by 阮思源

微信群学习报告

parent 11293978
......@@ -50,6 +50,11 @@ public class GroupClassifyQrcodeDTO implements Serializable {
private String qrCodeUrl;
/**
* 是否开启群学习报告
*/
private Boolean hasOpenLearningReport;
public Long getBookId() {
return bookId;
}
......@@ -122,6 +127,14 @@ public class GroupClassifyQrcodeDTO implements Serializable {
this.qrCodeUrl = qrCodeUrl;
}
public Boolean getHasOpenLearningReport() {
return hasOpenLearningReport;
}
public void setHasOpenLearningReport(Boolean hasOpenLearningReport) {
this.hasOpenLearningReport = hasOpenLearningReport;
}
@Override
public String toString() {
return "GroupClassifyQrcodeDTO{" +
......@@ -133,6 +146,8 @@ public class GroupClassifyQrcodeDTO implements Serializable {
", groupQrcodeId=" + groupQrcodeId +
", weixinQrcodeId=" + weixinQrcodeId +
", price=" + price +
", qrCodeUrl='" + qrCodeUrl + '\'' +
", hasOpenLearningReport=" + hasOpenLearningReport +
'}';
}
}
......@@ -176,6 +176,12 @@
</dependency>
<dependency>
<groupId>com.pcloud.facade</groupId>
<artifactId>pcloud-facade-shareimage</artifactId>
<version>${pcloud-facade-shareimage.version}</version>
</dependency>
<dependency>
<groupId>fakepath</groupId>
<artifactId>jbarcode</artifactId>
<version>0.2.8</version>
......
......@@ -188,4 +188,14 @@ public class BookApplication {
public Queue convert2BookQueue(){
return RabbitMQFactory.queueBuilder(MQQueueConstant.CONVERT_TO_BOOK);
}
@Bean
public Queue wxGroupLearningReportQueue() {
return RabbitMQFactory.queueBuilder(MQTopicConumer.WXGROUP_LEARNING_REPORT);
}
@Bean
public Binding wxGroupLearningReportBind() {
return RabbitMQFactory.bindingExchange(wxGroupLearningReportQueue(), MQTopicProducer.WXGROUP_LEARNING_REPORT);
}
}
package com.pcloud.book.consumer.analysisengine;
import com.pcloud.analysisengine.wechatgroupan.dto.GroupBrowseDTO;
import com.pcloud.analysisengine.wechatgroupan.service.WechatGroupAnService;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/25 10:09
**/
@Component("wechatGroupAnConsr")
public class WechatGroupAnConsr {
private static final Logger LOGGER = LoggerFactory.getLogger(WechatGroupAnConsr.class);
@Autowired
private WechatGroupAnService wechatGroupAnService;
@ParamLog(description = "获取微信群浏览集合")
public List<GroupBrowseDTO> getGroupBrowseList(Long qrcodeId) {
List<GroupBrowseDTO> groupBrowseDTOS = new ArrayList<>();
try {
groupBrowseDTOS = ResponseHandleUtil.parseListResponse(wechatGroupAnService.getGroupBrowseList(qrcodeId), GroupBrowseDTO.class);
} catch (BizException e) {
LOGGER.warn("【分析引擎(消)】获取微信群浏览集合.[getGroupBrowseList]:" + e.getMessage(), e);
} catch (Exception e) {
LOGGER.error("【分析引擎(消)】获取微信群浏览集合.[getGroupBrowseList]:" + e.getMessage(), e);
}
if (groupBrowseDTOS == null) {
groupBrowseDTOS = new ArrayList<>();
}
return groupBrowseDTOS;
}
@ParamLog(description = "获取微信群单个浏览")
public GroupBrowseDTO getGroupBrowseForOne(Long qrcodeId, Long wechatUserId) {
GroupBrowseDTO groupBrowseDTO = new GroupBrowseDTO();
try {
groupBrowseDTO = ResponseHandleUtil.parseResponse(wechatGroupAnService.getGroupBrowseForOne(qrcodeId, wechatUserId), GroupBrowseDTO.class);
} catch (BizException e) {
LOGGER.warn("【分析引擎(消)】获取微信群单个浏览.[getGroupBrowseForOne]:" + e.getMessage(), e);
} catch (Exception e) {
LOGGER.error("【分析引擎(消)】获取微信群单个浏览.[getGroupBrowseForOne]:" + e.getMessage(), e);
}
if (groupBrowseDTO == null) {
groupBrowseDTO = new GroupBrowseDTO();
}
return groupBrowseDTO;
}
}
package com.pcloud.book.consumer.trade;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.facade.tradecenter.dto.GroupMoneyDto;
import com.pcloud.facade.tradecenter.dto.QrGroupBuyDetailDto;
import com.pcloud.facade.tradecenter.dto.SpeWechatGroupDto;
import com.pcloud.facade.tradecenter.dto.WechatGroupDto;
import com.pcloud.facade.tradecenter.dto.*;
import com.pcloud.facade.tradecenter.service.OrderFormService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -90,4 +89,41 @@ public class TradeConsr {
}
return map;
}
@ParamLog("根据微信群id查询销售情况")
public List<SaleDetailByQrcodeDto> getSaleDetailByQrcodeId(Long qrcodeId) throws BizException{
List<SaleDetailByQrcodeDto> list=new ArrayList<>();
if (qrcodeId == null) {
return list;
}
try {
ResponseEntity<ResponseDto<List<SaleDetailByQrcodeDto>>> responseEntity = orderFormService.getSaleDetailByQrcodeId(qrcodeId);
list = ResponseHandleUtil.parseListResponse(responseEntity, SaleDetailByQrcodeDto.class);
} catch (Exception e) {
LOGGER.error("根据微信群id查询销售情况:" + e.getMessage(), e);
}
if (list == null) {
list = new ArrayList<>();
}
return list;
}
@ParamLog("根据微信群id和wechatUserId查询销售额")
public BigDecimal getAmountByQrcodeId(Long qrcodeId,Long wechatUserId) throws BizException{
BigDecimal amount=BigDecimal.ZERO;
if (qrcodeId == null) {
return amount;
}
try {
ResponseEntity<ResponseDto<BigDecimal>> responseEntity = orderFormService.getAmountByQrcodeId(qrcodeId,wechatUserId);
amount = ResponseHandleUtil.parseResponse(responseEntity, BigDecimal.class);
} catch (Exception e) {
LOGGER.error("根据微信群id和wechatUserId查询销售额:" + e.getMessage(), e);
}
if (amount == null) {
amount = BigDecimal.ZERO;
}
return amount;
}
}
package com.pcloud.book.group.biz;
import com.pcloud.book.group.dto.BookGroupStatisticDTO;
import com.pcloud.book.group.dto.ClassifyDTO;
import com.pcloud.book.group.dto.GroupClassifyQrcodeDTO;
import com.pcloud.book.group.dto.GroupNameAndMaxSeqDTO;
import com.pcloud.book.group.dto.GroupQrcodeBaseDTO;
import com.pcloud.book.group.dto.ProAssocGroupAndUserNumberDTO;
import com.pcloud.book.group.dto.*;
import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.vo.*;
import com.pcloud.common.page.PageBeanNew;
......@@ -174,4 +169,14 @@ public interface BookGroupClassifyBiz {
PageBeanNew<ClassifyDTO> listSimpleBookGroupClassify4Adviser(Long adviserId, BookGroupClassify bookGroupClassify, PageParam pageParam);
PageBeanNew<AdviserClassifyVO> listAdviserClassify(Long adviserId, AdviserClassifyParam adviserClassifyParam);
/**
* 更新是否开启微学习报告
*/
void updateHasOpenLearningReport(Long classifyId, Boolean hasOpenLearningReport, Long partyId);
/**
* 获取群分类学习报告相关列表
*/
PageBeanNew<ClassifyLearningReportDto> listClassifyForLearningReport(Integer currentPage, Integer numPerPage, String keyword, Long partyId);
}
package com.pcloud.book.group.biz;
import com.pcloud.book.group.dto.AppClickDTO;
import com.pcloud.book.group.dto.LearningScoreDTO;
import com.pcloud.book.group.dto.UserLearningInfoDTO;
import com.pcloud.book.group.entity.LearningReportBrowseRecord;
import java.util.List;
public interface LearningReportBiz {
Long createLearningReportBrowseRecord(LearningReportBrowseRecord learningReportBrowseRecord);
Long createLearningReportTouchRecord(String wxUserId,String wxGroupId);
List<AppClickDTO> getRecentlyLearning(Long wechatUserId, Long qrcodeId);
List<LearningScoreDTO> getLearningTopFive(Long qrcodeId);
LearningScoreDTO getUserLearningSore(Long qrcodeId,Long wechatUserId);
UserLearningInfoDTO getUserLearningInfo(Long qrcodeId, Long wechatUserId, String qrcodeUrlS);
}
......@@ -45,7 +45,7 @@ public class AppClickRecordBizImpl implements AppClickRecordBiz {
}
GroupQrcode groupQrcode = groupQrcodeDao.getById(appClickRecord.getQrcodeId());
if (groupQrcode != null) {
appClickRecord.setQrcodeId(groupQrcode.getId());
appClickRecord.setWeixinGroupId(groupQrcode.getWeixinGroupId());
}
appClickRecordDao.insert(appClickRecord);
return appClickRecord.getId();
......
......@@ -11,20 +11,14 @@ import com.pcloud.book.consumer.settlement.SettlementConsr;
import com.pcloud.book.consumer.trade.TradeConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.*;
import com.pcloud.book.group.dao.BookClassifyBuyRecordDao;
import com.pcloud.book.group.dao.BookGroupClassifyDao;
import com.pcloud.book.group.dao.BookQrcodeUserDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupStatisticDTO;
import com.pcloud.book.group.dto.ClassifyDTO;
import com.pcloud.book.group.dto.GroupAndUserNumberDTO;
import com.pcloud.book.group.dto.GroupClassifyQrcodeDTO;
import com.pcloud.book.group.dto.GroupNameAndMaxSeqDTO;
import com.pcloud.book.group.dto.GroupQrcodeBaseDTO;
import com.pcloud.book.group.dto.GroupQrcodeInfoDTO;
import com.pcloud.book.group.dto.ProAssocGroupAndUserNumberDTO;
import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO;
import com.pcloud.book.group.dto.WeixinQrcodeDTO;
import com.pcloud.book.group.dao.*;
import com.pcloud.book.group.dto.*;
import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.entity.BookQrcodeUser;
import com.pcloud.book.group.entity.GroupQrcode;
......@@ -60,9 +54,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -122,6 +118,10 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private GroupSet groupSet;
@Autowired
private BookGroupClassifyBiz bookGroupClassifyBiz;
@Autowired
private LearningReportBrowseRecordDao learningReportBrowseRecordDao;
@Autowired
private LearningReportTouchRecordDao learningReportTouchRecordDao;
@Override
@ParamLog("新增分类")
......@@ -859,4 +859,86 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
return pageBeanNew;
}
@Transactional(rollbackFor = Exception.class)
@ParamLog("更新是否开启微学习报告")
@Override
public void updateHasOpenLearningReport(Long classifyId, Boolean hasOpenLearningReport, Long partyId) {
bookGroupClassifyDao.updateHasOpenLearningReport(classifyId,hasOpenLearningReport,partyId);
}
@ParamLog("获取群分类学习报告相关列表")
@Override
public PageBeanNew<ClassifyLearningReportDto> listClassifyForLearningReport(Integer currentPage, Integer numPerPage, String keyword, Long partyId) {
PageParam pageParam = new PageParam(currentPage, numPerPage);
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("keyword", keyword);
paramMap.put("partyId", partyId);
PageBeanNew<ClassifyLearningReportDto> pageBeanNew = bookGroupClassifyDao.listPageNew(pageParam, paramMap, "listClassifyForLearningReport");
if (pageBeanNew == null) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
}
//遍历填充标签
List<ClassifyLearningReportDto> list = pageBeanNew.getRecordList();
if (!ListUtils.isEmpty(list)) {
List<Long> labelIds = new ArrayList<>();
List<Long> classifyIds = new ArrayList<>();
for (ClassifyLearningReportDto classifyLearningReportDto : list) {
classifyIds.add(classifyLearningReportDto.getClassifyId());
if (classifyLearningReportDto.getProLabelId() != null) {
labelIds.add(classifyLearningReportDto.getProLabelId());
}
if (classifyLearningReportDto.getPurLabelId() != null) {
labelIds.add(classifyLearningReportDto.getPurLabelId());
}
if (classifyLearningReportDto.getDepLabelId() != null) {
labelIds.add(classifyLearningReportDto.getDepLabelId());
}
}
Map<Long, Integer> browseCountMap = new HashMap<>();
Map<Long, Integer> touchCountMap = new HashMap<>();
if (!ListUtils.isEmpty(classifyIds)) {
List<ClassifyLearningCountDto> browseCountList = learningReportBrowseRecordDao.getCountGroupByClassifyId(classifyIds);
List<ClassifyLearningCountDto> touchCountList = learningReportTouchRecordDao.getCountGroupByClassifyId(classifyIds);
for (ClassifyLearningCountDto classifyLearningCountDto:browseCountList){
browseCountMap.put(classifyLearningCountDto.getClassifyId(),classifyLearningCountDto.getCount());
}
for (ClassifyLearningCountDto classifyLearningCountDto:touchCountList){
touchCountMap.put(classifyLearningCountDto.getClassifyId(),classifyLearningCountDto.getCount());
}
}
Map<Long, String> labelMap = new HashMap<>();
if (!ListUtils.isEmpty(labelIds)) {
labelMap = ResponseHandleUtil.parseMap(labelService.getLabelName(labelIds), Long.class, String.class);
}
for (ClassifyLearningReportDto classifyLearningReportDto : list) {
if (!MapUtils.isEmpty(labelMap)) {
Long proLabelId = classifyLearningReportDto.getProLabelId();
if (proLabelId != null) {
classifyLearningReportDto.setProLabelName(labelMap.get(proLabelId));
}
Long purLabelId = classifyLearningReportDto.getPurLabelId();
if (purLabelId != null) {
classifyLearningReportDto.setPurLabelName(labelMap.get(purLabelId));
}
Long depLabelId = classifyLearningReportDto.getDepLabelId();
if (depLabelId != null) {
classifyLearningReportDto.setDepLabelName(labelMap.get(depLabelId));
}
}
Integer browseCount = browseCountMap.get(classifyLearningReportDto.getClassifyId());
if (browseCount == null) {
browseCount = 0;
}
Integer touchCount = touchCountMap.get(classifyLearningReportDto.getClassifyId());
if (touchCount == null) {
touchCount = 0;
}
classifyLearningReportDto.setLearningReportBrowseCount(browseCount);
classifyLearningReportDto.setLearningReportTouchCount(touchCount);
}
}
return pageBeanNew;
}
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.AppClickDTO;
import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.entity.AppClickRecord;
import com.pcloud.common.core.dao.BaseDao;
......@@ -11,4 +12,9 @@ public interface AppClickRecordDao extends BaseDao<AppClickRecord> {
* 根据作品或应用id集合获取统计
*/
List<AppStatisticsDTO> getClickStatisticsByServeIds(List<Long> serveIds, Long qrcodeId, Long bookGroupId);
/**
* 获取最近点击
*/
List<AppClickDTO> getRecentlyClick(Long wechatUserId, Long qrcodeId, Integer top);
}
......@@ -230,4 +230,10 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
List<ClassifyKeywordDTO> getClassifyStatistics(Long bookId);
GroupClassifyQrcodeDTO getClassifyQrcodeInfoByName(String weixinGroupName);
/**
* 更新是否开启学习报告
*/
void updateHasOpenLearningReport(Long classifyId, Boolean hasOpenLearningReport, Long partyId);
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.ClassifyLearningCountDto;
import com.pcloud.book.group.entity.LearningReportBrowseRecord;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
public interface LearningReportBrowseRecordDao extends BaseDao<LearningReportBrowseRecord> {
List<ClassifyLearningCountDto> getCountGroupByClassifyId(List<Long> classifyIds);
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.ClassifyLearningCountDto;
import com.pcloud.book.group.entity.LearningReportTouchRecord;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
public interface LearningReportTouchRecordDao extends BaseDao<LearningReportTouchRecord> {
List<ClassifyLearningCountDto> getCountGroupByClassifyId(List<Long> classifyIds);
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.AppClickRecordDao;
import com.pcloud.book.group.dto.AppClickDTO;
import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.entity.AppClickRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
......@@ -25,4 +26,13 @@ public class AppClickRecordDaoImpl extends BaseDaoImpl<AppClickRecord> implement
map.put("serveIds", serveIds);
return this.getSqlSession().selectList(this.getStatement("getClickStatisticsByServeIds"), map);
}
@Override
public List<AppClickDTO> getRecentlyClick(Long wechatUserId, Long qrcodeId, Integer top) {
Map<String, Object> map = new HashMap<>();
map.put("qrcodeId", qrcodeId);
map.put("wechatUserId", wechatUserId);
map.put("top", top);
return this.getSqlSession().selectList(this.getStatement("getRecentlyClick"), map);
}
}
......@@ -197,4 +197,13 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
public GroupClassifyQrcodeDTO getClassifyQrcodeInfoByName(String weixinGroupName) {
return this.getSessionTemplate().selectOne(getStatement("getClassifyQrcodeInfoByName"), weixinGroupName);
}
@Override
public void updateHasOpenLearningReport(Long classifyId, Boolean hasOpenLearningReport, Long partyId) {
Map<String, Object> paramMap = new HashMap();
paramMap.put("classifyId", classifyId);
paramMap.put("hasOpenLearningReport", hasOpenLearningReport);
paramMap.put("partyId", partyId);
this.getSqlSession().update(this.getStatement("updateHasOpenLearningReport"), paramMap);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.LearningReportBrowseRecordDao;
import com.pcloud.book.group.dao.LearningReportTouchRecordDao;
import com.pcloud.book.group.dto.ClassifyLearningCountDto;
import com.pcloud.book.group.entity.LearningReportBrowseRecord;
import com.pcloud.book.group.entity.LearningReportTouchRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.List;
@Component("learningReportBrowseRecord")
public class LearningReportBrowseRecordDaoImpl extends BaseDaoImpl<LearningReportBrowseRecord> implements LearningReportBrowseRecordDao {
@Override
public List<ClassifyLearningCountDto> getCountGroupByClassifyId(List<Long> list) {
return this.getSqlSession().selectList(this.getStatement("getCountGroupByClassifyId"), list);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.LearningReportTouchRecordDao;
import com.pcloud.book.group.dto.ClassifyLearningCountDto;
import com.pcloud.book.group.entity.LearningReportTouchRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.List;
@Component("learningReportTouchRecord")
public class LearningReportTouchRecordDaoImpl extends BaseDaoImpl<LearningReportTouchRecord> implements LearningReportTouchRecordDao {
@Override
public List<ClassifyLearningCountDto> getCountGroupByClassifyId(List<Long> list) {
return this.getSqlSession().selectList(this.getStatement("getCountGroupByClassifyId"), list);
}
}
package com.pcloud.book.group.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/24 17:55
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AppClickDTO implements Serializable {
private static final long serialVersionUID = 7389809828237942796L;
@ApiModelProperty("社群书id")
private Long bookGroupId;
@ApiModelProperty("分类id")
private Long classifyId;
@ApiModelProperty("群id")
private Long qrcodeId;
@ApiModelProperty("微信群id")
private String weixinGroupId;
@ApiModelProperty("应用或作品id")
private Long serveId;
@ApiModelProperty("应用或作品名称")
private String serveName;
@ApiModelProperty("类型")
private String serveType;
@ApiModelProperty("应用或作品类型名称")
private String typeName;
@ApiModelProperty("类型code")
private String typeCode;
@ApiModelProperty("应用或作品图片")
private String image;
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getQrcodeId() {
return qrcodeId;
}
public void setQrcodeId(Long qrcodeId) {
this.qrcodeId = qrcodeId;
}
public String getWeixinGroupId() {
return weixinGroupId;
}
public void setWeixinGroupId(String weixinGroupId) {
this.weixinGroupId = weixinGroupId;
}
public Long getServeId() {
return serveId;
}
public void setServeId(Long serveId) {
this.serveId = serveId;
}
public String getServeName() {
return serveName;
}
public void setServeName(String serveName) {
this.serveName = serveName;
}
public String getServeType() {
return serveType;
}
public void setServeType(String serveType) {
this.serveType = serveType;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
@Override
public String toString() {
return "AppClickDTO{" +
"bookGroupId=" + bookGroupId +
", classifyId=" + classifyId +
", qrcodeId=" + qrcodeId +
", weixinGroupId='" + weixinGroupId + '\'' +
", serveId=" + serveId +
", serveName='" + serveName + '\'' +
", serveType='" + serveType + '\'' +
", typeName='" + typeName + '\'' +
", typeCode='" + typeCode + '\'' +
", image='" + image + '\'' +
'}';
}
}
package com.pcloud.book.group.dto;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/23 20:10
**/
public class ClassifyLearningCountDto implements Serializable {
private static final long serialVersionUID = -4629088587616450517L;
private Long classifyId;
private Integer count;
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
@Override
public String toString() {
return "ClassifyLearningCountDto{" +
"classifyId=" + classifyId +
", count=" + count +
'}';
}
}
package com.pcloud.book.group.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/23 18:17
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ClassifyLearningReportDto implements Serializable {
private static final long serialVersionUID = -5175893581465763555L;
@ApiModelProperty("分类标识")
private Long classifyId;
@ApiModelProperty("图书标识")
private Long bookId;
@ApiModelProperty("图书名称")
private String bookName;
@ApiModelProperty("群分类")
private String classify;
@ApiModelProperty("社群码标识")
private String bookGroupId;
@ApiModelProperty("群二维码名称")
private String groupQrcodeName;
@ApiModelProperty("专业标签ID")
private Long proLabelId;
@ApiModelProperty("深度标签ID")
private Long depLabelId;
@ApiModelProperty("目的标签ID")
private Long purLabelId;
@ApiModelProperty("专业标签名称")
private String proLabelName;
@ApiModelProperty("深度标签名称")
private String depLabelName;
@ApiModelProperty("目的标签名称")
private String purLabelName;
@ApiModelProperty("学习报告触发次数")
private Integer learningReportTouchCount;
@ApiModelProperty("学习报告浏览次数")
private Integer learningReportBrowseCount;
@ApiModelProperty("是否开启学习报告")
private Boolean hasOpenLearningReport;
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getClassify() {
return classify;
}
public void setClassify(String classify) {
this.classify = classify;
}
public String getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(String bookGroupId) {
this.bookGroupId = bookGroupId;
}
public String getGroupQrcodeName() {
return groupQrcodeName;
}
public void setGroupQrcodeName(String groupQrcodeName) {
this.groupQrcodeName = groupQrcodeName;
}
public Long getProLabelId() {
return proLabelId;
}
public void setProLabelId(Long proLabelId) {
this.proLabelId = proLabelId;
}
public Long getDepLabelId() {
return depLabelId;
}
public void setDepLabelId(Long depLabelId) {
this.depLabelId = depLabelId;
}
public Long getPurLabelId() {
return purLabelId;
}
public void setPurLabelId(Long purLabelId) {
this.purLabelId = purLabelId;
}
public String getProLabelName() {
return proLabelName;
}
public void setProLabelName(String proLabelName) {
this.proLabelName = proLabelName;
}
public String getDepLabelName() {
return depLabelName;
}
public void setDepLabelName(String depLabelName) {
this.depLabelName = depLabelName;
}
public String getPurLabelName() {
return purLabelName;
}
public void setPurLabelName(String purLabelName) {
this.purLabelName = purLabelName;
}
public Integer getLearningReportTouchCount() {
return learningReportTouchCount;
}
public void setLearningReportTouchCount(Integer learningReportTouchCount) {
this.learningReportTouchCount = learningReportTouchCount;
}
public Integer getLearningReportBrowseCount() {
return learningReportBrowseCount;
}
public void setLearningReportBrowseCount(Integer learningReportBrowseCount) {
this.learningReportBrowseCount = learningReportBrowseCount;
}
public Boolean getHasOpenLearningReport() {
return hasOpenLearningReport;
}
public void setHasOpenLearningReport(Boolean hasOpenLearningReport) {
this.hasOpenLearningReport = hasOpenLearningReport;
}
@Override
public String toString() {
return "ClassifyLearningReportDto{" +
"classifyId=" + classifyId +
", bookId=" + bookId +
", bookName='" + bookName + '\'' +
", classify='" + classify + '\'' +
", bookGroupId='" + bookGroupId + '\'' +
", groupQrcodeName='" + groupQrcodeName + '\'' +
", proLabelId=" + proLabelId +
", depLabelId=" + depLabelId +
", purLabelId=" + purLabelId +
", proLabelName='" + proLabelName + '\'' +
", depLabelName='" + depLabelName + '\'' +
", purLabelName='" + purLabelName + '\'' +
", learningReportTouchCount=" + learningReportTouchCount +
", learningReportBrowseCount=" + learningReportBrowseCount +
", hasOpenLearningReport=" + hasOpenLearningReport +
'}';
}
}
package com.pcloud.book.group.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/24 15:07
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LearningScoreDTO implements Serializable {
private static final long serialVersionUID = 3667715938819008003L;
@ApiModelProperty("微信id")
private Long wechatUserId;
@ApiModelProperty("昵称")
private String nickName;
@ApiModelProperty("头像")
private String headUrl;
@ApiModelProperty("元气值")
private Integer score;
@ApiModelProperty("总学习时长")
private Integer allLearningTime;
public Long getWechatUserId() {
return wechatUserId;
}
public void setWechatUserId(Long wechatUserId) {
this.wechatUserId = wechatUserId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getHeadUrl() {
return headUrl;
}
public void setHeadUrl(String headUrl) {
this.headUrl = headUrl;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public Integer getAllLearningTime() {
return allLearningTime;
}
public void setAllLearningTime(Integer allLearningTime) {
this.allLearningTime = allLearningTime;
}
@Override
public String toString() {
return "LearningScoreDTO{" +
"wechatUserId=" + wechatUserId +
", nickName='" + nickName + '\'' +
", headUrl='" + headUrl + '\'' +
", score=" + score +
", allLearningTime=" + allLearningTime +
'}';
}
}
package com.pcloud.book.group.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/25 9:50
**/
@ApiModel("学习报告")
public class UserLearningInfoDTO implements Serializable {
private static final long serialVersionUID = 7734297462091875084L;
@ApiModelProperty("微信id")
private Long wechatUserId;
@ApiModelProperty("昵称")
private String nickName;
@ApiModelProperty("头像")
private String headUrl;
@ApiModelProperty("元气值")
private Integer score;
@ApiModelProperty("总学习时长")
private Integer allLearningTime;
@ApiModelProperty("群排名")
private Integer groupSort;
@ApiModelProperty("超过群成员百分比")
private Double exceedPercent;
@ApiModelProperty("二维码链接")
private String qrcodeUrl;
public Long getWechatUserId() {
return wechatUserId;
}
public void setWechatUserId(Long wechatUserId) {
this.wechatUserId = wechatUserId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getHeadUrl() {
return headUrl;
}
public void setHeadUrl(String headUrl) {
this.headUrl = headUrl;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public Integer getAllLearningTime() {
return allLearningTime;
}
public void setAllLearningTime(Integer allLearningTime) {
this.allLearningTime = allLearningTime;
}
public Integer getGroupSort() {
return groupSort;
}
public void setGroupSort(Integer groupSort) {
this.groupSort = groupSort;
}
public Double getExceedPercent() {
return exceedPercent;
}
public void setExceedPercent(Double exceedPercent) {
this.exceedPercent = exceedPercent;
}
public String getQrcodeUrl() {
return qrcodeUrl;
}
public void setQrcodeUrl(String qrcodeUrl) {
this.qrcodeUrl = qrcodeUrl;
}
@Override
public String toString() {
return "UserLearningInfoDTO{" +
"wechatUserId=" + wechatUserId +
", nickName='" + nickName + '\'' +
", headUrl='" + headUrl + '\'' +
", score=" + score +
", allLearningTime=" + allLearningTime +
", groupSort=" + groupSort +
", exceedPercent=" + exceedPercent +
", qrcodeUrl='" + qrcodeUrl + '\'' +
'}';
}
}
......@@ -29,6 +29,9 @@ public class AppClickRecord extends BaseEntity {
@ApiModelProperty("类型")
private String serveType;
@ApiModelProperty("微信id")
private Long wechatUserId;
public Long getBookGroupId() {
return bookGroupId;
}
......@@ -78,6 +81,14 @@ public class AppClickRecord extends BaseEntity {
this.serveType = serveType;
}
public Long getWechatUserId() {
return wechatUserId;
}
public void setWechatUserId(Long wechatUserId) {
this.wechatUserId = wechatUserId;
}
@Override
public String toString() {
return "AppClickRecord{" +
......@@ -87,6 +98,7 @@ public class AppClickRecord extends BaseEntity {
", weixinGroupId='" + weixinGroupId + '\'' +
", serveId=" + serveId +
", serveType='" + serveType + '\'' +
", wechatUserId=" + wechatUserId +
"} " + super.toString();
}
}
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/5/29 17:32
**/
public class LearningReportBrowseRecord extends BaseEntity {
private static final long serialVersionUID = 8764621621846783953L;
@ApiModelProperty("群id")
private Long qrcodeId;
@ApiModelProperty("分类id")
private Long classifyId;
@ApiModelProperty("社群码id")
private Long bookGroupId;
@ApiModelProperty("创建人")
private Long createUser;
public Long getQrcodeId() {
return qrcodeId;
}
public void setQrcodeId(Long qrcodeId) {
this.qrcodeId = qrcodeId;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
@Override
public String toString() {
return "LearningReportBrowseRecord{" +
"qrcodeId=" + qrcodeId +
", classifyId=" + classifyId +
", bookGroupId=" + bookGroupId +
", createUser=" + createUser +
"} " + super.toString();
}
}
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/5/29 17:32
**/
public class LearningReportTouchRecord extends BaseEntity {
private static final long serialVersionUID = -6649480862036544354L;
@ApiModelProperty("群id")
private Long qrcodeId;
@ApiModelProperty("分类id")
private Long classifyId;
@ApiModelProperty("社群码id")
private Long bookGroupId;
@ApiModelProperty("微信用户id")
private String wxUserId;
public Long getQrcodeId() {
return qrcodeId;
}
public void setQrcodeId(Long qrcodeId) {
this.qrcodeId = qrcodeId;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
@Override
public String toString() {
return "LearningReportTouchRecord{" +
"qrcodeId=" + qrcodeId +
", classifyId=" + classifyId +
", bookGroupId=" + bookGroupId +
", wxUserId='" + wxUserId + '\'' +
"} " + super.toString();
}
}
......@@ -6,6 +6,7 @@ import com.pcloud.common.exceptions.BizException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -15,6 +16,7 @@ public interface AppClickRecordFacade {
@ApiOperation("新增应用作品点击记录")
@PostMapping("createAppClickRecord")
ResponseDto<?> createAppClickRecord(
@CookieValue("userInfo") String userInfo,
@RequestBody @ApiParam("应用点击记录模型") AppClickRecord appClickRecord
) throws BizException;
......
......@@ -155,4 +155,21 @@ public interface BookGroupClassifyFacade {
@PostMapping("listAdviserClassify")
ResponseDto<PageBeanNew<AdviserClassifyVO>> listAdviserClassify(@RequestHeader("token") String token, @RequestBody AdviserClassifyParam adviserClassifyParam) throws PermissionException;
@ApiOperation("关闭或开启学习报告")
@GetMapping("updateHasOpenLearningReport")
ResponseDto<?> updateHasOpenLearningReport(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("classifyId") @ApiParam("分类id") Long classifyId,
@RequestParam("hasOpenLearningReport") @ApiParam("是否开启学习报告") Boolean hasOpenLearningReport
) throws BizException, PermissionException;
@ApiOperation("获取群分类学习报告相关列表")
@GetMapping("listClassifyForLearningReport")
ResponseDto<?> listClassifyForLearningReport(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("currentPage") @ApiParam("当前页") Integer currentPage,
@RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage,
@RequestParam(value = "keyword", required = false) @ApiParam("关键词") String keyword
) throws BizException, PermissionException;
}
package com.pcloud.book.group.facade;
import com.pcloud.book.group.entity.LearningReportBrowseRecord;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
@Api(description = "学习报告")
public interface LearningReportFacade {
@ApiOperation("新增学习报告浏览记录")
@PostMapping("createLearningReportBrowseRecord")
ResponseDto<?> createLearningReportBrowseRecord(
@CookieValue("userInfo") String userInfo,
@RequestBody @ApiParam("学习报告浏览记录") LearningReportBrowseRecord learningReportBrowseRecord
) throws BizException, PermissionException;
@ApiOperation("获取最近学习记录")
@GetMapping("getRecentlyLearning")
ResponseDto<?> getRecentlyLearning(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException;
@ApiOperation("获取学习元气值前五名")
@GetMapping("getLearningTopFive")
ResponseDto<?> getLearningTopFive(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException;
@ApiOperation("获取微信用户元气值")
@GetMapping("getUserLearningSore")
ResponseDto<?> getUserLearningSore(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException;
@ApiOperation("获取微信用户榜单")
@GetMapping("getUserLearningInfo")
ResponseDto<?> getUserLearningInfo(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId,
@RequestParam @ApiParam("生成二维码的链接") String qrcodeUrlS
) throws BizException, PermissionException;
}
......@@ -6,13 +6,11 @@ import com.pcloud.book.group.entity.AppClickRecord;
import com.pcloud.book.group.facade.AppClickRecordFacade;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @Description
......@@ -30,11 +28,14 @@ public class AppClickRecordFacadeImpl implements AppClickRecordFacade {
@PostMapping("createAppClickRecord")
@Override
public ResponseDto<?> createAppClickRecord(
@CookieValue("userInfo") String userInfo,
@RequestBody @ApiParam("应用点击记录模型") AppClickRecord appClickRecord
) throws BizException {
if (appClickRecord==null){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"参数为空!");
}
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
appClickRecord.setWechatUserId(wechatUserId);
return new ResponseDto<>(appClickRecordBiz.createAppClickRecord(appClickRecord));
}
}
......@@ -10,6 +10,7 @@ import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
......@@ -157,4 +158,30 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
return new ResponseDto<>(bookGroupClassifyBiz.listAdviserClassify(adviserId, adviserClassifyParam));
}
@ApiOperation("关闭或开启学习报告")
@GetMapping("updateHasOpenLearningReport")
@Override
public ResponseDto<?> updateHasOpenLearningReport(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("classifyId") @ApiParam("分类id") Long classifyId,
@RequestParam("hasOpenLearningReport") @ApiParam("是否开启学习报告") Boolean hasOpenLearningReport
) throws BizException, PermissionException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookGroupClassifyBiz.updateHasOpenLearningReport(classifyId,hasOpenLearningReport,partyId);
return new ResponseDto<>();
}
@ApiOperation("获取群分类学习报告相关列表")
@GetMapping("listClassifyForLearningReport")
@Override
public ResponseDto<?> listClassifyForLearningReport(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("currentPage") @ApiParam("当前页") Integer currentPage,
@RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage,
@RequestParam(value = "keyword", required = false) @ApiParam("关键词") String keyword
) throws BizException, PermissionException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupClassifyBiz.listClassifyForLearningReport(currentPage,numPerPage,keyword,partyId));
}
}
package com.pcloud.book.group.facade.impl;
import com.pcloud.book.group.biz.LearningReportBiz;
import com.pcloud.book.group.entity.LearningReportBrowseRecord;
import com.pcloud.book.group.facade.LearningReportFacade;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController("learningReportFacade")
@RequestMapping("learningReport")
public class LearningReportFacadeImpl implements LearningReportFacade {
@Autowired
private LearningReportBiz learningReportBiz;
@ApiOperation("新增学习报告浏览记录")
@PostMapping("createLearningReportBrowseRecord")
@Override
public ResponseDto<?> createLearningReportBrowseRecord(
@CookieValue("userInfo") String userInfo,
@RequestBody @ApiParam("学习报告浏览记录") LearningReportBrowseRecord learningReportBrowseRecord
) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
learningReportBrowseRecord.setCreateUser(wechatUserId);
return new ResponseDto<>(learningReportBiz.createLearningReportBrowseRecord(learningReportBrowseRecord));
}
@ApiOperation("获取最近学习记录")
@GetMapping("getRecentlyLearning")
@Override
public ResponseDto<?> getRecentlyLearning(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(learningReportBiz.getRecentlyLearning(wechatUserId,qrcodeId));
}
@ApiOperation("获取学习元气值前五名")
@GetMapping("getLearningTopFive")
@Override
public ResponseDto<?> getLearningTopFive(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(learningReportBiz.getLearningTopFive(qrcodeId));
}
@ApiOperation("获取微信用户元气值")
@GetMapping("getUserLearningSore")
@Override
public ResponseDto<?> getUserLearningSore(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId
) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(learningReportBiz.getUserLearningSore(qrcodeId, wechatUserId));
}
@ApiOperation("获取微信用户榜单")
@GetMapping("getUserLearningInfo")
@Override
public ResponseDto<?> getUserLearningInfo(
@CookieValue("userInfo") String userInfo,
@RequestParam @ApiParam("群id") Long qrcodeId,
@RequestParam @ApiParam("生成二维码的链接") String qrcodeUrlS
) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(learningReportBiz.getUserLearningInfo(qrcodeId, wechatUserId,qrcodeUrlS));
}
}
......@@ -283,6 +283,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
//获取关键词信息(改成10个了)
SendWeixinRequestTools.sendKeywordsInfo(keywords, robotId, weixinGroupId);
//如果设置了群学习报告,加一个群学习报告的关键词
pushLearningReport(classifyQrcodeInfo,robotId, weixinGroupId);
if (bookGuide != null && bookGuide.getIsRecommend() != null && bookGuide.getIsRecommend() == 1) {
//推送公众号消息
SendWeixinRequestTools.sendAccountMessage(weixinGroupId, bookGuide.getRecommendLanguage(), robotId, wechatInfo);
......@@ -314,6 +316,13 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
}
@ParamLog("推关学习报告键词消息")
private void pushLearningReport(GroupClassifyQrcodeDTO classifyQrcodeInfo, String robotId, String weixinGroupId) {
if (classifyQrcodeInfo.getHasOpenLearningReport() != null && classifyQrcodeInfo.getHasOpenLearningReport()) {
SendWeixinRequestTools.sendTextMessage("关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值", robotId, weixinGroupId);
}
}
@Override
public Map<String, Object> getGuideMessage(String weixinGroupId, String wexinGroupName) {
Map<String, Object> map = new HashMap<>();
......
......@@ -65,4 +65,9 @@ public class MQTopicConumer {
*/
public static final String PRODUCT_UPDATE = PREFIX + MQTopicProducer.PRODUCT_UPDATE;
/**
* 微信群学习报告
*/
public static final String WXGROUP_LEARNING_REPORT = PREFIX + MQTopicProducer.WXGROUP_LEARNING_REPORT;
}
......@@ -9,15 +9,16 @@
<result column="weixin_group_id" property="weixinGroupId" jdbcType="VARCHAR"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="wechat_user_id" property="wechatUserId" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, book_group_id, classify_id, qrcode_id, weixin_group_id, serve_id, serve_type, create_time
id, book_group_id, classify_id, qrcode_id, weixin_group_id, serve_id, serve_type, wechat_user_id, create_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.AppTouchRecord" useGeneratedKeys="true"
<insert id="insert" parameterType="com.pcloud.book.group.entity.AppClickRecord" useGeneratedKeys="true"
keyProperty="id">
insert into app_click_record
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -27,6 +28,7 @@
weixin_group_id,
serve_id,
serve_type,
wechat_user_id,
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -36,6 +38,7 @@
#{weixinGroupId,jdbcType=VARCHAR},
#{serveId,jdbcType=BIGINT},
#{serveType,jdbcType=VARCHAR},
#{wechatUserId,jdbcType=BIGINT},
NOW(),
</trim>
</insert>
......@@ -62,4 +65,20 @@
t.serve_id
</select>
<!--获取最近点击-->
<select id="getRecentlyClick" parameterType="map" resultType="com.pcloud.book.group.dto.AppClickDTO">
select
book_group_id bookGroupId,
classify_id classifyId,
qrcode_id qrcodeId,
weixin_group_id weixinGroupId,
serve_id serveId,
serve_type serveType
from app_click_record
where wechat_user_id=#{wechatUserId}
and qrcode_id=#{qrcodeId}
group by serve_id
order by create_time desc
limit #{top}
</select>
</mapper>
\ No newline at end of file
......@@ -308,6 +308,7 @@
c.book_group_id bookGroupId,
c.price price,
q.id groupQrcodeId,
c.has_open_learning_report hasOpenLearningReport,
q.weixin_qrcode_id weixinQrcodeId,
q.qrcode_url qrCodeUrl
from
......@@ -783,4 +784,43 @@
book_group_classify c join book_group_qrcode q on c.id = q.classify_id
and q.group_name = #{_parameter} limit 1
</select>
<!--更新是否开启学习报告-->
<update id="updateHasOpenLearningReport" parameterType="map">
update book_group_classify set
has_open_learning_report=#{hasOpenLearningReport},
update_user=#{partyId},
update_time=now()
where id=#{classifyId}
</update>
<!--获取群分类学习报告相关列表-->
<select id="listClassifyForLearningReport" parameterType="map" resultType="com.pcloud.book.group.dto.ClassifyLearningReportDto">
SELECT
c.id classifyId,
c.book_id bookId,
b.BOOK_NAME bookName,
c.classify,
c.book_group_id bookGroupId,
bg.group_qrcode_name groupQrcodeName,
bg.pro_label_id proLabelId,
bg.dep_label_id depLabelId,
bg.pur_label_id purLabelId,
c.has_open_learning_report hasOpenLearningReport
FROM book_group_classify c
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN book b ON c.book_id = b.book_id
WHERE c.is_delete = 0
AND bg.is_delete = 0
AND b.is_delete = 0
AND c.create_user = #{partyId}
<if test="keyword != null">
AND (
b.book_name LIKE CONCAT('%', #{keyword},'%')
OR c.classify LIKE CONCAT('%', #{keyword},'%')
OR bg.group_qrcode_name LIKE CONCAT('%', #{keyword},'%')
)
</if>
group by c.id
order by c.id desc
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.group.dao.impl.LearningReportBrowseRecordDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.LearningReportBrowseRecord">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="qrcode_id" property="qrcodeId" jdbcType="BIGINT"/>
<result column="classify_id" property="classifyId" jdbcType="BIGINT"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="create_user" property="createUser" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, qrcode_id, classify_id, book_group_id, create_user, create_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.LearningReportBrowseRecord" useGeneratedKeys="true"
keyProperty="id">
insert into learning_report_browse_record
<trim prefix="(" suffix=")" suffixOverrides=",">
qrcode_id,
classify_id,
book_group_id,
create_user,
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{qrcodeId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{bookGroupId,jdbcType=BIGINT},
#{createUser,jdbcType=BIGINT},
NOW()
</trim>
</insert>
<select id="getCountGroupByClassifyId" parameterType="list" resultType="com.pcloud.book.group.dto.ClassifyLearningCountDto">
select
classify_id classifyId,
count(1) count
from learning_report_browse_record
where classify_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
group by classify_id
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.group.dao.impl.LearningReportTouchRecordDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.LearningReportTouchRecord">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="qrcode_id" property="qrcodeId" jdbcType="BIGINT"/>
<result column="classify_id" property="classifyId" jdbcType="BIGINT"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, qrcode_id, classify_id, book_group_id, create_user, create_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.LearningReportTouchRecord" useGeneratedKeys="true"
keyProperty="id">
insert into learning_report_touch_record
<trim prefix="(" suffix=")" suffixOverrides=",">
qrcode_id,
classify_id,
book_group_id,
wx_user_id,
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{qrcodeId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{bookGroupId,jdbcType=BIGINT},
#{wxUserId,jdbcType=VARCHAR},
NOW()
</trim>
</insert>
<select id="getCountGroupByClassifyId" parameterType="list" resultType="com.pcloud.book.group.dto.ClassifyLearningCountDto">
select
classify_id classifyId,
count(1) count
from learning_report_touch_record
where classify_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
group by classify_id
</select>
</mapper>
\ No newline at end of file
......@@ -128,6 +128,7 @@
<pcloud-facade-audioapp.version>2.1.0-RELEASE</pcloud-facade-audioapp.version>
<pcloud-facade-videolesson.version>2.1.0-RELEASE</pcloud-facade-videolesson.version>
<pcloud-facade-liveapp.version>2.1.0-RELEASE</pcloud-facade-liveapp.version>
<pcloud-facade-shareimage.version>2.1.0-RELEASE</pcloud-facade-shareimage.version>
</properties>
<dependencyManagement>
......
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